From 3387cf6a77cf472bfa930a568e5817e79c545902 Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Thu, 16 Oct 2025 11:29:11 -0700 Subject: [PATCH] Prepare for adding file suffixes --- app/EmojiService.ts | 8 +- app/OptionalResourceService.ts | 12 +- app/PreventDisplaySleepService.ts | 2 +- app/SystemTrayService.ts | 4 +- app/SystemTraySettingCache.ts | 10 +- app/WindowsNotifications.ts | 8 +- app/attachment_channel.ts | 36 +- app/attachments.ts | 16 +- app/base_config.ts | 4 +- app/config.ts | 4 +- app/crashReports.ts | 12 +- app/dns-fallback.ts | 8 +- app/ephemeral_config.ts | 2 +- app/global_errors.ts | 10 +- app/locale.ts | 16 +- app/main.ts | 144 ++++---- app/menu.ts | 4 +- app/permissions.ts | 4 +- app/protocol_filter.ts | 4 +- app/renderWindowsToast.tsx | 8 +- app/spell_check.ts | 14 +- app/sql_channel.ts | 6 +- app/startup_config.ts | 6 +- app/updateDefaultSession.ts | 8 +- app/user_config.ts | 6 +- build/intl-linter/linter.ts | 20 +- build/intl-linter/rules/icuPrefix.ts | 2 +- build/intl-linter/rules/noLegacyVariables.ts | 2 +- build/intl-linter/rules/noNestedChoice.ts | 4 +- build/intl-linter/rules/noOffset.ts | 2 +- build/intl-linter/rules/noOneChoice.ts | 2 +- build/intl-linter/rules/noOrdinal.ts | 2 +- build/intl-linter/rules/onePlural.ts | 2 +- build/intl-linter/rules/pluralPound.ts | 2 +- build/intl-linter/rules/wrapEmoji.ts | 2 +- build/intl-linter/utils/rule.ts | 4 +- test/test.js | 3 - ts/AttachmentCrypto.ts | 38 +- ts/Bytes.ts | 2 +- ts/CI.ts | 30 +- ts/CI/benchmarkConversationOpen.ts | 30 +- ts/ConversationController.ts | 71 ++-- ts/Crypto.ts | 24 +- ts/Curve.ts | 6 +- ts/IdleDetector.ts | 4 +- ts/LibSignalStores.ts | 12 +- ts/RemoteConfig.ts | 20 +- ts/SignalProtocolStore.ts | 42 +-- ts/Timers.ts | 2 +- ts/axo/AriaClickable.stories.tsx | 6 +- ts/axo/AriaClickable.tsx | 4 +- ts/axo/AxoBadge.stories.tsx | 4 +- ts/axo/AxoBadge.tsx | 8 +- ts/axo/AxoButton.stories.tsx | 4 +- ts/axo/AxoButton.tsx | 8 +- ts/axo/AxoCheckbox.stories.tsx | 4 +- ts/axo/AxoCheckbox.tsx | 4 +- ts/axo/AxoContextMenu.stories.tsx | 4 +- ts/axo/AxoContextMenu.tsx | 6 +- ts/axo/AxoDropdownMenu.stories.tsx | 6 +- ts/axo/AxoDropdownMenu.tsx | 8 +- ts/axo/AxoMenuBuilder.stories.tsx | 6 +- ts/axo/AxoMenuBuilder.tsx | 8 +- ts/axo/AxoSegmentedControl.stories.tsx | 4 +- ts/axo/AxoSegmentedControl.tsx | 2 +- ts/axo/AxoSelect.stories.tsx | 4 +- ts/axo/AxoSelect.tsx | 10 +- ts/axo/AxoSwitch.stories.tsx | 4 +- ts/axo/AxoSwitch.tsx | 4 +- ts/axo/AxoSymbol.stories.tsx | 6 +- ts/axo/AxoSymbol.tsx | 6 +- ts/axo/_internal/AriaLabellingContext.tsx | 2 +- ts/axo/_internal/AxoBaseMenu.tsx | 4 +- ts/axo/_internal/AxoBaseSegmentedControl.tsx | 6 +- ts/background.ts | 325 +++++++++--------- ts/badges/BadgeCategory.ts | 2 +- ts/badges/BadgeImageTheme.ts | 2 +- ts/badges/badgeImageFileDownloader.ts | 14 +- ts/badges/getBadgeImageFileLocalPath.ts | 4 +- ts/badges/isBadgeImageFileUrlValid.ts | 2 +- ts/badges/isBadgeVisible.ts | 2 +- ts/badges/parseBadgesFromServer.ts | 17 +- ts/badges/types.ts | 4 +- ts/calling/VideoSupport.ts | 2 +- ts/calling/useGetCallingFrameBuffer.ts | 2 +- ts/challenge.ts | 22 +- ts/components/About.stories.tsx | 6 +- ts/components/About.tsx | 4 +- .../AddGroupMemberErrorDialog.stories.tsx | 4 +- ts/components/AddGroupMemberErrorDialog.tsx | 6 +- .../AddUserToAnotherGroupModal.stories.tsx | 6 +- ts/components/AddUserToAnotherGroupModal.tsx | 28 +- ts/components/Alert.stories.tsx | 4 +- ts/components/Alert.tsx | 8 +- ts/components/AnimatedEmojiGalore.stories.tsx | 4 +- ts/components/AnimatedEmojiGalore.tsx | 8 +- .../AnnouncementsOnlyGroupBanner.tsx | 10 +- ts/components/App.tsx | 16 +- ts/components/AutoSizeInput.stories.tsx | 4 +- ts/components/AutoSizeInput.tsx | 2 +- ts/components/AutoSizeTextArea.tsx | 6 +- ts/components/Avatar.stories.tsx | 14 +- ts/components/Avatar.tsx | 28 +- ts/components/AvatarColorPicker.stories.tsx | 6 +- ts/components/AvatarColorPicker.tsx | 8 +- ts/components/AvatarEditor.stories.tsx | 10 +- ts/components/AvatarEditor.tsx | 28 +- ts/components/AvatarIconEditor.stories.tsx | 10 +- ts/components/AvatarIconEditor.tsx | 14 +- ts/components/AvatarLightbox.stories.tsx | 8 +- ts/components/AvatarLightbox.tsx | 8 +- ts/components/AvatarModalButtons.stories.tsx | 4 +- ts/components/AvatarModalButtons.tsx | 8 +- ts/components/AvatarPreview.stories.tsx | 6 +- ts/components/AvatarPreview.tsx | 16 +- ts/components/AvatarSpacer.tsx | 2 +- ts/components/AvatarTextEditor.stories.tsx | 6 +- ts/components/AvatarTextEditor.tsx | 20 +- ts/components/AvatarUploadButton.stories.tsx | 4 +- ts/components/AvatarUploadButton.tsx | 4 +- .../BackfillFailureModal.stories.tsx | 6 +- ts/components/BackfillFailureModal.tsx | 8 +- ...pMediaDownloadCancelConfirmationDialog.tsx | 6 +- .../BackupMediaDownloadProgress.stories.tsx | 6 +- ts/components/BackupMediaDownloadProgress.tsx | 14 +- .../BackupMediaDownloadProgressSettings.tsx | 12 +- ts/components/BadgeCarouselIndex.tsx | 2 +- ts/components/BadgeDescription.stories.tsx | 4 +- ts/components/BadgeDescription.tsx | 2 +- ts/components/BadgeDialog.stories.tsx | 13 +- ts/components/BadgeDialog.tsx | 20 +- ts/components/BadgeImage.tsx | 8 +- .../BadgeSustainerInstructionsDialog.tsx | 4 +- ts/components/BetterAvatar.stories.tsx | 10 +- ts/components/BetterAvatar.tsx | 10 +- ts/components/BetterAvatarBubble.stories.tsx | 6 +- ts/components/BetterAvatarBubble.tsx | 4 +- ts/components/BrandedQRCode.stories.tsx | 4 +- ts/components/Button.stories.tsx | 4 +- ts/components/Button.tsx | 6 +- .../CallLinkAddNameModal.stories.tsx | 8 +- ts/components/CallLinkAddNameModal.tsx | 14 +- ts/components/CallLinkDetails.stories.tsx | 10 +- ts/components/CallLinkDetails.tsx | 41 ++- ts/components/CallLinkEditModal.stories.tsx | 8 +- ts/components/CallLinkEditModal.tsx | 21 +- ...allLinkPendingParticipantModal.stories.tsx | 8 +- .../CallLinkPendingParticipantModal.tsx | 22 +- ts/components/CallLinkRestrictionsSelect.tsx | 6 +- ts/components/CallManager.stories.tsx | 26 +- ts/components/CallManager.tsx | 54 +-- .../CallNeedPermissionScreen.stories.tsx | 8 +- ts/components/CallNeedPermissionScreen.tsx | 12 +- ts/components/CallParticipantCount.tsx | 4 +- ts/components/CallReactionBurst.tsx | 4 +- ts/components/CallReactionBurstEmoji.tsx | 4 +- ts/components/CallScreen.stories.tsx | 32 +- ts/components/CallScreen.tsx | 89 ++--- .../CallingAdhocCallInfo.stories.tsx | 16 +- ts/components/CallingAdhocCallInfo.tsx | 32 +- .../CallingAudioIndicator.stories.tsx | 8 +- ts/components/CallingAudioIndicator.tsx | 4 +- ts/components/CallingButton.stories.tsx | 6 +- ts/components/CallingButton.tsx | 8 +- .../CallingDeviceSelection.stories.tsx | 4 +- ts/components/CallingDeviceSelection.tsx | 14 +- ts/components/CallingHeader.stories.tsx | 6 +- ts/components/CallingHeader.tsx | 10 +- ts/components/CallingLobby.stories.tsx | 18 +- ts/components/CallingLobby.tsx | 36 +- ts/components/CallingLobbyJoinButton.tsx | 6 +- .../CallingParticipantsList.stories.tsx | 8 +- ts/components/CallingParticipantsList.tsx | 18 +- .../CallingPendingParticipants.stories.tsx | 6 +- ts/components/CallingPendingParticipants.tsx | 30 +- ts/components/CallingPip.stories.tsx | 24 +- ts/components/CallingPip.tsx | 30 +- ts/components/CallingPipRemoteVideo.tsx | 38 +- ts/components/CallingPreCallInfo.stories.tsx | 14 +- ts/components/CallingPreCallInfo.tsx | 14 +- .../CallingRaisedHandsList.stories.tsx | 10 +- ts/components/CallingRaisedHandsList.tsx | 22 +- ...CallingScreenSharingController.stories.tsx | 6 +- .../CallingScreenSharingController.tsx | 6 +- ...ngSelectPresentingSourcesModal.stories.tsx | 4 +- .../CallingSelectPresentingSourcesModal.tsx | 15 +- ts/components/CallingToast.tsx | 10 +- ts/components/CallingToastManager.tsx | 22 +- ts/components/CallsList.tsx | 69 ++-- ts/components/CallsNewCallButton.tsx | 28 +- ts/components/CallsTab.tsx | 32 +- ts/components/CaptchaDialog.stories.tsx | 6 +- ts/components/CaptchaDialog.tsx | 8 +- ts/components/ChatColorPicker.stories.tsx | 6 +- ts/components/ChatColorPicker.tsx | 22 +- ts/components/ChatsTab.stories.tsx | 6 +- ts/components/ChatsTab.tsx | 10 +- ts/components/Checkbox.stories.tsx | 4 +- ts/components/Checkbox.tsx | 2 +- ts/components/CircleCheckbox.stories.tsx | 4 +- ts/components/CircleCheckbox.tsx | 4 +- ts/components/ClearingData.stories.tsx | 4 +- ts/components/ClearingData.tsx | 8 +- ts/components/CollidingAvatars.stories.tsx | 8 +- ts/components/CollidingAvatars.tsx | 6 +- ts/components/CompositionArea.stories.tsx | 20 +- ts/components/CompositionArea.tsx | 104 +++--- ts/components/CompositionInput.stories.tsx | 10 +- ts/components/CompositionInput.tsx | 77 +++-- .../CompositionRecording.stories.tsx | 4 +- ts/components/CompositionRecording.tsx | 25 +- .../CompositionRecordingDraft.stories.tsx | 4 +- ts/components/CompositionRecordingDraft.tsx | 16 +- ts/components/CompositionTextArea.tsx | 24 +- ts/components/CompositionUpload.tsx | 11 +- .../ConfirmDiscardDialog.stories.tsx | 4 +- ts/components/ConfirmDiscardDialog.tsx | 4 +- ts/components/ConfirmLeaveCallModal.tsx | 6 +- ts/components/ConfirmationDialog.stories.tsx | 4 +- ts/components/ConfirmationDialog.tsx | 14 +- ts/components/ContactPill.tsx | 8 +- ts/components/ContactPills.stories.tsx | 10 +- ts/components/ContactPills.tsx | 4 +- ts/components/ContextMenu.stories.tsx | 4 +- ts/components/ContextMenu.tsx | 10 +- ts/components/ConversationList.stories.tsx | 18 +- ts/components/ConversationList.tsx | 56 +-- ts/components/CountryCodeSelect.stories.tsx | 6 +- ts/components/CountryCodeSelect.tsx | 8 +- ts/components/CrashReportDialog.stories.tsx | 6 +- ts/components/CrashReportDialog.tsx | 8 +- .../CriticalIdlePrimaryDeviceDialog.tsx | 8 +- ...CriticalIdlePrimaryDeviceModal.stories.tsx | 2 +- .../CriticalIdlePrimaryDeviceModal.tsx | 10 +- ts/components/CustomColorEditor.stories.tsx | 4 +- ts/components/CustomColorEditor.tsx | 18 +- ...omizingPreferredReactionsModal.stories.tsx | 8 +- .../CustomizingPreferredReactionsModal.tsx | 16 +- ts/components/DebugLogErrorModal.stories.tsx | 4 +- ts/components/DebugLogErrorModal.tsx | 6 +- ts/components/DebugLogWindow.stories.tsx | 6 +- ts/components/DebugLogWindow.tsx | 24 +- .../DeleteMessagesConfirmationDialog.tsx | 6 +- ts/components/DeleteMessagesModal.stories.tsx | 4 +- ts/components/DeleteMessagesModal.tsx | 10 +- ts/components/DialogExpiredBuild.stories.tsx | 8 +- ts/components/DialogExpiredBuild.tsx | 8 +- ts/components/DialogNetworkStatus.stories.tsx | 10 +- ts/components/DialogNetworkStatus.tsx | 14 +- ts/components/DialogRelink.stories.tsx | 8 +- ts/components/DialogRelink.tsx | 6 +- ts/components/DialogUpdate.stories.tsx | 12 +- ts/components/DialogUpdate.tsx | 18 +- ts/components/DirectCallRemoteParticipant.tsx | 12 +- .../DisappearingTimeDialog.stories.tsx | 6 +- ts/components/DisappearingTimeDialog.tsx | 10 +- .../DisappearingTimerSelect.stories.tsx | 6 +- ts/components/DisappearingTimerSelect.tsx | 12 +- ts/components/DonationErrorModal.stories.tsx | 6 +- ts/components/DonationErrorModal.tsx | 12 +- .../DonationInterruptedModal.stories.tsx | 4 +- ts/components/DonationInterruptedModal.tsx | 6 +- .../DonationPrivacyInformationModal.tsx | 10 +- .../DonationProgressModal.stories.tsx | 4 +- ts/components/DonationProgressModal.tsx | 8 +- .../DonationStillProcessingModal.stories.tsx | 4 +- .../DonationStillProcessingModal.tsx | 6 +- ts/components/DonationThanksModal.stories.tsx | 6 +- ts/components/DonationThanksModal.tsx | 14 +- .../DonationVerificationModal.stories.tsx | 6 +- ts/components/DonationVerificationModal.tsx | 8 +- ts/components/DonationsErrorBoundary.tsx | 4 +- .../DraftGifMessageSendModal.stories.tsx | 18 +- ts/components/DraftGifMessageSendModal.tsx | 22 +- ts/components/EditHistoryMessagesModal.tsx | 24 +- .../EditNicknameAndNoteModal.stories.tsx | 8 +- ts/components/EditNicknameAndNoteModal.tsx | 18 +- ts/components/ErrorBoundary.tsx | 6 +- ts/components/ErrorModal.stories.tsx | 6 +- ts/components/ErrorModal.tsx | 6 +- ts/components/FileThumbnail.stories.tsx | 4 +- ts/components/FileThumbnail.tsx | 6 +- .../ForwardMessagesModal.stories.tsx | 16 +- ts/components/ForwardMessagesModal.tsx | 56 +-- ts/components/GlobalModalContainer.tsx | 30 +- ts/components/GradientDial.tsx | 4 +- .../GroupCallOverflowArea.stories.tsx | 16 +- ts/components/GroupCallOverflowArea.tsx | 8 +- .../GroupCallRemoteParticipant.stories.tsx | 14 +- ts/components/GroupCallRemoteParticipant.tsx | 32 +- ts/components/GroupCallRemoteParticipants.tsx | 36 +- .../GroupDescriptionInput.stories.tsx | 4 +- ts/components/GroupDescriptionInput.tsx | 4 +- ts/components/GroupDescriptionText.tsx | 8 +- ts/components/GroupDialog.tsx | 14 +- ts/components/GroupMembersNames.tsx | 8 +- ts/components/GroupTitleInput.stories.tsx | 4 +- ts/components/GroupTitleInput.tsx | 4 +- .../GroupV1MigrationDialog.stories.tsx | 10 +- ts/components/GroupV1MigrationDialog.tsx | 12 +- ts/components/GroupV2JoinDialog.stories.tsx | 4 +- ts/components/GroupV2JoinDialog.tsx | 12 +- ts/components/I18n.stories.tsx | 6 +- ts/components/I18n.tsx | 4 +- ts/components/IdenticonSVG.stories.tsx | 4 +- ts/components/ImageOrBlurhash.stories.tsx | 4 +- ts/components/ImageOrBlurhash.tsx | 2 +- ts/components/InContactsIcon.stories.tsx | 4 +- ts/components/InContactsIcon.tsx | 4 +- ts/components/Inbox.stories.tsx | 6 +- ts/components/Inbox.tsx | 8 +- ts/components/IncomingCallBar.stories.tsx | 8 +- ts/components/IncomingCallBar.tsx | 28 +- ts/components/Input.stories.tsx | 4 +- ts/components/Input.tsx | 10 +- ts/components/InstallScreen.tsx | 12 +- ts/components/LeftPane.stories.tsx | 53 +-- ts/components/LeftPane.tsx | 106 +++--- ts/components/LeftPaneBanner.stories.tsx | 2 +- ts/components/LeftPaneDialog.stories.tsx | 6 +- ts/components/LeftPaneDialog.tsx | 4 +- ts/components/LeftPaneSearchInput.tsx | 14 +- ts/components/Lightbox.stories.tsx | 10 +- ts/components/Lightbox.tsx | 46 +-- ts/components/ListTile.stories.tsx | 8 +- ts/components/ListTile.tsx | 4 +- ts/components/ListView.tsx | 2 +- .../LocalDeleteWarningModal.stories.tsx | 4 +- ts/components/LocalDeleteWarningModal.tsx | 8 +- .../LowDiskSpaceBackupImportModal.stories.tsx | 4 +- .../LowDiskSpaceBackupImportModal.tsx | 8 +- ts/components/MediaEditor.stories.tsx | 6 +- ts/components/MediaEditor.tsx | 82 ++--- .../MediaPermissionsModal.stories.tsx | 6 +- ts/components/MediaPermissionsModal.tsx | 10 +- .../MediaQualitySelector.stories.tsx | 4 +- ts/components/MediaQualitySelector.tsx | 6 +- ts/components/MiniPlayer.stories.tsx | 4 +- ts/components/MiniPlayer.tsx | 10 +- ts/components/Modal.stories.tsx | 6 +- ts/components/Modal.tsx | 18 +- ts/components/ModalContainer.tsx | 2 +- ts/components/ModalHost.tsx | 18 +- ts/components/MyStories.stories.tsx | 14 +- ts/components/MyStories.tsx | 32 +- ts/components/MyStoryButton.stories.tsx | 12 +- ts/components/MyStoryButton.tsx | 22 +- ts/components/NavSidebar.tsx | 10 +- ts/components/NavTabs.stories.tsx | 10 +- ts/components/NavTabs.tsx | 20 +- .../NeedsScreenRecordingPermissionsModal.tsx | 10 +- ...atedGroupInvitedContactsDialog.stories.tsx | 10 +- ...NewlyCreatedGroupInvitedContactsDialog.tsx | 14 +- ts/components/NotePreviewModal.stories.tsx | 6 +- ts/components/NotePreviewModal.tsx | 14 +- .../NotificationProfilesMenu.stories.tsx | 16 +- ts/components/NotificationProfilesMenu.tsx | 12 +- .../OutgoingGiftBadgeModal.stories.tsx | 6 +- ts/components/OutgoingGiftBadgeModal.tsx | 10 +- ts/components/PermissionsPopup.tsx | 6 +- ts/components/PlaybackButton.stories.tsx | 8 +- ts/components/PlaybackButton.tsx | 6 +- ts/components/PlaybackRateButton.tsx | 4 +- ts/components/Preferences.stories.tsx | 72 ++-- ts/components/Preferences.tsx | 113 +++--- ts/components/PreferencesBackupDetails.tsx | 20 +- ts/components/PreferencesBackups.tsx | 26 +- ts/components/PreferencesDonateFlow.tsx | 40 +-- ts/components/PreferencesDonations.tsx | 68 ++-- ts/components/PreferencesInternal.tsx | 30 +- ts/components/PreferencesLocalBackups.tsx | 26 +- .../PreferencesNotificationProfiles.tsx | 74 ++-- ts/components/PreferencesUtil.tsx | 2 +- ts/components/ProfileEditor.stories.tsx | 16 +- ts/components/ProfileEditor.tsx | 70 ++-- ts/components/ProfileMovedModal.stories.tsx | 6 +- ts/components/ProfileMovedModal.tsx | 8 +- ts/components/Profiler.tsx | 2 +- ts/components/ProgressBar.stories.tsx | 4 +- ts/components/ProgressDialog.stories.tsx | 4 +- ts/components/ProgressDialog.tsx | 4 +- ts/components/ProgressModal.stories.tsx | 4 +- ts/components/ProgressModal.tsx | 4 +- ts/components/QrCode.stories.tsx | 4 +- ts/components/QrCode.tsx | 2 +- ts/components/ReactionPickerPicker.tsx | 8 +- ts/components/RecordingComposer.tsx | 4 +- .../SafetyNumberChangeDialog.stories.tsx | 12 +- ts/components/SafetyNumberChangeDialog.tsx | 36 +- ts/components/SafetyNumberModal.tsx | 10 +- .../SafetyNumberNotReady.stories.tsx | 4 +- ts/components/SafetyNumberNotReady.tsx | 12 +- ts/components/SafetyNumberViewer.stories.tsx | 6 +- ts/components/SafetyNumberViewer.tsx | 16 +- ts/components/SafetyTipsModal.stories.tsx | 6 +- ts/components/SafetyTipsModal.tsx | 8 +- ts/components/SampleMessageBubbles.tsx | 6 +- ts/components/SearchInput.tsx | 4 +- ts/components/Select.stories.tsx | 4 +- ts/components/SendStoryModal.stories.tsx | 12 +- ts/components/SendStoryModal.tsx | 66 ++-- ts/components/ServerAlerts.tsx | 15 +- ts/components/SharedGroupNames.tsx | 6 +- ts/components/ShortcutGuide.stories.tsx | 4 +- ts/components/ShortcutGuide.tsx | 4 +- ts/components/ShortcutGuideModal.tsx | 4 +- .../SignalConnectionsModal.stories.tsx | 4 +- ts/components/SignalConnectionsModal.tsx | 6 +- ts/components/Slider.stories.tsx | 4 +- ts/components/Slider.tsx | 4 +- ts/components/Spinner.stories.tsx | 4 +- ts/components/Spinner.tsx | 2 +- ts/components/SpinnerV2.stories.tsx | 8 +- ts/components/SpinnerV2.tsx | 4 +- .../StandaloneRegistration.stories.tsx | 8 +- ts/components/StandaloneRegistration.tsx | 8 +- ts/components/StoriesAddStoryButton.tsx | 12 +- ts/components/StoriesPane.tsx | 25 +- .../StoriesSettingsModal.stories.tsx | 8 +- ts/components/StoriesSettingsModal.tsx | 63 ++-- ts/components/StoriesTab.stories.tsx | 13 +- ts/components/StoriesTab.tsx | 28 +- ts/components/StoryCreator.stories.tsx | 12 +- ts/components/StoryCreator.tsx | 30 +- ts/components/StoryDetailsModal.stories.tsx | 8 +- ts/components/StoryDetailsModal.tsx | 41 ++- ts/components/StoryDistributionListName.tsx | 8 +- ts/components/StoryImage.stories.tsx | 8 +- ts/components/StoryImage.tsx | 22 +- ts/components/StoryLinkPreview.stories.tsx | 8 +- ts/components/StoryLinkPreview.tsx | 10 +- ts/components/StoryListItem.stories.tsx | 8 +- ts/components/StoryListItem.tsx | 29 +- ts/components/StoryViewer.stories.tsx | 22 +- ts/components/StoryViewer.tsx | 80 ++--- .../StoryViewsNRepliesModal.stories.tsx | 14 +- ts/components/StoryViewsNRepliesModal.tsx | 56 +-- ts/components/Tabs.tsx | 4 +- .../TapToViewNotAvailableModal.stories.tsx | 6 +- ts/components/TapToViewNotAvailableModal.tsx | 6 +- ts/components/TextAttachment.stories.tsx | 4 +- ts/components/TextAttachment.tsx | 29 +- ts/components/TextStoryCreator.tsx | 44 +-- ts/components/Time.tsx | 2 +- ts/components/Toast.stories.tsx | 6 +- ts/components/Toast.tsx | 4 +- ts/components/ToastManager.stories.tsx | 14 +- ts/components/ToastManager.tsx | 34 +- ts/components/Tooltip.stories.tsx | 6 +- ts/components/Tooltip.tsx | 10 +- ts/components/UnsupportedOSDialog.stories.tsx | 10 +- ts/components/UnsupportedOSDialog.tsx | 12 +- ts/components/UserText.tsx | 4 +- ts/components/UsernameEditor.stories.tsx | 8 +- ts/components/UsernameEditor.tsx | 30 +- ts/components/UsernameLinkEditor.stories.tsx | 10 +- ts/components/UsernameLinkEditor.tsx | 32 +- ts/components/UsernameMegaphone.stories.tsx | 6 +- ts/components/UsernameMegaphone.tsx | 6 +- .../UsernameOnboardingModal.stories.tsx | 4 +- ts/components/UsernameOnboardingModal.tsx | 6 +- ts/components/VoiceNotesPlaybackContext.tsx | 4 +- .../WarningIdlePrimaryDeviceDialog.tsx | 8 +- ts/components/WhatsNewLink.tsx | 4 +- ts/components/WhatsNewModal.stories.tsx | 4 +- ts/components/WhatsNewModal.tsx | 8 +- ts/components/conversation/About.tsx | 2 +- .../AboutContactModal.stories.tsx | 8 +- .../conversation/AboutContactModal.tsx | 22 +- .../conversation/AddNewLines.stories.tsx | 4 +- ts/components/conversation/AddNewLines.tsx | 2 +- ts/components/conversation/AtMention.tsx | 2 +- .../conversation/AtMentionify.stories.tsx | 6 +- ts/components/conversation/AtMentionify.tsx | 4 +- .../AttachmentDetailPill.stories.tsx | 6 +- .../conversation/AttachmentDetailPill.tsx | 10 +- .../conversation/AttachmentList.stories.tsx | 10 +- ts/components/conversation/AttachmentList.tsx | 12 +- .../AttachmentStatusIcon.stories.tsx | 6 +- .../conversation/AttachmentStatusIcon.tsx | 8 +- ts/components/conversation/AudioCapture.tsx | 10 +- .../CallingNotification.stories.tsx | 15 +- .../conversation/CallingNotification.tsx | 34 +- .../ChangeNumberNotification.stories.tsx | 6 +- .../conversation/ChangeNumberNotification.tsx | 12 +- .../ChatSessionRefreshedDialog.stories.tsx | 4 +- .../ChatSessionRefreshedDialog.tsx | 8 +- ...atSessionRefreshedNotification.stories.tsx | 4 +- .../ChatSessionRefreshedNotification.tsx | 10 +- .../conversation/ContactDetail.stories.tsx | 13 +- ts/components/conversation/ContactDetail.tsx | 13 +- .../conversation/ContactModal.stories.tsx | 14 +- ts/components/conversation/ContactModal.tsx | 42 +-- .../conversation/ContactName.stories.tsx | 6 +- ts/components/conversation/ContactName.tsx | 10 +- .../ContactSpoofingReviewDialog.stories.tsx | 10 +- .../ContactSpoofingReviewDialog.tsx | 24 +- ...tactSpoofingReviewDialogPerson.stories.tsx | 8 +- .../ContactSpoofingReviewDialogPerson.tsx | 18 +- .../ConversationHeader.stories.tsx | 14 +- .../conversation/ConversationHeader.tsx | 46 +-- .../conversation/ConversationHero.stories.tsx | 12 +- .../conversation/ConversationHero.tsx | 30 +- .../ConversationMergeNotification.stories.tsx | 4 +- .../ConversationMergeNotification.tsx | 14 +- .../conversation/ConversationView.tsx | 6 +- .../DeliveryIssueDialog.stories.tsx | 6 +- .../conversation/DeliveryIssueDialog.tsx | 16 +- .../DeliveryIssueNotification.stories.tsx | 6 +- .../DeliveryIssueNotification.tsx | 14 +- .../conversation/DonationsOfflineTooltip.tsx | 6 +- .../conversation/EmbeddedContact.tsx | 6 +- .../conversation/Emojify.stories.tsx | 4 +- ts/components/conversation/Emojify.tsx | 14 +- .../conversation/ErrorBoundary.stories.tsx | 4 +- ts/components/conversation/ErrorBoundary.tsx | 6 +- .../conversation/ExpireTimer.stories.tsx | 4 +- ts/components/conversation/ExpireTimer.tsx | 2 +- ts/components/conversation/GIF.tsx | 20 +- .../conversation/GroupDescription.stories.tsx | 4 +- .../conversation/GroupDescription.tsx | 6 +- .../GroupNotification.stories.tsx | 6 +- .../conversation/GroupNotification.tsx | 12 +- .../GroupV1DisabledActions.stories.tsx | 4 +- .../conversation/GroupV1DisabledActions.tsx | 4 +- .../conversation/GroupV1Migration.stories.tsx | 8 +- .../conversation/GroupV1Migration.tsx | 18 +- .../conversation/GroupV2Change.stories.tsx | 14 +- ts/components/conversation/GroupV2Change.tsx | 24 +- .../GroupV2PendingApprovalActions.stories.tsx | 4 +- .../GroupV2PendingApprovalActions.tsx | 4 +- ts/components/conversation/Image.stories.tsx | 12 +- ts/components/conversation/Image.tsx | 12 +- .../conversation/ImageGrid.stories.tsx | 14 +- ts/components/conversation/ImageGrid.tsx | 10 +- .../conversation/InAnotherCallTooltip.tsx | 6 +- .../InlineNotificationWrapper.tsx | 2 +- .../JoinedSignalNotification.stories.tsx | 4 +- .../conversation/JoinedSignalNotification.tsx | 8 +- .../LastSeenIndicator.stories.tsx | 4 +- .../conversation/LastSeenIndicator.tsx | 2 +- .../conversation/LinkPreviewDate.tsx | 2 +- .../conversation/Linkify.stories.tsx | 4 +- ts/components/conversation/Linkify.tsx | 11 +- ...MandatoryProfileSharingActions.stories.tsx | 6 +- .../MandatoryProfileSharingActions.tsx | 12 +- ts/components/conversation/Message.tsx | 130 +++---- ts/components/conversation/MessageAudio.tsx | 34 +- .../conversation/MessageBody.stories.tsx | 10 +- ts/components/conversation/MessageBody.tsx | 22 +- .../MessageBodyReadMore.stories.tsx | 12 +- .../conversation/MessageBodyReadMore.tsx | 8 +- .../conversation/MessageContextMenu.tsx | 4 +- .../conversation/MessageDetail.stories.tsx | 18 +- ts/components/conversation/MessageDetail.tsx | 42 +-- .../conversation/MessageMetadata.tsx | 26 +- .../MessageRequestActions.stories.tsx | 4 +- .../conversation/MessageRequestActions.tsx | 14 +- .../MessageRequestActionsConfirmation.tsx | 10 +- .../MessageRequestResponseNotification.tsx | 12 +- .../conversation/MessageTextRenderer.tsx | 18 +- .../conversation/MessageTimestamp.stories.tsx | 4 +- .../conversation/MessageTimestamp.tsx | 8 +- .../conversation/PaymentEventNotification.tsx | 12 +- ...oneNumberDiscoveryNotification.stories.tsx | 4 +- .../PhoneNumberDiscoveryNotification.tsx | 8 +- .../ProfileChangeNotification.stories.tsx | 6 +- .../ProfileChangeNotification.tsx | 14 +- .../ProfileNameWarningModal.stories.tsx | 6 +- .../conversation/ProfileNameWarningModal.tsx | 4 +- ts/components/conversation/Quote.stories.tsx | 26 +- ts/components/conversation/Quote.tsx | 39 ++- .../conversation/ReactionPicker.stories.tsx | 6 +- ts/components/conversation/ReactionPicker.tsx | 14 +- .../conversation/ReactionViewer.stories.tsx | 8 +- ts/components/conversation/ReactionViewer.tsx | 29 +- .../RemoveGroupMemberConfirmationDialog.tsx | 12 +- .../ResetSessionNotification.stories.tsx | 4 +- .../conversation/ResetSessionNotification.tsx | 4 +- .../SafetyNumberNotification.stories.tsx | 4 +- .../conversation/SafetyNumberNotification.tsx | 10 +- .../conversation/ScrollDownButton.stories.tsx | 4 +- .../conversation/ScrollDownButton.tsx | 4 +- .../conversation/SelectModeActions.tsx | 6 +- .../SignalConversationMuteToggle.tsx | 2 +- .../StagedGenericAttachment.stories.tsx | 8 +- .../conversation/StagedGenericAttachment.tsx | 6 +- .../StagedLinkPreview.stories.tsx | 8 +- .../conversation/StagedLinkPreview.tsx | 20 +- .../StagedPlaceholderAttachment.stories.tsx | 4 +- .../StagedPlaceholderAttachment.tsx | 2 +- .../conversation/SystemMessage.stories.tsx | 4 +- .../conversation/Timeline.stories.tsx | 32 +- ts/components/conversation/Timeline.tsx | 48 +-- .../conversation/TimelineDateHeader.tsx | 8 +- .../TimelineFloatingHeader.stories.tsx | 4 +- .../conversation/TimelineFloatingHeader.tsx | 8 +- .../conversation/TimelineItem.stories.tsx | 22 +- ts/components/conversation/TimelineItem.tsx | 90 ++--- .../conversation/TimelineMessage.stories.tsx | 44 +-- .../conversation/TimelineMessage.tsx | 38 +- .../conversation/TimelineWarning.tsx | 2 +- .../TimerNotification.stories.tsx | 6 +- .../conversation/TimerNotification.tsx | 14 +- .../TitleTransitionNotification.stories.tsx | 4 +- .../TitleTransitionNotification.tsx | 8 +- .../conversation/TypingAnimation.stories.tsx | 4 +- .../conversation/TypingAnimation.tsx | 2 +- .../conversation/TypingBubble.stories.tsx | 12 +- ts/components/conversation/TypingBubble.tsx | 14 +- .../UniversalTimerNotification.stories.tsx | 6 +- .../UniversalTimerNotification.tsx | 8 +- .../UnsupportedMessage.stories.tsx | 4 +- .../conversation/UnsupportedMessage.tsx | 12 +- .../VerificationNotification.stories.tsx | 4 +- .../conversation/VerificationNotification.tsx | 10 +- ts/components/conversation/Waveform.tsx | 2 +- .../conversation/WaveformScrubber.tsx | 10 +- ts/components/conversation/contactUtil.tsx | 12 +- .../AddGroupMembersModal.stories.tsx | 22 +- .../AddGroupMembersModal.tsx | 14 +- .../ChooseGroupMembersModal.tsx | 48 +-- .../ConfirmAdditionsModal.tsx | 20 +- .../CallHistoryGroupPanelSection.tsx | 12 +- .../ConversationDetails.stories.tsx | 22 +- .../ConversationDetails.tsx | 76 ++-- .../ConversationDetailsActions.stories.tsx | 4 +- .../ConversationDetailsActions.tsx | 12 +- .../ConversationDetailsGroups.tsx | 12 +- .../ConversationDetailsHeader.stories.tsx | 10 +- .../ConversationDetailsHeader.tsx | 24 +- .../ConversationDetailsIcon.stories.tsx | 4 +- .../ConversationDetailsIcon.tsx | 4 +- ...versationDetailsMembershipList.stories.tsx | 8 +- .../ConversationDetailsMembershipList.tsx | 16 +- .../ConversationNotificationsModal.tsx | 12 +- ...versationNotificationsSettings.stories.tsx | 4 +- .../ConversationNotificationsSettings.tsx | 18 +- ...ditConversationAttributesModal.stories.tsx | 4 +- .../EditConversationAttributesModal.tsx | 24 +- .../GroupLinkManagement.stories.tsx | 10 +- .../GroupLinkManagement.tsx | 22 +- .../GroupV2Permissions.stories.tsx | 8 +- .../GroupV2Permissions.tsx | 14 +- .../conversation-details/PanelRow.stories.tsx | 6 +- .../conversation-details/PanelRow.tsx | 2 +- .../PanelSection.stories.tsx | 6 +- .../conversation-details/PanelSection.tsx | 2 +- .../PendingInvites.stories.tsx | 14 +- .../conversation-details/PendingInvites.tsx | 24 +- .../AttachmentSection.stories.tsx | 6 +- .../media-gallery/AttachmentSection.tsx | 16 +- .../DocumentListItem.stories.tsx | 6 +- .../media-gallery/DocumentListItem.tsx | 18 +- .../media-gallery/EmptyState.stories.tsx | 4 +- .../media-gallery/MediaGallery.stories.tsx | 6 +- .../media-gallery/MediaGallery.tsx | 22 +- .../media-gallery/MediaGridItem.stories.tsx | 10 +- .../media-gallery/MediaGridItem.tsx | 24 +- .../media-gallery/groupMediaItemsByDate.ts | 4 +- .../media-gallery/types/ItemClickEvent.ts | 4 +- .../conversation/media-gallery/utils/mocks.ts | 8 +- .../poll-message/PollMessageContents.tsx | 14 +- .../poll-message/PollVotesModal.tsx | 12 +- .../BaseConversationListItem.tsx | 20 +- .../conversationList/ComposeStepButton.tsx | 2 +- .../conversationList/ContactCheckbox.tsx | 16 +- .../conversationList/ContactListItem.tsx | 28 +- .../conversationList/ConversationListItem.tsx | 20 +- .../conversationList/GroupListItem.tsx | 12 +- .../MessageSearchResult.stories.tsx | 14 +- .../conversationList/MessageSearchResult.tsx | 18 +- .../conversationList/PhoneNumberCheckbox.tsx | 22 +- .../conversationList/StartNewConversation.tsx | 20 +- .../conversationList/UsernameCheckbox.tsx | 14 +- .../UsernameSearchResultListItem.tsx | 14 +- ts/components/fun/FunButton.tsx | 11 +- ts/components/fun/FunEmoji.stories.tsx | 8 +- ts/components/fun/FunEmoji.tsx | 4 +- .../fun/FunEmojiLocalizationProvider.tsx | 20 +- ts/components/fun/FunEmojiPicker.stories.tsx | 16 +- ts/components/fun/FunEmojiPicker.tsx | 14 +- ts/components/fun/FunGif.stories.tsx | 4 +- ts/components/fun/FunGif.tsx | 16 +- ts/components/fun/FunPicker.stories.tsx | 17 +- ts/components/fun/FunPicker.tsx | 24 +- ts/components/fun/FunProvider.tsx | 25 +- ts/components/fun/FunSkinTones.tsx | 10 +- ts/components/fun/FunSticker.stories.tsx | 2 +- ts/components/fun/FunSticker.tsx | 4 +- .../fun/FunStickerPicker.stories.tsx | 14 +- ts/components/fun/FunStickerPicker.tsx | 14 +- ts/components/fun/base/FunErrorBoundary.tsx | 8 +- ts/components/fun/base/FunGrid.tsx | 2 +- ts/components/fun/base/FunImage.tsx | 6 +- ts/components/fun/base/FunItem.tsx | 2 +- ts/components/fun/base/FunLightbox.tsx | 2 +- ts/components/fun/base/FunPopover.tsx | 2 +- ts/components/fun/base/FunResults.tsx | 2 +- ts/components/fun/base/FunScroller.tsx | 4 +- ts/components/fun/base/FunSearch.tsx | 4 +- ts/components/fun/base/FunSubNav.tsx | 12 +- ts/components/fun/base/FunTabs.tsx | 2 +- ts/components/fun/base/FunTooltip.tsx | 2 +- ts/components/fun/constants.tsx | 4 +- ts/components/fun/data/emojis.ts | 10 +- ts/components/fun/data/gifs.ts | 8 +- ts/components/fun/data/infinite.ts | 8 +- ts/components/fun/data/segments.ts | 4 +- ts/components/fun/data/tenor.ts | 8 +- ts/components/fun/keyboard/FunKeyboard.tsx | 2 +- .../fun/keyboard/GridKeyboardDelegate.tsx | 6 +- .../keyboard/WaterfallKeyboardDelegate.tsx | 4 +- ts/components/fun/mocks.tsx | 8 +- ts/components/fun/panels/FunPanelEmojis.tsx | 50 +-- ts/components/fun/panels/FunPanelGifs.tsx | 54 +-- ts/components/fun/panels/FunPanelStickers.tsx | 50 +-- ts/components/fun/useFunEmojiLocalizer.tsx | 10 +- ts/components/fun/useFunEmojiSearch.tsx | 8 +- .../fun/virtual/useFunVirtualGrid.tsx | 4 +- .../InstallScreenBackupImportStep.stories.tsx | 10 +- .../InstallScreenBackupImportStep.tsx | 26 +- .../InstallScreenErrorStep.stories.tsx | 6 +- .../installScreen/InstallScreenErrorStep.tsx | 16 +- .../InstallScreenLinkInProgress.stories.tsx | 4 +- .../InstallScreenLinkInProgressStep.tsx | 8 +- ...tallScreenQrCodeNotScannedStep.stories.tsx | 12 +- .../InstallScreenQrCodeNotScannedStep.tsx | 30 +- .../InstallScreenUpdateDialog.tsx | 24 +- .../leftPane/LeftPaneArchiveHelper.tsx | 24 +- .../leftPane/LeftPaneChatFolders.tsx | 26 +- .../LeftPaneChooseGroupMembersHelper.tsx | 30 +- .../leftPane/LeftPaneComposeHelper.tsx | 24 +- ...eftPaneConversationListItemContextMenu.tsx | 18 +- .../LeftPaneFindByPhoneNumberHelper.tsx | 32 +- .../leftPane/LeftPaneFindByUsernameHelper.tsx | 24 +- ts/components/leftPane/LeftPaneHelper.tsx | 12 +- .../leftPane/LeftPaneInboxHelper.tsx | 30 +- .../leftPane/LeftPaneSearchHelper.tsx | 24 +- .../LeftPaneSetGroupMetadataHelper.tsx | 32 +- .../leftPane/getConversationInDirection.ts | 8 +- .../leftPane/handleKeydownForSearch.ts | 2 +- .../PreferencesSelectChatsDialog.tsx | 32 +- .../chatFolders/DeleteChatFolderDialog.tsx | 4 +- .../PreferencesChatFolderItems.tsx | 8 +- .../PreferencesChatFoldersPage.tsx | 32 +- .../PreferencesEditChatFoldersPage.tsx | 58 ++-- .../donations/DonateInputAmount.tsx | 6 +- .../donations/DonateInputCardCvc.stories.tsx | 6 +- .../donations/DonateInputCardCvc.tsx | 11 +- .../donations/DonateInputCardExp.stories.tsx | 6 +- .../donations/DonateInputCardExp.tsx | 11 +- .../DonateInputCardNumber.stories.tsx | 6 +- .../donations/DonateInputCardNumber.tsx | 8 +- .../stickers/StickerManager.stories.tsx | 6 +- ts/components/stickers/StickerManager.tsx | 10 +- .../stickers/StickerManagerPackRow.tsx | 10 +- .../stickers/StickerPackInstallButton.tsx | 2 +- .../stickers/StickerPreviewModal.stories.tsx | 6 +- .../stickers/StickerPreviewModal.tsx | 16 +- ts/components/stickers/mocks.ts | 2 +- ts/context/Crypto.ts | 6 +- ts/context/activeWindowService.ts | 2 +- ts/context/config.ts | 2 +- ts/context/createNativeThemeListener.ts | 2 +- ts/context/environment.ts | 4 +- ts/context/i18n.ts | 8 +- ts/context/waitForSettingsChange.ts | 2 +- .../isConversationTooBigToRing.ts | 6 +- ts/environment.ts | 4 +- ts/groupChange.ts | 12 +- ts/groups.ts | 95 ++--- ts/groups/joinViaLink.ts | 46 +-- ts/groups/limits.ts | 6 +- ts/groups/util.ts | 2 +- .../useActivateSpeakerViewOnPresenting.ts | 4 +- ts/hooks/useAnimated.tsx | 2 +- ts/hooks/useAttachmentStatus.ts | 12 +- ts/hooks/useComputePeaks.ts | 4 +- ts/hooks/useConfirmDiscard.tsx | 10 +- ts/hooks/useInputMask.tsx | 2 +- ts/hooks/useIntersectionObserver.ts | 2 +- ts/hooks/useKeyboardShortcuts.tsx | 10 +- ts/hooks/useMinimalConversation.ts | 2 +- ts/hooks/useNavBlocker.ts | 4 +- ts/hooks/useNowThatUpdatesEveryMinute.ts | 2 +- ts/hooks/useProxySelector.ts | 2 +- ts/hooks/useRefMerger.ts | 2 +- ts/hooks/useRetryStorySend.tsx | 8 +- ts/hooks/useScrollLock.tsx | 2 +- ts/hooks/useSizeObserver.tsx | 2 +- ts/hooks/useTabs.tsx | 4 +- ts/hooks/useTheme.ts | 2 +- ts/indexeddb.ts | 2 +- ts/jobs/AttachmentBackupManager.ts | 62 ++-- ts/jobs/AttachmentDownloadManager.ts | 76 ++-- ts/jobs/AttachmentLocalBackupManager.ts | 26 +- ts/jobs/CallLinkFinalizeDeleteManager.ts | 8 +- ts/jobs/Job.ts | 2 +- ts/jobs/JobError.ts | 2 +- ts/jobs/JobLogger.ts | 4 +- ts/jobs/JobManager.ts | 20 +- ts/jobs/JobQueue.ts | 22 +- ts/jobs/JobQueueDatabaseStore.ts | 12 +- ts/jobs/callLinkRefreshJobQueue.ts | 37 +- ts/jobs/conversationJobQueue.ts | 84 ++--- ts/jobs/deleteDownloadsJobQueue.ts | 22 +- ts/jobs/formatJobForInsert.ts | 2 +- ts/jobs/groupAvatarJobQueue.ts | 16 +- ts/jobs/helpers/addReportSpamJob.ts | 12 +- ts/jobs/helpers/areAllErrorsUnregistered.ts | 4 +- ts/jobs/helpers/attachmentBackfill.ts | 50 +-- ts/jobs/helpers/commonShouldJobContinue.ts | 14 +- .../helpers/findRetryAfterTimeFromError.ts | 6 +- ts/jobs/helpers/getHttpErrorCode.ts | 4 +- .../getUntrustedConversationServiceIds.ts | 6 +- ts/jobs/helpers/getValidRecipients.ts | 6 +- .../helpers/handleCommonJobRequestError.ts | 6 +- ts/jobs/helpers/handleMultipleSendErrors.ts | 14 +- ts/jobs/helpers/sendCallingMessage.ts | 26 +- ts/jobs/helpers/sendDeleteForEveryone.ts | 44 +-- ts/jobs/helpers/sendDeleteStoryForEveryone.ts | 36 +- .../sendDirectExpirationTimerUpdate.ts | 24 +- ts/jobs/helpers/sendGroupCallUpdate.ts | 18 +- ts/jobs/helpers/sendGroupUpdate.ts | 26 +- ts/jobs/helpers/sendNormalMessage.ts | 88 ++--- ts/jobs/helpers/sendNullMessage.ts | 22 +- ts/jobs/helpers/sendProfileKey.ts | 26 +- ts/jobs/helpers/sendReaction.ts | 56 +-- ts/jobs/helpers/sendReceipts.ts | 8 +- ts/jobs/helpers/sendResendRequest.ts | 28 +- ts/jobs/helpers/sendSavedProto.ts | 20 +- ts/jobs/helpers/sendSenderKeyDistribution.ts | 18 +- ts/jobs/helpers/sendStory.ts | 59 ++-- ts/jobs/helpers/shouldSendToConversation.ts | 12 +- .../sleepForRateLimitRetryAfterTime.ts | 6 +- ts/jobs/helpers/syncHelpers.ts | 26 +- ts/jobs/initializeAllJobQueues.ts | 28 +- ts/jobs/readSyncJobQueue.ts | 20 +- ts/jobs/removeStorageKeyJobQueue.ts | 10 +- ts/jobs/reportSpamJobQueue.ts | 32 +- ts/jobs/singleProtoJobQueue.ts | 36 +- ts/jobs/viewOnceOpenJobQueue.ts | 20 +- ts/jobs/viewSyncJobQueue.ts | 20 +- ts/linkPreviews/linkPreviewFetch.ts | 10 +- .../shouldUseFullSizeLinkPreviewImage.ts | 4 +- ts/logging/debuglogs.ts | 10 +- ts/logging/log.ts | 8 +- ts/logging/main_process_logging.ts | 16 +- ts/logging/set_up_renderer_logging.ts | 8 +- ts/logging/shared.ts | 6 +- ts/logging/uploadDebugLog.ts | 10 +- ts/main/challengeMain.ts | 6 +- ts/main/settingsChannel.ts | 12 +- .../MediaEditorFabricAnalogTimeSticker.ts | 8 +- ts/mediaEditor/MediaEditorFabricCropRect.ts | 2 +- .../MediaEditorFabricDigitalTimeSticker.ts | 6 +- ts/mediaEditor/MediaEditorFabricIText.ts | 2 +- .../MediaEditorFabricPencilBrush.ts | 2 +- ts/mediaEditor/MediaEditorFabricSticker.ts | 4 +- ts/mediaEditor/useFabricHistory.ts | 18 +- ts/mediaEditor/util/color.ts | 2 +- ts/mediaEditor/util/getTextStyleAttributes.ts | 8 +- ts/messageModifiers/AttachmentDownloads.ts | 16 +- ts/messageModifiers/Deletes.ts | 16 +- ts/messageModifiers/DeletesForMe.ts | 20 +- ts/messageModifiers/Edits.ts | 18 +- ts/messageModifiers/MessageReceipts.ts | 40 +-- ts/messageModifiers/MessageRequests.ts | 14 +- ts/messageModifiers/Polls.ts | 26 +- ts/messageModifiers/Reactions.ts | 55 +-- ts/messageModifiers/ReadSyncs.ts | 32 +- ts/messageModifiers/ViewOnceOpenSyncs.ts | 14 +- ts/messageModifiers/ViewSyncs.ts | 28 +- ts/messages/MessageSendState.ts | 2 +- ts/messages/copyQuote.ts | 31 +- ts/messages/getMessageById.ts | 8 +- ts/messages/getMessagesById.ts | 8 +- ts/messages/handleDataMessage.ts | 97 +++--- ts/messages/helpers.ts | 2 +- ts/messages/maybeNotify.ts | 34 +- ts/messages/migrateLegacyReadStatus.ts | 2 +- ts/messages/migrateLegacySendAttributes.ts | 10 +- ts/messages/migrateMessageData.ts | 20 +- ts/messages/payments.ts | 8 +- ts/messages/quotes.ts | 2 +- ts/messages/saveAndNotify.ts | 20 +- ts/messages/send.ts | 34 +- ts/messages/sources.ts | 10 +- ts/model-types.d.ts | 58 ++-- ts/models/conversations.ts | 244 ++++++------- ts/models/messages.ts | 4 +- ts/protobuf/index.ts | 2 +- .../auto-substitute-ascii-emojis/index.tsx | 6 +- ts/quill/emoji/blot.tsx | 6 +- ts/quill/emoji/completion.tsx | 18 +- ts/quill/emoji/index.tsx | 4 +- ts/quill/emoji/matchers.ts | 6 +- ts/quill/formatting/matchers.ts | 4 +- ts/quill/formatting/menu.tsx | 8 +- ts/quill/memberRepository.ts | 12 +- ts/quill/mentions/blot.tsx | 10 +- ts/quill/mentions/completion.tsx | 18 +- ts/quill/mentions/matchers.ts | 8 +- ts/quill/signal-clipboard/index.ts | 9 +- ts/quill/signal-clipboard/util.ts | 2 +- ts/quill/util.ts | 19 +- ts/reactions/constants.ts | 2 +- ts/reactions/enqueueReactionForSend.ts | 34 +- ts/reactions/isValidReactionEmoji.ts | 4 +- ts/reactions/preferredReactionEmoji.ts | 8 +- ts/reactions/util.ts | 2 +- ts/routineProfileRefresh.ts | 22 +- ts/scripts/after-all-artifact-build.ts | 2 +- ts/scripts/after-pack.ts | 8 +- ts/scripts/after-sign.ts | 2 +- ts/scripts/build-localized-display-names.ts | 4 +- ts/scripts/check-min-os-version.ts | 4 +- ts/scripts/compile-stories-icu-lookup.ts | 2 +- ts/scripts/dd-installer-size.ts | 2 +- ts/scripts/gen-nsis-script.ts | 2 +- ts/scripts/generate-compact-locales.ts | 2 +- ts/scripts/generate-dns-fallback.ts | 2 +- ts/scripts/generate-icu-types.ts | 8 +- ts/scripts/generate-preload-cache.ts | 4 +- ts/scripts/generate-tray-icons.ts | 2 +- ts/scripts/get-emoji-locales.ts | 6 +- ts/scripts/get-expire-time.ts | 6 +- ts/scripts/get-jumbomoji.ts | 8 +- ts/scripts/get-strings.ts | 2 +- ts/scripts/mark-unused-strings-deleted.ts | 2 +- ts/scripts/notarize-universal-dmg.ts | 2 +- ts/scripts/notarize.ts | 2 +- ts/scripts/push-strings.ts | 2 +- ts/scripts/remove-strings.ts | 6 +- ts/scripts/test-electron.ts | 8 +- ts/scripts/test-release.ts | 2 +- ts/scripts/update-gha.ts | 4 +- ts/services/ActiveWindowService.ts | 2 +- ts/services/BeforeNavigate.ts | 8 +- ts/services/LinkPreview.ts | 58 ++-- ts/services/MessageCache.ts | 26 +- ts/services/MessageUpdater.ts | 31 +- ts/services/ZoomFactorService.ts | 2 +- ts/services/addGlobalKeyboardShortcuts.ts | 18 +- ts/services/allLoaders.ts | 31 +- ts/services/areWeASubscriber.ts | 9 +- ts/services/audioRecorder.ts | 8 +- ts/services/backups/api.ts | 18 +- ts/services/backups/constants.ts | 4 +- ts/services/backups/credentials.ts | 34 +- ts/services/backups/crypto.ts | 8 +- ts/services/backups/errors.ts | 2 +- ts/services/backups/export.ts | 131 +++---- ts/services/backups/import.ts | 155 +++++---- ts/services/backups/index.ts | 96 +++--- ts/services/backups/types.ts | 4 +- ts/services/backups/util/filePointers.ts | 36 +- ts/services/backups/util/localBackup.ts | 20 +- ts/services/backups/util/mediaId.ts | 8 +- ts/services/backups/validator.ts | 8 +- ts/services/badgeLoader.ts | 10 +- ts/services/buildExpiration.ts | 8 +- ts/services/callHistoryLoader.ts | 6 +- ts/services/callLinksLoader.ts | 6 +- ts/services/calling.ts | 112 +++--- ts/services/challengeHandler.ts | 10 +- ts/services/chatFoldersLoader.ts | 6 +- ts/services/contactSync.ts | 43 +-- ts/services/distributionListLoader.ts | 8 +- ts/services/donations.ts | 42 +-- ts/services/donationsLoader.ts | 10 +- .../expiring/chatFolderCleanupService.ts | 8 +- .../createExpiringEntityCleanupService.ts | 14 +- ts/services/expiringMessagesDeletion.ts | 18 +- ts/services/gifsLoader.ts | 8 +- ts/services/globalMessageAudio.ts | 2 +- ts/services/groupCredentialFetcher.ts | 26 +- ts/services/keyboardLayout.ts | 2 +- ts/services/messageStateCleanup.ts | 6 +- ts/services/networkObserver.ts | 12 +- ts/services/notificationProfilesService.ts | 24 +- ts/services/notifications.ts | 28 +- ts/services/ourProfileKey.ts | 4 +- ts/services/profiles.ts | 66 ++-- ts/services/releaseNotesFetcher.ts | 46 +-- ts/services/retryPlaceholders.ts | 8 +- ts/services/senderCertificate.ts | 27 +- ts/services/singleServePromise.ts | 2 +- ts/services/storage.ts | 85 ++--- ts/services/storageRecordOps.ts | 113 +++--- ts/services/storyLoader.ts | 26 +- .../tapToViewMessagesDeletionService.ts | 22 +- ts/services/updateListener.ts | 4 +- ts/services/userLoader.ts | 10 +- ts/services/username.ts | 32 +- ts/services/usernameIntegrity.ts | 34 +- ts/services/writeProfile.ts | 34 +- ts/setAppLoadingScreenMessage.ts | 2 +- ts/shims/deleteAllData.ts | 10 +- ts/shims/dispatchItemsMiddleware.ts | 2 +- ts/shims/events.ts | 6 +- ts/shims/getUserTheme.ts | 4 +- ts/shims/renderClearingDataView.tsx | 10 +- ts/shims/storage.ts | 2 +- ts/shims/textsecure.ts | 8 +- ts/shims/themeChanged.ts | 2 +- ts/signal.ts | 14 +- ts/sql/Client.ts | 55 +-- ts/sql/Interface.ts | 55 +-- ts/sql/Server.ts | 104 +++--- ts/sql/channels.ts | 8 +- ts/sql/cleanDataForIpc.ts | 4 +- ts/sql/hydration.ts | 22 +- ts/sql/main.ts | 12 +- ts/sql/mainWorker.ts | 13 +- ...-unread-call-history-messages-as-unseen.ts | 8 +- ts/sql/migrations/1010-call-links-table.ts | 2 +- ts/sql/migrations/1020-self-merges.ts | 8 +- ts/sql/migrations/1030-unblock-event.ts | 2 +- .../1040-undownloaded-backed-up-media.ts | 16 +- .../1050-group-send-endorsements.ts | 2 +- ...-mark-call-history-read-in-conversation.ts | 2 +- .../1160-optimize-calls-unread-count.ts | 7 +- .../1170-update-call-history-unread-index.ts | 2 +- .../1180-add-attachment-download-source.ts | 2 +- ts/sql/migrations/1220-blob-sessions.ts | 10 +- .../1240-defunct-call-links-table.ts | 2 +- ts/sql/migrations/1260-sync-tasks-rowid.ts | 2 +- ts/sql/migrations/1270-normalize-messages.ts | 2 +- ts/sql/migrations/1280-blob-unprocessed.ts | 12 +- .../1290-int-unprocessed-source-device.ts | 4 +- ts/sql/migrations/1300-sticker-pack-refs.ts | 4 +- ts/sql/migrations/1310-muted-fixup.ts | 6 +- .../1320-unprocessed-received-at-date.ts | 4 +- .../migrations/1330-sync-tasks-type-index.ts | 2 +- ts/sql/migrations/1340-recent-gifs.ts | 2 +- .../migrations/1350-notification-profiles.ts | 2 +- ts/sql/migrations/1360-attachments.ts | 2 +- .../1370-message-attachment-indexes.ts | 2 +- ts/sql/migrations/1380-donation-receipts.ts | 2 +- .../1390-attachment-download-keys.ts | 2 +- ts/sql/migrations/1400-simplify-receipts.ts | 2 +- ts/sql/migrations/1410-remove-wallpaper.ts | 2 +- ts/sql/migrations/1420-backup-downloads.ts | 2 +- ts/sql/migrations/1430-call-links-epoch-id.ts | 2 +- ts/sql/migrations/1440-chat-folders.ts | 4 +- ts/sql/migrations/1450-all-media.ts | 2 +- ts/sql/migrations/1460-attachment-duration.ts | 2 +- ts/sql/migrations/1470-kyber-triple.ts | 2 +- .../1480-chat-folders-remove-duplicates.ts | 6 +- ts/sql/migrations/41-uuid-keys.ts | 10 +- ts/sql/migrations/42-stale-reactions.ts | 6 +- ts/sql/migrations/43-gv2-uuid.ts | 14 +- ts/sql/migrations/47-further-optimize.ts | 6 +- .../51-centralize-conversation-jobs.ts | 8 +- ts/sql/migrations/53-gv2-banned-members.ts | 4 +- ts/sql/migrations/55-report-message-aci.ts | 10 +- ts/sql/migrations/56-add-unseen-to-message.ts | 4 +- ts/sql/migrations/58-update-unread.ts | 4 +- ts/sql/migrations/78-merge-receipt-jobs.ts | 8 +- ts/sql/migrations/87-cleanup.ts | 6 +- ts/sql/migrations/88-service-ids.ts | 12 +- ts/sql/migrations/89-call-history.ts | 20 +- .../90-delete-story-reply-screenshot.ts | 4 +- ts/sql/migrations/91-clean-keys.ts | 10 +- ts/sql/migrations/920-clean-more-keys.ts | 12 +- ts/sql/migrations/960-untag-pni.ts | 10 +- ts/sql/migrations/index.ts | 224 ++++++------ ts/sql/server/callLinks.ts | 20 +- ts/sql/server/chatFolders.ts | 12 +- ts/sql/server/donationReceipts.ts | 6 +- ts/sql/server/groupSendEndorsements.ts | 14 +- ts/sql/server/messageAttachments.ts | 8 +- ts/sql/sqlLogger.ts | 11 +- ts/sql/util.ts | 4 +- ts/state/actions.ts | 70 ++-- ts/state/createStore.ts | 14 +- ts/state/ducks/accounts.ts | 18 +- ts/state/ducks/app.ts | 12 +- ts/state/ducks/audioPlayer.ts | 22 +- ts/state/ducks/audioRecorder.ts | 24 +- ts/state/ducks/badges.ts | 14 +- ts/state/ducks/callHistory.ts | 38 +- ts/state/ducks/calling.ts | 111 +++--- ts/state/ducks/callingHelpers.ts | 10 +- ts/state/ducks/chatFolders.ts | 32 +- ts/state/ducks/composer.ts | 109 +++--- ts/state/ducks/conversations.ts | 242 ++++++------- ts/state/ducks/crashReports.ts | 18 +- ts/state/ducks/donations.ts | 34 +- ts/state/ducks/emojis.ts | 10 +- ts/state/ducks/gifs.ts | 6 +- ts/state/ducks/globalModals.ts | 76 ++-- ts/state/ducks/installer.ts | 36 +- ts/state/ducks/items.ts | 22 +- ts/state/ducks/lightbox.ts | 53 +-- ts/state/ducks/linkPreviews.ts | 24 +- ts/state/ducks/mediaGallery.ts | 22 +- ts/state/ducks/nav.ts | 14 +- ts/state/ducks/network.ts | 10 +- ts/state/ducks/notificationProfiles.ts | 30 +- ts/state/ducks/preferredReactions.ts | 22 +- ts/state/ducks/safetyNumber.ts | 18 +- ts/state/ducks/search.ts | 42 +-- ts/state/ducks/stickers.ts | 26 +- ts/state/ducks/stories.ts | 108 +++--- ts/state/ducks/storyDistributionLists.ts | 28 +- ts/state/ducks/toast.ts | 8 +- ts/state/ducks/updates.ts | 12 +- ts/state/ducks/user.ts | 20 +- ts/state/ducks/username.ts | 38 +- ts/state/getInitialState.ts | 96 +++--- ts/state/initializeRedux.ts | 34 +- ts/state/reducer.ts | 70 ++-- ts/state/reinitializeRedux.ts | 10 +- ts/state/roots/createApp.tsx | 6 +- ts/state/roots/createGroupV2JoinModal.tsx | 8 +- ts/state/selectors/accounts.ts | 6 +- ts/state/selectors/app.ts | 4 +- ts/state/selectors/audioPlayer.ts | 24 +- ts/state/selectors/audioRecorder.ts | 4 +- ts/state/selectors/badges.ts | 14 +- ts/state/selectors/callHistory.ts | 8 +- ts/state/selectors/calling.ts | 21 +- ts/state/selectors/chatFolders.ts | 10 +- ts/state/selectors/composer.ts | 6 +- ts/state/selectors/conversations-extra.ts | 20 +- ts/state/selectors/conversations.ts | 89 ++--- ts/state/selectors/crashReports.ts | 4 +- ts/state/selectors/emojis.ts | 4 +- ts/state/selectors/expiration.ts | 13 +- ts/state/selectors/gifs.ts | 4 +- ts/state/selectors/globalModals.ts | 6 +- ts/state/selectors/inbox.ts | 2 +- ts/state/selectors/installer.ts | 4 +- ts/state/selectors/items.ts | 28 +- ts/state/selectors/lightbox.ts | 6 +- ts/state/selectors/linkPreviews.ts | 4 +- ts/state/selectors/mediaGallery.ts | 4 +- ts/state/selectors/message.ts | 146 ++++---- ts/state/selectors/nav.ts | 14 +- ts/state/selectors/network.ts | 6 +- ts/state/selectors/notificationProfiles.ts | 8 +- ts/state/selectors/preferredReactions.ts | 4 +- ts/state/selectors/safetyNumber.ts | 4 +- ts/state/selectors/search.ts | 24 +- ts/state/selectors/stickers.ts | 10 +- ts/state/selectors/stories.ts | 40 +-- ts/state/selectors/stories2.ts | 10 +- ts/state/selectors/storyDistributionLists.ts | 10 +- ts/state/selectors/timeline.ts | 20 +- ts/state/selectors/toast.ts | 4 +- ts/state/selectors/updates.ts | 6 +- ts/state/selectors/user.ts | 16 +- ts/state/selectors/username.ts | 8 +- ts/state/smart/AboutContactModal.tsx | 20 +- ts/state/smart/AddUserToAnotherGroupModal.tsx | 12 +- ts/state/smart/AllMedia.tsx | 12 +- ts/state/smart/App.tsx | 48 +-- ts/state/smart/CallLinkAddNameModal.tsx | 18 +- ts/state/smart/CallLinkDetails.tsx | 18 +- ts/state/smart/CallLinkEditModal.tsx | 24 +- .../smart/CallLinkPendingParticipantModal.tsx | 16 +- ts/state/smart/CallManager.tsx | 61 ++-- ts/state/smart/CallingDeviceSelection.tsx | 8 +- ts/state/smart/CallsTab.tsx | 46 +-- ts/state/smart/CaptchaDialog.tsx | 10 +- ts/state/smart/ChatColorPicker.tsx | 14 +- ts/state/smart/ChatsTab.tsx | 42 +-- ts/state/smart/ChooseGroupMembersModal.tsx | 14 +- ts/state/smart/CollidingAvatars.tsx | 6 +- ts/state/smart/CompositionArea.tsx | 62 ++-- ts/state/smart/CompositionRecording.tsx | 12 +- ts/state/smart/CompositionRecordingDraft.tsx | 14 +- ts/state/smart/CompositionTextArea.tsx | 18 +- ts/state/smart/ConfirmAdditionsModal.tsx | 10 +- ts/state/smart/ConfirmLeaveCallModal.tsx | 10 +- ts/state/smart/ContactDetail.tsx | 14 +- ts/state/smart/ContactModal.tsx | 26 +- ts/state/smart/ContactName.tsx | 8 +- .../smart/ContactSpoofingReviewDialog.tsx | 26 +- ts/state/smart/ConversationDetails.tsx | 50 +-- ts/state/smart/ConversationHeader.tsx | 63 ++-- .../ConversationNotificationsSettings.tsx | 10 +- ts/state/smart/ConversationPanel.tsx | 46 +-- ts/state/smart/ConversationView.tsx | 18 +- ts/state/smart/CrashReportDialog.tsx | 8 +- .../CustomizingPreferredReactionsModal.tsx | 16 +- ts/state/smart/DeleteMessagesModal.tsx | 26 +- ts/state/smart/DraftGifMessageSendModal.tsx | 40 +-- ts/state/smart/EditHistoryMessagesModal.tsx | 18 +- ts/state/smart/EditNicknameAndNoteModal.tsx | 16 +- ts/state/smart/ForwardMessagesModal.tsx | 42 +-- ts/state/smart/FunProvider.tsx | 38 +- ts/state/smart/GV1Members.tsx | 14 +- ts/state/smart/GlobalModalContainer.tsx | 58 ++-- ts/state/smart/GroupLinkManagement.tsx | 8 +- ts/state/smart/GroupV1MigrationDialog.tsx | 16 +- ts/state/smart/GroupV2JoinDialog.tsx | 8 +- ts/state/smart/GroupV2Permissions.tsx | 8 +- ts/state/smart/HeroRow.tsx | 24 +- ts/state/smart/Inbox.tsx | 30 +- ts/state/smart/InstallScreen.tsx | 30 +- ts/state/smart/LeftPane.tsx | 109 +++--- ts/state/smart/LeftPaneChatFolders.tsx | 29 +- ...eftPaneConversationListItemContextMenu.tsx | 16 +- ts/state/smart/Lightbox.tsx | 16 +- ts/state/smart/MessageAudio.tsx | 18 +- ts/state/smart/MessageDetail.tsx | 26 +- .../MessageRequestActionsConfirmation.tsx | 18 +- ts/state/smart/MessageSearchResult.tsx | 12 +- ts/state/smart/MiniPlayer.tsx | 10 +- ts/state/smart/NavTabs.tsx | 26 +- ts/state/smart/NetworkStatus.tsx | 10 +- ts/state/smart/NotePreviewModal.tsx | 12 +- ts/state/smart/NotificationProfilesMenu.tsx | 12 +- ts/state/smart/PendingInvites.tsx | 16 +- ts/state/smart/Preferences.tsx | 141 ++++---- ts/state/smart/PreferencesChatFoldersPage.tsx | 16 +- ts/state/smart/PreferencesDonations.tsx | 40 +-- .../smart/PreferencesEditChatFolderPage.tsx | 22 +- .../smart/PreferencesNotificationProfiles.tsx | 18 +- ts/state/smart/ProfileEditor.tsx | 33 +- ts/state/smart/ProfileNameWarningModal.tsx | 8 +- ts/state/smart/ReactionPicker.tsx | 8 +- ts/state/smart/RelinkDialog.tsx | 8 +- ts/state/smart/SafetyNumberModal.tsx | 12 +- ts/state/smart/SafetyNumberViewer.tsx | 12 +- ts/state/smart/SendAnywayDialog.tsx | 24 +- ts/state/smart/ShortcutGuideModal.tsx | 6 +- ts/state/smart/StickerManager.tsx | 10 +- ts/state/smart/StickerPreviewModal.tsx | 10 +- ts/state/smart/StoriesSettingsModal.tsx | 22 +- ts/state/smart/StoriesTab.tsx | 44 +-- ts/state/smart/StoryCreator.tsx | 42 +-- ts/state/smart/StoryViewer.tsx | 40 +-- ts/state/smart/Timeline.tsx | 46 +-- ts/state/smart/TimelineItem.tsx | 40 +-- ts/state/smart/ToastManager.tsx | 46 +-- ts/state/smart/TypingBubble.tsx | 12 +- ts/state/smart/UniversalTimerNotification.tsx | 6 +- ts/state/smart/UnsupportedOSDialog.tsx | 10 +- ts/state/smart/UpdateDialog.tsx | 12 +- ts/state/smart/UsernameEditor.tsx | 16 +- ts/state/smart/UsernameOnboardingModal.tsx | 18 +- ts/state/smart/VoiceNotesPlaybackProvider.tsx | 28 +- ts/state/smart/Waveform.tsx | 8 +- ts/state/smart/renderAudioAttachment.tsx | 6 +- ts/state/smart/renderReactionPicker.tsx | 2 +- ts/state/types.ts | 70 ++-- ts/test-electron/ContactsParser_test.ts | 40 ++- .../ConversationController_test.ts | 14 +- ts/test-electron/Crypto_test.ts | 35 +- ts/test-electron/Curve_test.ts | 6 +- ts/test-electron/MessageReceipts_test.ts | 16 +- ts/test-electron/MessageReceiver_test.ts | 22 +- ts/test-electron/SignalProtocolStore_test.ts | 31 +- ts/test-electron/WebsocketResources_test.ts | 6 +- ts/test-electron/background_test.ts | 9 +- ts/test-electron/backup/attachments_test.ts | 36 +- .../backup_groupv2_notifications_test.ts | 28 +- ts/test-electron/backup/bubble_test.ts | 38 +- ts/test-electron/backup/calling_test.ts | 39 ++- ts/test-electron/backup/conversations_test.ts | 23 +- ts/test-electron/backup/filePointer_test.ts | 22 +- ts/test-electron/backup/helpers.ts | 20 +- ts/test-electron/backup/integration_test.ts | 13 +- ts/test-electron/backup/non_bubble_test.ts | 32 +- .../cleanupOrphanedAttachments_test.ts | 14 +- ts/test-electron/components/Avatar_test.tsx | 5 +- ts/test-electron/context/Crypto_test.ts | 2 +- .../context/createNativeThemeListener_test.ts | 6 +- .../deleteMessageAttachments_test.ts | 19 +- .../linkPreviews/linkPreviewFetch_test.ts | 10 +- ts/test-electron/models/conversations_test.ts | 16 +- ts/test-electron/models/messages_test.ts | 32 +- .../normalizedAttachments_test.ts | 20 +- .../quill/emoji/completion_test.tsx | 12 +- .../quill/memberRepository_test.ts | 13 +- .../quill/mentions/completion_test.tsx | 16 +- .../quill/mentions/matchers_test.ts | 12 +- ts/test-electron/quill/util_test.ts | 6 +- .../routineProfileRefresh_test.ts | 10 +- ts/test-electron/scrollUtil_test.ts | 2 +- .../services/ActiveWindowService_test.ts | 2 +- .../services/AttachmentBackupManager_test.ts | 27 +- .../AttachmentDownloadManager_test.ts | 36 +- .../services/MessageCache_test.ts | 12 +- .../services/ReleaseNotesFetcher_test.ts | 14 +- .../services/areWeASubscriber_test.ts | 4 +- ts/test-electron/services/profiles_test.ts | 12 +- .../services/senderCertificate_test.ts | 10 +- .../attachment_download_backup_stats_test.ts | 12 +- ts/test-electron/sql/callLinks_test.ts | 4 +- .../sql/conversationSummary_test.ts | 8 +- ts/test-electron/sql/donationReceipts_test.ts | 4 +- ts/test-electron/sql/fullTextSearch_test.ts | 6 +- .../sql/getCallHistoryGroups_test.ts | 16 +- .../sql/getCallHistoryMessageByCallId_test.ts | 6 +- .../sql/getMessagesBetween_test.ts | 8 +- .../getNearbyMessageFromDeletedSet_test.ts | 8 +- ...RecentStaleRingsAndMarkOlderMissed_test.ts | 10 +- .../sql/getRecentStoryReplies_test.ts | 6 +- ts/test-electron/sql/markRead_test.ts | 14 +- .../sql/notificationProfiles_test.ts | 8 +- .../sql/removeAllConfiguration_test.ts | 2 +- ts/test-electron/sql/sendLog_test.ts | 11 +- ts/test-electron/sql/stories_test.ts | 6 +- .../sql/storyDistribution_test.ts | 8 +- ts/test-electron/sql/storyReads_test.ts | 6 +- ts/test-electron/sql/timelineFetches_test.ts | 8 +- ts/test-electron/sql/utils_test.ts | 2 +- ts/test-electron/state/ducks/calling_test.ts | 36 +- .../state/ducks/conversations_test.ts | 42 +-- ts/test-electron/state/ducks/stories_test.ts | 37 +- ts/test-electron/state/ducks/username_test.ts | 16 +- .../state/selectors/audioPlayer_test.ts | 12 +- .../state/selectors/calling_test.ts | 20 +- .../selectors/conversations-extra_test.ts | 32 +- .../state/selectors/messages_test.ts | 8 +- .../textsecure/AccountManager_test.ts | 14 +- .../textsecure/KeyChangeListener_test.ts | 22 +- ts/test-electron/textsecure/WebAPI_test.ts | 2 +- .../textsecure/generate_keys_test.ts | 18 +- .../updateConversationsWithUuidLookup_test.ts | 10 +- ts/test-electron/util/Username_test.ts | 2 +- ts/test-electron/util/canvasToBlob_test.ts | 6 +- ts/test-electron/util/canvasToBytes_test.ts | 6 +- .../util/downloadAttachment_test.ts | 28 +- .../util/encryptProfileData_test.ts | 10 +- ts/test-electron/util/formatTimestamp_test.ts | 249 ++++++++++++++ .../util/imagePathToBytes_test.ts | 2 +- .../util/isWindowDragElement_test.ts | 2 +- .../util/migrateMessageData_test.ts | 14 +- ts/test-electron/util/reactions_test.ts | 18 +- .../util/scaleImageToLevel_test.ts | 4 +- ts/test-electron/util/sendToGroup_test.ts | 8 +- ts/test-electron/util/waitForOnline_test.ts | 2 +- ts/test-electron/windows/attachments_test.ts | 6 +- ts/test-helpers/FakeLeftPaneContainer.tsx | 2 +- ts/test-helpers/RemoteConfigStub.ts | 4 +- ts/test-helpers/attachmentDownloads.ts | 6 +- ts/test-helpers/createCallParticipant.ts | 8 +- ts/test-helpers/defaultComposerStates.ts | 6 +- ts/test-helpers/expireTimers.ts | 4 +- ts/test-helpers/fakeAttachment.ts | 4 +- ts/test-helpers/fakeCallLink.ts | 8 +- .../fakeLookupConversationWithoutServiceId.ts | 12 +- ts/test-helpers/generateBackup.ts | 18 +- ts/test-helpers/getDefaultConversation.ts | 16 +- ts/test-helpers/getFakeBadge.ts | 8 +- ts/test-helpers/getFakeCallHistoryGroup.ts | 6 +- ts/test-helpers/getFakeDistributionLists.ts | 12 +- ts/test-helpers/getFakeStory.tsx | 14 +- ts/test-helpers/getRandomColor.ts | 4 +- ts/test-helpers/getStickerPacks.ts | 5 +- ts/test-mock/backups/backups_test.ts | 30 +- ts/test-mock/benchmarks/backup_bench.ts | 6 +- .../benchmarks/call_history_search_bench.ts | 10 +- ts/test-mock/benchmarks/convo_open_bench.ts | 6 +- ts/test-mock/benchmarks/fixtures.ts | 4 +- ts/test-mock/benchmarks/group_send_bench.ts | 10 +- ts/test-mock/benchmarks/send_bench.ts | 6 +- ts/test-mock/benchmarks/startup_bench.ts | 4 +- ts/test-mock/benchmarks/storage_sync_bench.ts | 2 +- ts/test-mock/bootstrap.ts | 22 +- ts/test-mock/calling/callLinkAdmin_test.ts | 8 +- .../calling/callMessages_test.docker.ts | 8 +- ts/test-mock/helpers.ts | 4 +- ts/test-mock/messaging/attachments_test.ts | 14 +- ts/test-mock/messaging/backfill_test.ts | 13 +- ts/test-mock/messaging/edit_test.ts | 27 +- .../messaging/expire_timer_version_test.ts | 12 +- ts/test-mock/messaging/lightbox_test.ts | 12 +- ts/test-mock/messaging/reaction_test.ts | 10 +- ts/test-mock/messaging/readSync_test.ts | 6 +- ts/test-mock/messaging/relink_test.ts | 8 +- ts/test-mock/messaging/retries_test.ts | 8 +- ts/test-mock/messaging/safety_number_test.ts | 12 +- ts/test-mock/messaging/sendSync_test.ts | 6 +- ts/test-mock/messaging/sender_key_test.ts | 6 +- ts/test-mock/messaging/stories_test.ts | 12 +- ts/test-mock/messaging/twoClients_test.ts | 8 +- .../messaging/unknown_contact_test.ts | 8 +- ts/test-mock/messaging/unprocessed_test.ts | 6 +- ts/test-mock/network/serverAlerts_test.ts | 8 +- ts/test-mock/playwright.ts | 12 +- ts/test-mock/pnp/accept_gv2_invite_test.ts | 10 +- ts/test-mock/pnp/calling_test.ts | 8 +- ts/test-mock/pnp/change_number_test.ts | 6 +- ts/test-mock/pnp/merge_test.ts | 14 +- ts/test-mock/pnp/phone_discovery_test.ts | 12 +- ts/test-mock/pnp/pni_change_test.ts | 12 +- ts/test-mock/pnp/pni_signature_test.ts | 16 +- ts/test-mock/pnp/pni_unlink_test.ts | 8 +- ts/test-mock/pnp/send_gv2_invite_test.ts | 10 +- ts/test-mock/pnp/username_test.ts | 14 +- ts/test-mock/rate-limit/story_test.ts | 10 +- ts/test-mock/rate-limit/viewed_test.ts | 10 +- .../release-notes/release_notes_test.ts | 10 +- ts/test-mock/routing/routing_test.ts | 10 +- ts/test-mock/settings/language_test.ts | 6 +- ts/test-mock/settings/settings_test.ts | 6 +- ts/test-mock/setup-ci.ts | 2 +- ts/test-mock/storage/archive_test.ts | 6 +- ts/test-mock/storage/call_links_test.ts | 16 +- ts/test-mock/storage/chat_folder_test.ts | 16 +- ts/test-mock/storage/conflict_test.ts | 12 +- ts/test-mock/storage/drop_test.ts | 6 +- ts/test-mock/storage/fixtures.ts | 14 +- ts/test-mock/storage/max_read_keys_test.ts | 12 +- ts/test-mock/storage/message_request_test.ts | 8 +- .../storage/notification_profiles_test.ts | 18 +- ts/test-mock/storage/pin_unpin_test.ts | 6 +- ts/test-mock/storage/sticker_test.ts | 6 +- ts/test-node/AsyncQueue_test.ts | 2 +- ts/test-node/RemoteConfig_test.ts | 8 +- ts/test-node/TaskWithTimeout_test.ts | 6 +- .../app/PreventDisplaySleepService_test.ts | 2 +- ts/test-node/app/SystemTrayService_test.ts | 8 +- .../app/SystemTraySettingCache_test.ts | 6 +- ts/test-node/app/base_config_test.ts | 4 +- ts/test-node/app/locale_test.ts | 6 +- ts/test-node/app/menu_test.ts | 12 +- ts/test-node/app/protocol_filter_test.ts | 2 +- ts/test-node/app/renderWindowsToast_test.tsx | 4 +- ts/test-node/app/spell_check_test.ts | 2 +- ts/test-node/app/updateDefaultSession_test.ts | 2 +- .../badges/getBadgeImageFileLocalPath_test.ts | 6 +- .../badges/isBadgeImageFileUrlValid_test.ts | 2 +- ts/test-node/badges/isBadgeVisible_test.ts | 6 +- .../badges/parseBadgesFromServer_test.ts | 6 +- .../calling/findBestMatchingDevice_test.ts | 2 +- ts/test-node/challenge_test.ts | 6 +- ts/test-node/components/fun/emojis_test.ts | 2 +- ts/test-node/components/fun/segments_test.ts | 2 +- .../leftPane/LeftPaneArchiveHelper_test.ts | 10 +- .../LeftPaneChooseGroupMembersHelper_test.ts | 8 +- .../leftPane/LeftPaneComposeHelper_test.ts | 8 +- .../leftPane/LeftPaneInboxHelper_test.tsx | 10 +- .../leftPane/LeftPaneSearchHelper_test.ts | 6 +- .../LeftPaneSetGroupMetadataHelper_test.ts | 8 +- .../getConversationInDirection_test.ts | 8 +- .../media-gallery/groupMediaItemsByDate.ts | 8 +- .../isConversationTooBigToRing_test.ts | 6 +- ts/test-node/environment_test.ts | 2 +- ts/test-node/groups/add_banned_member_test.ts | 8 +- ts/test-node/groups/limits_test.ts | 4 +- ts/test-node/groups/message_merge_test.ts | 4 +- ts/test-node/jobs/JobError_test.ts | 2 +- ts/test-node/jobs/JobLogger_test.ts | 2 +- .../jobs/JobQueueDatabaseStore_test.ts | 4 +- ts/test-node/jobs/JobQueue_test.ts | 24 +- ts/test-node/jobs/Job_test.ts | 2 +- ts/test-node/jobs/TestJobQueueStore.ts | 6 +- ts/test-node/jobs/formatJobForInsert_test.ts | 2 +- .../jobs/helpers/InMemoryQueues_test.ts | 2 +- .../jobs/helpers/addReportSpamJob_test.ts | 8 +- .../findRetryAfterTimeFromError_test.ts | 6 +- .../jobs/helpers/getHttpErrorCode_test.ts | 2 +- .../helpers/handleMultipleSendErrors_test.ts | 8 +- .../sleepForRateLimitRetryAfterTime_test.ts | 8 +- ts/test-node/jobs/helpers/syncHelpers_test.ts | 4 +- .../isLinkPreviewDateValid_test.ts | 2 +- .../shouldUseFullSizeLinkPreviewImage_test.ts | 6 +- .../logging/formatCountForLogging_test.ts | 2 +- ts/test-node/logging/uploadDebugLogs_test.ts | 6 +- ts/test-node/logging_test.ts | 2 +- .../messages/MessageReadStatus_test.ts | 5 +- .../messages/MessageSendState_test.ts | 4 +- .../messages/migrateLegacyReadStatus_test.ts | 4 +- .../migrateLegacySendAttributes_test.ts | 8 +- ts/test-node/processDataMessage_test.ts | 12 +- ts/test-node/processSyncMessage_test.ts | 4 +- .../reactions/isValidReactionEmoji_test.ts | 2 +- .../reactions/preferredReactionEmoji_test.ts | 4 +- ts/test-node/reactions/util_test.ts | 4 +- ts/test-node/services/donations_test.ts | 2 +- ...createExpiringEntityCleanupService_test.ts | 4 +- ts/test-node/services/ourProfileKey_test.ts | 6 +- .../services/retryPlaceholders_test.ts | 6 +- ts/test-node/sql/cleanDataForIpc_test.ts | 2 +- ts/test-node/sql/cleanMessageData_test.ts | 4 +- ts/test-node/sql/helpers.ts | 8 +- ...incrementMessagesMigrationAttempts_test.ts | 6 +- .../sql/migrateConversationMessages_test.ts | 9 +- ts/test-node/sql/migration_1000_test.ts | 10 +- ts/test-node/sql/migration_1020_test.ts | 6 +- ts/test-node/sql/migration_1030_test.ts | 8 +- ts/test-node/sql/migration_1040_test.ts | 17 +- ts/test-node/sql/migration_1060_test.ts | 21 +- ts/test-node/sql/migration_1080_test.ts | 15 +- ts/test-node/sql/migration_1090_test.ts | 6 +- ts/test-node/sql/migration_1100_test.ts | 12 +- ts/test-node/sql/migration_1120_test.ts | 6 +- ts/test-node/sql/migration_1130_test.ts | 6 +- ts/test-node/sql/migration_1180_test.ts | 10 +- ts/test-node/sql/migration_1200_test.ts | 10 +- ts/test-node/sql/migration_1220_test.ts | 8 +- ts/test-node/sql/migration_1280_test.ts | 8 +- ts/test-node/sql/migration_1290_test.ts | 4 +- ts/test-node/sql/migration_1310_test.ts | 4 +- ts/test-node/sql/migration_1330_test.ts | 10 +- ts/test-node/sql/migration_1350_test.ts | 6 +- ts/test-node/sql/migration_1360_test.ts | 6 +- ts/test-node/sql/migration_1380_test.ts | 6 +- ts/test-node/sql/migration_1410_test.ts | 6 +- ts/test-node/sql/migration_1420_test.ts | 10 +- ts/test-node/sql/migration_87_test.ts | 10 +- ts/test-node/sql/migration_88_test.ts | 4 +- ts/test-node/sql/migration_89_test.ts | 18 +- ts/test-node/sql/migration_90_test.ts | 6 +- ts/test-node/sql/migration_91_test.ts | 10 +- ts/test-node/sql/migration_920_test.ts | 10 +- ts/test-node/sql/migration_960_test.ts | 4 +- ts/test-node/sql/migration_990_test.ts | 4 +- ts/test-node/sql/migrations_test.ts | 18 +- ts/test-node/state/ducks/audioPlayer_test.ts | 14 +- ts/test-node/state/ducks/badges_test.ts | 10 +- ts/test-node/state/ducks/composer_test.ts | 14 +- ts/test-node/state/ducks/donations_test.ts | 18 +- ts/test-node/state/ducks/globalModals_test.ts | 2 +- ts/test-node/state/ducks/linkPreviews_test.ts | 4 +- ts/test-node/state/ducks/network_test.ts | 2 +- .../state/ducks/preferredReactions_test.ts | 14 +- .../state/selectors/conversations_test.ts | 24 +- ts/test-node/state/selectors/items_test.ts | 8 +- .../selectors/preferredReactions_test.ts | 10 +- ts/test-node/state/selectors/search_test.ts | 26 +- ts/test-node/state/selectors/user_test.ts | 8 +- ts/test-node/types/Attachment_test.ts | 18 +- ts/test-node/types/Avatar_test.ts | 2 +- ts/test-node/types/BodyRange_test.ts | 6 +- ts/test-node/types/DonationsCardForm_test.ts | 6 +- ts/test-node/types/EmbeddedContact_test.ts | 12 +- ts/test-node/types/LinkPreview_test.ts | 2 +- ts/test-node/types/MIME_test.ts | 2 +- ts/test-node/types/Message2_test.ts | 14 +- .../types/NotificationProfile_test.ts | 8 +- ts/test-node/types/PhoneNumber_test.ts | 2 +- ts/test-node/types/SchemaVersion_test.ts | 2 +- ts/test-node/types/Settings_test.ts | 6 +- ts/test-node/types/Stickers_test.ts | 4 +- .../types/StoryDistributionId_test.ts | 4 +- ts/test-node/types/SystemTraySetting_test.ts | 2 +- ts/test-node/types/errors_test.ts | 2 +- ts/test-node/types/setupI18n_test.ts | 6 +- ts/test-node/updater/common_test.ts | 4 +- ts/test-node/updater/curve_test.ts | 2 +- ts/test-node/updater/differential_test.ts | 8 +- ts/test-node/updater/signature_test.ts | 8 +- ts/test-node/updater/util_test.ts | 6 +- ts/test-node/util/AbortableProcess_test.ts | 2 +- ts/test-node/util/BackOff_test.ts | 2 +- ts/test-node/util/Bytes_test.ts | 2 +- ts/test-node/util/DelimitedStream_test.ts | 2 +- ts/test-node/util/LatestQueue_test.ts | 2 +- ts/test-node/util/appendMacStream_test.ts | 4 +- .../util/areObjectEntriesEqual_test.ts | 2 +- .../util/arePinnedConversationsEqual_test.ts | 4 +- ts/test-node/util/assert_test.ts | 2 +- .../assignWithNoUnnecessaryAllocation_test.ts | 2 +- ts/test-node/util/asyncIterables_test.ts | 4 +- ts/test-node/util/awaitObject_test.ts | 2 +- ts/test-node/util/batcher_test.ts | 4 +- ...kSendUntilConversationsAreVerified_test.ts | 10 +- ts/test-node/util/callDisposition_test.ts | 6 +- ts/test-node/util/callLinks_test.ts | 4 +- .../util/callingGetParticipantName_test.ts | 2 +- .../util/callingMessageToProto_test.ts | 4 +- ts/test-node/util/callingNotification_test.ts | 12 +- ts/test-node/util/characters_test.ts | 2 +- .../util/clearTimeoutIfNecessary_test.ts | 2 +- ts/test-node/util/combineNames_test.ts | 2 +- ts/test-node/util/countUnreadStats_test.ts | 4 +- ts/test-node/util/createSupportUrl_test.ts | 2 +- ts/test-node/util/currency_test.ts | 2 +- ts/test-node/util/deconstructLookup_test.ts | 2 +- ts/test-node/util/diffArraysAsSets_test.ts | 2 +- ts/test-node/util/dropNull_test.ts | 2 +- ts/test-node/util/emoji_test.ts | 2 +- ts/test-node/util/enum_test.ts | 2 +- ts/test-node/util/expirationTimer_test.ts | 8 +- ts/test-node/util/explodePromise_test.ts | 2 +- ts/test-node/util/exponentialBackoff_test.ts | 4 +- .../util/filterAndSortConversations_test.ts | 6 +- ts/test-node/util/finalStream_test.ts | 2 +- ts/test-node/util/formatTimestamp_test.ts | 75 ---- .../util/generateConfigMatrix_test.ts | 2 +- ts/test-node/util/getAvatarData_test.ts | 4 +- ts/test-node/util/getClassNamesFor_test.ts | 2 +- ts/test-node/util/getCustomColorStyle.ts | 2 +- .../util/getFontNameByTextScript_test.ts | 4 +- ts/test-node/util/getGroupMemberships_test.ts | 12 +- ts/test-node/util/getHSL_test.ts | 2 +- ts/test-node/util/getInitials_test.ts | 2 +- ts/test-node/util/getMuteOptions_test.ts | 4 +- ts/test-node/util/getMutedUntilText_test.ts | 4 +- ts/test-node/util/getOwn_test.ts | 2 +- .../util/getStreamWithTimeout_test.ts | 2 +- ts/test-node/util/getUserAgent_test.ts | 2 +- .../util/graphemeAndLinkAwareSlice.ts | 2 +- ts/test-node/util/grapheme_test.ts | 2 +- ts/test-node/util/groupBy_test.ts | 2 +- .../util/groupMemberNameCollisions_test.ts | 4 +- .../util/groupSendEndorsements_test.ts | 4 +- ts/test-node/util/hslToRGB_test.ts | 2 +- ts/test-node/util/i18n.ts | 9 +- ts/test-node/util/isConversationMuted_test.ts | 2 +- .../util/isConversationNameKnown_test.ts | 2 +- .../util/isConversationSMSOnly_test.ts | 4 +- .../util/isConversationUnread_test.ts | 2 +- .../util/isConversationUnregistered_test.ts | 6 +- ts/test-node/util/isFileDangerous_test.ts | 2 +- ts/test-node/util/isInSystemContacts_test.ts | 2 +- ts/test-node/util/isMessageUnread_test.ts | 4 +- ts/test-node/util/isNormalNumber_test.ts | 2 +- ts/test-node/util/isNotNil_test.ts | 2 +- ts/test-node/util/isPathInside_test.ts | 2 +- ts/test-node/util/isRecord_test.ts | 2 +- ts/test-node/util/isSorted_test.ts | 2 +- ts/test-node/util/isValidE164_test.ts | 2 +- ts/test-node/util/isValidUuid.ts | 2 +- ts/test-node/util/iterables_test.ts | 2 +- ts/test-node/util/libphonenumberUtil_test.ts | 2 +- ts/test-node/util/logPadding_test.ts | 4 +- ts/test-node/util/makeLookup_test.ts | 2 +- ts/test-node/util/mapEmplace_test.ts | 4 +- ts/test-node/util/mapObjectWithSpec_test.ts | 2 +- ts/test-node/util/mapUtil_test.ts | 2 +- ts/test-node/util/messageFailures.ts | 22 +- ts/test-node/util/normalizeDeviceName_test.ts | 2 +- ts/test-node/util/parseIntOrThrow_test.ts | 2 +- .../util/parseIntWithFallback_test.ts | 2 +- ts/test-node/util/parseRetryAfter_test.ts | 4 +- ts/test-node/util/prependStream_test.ts | 2 +- ts/test-node/util/privacy_test.ts | 4 +- .../util/queueAttachmentDownloads_test.ts | 12 +- ts/test-node/util/reallyJsonStringify_test.ts | 2 +- ts/test-node/util/replaceIndex_test.ts | 2 +- .../util/resolveCanonicalLocales_test.ts | 2 +- ts/test-node/util/rgbToHSL_test.ts | 2 +- .../nonRenderedRemoteParticipant_test.ts | 2 +- .../normalizeGroupCallTimestamp_test.ts | 2 +- ts/test-node/util/schemas_test.ts | 2 +- .../util/searchConversationTitles_test.ts | 4 +- ts/test-node/util/search_test.ts | 2 +- ts/test-node/util/serverAlerts_test.ts | 6 +- ts/test-node/util/sessionTranslation_test.ts | 6 +- ts/test-node/util/setUtil_test.ts | 2 +- ts/test-node/util/signalRoutes_test.ts | 4 +- ts/test-node/util/sleep_test.ts | 2 +- ts/test-node/util/sniffImageMimeType_test.ts | 4 +- ts/test-node/util/sortByTitle_test.ts | 2 +- ts/test-node/util/splitText_test.ts | 4 +- .../util/startTimeTravelDetector_test.ts | 2 +- ts/test-node/util/theme_test.ts | 2 +- ts/test-node/util/timelineUtil_test.ts | 6 +- ts/test-node/util/timestampLongUtils_test.ts | 4 +- ts/test-node/util/timestamp_test.ts | 163 +-------- ts/test-node/util/toWebStream_test.ts | 2 +- .../util/toggleMaximizedBrowserWindow_test.ts | 2 +- ts/test-node/util/unicodeBidi_test.ts | 2 +- ts/test-node/util/unicodeSlice_test.ts | 4 +- ts/test-node/util/uploads/helpers.ts | 2 +- ts/test-node/util/uploads/tusProtocol_test.ts | 6 +- ts/test-node/util/url_test.ts | 4 +- ts/test-node/util/userLanguages_test.ts | 2 +- ts/test-node/util/version_test.ts | 2 +- ts/test-node/util/waitBatcher_test.ts | 6 +- ts/test-node/util/waitForAll.ts | 2 +- ts/test-node/util/webSafeBase64_test.ts | 2 +- .../util/windowsZoneIdentifier_test.ts | 2 +- .../util/wrapEventEmitterOnce_test.ts | 2 +- ts/textsecure/AccountManager.ts | 58 ++-- ts/textsecure/ContactsParser.ts | 28 +- ts/textsecure/Errors.ts | 6 +- ts/textsecure/KeyChangeListener.ts | 4 +- ts/textsecure/MessageReceiver.ts | 112 +++--- ts/textsecure/OutgoingMessage.ts | 39 ++- ts/textsecure/Provisioner.ts | 38 +- ts/textsecure/ProvisioningCipher.ts | 16 +- ts/textsecure/SendMessage.ts | 90 ++--- ts/textsecure/SocketManager.ts | 38 +- ts/textsecure/Storage.ts | 8 +- ts/textsecure/TaskWithTimeout.ts | 10 +- ts/textsecure/Types.d.ts | 20 +- ts/textsecure/UpdateKeysListener.ts | 20 +- ts/textsecure/Utils.ts | 2 +- ts/textsecure/WebAPI.ts | 104 +++--- ts/textsecure/WebSocket.ts | 24 +- ts/textsecure/WebsocketResources.ts | 36 +- ts/textsecure/cds/CDSBase.ts | 10 +- ts/textsecure/cds/CDSI.ts | 10 +- ts/textsecure/cds/CDSISocket.ts | 8 +- ts/textsecure/cds/CDSSocketBase.ts | 18 +- ts/textsecure/cds/Types.d.ts | 2 +- ts/textsecure/downloadAttachment.ts | 47 +-- ts/textsecure/getKeysForServiceId.ts | 29 +- ts/textsecure/messageReceiverEvents.ts | 12 +- ts/textsecure/preconnect.ts | 16 +- ts/textsecure/processDataMessage.ts | 37 +- ts/textsecure/processSyncMessage.ts | 6 +- ts/textsecure/storage/Blocked.ts | 8 +- ts/textsecure/storage/User.ts | 12 +- ts/textsecure/syncRequests.ts | 8 +- ts/types/Address.ts | 2 +- ts/types/Attachment.ts | 11 +- ts/types/AttachmentBackup.ts | 4 +- ts/types/AttachmentDownload.ts | 8 +- ts/types/AttachmentSize.ts | 6 +- ts/types/Avatar.ts | 6 +- ts/types/BodyRange.ts | 16 +- ts/types/CallDisposition.ts | 12 +- ts/types/CallLink.ts | 10 +- ts/types/Calling.ts | 8 +- ts/types/ChatFolder.ts | 41 +-- ts/types/Conversation.ts | 8 +- ts/types/Crypto.ts | 2 +- ts/types/CurrentChatFolders.ts | 6 +- ts/types/DonationsCardForm.ts | 4 +- ts/types/EmbeddedContact.ts | 18 +- ts/types/ErrorWithToast.ts | 2 +- ts/types/ForwardDraft.ts | 10 +- ts/types/GroupSendEndorsements.ts | 6 +- ts/types/I18N.ts | 4 +- ts/types/LinkPreview.ts | 14 +- ts/types/MediaItem.ts | 2 +- ts/types/Message.ts | 6 +- ts/types/Message2.ts | 45 +-- ts/types/Nav.ts | 2 +- ts/types/NotificationProfile-node.ts | 12 +- ts/types/NotificationProfile.ts | 6 +- ts/types/PhoneNumber.ts | 9 +- ts/types/PhoneNumberSharingMode.ts | 2 +- ts/types/Polls.ts | 10 +- ts/types/PreferencesBackupPage.ts | 2 +- ts/types/QualifiedAddress.ts | 10 +- ts/types/Reactions.ts | 2 +- ts/types/Receipt.ts | 2 +- ts/types/RendererConfig.ts | 8 +- ts/types/ServiceId.ts | 8 +- ts/types/Settings.ts | 6 +- ts/types/SignalConversation.ts | 2 +- ts/types/Stickers.ts | 50 +-- ts/types/Storage.d.ts | 22 +- ts/types/Stories.ts | 20 +- ts/types/StoryDistributionId.ts | 6 +- ts/types/SystemTraySetting.ts | 2 +- ts/types/Util.ts | 6 +- ts/types/VisualAttachment.ts | 20 +- ts/types/backups.ts | 2 +- ts/types/errors.ts | 2 +- ts/types/groups.ts | 2 +- ts/types/message/LinkPreviews.ts | 2 +- ts/types/notifications.ts | 10 + ts/updateConversationsWithUuidLookup.ts | 15 +- ts/updater/common.ts | 39 ++- ts/updater/differential.ts | 12 +- ts/updater/generateKeyPair.ts | 8 +- ts/updater/generateSignature.ts | 8 +- ts/updater/got.ts | 10 +- ts/updater/index.ts | 8 +- ts/updater/linux.ts | 10 +- ts/updater/macos.ts | 8 +- ts/updater/signature.ts | 2 +- ts/updater/util.ts | 10 +- ts/updater/windows.ts | 2 +- ts/util/AbortableProcess.ts | 2 +- ts/util/Attachment.ts | 248 +------------ ts/util/AttachmentCrypto.ts | 8 +- ts/util/DelimitedStream.ts | 2 +- ts/util/GoogleChrome.ts | 2 +- ts/util/JobQueue.ts | 2 +- ts/util/LatestQueue.ts | 2 +- ts/util/ServiceId.ts | 8 +- ts/util/Settings.ts | 2 +- ts/util/Sound.ts | 4 +- ts/util/StartupQueue.ts | 4 +- ts/util/Username.ts | 4 +- ts/util/appendMacStream.ts | 2 +- ts/util/arePinnedConversationsEqual.ts | 6 +- ts/util/areWeAdmin.ts | 8 +- ts/util/arrayBufferToObjectURL.ts | 2 +- ts/util/assert.ts | 6 +- ts/util/attachmentDownloadQueue.ts | 22 +- ts/util/attachmentPath.ts | 4 +- ts/util/attachments.ts | 16 +- .../markAttachmentAsPermanentlyErrored.ts | 2 +- .../attachments/migrateDataToFilesystem.ts | 4 +- ts/util/avatarDataToBytes.ts | 12 +- ts/util/avatarTextSizeCalculator.ts | 2 +- ts/util/avatarUtils.ts | 12 +- ts/util/backupMediaDownload.ts | 8 +- ts/util/backupSubscriptionData.ts | 14 +- ts/util/basePaths.ts | 2 +- ts/util/batcher.ts | 12 +- .../blockSendUntilConversationsAreVerified.ts | 14 +- ts/util/buildExpiration.ts | 10 +- ts/util/callDisposition.ts | 66 ++-- ts/util/callLinks.ts | 12 +- ts/util/callLinks/zkgroup.ts | 10 +- ts/util/callLinksRingrtc.ts | 12 +- ts/util/callingGetParticipantName.ts | 2 +- ts/util/callingIsReconnecting.ts | 8 +- ts/util/callingMessageToProto.ts | 8 +- ts/util/callingNotification.ts | 16 +- ts/util/callingTones.ts | 6 +- ts/util/canAddNewMembers.ts | 6 +- ts/util/canBeAnnouncementGroup.ts | 2 +- ts/util/canChangeTimer.ts | 8 +- ts/util/canConversationBeUnarchived.ts | 4 +- ts/util/canEditGroupInfo.ts | 6 +- ts/util/canEditMessage.ts | 8 +- ts/util/canvasToBlob.ts | 2 +- ts/util/canvasToBytes.ts | 4 +- ts/util/captureDimensionsAndScreenshot.ts | 193 +++++++++++ ts/util/checkFirstEnvelope.ts | 14 +- ts/util/checkOurPniIdentityKey.ts | 10 +- ts/util/cleanup.ts | 38 +- ts/util/clearConversationDraftAttachments.ts | 8 +- ts/util/computeBlurHashUrl.ts | 2 +- ts/util/consoleLogger.ts | 2 +- ts/util/copyLinksWithToast.ts | 2 +- ts/util/countMutedStats.ts | 8 +- ts/util/countUnreadStats.ts | 10 +- ts/util/createAvatarData.ts | 2 +- ts/util/createHTTPSAgent.ts | 16 +- ts/util/createIPCEvents.ts | 39 ++- ts/util/createIdenticon.tsx | 10 +- ts/util/createProxyAgent.ts | 12 +- ts/util/currency.ts | 8 +- ts/util/decipherWithAesKey.ts | 4 +- ts/util/deconstructLookup.ts | 4 +- ts/util/deleteAllLogs.ts | 4 +- ts/util/deleteAllMyStories.ts | 2 +- ts/util/deleteDraftAttachment.ts | 4 +- ts/util/deleteForEveryone.ts | 20 +- ts/util/deleteForMe.ts | 26 +- ts/util/deleteGroupStoryReplyForEveryone.ts | 8 +- ts/util/deleteStoryForEveryone.ts | 32 +- ts/util/deliveryReceipt.ts | 10 +- ts/util/denyPendingApprovalRequest.ts | 14 +- ts/util/deprecated.ts | 4 +- ts/util/desktopCapturer.ts | 22 +- ts/util/distributionListToSendTarget.ts | 10 +- ts/util/dns.ts | 8 +- ts/util/donations.ts | 8 +- ts/util/doubleCheckMissingQuoteReference.ts | 20 +- ts/util/downloadAttachment.ts | 26 +- ts/util/downloadAttachmentFromLocalBackup.ts | 8 +- ts/util/downloadOnboardingStory.ts | 27 +- ts/util/durations/duration-in-seconds.ts | 2 +- ts/util/durations/index.ts | 4 +- ts/util/editHelpers.ts | 6 +- ts/util/emoji.ts | 4 +- ts/util/encryptConversationAttachments.ts | 18 +- ts/util/encryptLegacyAttachment.ts | 14 +- ts/util/encryptProfileData.ts | 18 +- ts/util/expirationTimer.ts | 4 +- ts/util/exponentialBackoff.ts | 4 +- ts/util/filterAndSortConversations.ts | 16 +- ts/util/filterCallLinks.ts | 6 +- .../findAndDeleteOnboardingStoryIfExists.ts | 14 +- ts/util/findAndFormatContact.ts | 8 +- ts/util/findStoryMessage.ts | 8 +- ts/util/formatTimestamp.ts | 178 +++++++++- ts/util/fuse.ts | 2 +- ts/util/generateDonationReceipt.ts | 15 +- ts/util/generateMessageId.ts | 2 +- ts/util/getAboutText.ts | 2 +- ts/util/getAccessControlOptions.ts | 4 +- ts/util/getAddedByForOurPendingInvitation.ts | 4 +- ts/util/getAvatarData.ts | 6 +- ts/util/getBasicAuth.ts | 2 +- ts/util/getColorForCallLink.ts | 4 +- ts/util/getConversation.ts | 60 ++-- ts/util/getConversationColorAttributes.ts | 4 +- ts/util/getConversationMembers.ts | 4 +- ts/util/getConversationTitleForPanelType.ts | 6 +- ts/util/getCountryData.ts | 2 +- ts/util/getCustomColorStyle.ts | 8 +- ts/util/getDraftPreview.ts | 12 +- ts/util/getE164.ts | 4 +- ts/util/getFontNameByTextScript.ts | 4 +- ts/util/getGroupMemberships.ts | 10 +- ts/util/getICUMessageParams.ts | 2 +- ts/util/getLastMessage.ts | 10 +- ts/util/getLocalAttachmentUrl.ts | 4 +- ts/util/getMacAndUpdateHmac.ts | 2 +- ts/util/getMessageAuthorText.ts | 4 +- ts/util/getMessageConversation.ts | 2 +- ts/util/getMessageQueueTime.ts | 6 +- ts/util/getMessageSentTimestamp.ts | 4 +- ts/util/getMuteOptions.ts | 8 +- ts/util/getMutedUntilText.ts | 4 +- ts/util/getNotificationDataForMessage.ts | 59 ++-- ts/util/getNotificationTextForMessage.ts | 12 +- ts/util/getProfile.ts | 6 +- ts/util/getQuoteBodyText.ts | 2 +- ts/util/getRecipientConversationIds.ts | 4 +- ts/util/getRecipients.ts | 10 +- ts/util/getRecipientsByConversation.ts | 10 +- ts/util/getSendOptions.ts | 22 +- ts/util/getSendTarget.ts | 2 +- ts/util/getServiceIdsForE164s.ts | 10 +- ts/util/getSignalConnections.ts | 14 +- ts/util/getStoryBackground.ts | 2 +- ts/util/getStoryDuration.ts | 12 +- ts/util/getStoryReplyText.ts | 6 +- ts/util/getStreamWithTimeout.ts | 6 +- ts/util/getStringForConversationMerge.ts | 2 +- ts/util/getStringForPhoneNumberDiscovery.ts | 2 +- ts/util/getStringForProfileChange.ts | 2 +- ts/util/getThemeType.ts | 4 +- ts/util/getTitle.ts | 12 +- ts/util/getUserAgent.ts | 2 +- ts/util/grapheme.ts | 2 +- ts/util/groupAndOrderReactions.ts | 8 +- ts/util/groupMemberNameCollisions.ts | 10 +- ts/util/groupMembershipUtils.ts | 11 +- ts/util/groupSendEndorsements.ts | 38 +- ts/util/handleEditMessage.ts | 42 +-- ts/util/handleImageAttachment.ts | 14 +- ts/util/handleMessageSend.ts | 12 +- ts/util/handleOutsideClick.ts | 2 +- ts/util/handleRetry.ts | 54 +-- ts/util/handleServerAlerts.ts | 19 +- ts/util/handleVideoAttachment.ts | 14 +- ts/util/hasAttachmentDownloads.ts | 2 +- ts/util/hasDraft.ts | 2 +- ts/util/hasDraftAttachments.ts | 2 +- ts/util/hydrateStoryContext.ts | 22 +- ts/util/idForLogging.ts | 11 +- ts/util/imagePathToBytes.ts | 2 +- ts/util/incrementMessageCounter.ts | 8 +- ts/util/isAciString.ts | 4 +- ts/util/isBackupEnabled.ts | 10 +- ts/util/isBlocked.ts | 6 +- ts/util/isCallSafe.ts | 10 +- ts/util/isChatFoldersEnabled.ts | 33 ++ ts/util/isConversationAccepted.ts | 10 +- ts/util/isConversationNameKnown.ts | 4 +- ts/util/isConversationSMSOnly.ts | 2 +- ts/util/isConversationUnregistered.ts | 8 +- ts/util/isGroupInStoryMode.ts | 6 +- ts/util/isGroupOrAdhocCall.ts | 9 +- ts/util/isLinkAndSyncEnabled.ts | 2 +- ts/util/isLocalBackupsEnabled.ts | 8 +- ts/util/isMessageEmpty.ts | 6 +- ts/util/isMessageUnread.ts | 2 +- ts/util/isProtoBinaryEncodingEnabled.ts | 2 +- ts/util/isSafetyNumberNotAvailable.ts | 4 +- ts/util/isSameAvatarData.ts | 2 +- ts/util/isSettingsInternalEnabled.ts | 4 +- ts/util/isSignalConversation.ts | 4 +- ts/util/isStagingServer.ts | 4 +- ts/util/isTooOldToModifyMessage.ts | 2 +- ts/util/isValidTapToView.ts | 4 +- ts/util/isVideoGoodForStories.ts | 9 +- ts/util/iterables.ts | 2 +- ts/util/keyboard.ts | 2 +- ts/util/leftPaneWidth.ts | 4 +- ts/util/libphonenumberUtil.ts | 2 +- ts/util/lint/analyze_exceptions.ts | 4 +- ts/util/lint/linter.ts | 11 +- ts/util/lint/sort_exceptions.ts | 4 +- ts/util/lint/util.ts | 2 +- ts/util/loadImage.ts | 2 +- ts/util/loadRecentEmojis.ts | 2 +- ts/util/logPadding.ts | 2 +- ts/util/longAttachment.ts | 2 +- ts/util/longRunningTaskWrapper.tsx | 14 +- ts/util/lookupConversationWithoutServiceId.ts | 23 +- ts/util/makeQuote.ts | 33 +- ts/util/mapUtil.ts | 2 +- ts/util/markConversationRead.ts | 42 +-- ts/util/markOnboardingStoryAsRead.ts | 18 +- ts/util/maybeForwardMessages.ts | 36 +- ts/util/messageBatcher.ts | 12 +- ts/util/messageFilePaths.ts | 4 +- ts/util/mightStillBeOnTransitTier.ts | 38 ++ ts/util/migrateColor.ts | 8 +- ts/util/migrations.ts | 18 +- ts/util/missingCaseError.ts | 2 +- ts/util/modifyTargetMessage.ts | 69 ++-- ts/util/nicknames.ts | 4 +- ts/util/normalizeAci.ts | 10 +- ts/util/numbers.ts | 2 +- ts/util/onCallEventSync.ts | 8 +- ts/util/onCallLinkUpdateSync.ts | 19 +- ts/util/onCallLogEventSync.ts | 16 +- ts/util/onDeviceNameChangeSync.ts | 20 +- ts/util/onStoryRecipientUpdate.ts | 26 +- ts/util/openLinkInWebBrowser.ts | 2 +- ts/util/os/osMain.ts | 2 +- ts/util/os/osPreload.ts | 4 +- ts/util/os/promptOSAuthMain.ts | 6 +- ts/util/parseIntWithFallback.ts | 2 +- ts/util/parseRetryAfter.ts | 4 +- ts/util/pemToDer.ts | 2 +- ts/util/phoneNumberDiscoverability.ts | 2 +- ts/util/phoneNumberSharingMode.ts | 8 +- ts/util/preload.ts | 10 +- ts/util/privacy.ts | 2 +- ts/util/processAttachment.ts | 29 +- ts/util/processImageFile.ts | 2 +- ts/util/promptOSAuth.ts | 2 +- ts/util/queueAttachmentDownloads.ts | 50 +-- ts/util/randomBlurHash.ts | 2 +- ts/util/registration.ts | 2 +- ts/util/removePendingMember.ts | 14 +- ts/util/resolveAttachmentDraftData.ts | 6 +- ts/util/resolveDraftAttachmentOnDisk.ts | 10 +- ts/util/resolveStorySendStatus.ts | 12 +- .../ringrtc/nonRenderedRemoteParticipant.ts | 2 +- ts/util/rotatingPinoDest.ts | 4 +- ts/util/safetyNumber.ts | 16 +- ts/util/scaleImageToLevel.ts | 12 +- ts/util/searchConversationTitles.ts | 4 +- ts/util/sendCallLinkUpdateSync.ts | 20 +- ts/util/sendDeleteForEveryoneMessage.ts | 24 +- ts/util/sendEditedMessage.ts | 57 +-- ts/util/sendReceipts.ts | 26 +- ts/util/sendStoryMessage.ts | 48 +-- ts/util/sendToGroup.ts | 84 +++-- ts/util/sessionTranslation.ts | 4 +- ts/util/setUtil.ts | 2 +- ts/util/setupI18n.tsx | 39 ++- ts/util/setupI18nMain.ts | 35 +- ts/util/shouldDownloadStory.ts | 4 +- ts/util/shouldNeverBeCalled.ts | 2 +- ts/util/shouldRespondWithProfileKey.ts | 4 +- ts/util/shouldShowInvalidMessageToast.ts | 14 +- ts/util/shouldStoryReplyNotifyUser.ts | 12 +- ts/util/showConfirmationDialog.tsx | 6 +- ts/util/showDownloadFailedToast.ts | 6 +- ts/util/signalRoutes.ts | 8 +- ts/util/sleeper.ts | 4 +- ts/util/smartling.ts | 4 +- ts/util/sniffImageMimeType.ts | 4 +- ts/util/startConversation.ts | 4 +- ts/util/stories.ts | 4 +- ts/util/subscriptionConfiguration.ts | 10 +- ts/util/syncIdentifiers.ts | 26 +- ts/util/syncTasks.ts | 22 +- ts/util/theme.ts | 4 +- ts/util/timeAndLogIfTooLong.ts | 2 +- ts/util/timelineUtil.ts | 16 +- ts/util/timeout.ts | 2 +- ts/util/timestamp.ts | 177 +--------- ts/util/timestampLongUtils.ts | 2 +- ts/util/trimPadding.ts | 2 +- ts/util/unicodeBidi.ts | 2 +- ts/util/universalExpireTimer.ts | 6 +- ts/util/updateBackupMediaDownloadProgress.ts | 4 +- ts/util/uploadAttachment.ts | 24 +- ts/util/uploads/tusProtocol.ts | 10 +- ts/util/uploads/uploads.ts | 6 +- ts/util/uuidToBytes.ts | 6 +- ts/util/validateConversation.ts | 4 +- ts/util/verifyStoryListMembers.ts | 14 +- ts/util/waitBatcher.ts | 14 +- ts/util/waitForAll.ts | 2 +- ts/util/waitForOnline.ts | 2 +- ts/util/whatTypeOfConversation.ts | 8 +- ts/util/windowsZoneIdentifier.ts | 2 +- ts/util/wrapWithSyncMessageSend.ts | 16 +- ts/util/writeDraftAttachment.ts | 16 +- ts/util/zkgroup.ts | 10 +- ts/window.d.ts | 30 +- ts/windows/about/app.tsx | 10 +- ts/windows/about/preload.ts | 6 +- ts/windows/calling-tools/preload.ts | 2 +- ts/windows/context.ts | 31 +- ts/windows/debuglog/app.tsx | 10 +- ts/windows/debuglog/preload.ts | 2 +- ts/windows/loading/preload.ts | 4 +- ts/windows/main/attachments.ts | 16 +- ts/windows/main/phase0-devtools.ts | 2 +- ts/windows/main/phase1-ipc.ts | 42 +-- ts/windows/main/phase2-dependencies.ts | 12 +- ts/windows/main/phase3-post-signal.ts | 8 +- ts/windows/main/preload.ts | 2 +- ts/windows/main/preload_test.ts | 12 +- ts/windows/main/start.ts | 34 +- ts/windows/minimalContext.ts | 28 +- ts/windows/permissions/app.tsx | 10 +- ts/windows/permissions/preload.ts | 6 +- ts/windows/preload.ts | 2 +- ts/windows/sandboxedInit.ts | 2 +- ts/windows/screenShare/app.tsx | 14 +- ts/windows/screenShare/preload.ts | 4 +- ts/workers/heicConverterWorker.ts | 2 +- 2095 files changed, 15148 insertions(+), 14629 deletions(-) create mode 100644 ts/test-electron/util/formatTimestamp_test.ts delete mode 100644 ts/test-node/util/formatTimestamp_test.ts create mode 100644 ts/types/notifications.ts create mode 100644 ts/util/captureDimensionsAndScreenshot.ts create mode 100644 ts/util/isChatFoldersEnabled.ts create mode 100644 ts/util/mightStillBeOnTransitTier.ts diff --git a/app/EmojiService.ts b/app/EmojiService.ts index c51937c550..7e45e847f2 100644 --- a/app/EmojiService.ts +++ b/app/EmojiService.ts @@ -7,10 +7,10 @@ import * as z from 'zod'; import { protocol } from 'electron'; import { LRUCache } from 'lru-cache'; -import type { OptionalResourceService } from './OptionalResourceService.js'; -import { SignalService as Proto } from '../ts/protobuf/index.js'; -import { parseUnknown } from '../ts/util/schemas.js'; -import { utf16ToEmoji } from '../ts/util/utf16ToEmoji.js'; +import type { OptionalResourceService } from './OptionalResourceService.main.js'; +import { SignalService as Proto } from '../ts/protobuf/index.std.js'; +import { parseUnknown } from '../ts/util/schemas.std.js'; +import { utf16ToEmoji } from '../ts/util/utf16ToEmoji.node.js'; const MANIFEST_PATH = join(__dirname, '..', 'build', 'jumbomoji.json'); diff --git a/app/OptionalResourceService.ts b/app/OptionalResourceService.ts index bc5404ef4d..aa53a42024 100644 --- a/app/OptionalResourceService.ts +++ b/app/OptionalResourceService.ts @@ -12,12 +12,12 @@ import PQueue from 'p-queue'; import type { OptionalResourceType, OptionalResourcesDictType, -} from '../ts/types/OptionalResource.js'; -import { OptionalResourcesDictSchema } from '../ts/types/OptionalResource.js'; -import { createLogger } from '../ts/logging/log.js'; -import { getGotOptions } from '../ts/updater/got.js'; -import { drop } from '../ts/util/drop.js'; -import { parseUnknown } from '../ts/util/schemas.js'; +} from '../ts/types/OptionalResource.std.js'; +import { OptionalResourcesDictSchema } from '../ts/types/OptionalResource.std.js'; +import { createLogger } from '../ts/logging/log.std.js'; +import { getGotOptions } from '../ts/updater/got.node.js'; +import { drop } from '../ts/util/drop.std.js'; +import { parseUnknown } from '../ts/util/schemas.std.js'; const log = createLogger('OptionalResourceService'); diff --git a/app/PreventDisplaySleepService.ts b/app/PreventDisplaySleepService.ts index dbc0654170..d4b07e4ac7 100644 --- a/app/PreventDisplaySleepService.ts +++ b/app/PreventDisplaySleepService.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { PowerSaveBlocker } from 'electron'; -import { createLogger } from '../ts/logging/log.js'; +import { createLogger } from '../ts/logging/log.std.js'; const log = createLogger('PreventDisplaySleepService'); diff --git a/app/SystemTrayService.ts b/app/SystemTrayService.ts index 45bae0e9db..83a7240e41 100644 --- a/app/SystemTrayService.ts +++ b/app/SystemTrayService.ts @@ -6,8 +6,8 @@ import { Menu, Tray, app, nativeImage, nativeTheme, screen } from 'electron'; import os from 'node:os'; import { join } from 'node:path'; import { readFileSync } from 'node:fs'; -import { createLogger } from '../ts/logging/log.js'; -import type { LocalizerType } from '../ts/types/I18N.js'; +import { createLogger } from '../ts/logging/log.std.js'; +import type { LocalizerType } from '../ts/types/I18N.std.js'; const log = createLogger('SystemTrayService'); diff --git a/app/SystemTraySettingCache.ts b/app/SystemTraySettingCache.ts index c0d7a6b21a..6d37625a2a 100644 --- a/app/SystemTraySettingCache.ts +++ b/app/SystemTraySettingCache.ts @@ -1,14 +1,14 @@ // Copyright 2017 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../ts/logging/log.js'; -import OS from '../ts/util/os/osMain.js'; +import { createLogger } from '../ts/logging/log.std.js'; +import OS from '../ts/util/os/osMain.node.js'; import { parseSystemTraySetting, SystemTraySetting, -} from '../ts/types/SystemTraySetting.js'; -import { isSystemTraySupported } from '../ts/types/Settings.js'; -import type { ConfigType } from './base_config.js'; +} from '../ts/types/SystemTraySetting.std.js'; +import { isSystemTraySupported } from '../ts/types/Settings.std.js'; +import type { ConfigType } from './base_config.node.js'; const log = createLogger('SystemTraySettingCache'); diff --git a/app/WindowsNotifications.ts b/app/WindowsNotifications.ts index 0fa9e759de..7a889ed6f0 100644 --- a/app/WindowsNotifications.ts +++ b/app/WindowsNotifications.ts @@ -9,10 +9,10 @@ import { sendDummyKeystroke, } from '@indutny/simple-windows-notifications'; -import { createLogger } from '../ts/logging/log.js'; -import { AUMID } from './startup_config.js'; -import type { WindowsNotificationData } from '../ts/services/notifications.js'; -import { renderWindowsToast } from './renderWindowsToast.js'; +import { createLogger } from '../ts/logging/log.std.js'; +import { AUMID } from './startup_config.main.js'; +import type { WindowsNotificationData } from '../ts/services/notifications.preload.js'; +import { renderWindowsToast } from './renderWindowsToast.dom.js'; const log = createLogger('WindowsNotifications'); diff --git a/app/attachment_channel.ts b/app/attachment_channel.ts index ed4bdfb92a..9cf63a79dd 100644 --- a/app/attachment_channel.ts +++ b/app/attachment_channel.ts @@ -23,30 +23,30 @@ import { pathExists } from 'fs-extra'; import { type DecryptAttachmentToSinkOptionsType, decryptAttachmentV2ToSink, -} from '../ts/AttachmentCrypto.js'; -import * as Bytes from '../ts/Bytes.js'; -import type { MessageAttachmentsCursorType } from '../ts/sql/Interface.js'; -import type { MainSQL } from '../ts/sql/main.js'; +} from '../ts/AttachmentCrypto.node.js'; +import * as Bytes from '../ts/Bytes.std.js'; +import type { MessageAttachmentsCursorType } from '../ts/sql/Interface.std.js'; +import type { MainSQL } from '../ts/sql/main.main.js'; import { APPLICATION_OCTET_STREAM, MIMETypeToString, stringToMIMEType, -} from '../ts/types/MIME.js'; -import * as Errors from '../ts/types/errors.js'; +} from '../ts/types/MIME.std.js'; +import * as Errors from '../ts/types/errors.std.js'; import { isImageTypeSupported, isVideoTypeSupported, -} from '../ts/util/GoogleChrome.js'; -import { strictAssert } from '../ts/util/assert.js'; -import { drop } from '../ts/util/drop.js'; -import { SECOND } from '../ts/util/durations/index.js'; -import { isPathInside } from '../ts/util/isPathInside.js'; -import { missingCaseError } from '../ts/util/missingCaseError.js'; -import { safeParseInteger } from '../ts/util/numbers.js'; -import { parseLoose } from '../ts/util/schemas.js'; -import { sleep } from '../ts/util/sleep.js'; -import { toWebStream } from '../ts/util/toWebStream.js'; -import { createLogger } from '../ts/logging/log.js'; +} from '../ts/util/GoogleChrome.std.js'; +import { strictAssert } from '../ts/util/assert.std.js'; +import { drop } from '../ts/util/drop.std.js'; +import { SECOND } from '../ts/util/durations/index.std.js'; +import { isPathInside } from '../ts/util/isPathInside.node.js'; +import { missingCaseError } from '../ts/util/missingCaseError.std.js'; +import { safeParseInteger } from '../ts/util/numbers.std.js'; +import { parseLoose } from '../ts/util/schemas.std.js'; +import { sleep } from '../ts/util/sleep.std.js'; +import { toWebStream } from '../ts/util/toWebStream.node.js'; +import { createLogger } from '../ts/logging/log.std.js'; import { deleteAll as deleteAllAttachments, deleteAllBadges, @@ -64,7 +64,7 @@ import { getPath, getStickersPath, getTempPath, -} from './attachments.js'; +} from './attachments.node.js'; const { isNumber } = lodash; diff --git a/app/attachments.ts b/app/attachments.ts index f9cf94481f..448b06678d 100644 --- a/app/attachments.ts +++ b/app/attachments.ts @@ -9,18 +9,18 @@ import fastGlob from 'fast-glob'; import fse from 'fs-extra'; import lodash from 'lodash'; import normalizePath from 'normalize-path'; -import { isPathInside } from '../ts/util/isPathInside.js'; -import { DAY } from '../ts/util/durations/index.js'; -import { isOlderThan } from '../ts/util/timestamp.js'; -import { isNotNil } from '../ts/util/isNotNil.js'; +import { isPathInside } from '../ts/util/isPathInside.node.js'; +import { DAY } from '../ts/util/durations/index.std.js'; +import { isOlderThan } from '../ts/util/timestamp.std.js'; +import { isNotNil } from '../ts/util/isNotNil.std.js'; import { generateKeys, decryptAttachmentV2ToSink, encryptAttachmentV2ToDisk, -} from '../ts/AttachmentCrypto.js'; -import type { LocalAttachmentV2Type } from '../ts/types/Attachment.js'; -import * as Errors from '../ts/types/errors.js'; -import { createLogger } from '../ts/logging/log.js'; +} from '../ts/AttachmentCrypto.node.js'; +import type { LocalAttachmentV2Type } from '../ts/types/Attachment.std.js'; +import * as Errors from '../ts/types/errors.std.js'; +import { createLogger } from '../ts/logging/log.std.js'; const { map, isString } = lodash; diff --git a/app/base_config.ts b/app/base_config.ts index ffcaff6320..32db817e0f 100644 --- a/app/base_config.ts +++ b/app/base_config.ts @@ -6,8 +6,8 @@ import { sync as writeFileSync } from 'write-file-atomic'; import lodash from 'lodash'; import lodashFp from 'lodash/fp.js'; -import { strictAssert } from '../ts/util/assert.js'; -import { createLogger } from '../ts/logging/log.js'; +import { strictAssert } from '../ts/util/assert.std.js'; +import { createLogger } from '../ts/logging/log.std.js'; const { set } = lodashFp; diff --git a/app/config.ts b/app/config.ts index 0fed5503cc..ac10f0b374 100644 --- a/app/config.ts +++ b/app/config.ts @@ -11,8 +11,8 @@ import { getEnvironment, setEnvironment, parseEnvironment, -} from '../ts/environment.js'; -import { createLogger } from '../ts/logging/log.js'; +} from '../ts/environment.std.js'; +import { createLogger } from '../ts/logging/log.std.js'; const log = createLogger('config'); diff --git a/app/crashReports.ts b/app/crashReports.ts index e43b86b063..dbb14592da 100644 --- a/app/crashReports.ts +++ b/app/crashReports.ts @@ -7,12 +7,12 @@ import { basename, join } from 'node:path'; import { toJSONString as dumpToJSONString } from '@signalapp/libsignal-client/dist/Minidump.js'; import z from 'zod'; -import type { LoggerType } from '../ts/types/Logging.js'; -import * as Errors from '../ts/types/errors.js'; -import { isProduction } from '../ts/util/version.js'; -import { isNotNil } from '../ts/util/isNotNil.js'; -import OS from '../ts/util/os/osMain.js'; -import { parseUnknown } from '../ts/util/schemas.js'; +import type { LoggerType } from '../ts/types/Logging.std.js'; +import * as Errors from '../ts/types/errors.std.js'; +import { isProduction } from '../ts/util/version.std.js'; +import { isNotNil } from '../ts/util/isNotNil.std.js'; +import OS from '../ts/util/os/osMain.node.js'; +import { parseUnknown } from '../ts/util/schemas.std.js'; const { realpath, readdir, readFile, unlink, stat } = fsExtra; diff --git a/app/dns-fallback.ts b/app/dns-fallback.ts index fdb2a773f2..e101578fe1 100644 --- a/app/dns-fallback.ts +++ b/app/dns-fallback.ts @@ -3,10 +3,10 @@ import { join } from 'node:path'; import { readFile } from 'node:fs/promises'; -import { DNSFallbackSchema } from '../ts/types/DNSFallback.js'; -import type { DNSFallbackType } from '../ts/types/DNSFallback.js'; -import { parseUnknown } from '../ts/util/schemas.js'; -import { createLogger } from '../ts/logging/log.js'; +import { DNSFallbackSchema } from '../ts/types/DNSFallback.std.js'; +import type { DNSFallbackType } from '../ts/types/DNSFallback.std.js'; +import { parseUnknown } from '../ts/util/schemas.std.js'; +import { createLogger } from '../ts/logging/log.std.js'; const log = createLogger('dns-fallback'); diff --git a/app/ephemeral_config.ts b/app/ephemeral_config.ts index a504b7ee20..07d70b78ae 100644 --- a/app/ephemeral_config.ts +++ b/app/ephemeral_config.ts @@ -5,7 +5,7 @@ import { join } from 'node:path'; import { app } from 'electron'; -import { start } from './base_config.js'; +import { start } from './base_config.node.js'; const userDataPath = app.getPath('userData'); const targetPath = join(userDataPath, 'ephemeral.json'); diff --git a/app/global_errors.ts b/app/global_errors.ts index 4a39f10861..9fb674f948 100644 --- a/app/global_errors.ts +++ b/app/global_errors.ts @@ -4,11 +4,11 @@ import { app, dialog, clipboard } from 'electron'; import os from 'node:os'; -import * as Errors from '../ts/types/errors.js'; -import { redactAll } from '../ts/util/privacy.js'; -import { createLogger } from '../ts/logging/log.js'; -import { reallyJsonStringify } from '../ts/util/reallyJsonStringify.js'; -import type { LocaleType } from './locale.js'; +import * as Errors from '../ts/types/errors.std.js'; +import { redactAll } from '../ts/util/privacy.node.js'; +import { createLogger } from '../ts/logging/log.std.js'; +import { reallyJsonStringify } from '../ts/util/reallyJsonStringify.std.js'; +import type { LocaleType } from './locale.main.js'; const log = createLogger('global_errors'); diff --git a/app/locale.ts b/app/locale.ts index 576bf82169..c38cc350d1 100644 --- a/app/locale.ts +++ b/app/locale.ts @@ -7,17 +7,17 @@ import { app } from 'electron'; import lodash from 'lodash'; import * as LocaleMatcher from '@formatjs/intl-localematcher'; import { z } from 'zod'; -import { setupI18n } from '../ts/util/setupI18nMain.js'; -import { shouldNeverBeCalled } from '../ts/util/shouldNeverBeCalled.js'; +import { setupI18n } from '../ts/util/setupI18nMain.std.js'; +import { shouldNeverBeCalled } from '../ts/util/shouldNeverBeCalled.std.js'; -import type { LoggerType } from '../ts/types/Logging.js'; +import type { LoggerType } from '../ts/types/Logging.std.js'; import type { HourCyclePreference, LocaleMessagesType, -} from '../ts/types/I18N.js'; -import type { LocalizerType } from '../ts/types/Util.js'; -import * as Errors from '../ts/types/errors.js'; -import { parseUnknown } from '../ts/util/schemas.js'; +} from '../ts/types/I18N.std.js'; +import type { LocalizerType } from '../ts/types/Util.std.js'; +import * as Errors from '../ts/types/errors.std.js'; +import { parseUnknown } from '../ts/util/schemas.std.js'; const { merge } = lodash; @@ -197,6 +197,8 @@ export function load({ const i18n = setupI18n(matchedLocale, finalMessages, { renderEmojify: shouldNeverBeCalled, + getLocaleDirection: shouldNeverBeCalled, + getHourCyclePreference: shouldNeverBeCalled, }); const direction = localeDirectionTestingOverride ?? getLocaleDirection(matchedLocale, logger); diff --git a/app/main.ts b/app/main.ts index 9a46bb915b..1aaa84ceaa 100644 --- a/app/main.ts +++ b/app/main.ts @@ -35,100 +35,106 @@ import { z } from 'zod'; import { version as packageVersion, productName, -} from '../ts/util/packageJson.js'; -import * as GlobalErrors from './global_errors.js'; -import { setup as setupCrashReports } from './crashReports.js'; -import { setup as setupSpellChecker } from './spell_check.js'; -import { getDNSFallback } from './dns-fallback.js'; -import { redactAll, addSensitivePath } from '../ts/util/privacy.js'; -import { createSupportUrl } from '../ts/util/createSupportUrl.js'; -import { missingCaseError } from '../ts/util/missingCaseError.js'; -import { strictAssert } from '../ts/util/assert.js'; -import { drop } from '../ts/util/drop.js'; -import type { ThemeSettingType } from '../ts/types/StorageUIKeys.js'; -import { ThemeType } from '../ts/types/Util.js'; -import * as Errors from '../ts/types/errors.js'; -import { resolveCanonicalLocales } from '../ts/util/resolveCanonicalLocales.js'; -import { createLogger } from '../ts/logging/log.js'; -import * as debugLog from '../ts/logging/debuglogs.js'; -import * as uploadDebugLog from '../ts/logging/uploadDebugLog.js'; -import { explodePromise } from '../ts/util/explodePromise.js'; +} from '../ts/util/packageJson.node.js'; +import * as GlobalErrors from './global_errors.main.js'; +import { setup as setupCrashReports } from './crashReports.main.js'; +import { setup as setupSpellChecker } from './spell_check.main.js'; +import { getDNSFallback } from './dns-fallback.node.js'; +import { redactAll, addSensitivePath } from '../ts/util/privacy.node.js'; +import { createSupportUrl } from '../ts/util/createSupportUrl.std.js'; +import { missingCaseError } from '../ts/util/missingCaseError.std.js'; +import { strictAssert } from '../ts/util/assert.std.js'; +import { drop } from '../ts/util/drop.std.js'; +import type { ThemeSettingType } from '../ts/types/StorageUIKeys.std.js'; +import { ThemeType } from '../ts/types/Util.std.js'; +import * as Errors from '../ts/types/errors.std.js'; +import { resolveCanonicalLocales } from '../ts/util/resolveCanonicalLocales.std.js'; +import { createLogger } from '../ts/logging/log.std.js'; +import * as debugLog from '../ts/logging/debuglogs.node.js'; +import * as uploadDebugLog from '../ts/logging/uploadDebugLog.node.js'; +import { explodePromise } from '../ts/util/explodePromise.std.js'; -import './startup_config.js'; +import './startup_config.main.js'; -import type { RendererConfigType } from '../ts/types/RendererConfig.js'; +import type { RendererConfigType } from '../ts/types/RendererConfig.std.js'; import { directoryConfigSchema, rendererConfigSchema, -} from '../ts/types/RendererConfig.js'; -import config from './config.js'; +} from '../ts/types/RendererConfig.std.js'; +import config from './config.main.js'; import { Environment, getEnvironment, isTestEnvironment, -} from '../ts/environment.js'; +} from '../ts/environment.std.js'; // Very important to put before the single instance check, since it is based on the // userData directory. (see requestSingleInstanceLock below) -import * as userConfig from './user_config.js'; +import * as userConfig from './user_config.main.js'; // We generally want to pull in our own modules after this point, after the user // data directory has been set. -import * as attachments from './attachments.js'; -import * as attachmentChannel from './attachment_channel.js'; -import * as bounce from '../ts/services/bounce.js'; -import * as updater from '../ts/updater/index.js'; -import { updateDefaultSession } from './updateDefaultSession.js'; -import { PreventDisplaySleepService } from './PreventDisplaySleepService.js'; -import { SystemTrayService, focusAndForceToTop } from './SystemTrayService.js'; -import { SystemTraySettingCache } from './SystemTraySettingCache.js'; -import { OptionalResourceService } from './OptionalResourceService.js'; -import { EmojiService } from './EmojiService.js'; +import * as attachments from './attachments.node.js'; +import * as attachmentChannel from './attachment_channel.main.js'; +import * as bounce from '../ts/services/bounce.main.js'; +import * as updater from '../ts/updater/index.main.js'; +import { updateDefaultSession } from './updateDefaultSession.main.js'; +import { PreventDisplaySleepService } from './PreventDisplaySleepService.std.js'; +import { + SystemTrayService, + focusAndForceToTop, +} from './SystemTrayService.main.js'; +import { SystemTraySettingCache } from './SystemTraySettingCache.node.js'; +import { OptionalResourceService } from './OptionalResourceService.main.js'; +import { EmojiService } from './EmojiService.main.js'; import { SystemTraySetting, shouldMinimizeToSystemTray, parseSystemTraySetting, -} from '../ts/types/SystemTraySetting.js'; +} from '../ts/types/SystemTraySetting.std.js'; import { getDefaultSystemTraySetting, isSystemTraySupported, isContentProtectionEnabledByDefault, -} from '../ts/types/Settings.js'; -import * as ephemeralConfig from './ephemeral_config.js'; -import * as mainProcessLogging from '../ts/logging/main_process_logging.js'; -import { MainSQL } from '../ts/sql/main.js'; -import * as sqlChannels from './sql_channel.js'; -import * as windowState from './window_state.js'; -import type { CreateTemplateOptionsType } from './menu.js'; -import { createTemplate } from './menu.js'; -import { installFileHandler, installWebHandler } from './protocol_filter.js'; -import OS from '../ts/util/os/osMain.js'; -import { isNightly, isProduction } from '../ts/util/version.js'; -import { clearTimeoutIfNecessary } from '../ts/util/clearTimeoutIfNecessary.js'; -import { toggleMaximizedBrowserWindow } from '../ts/util/toggleMaximizedBrowserWindow.js'; -import { ChallengeMainHandler } from '../ts/main/challengeMain.js'; -import { NativeThemeNotifier } from '../ts/main/NativeThemeNotifier.js'; -import { PowerChannel } from '../ts/main/powerChannel.js'; -import { SettingsChannel } from '../ts/main/settingsChannel.js'; -import { maybeParseUrl, setUrlSearchParams } from '../ts/util/url.js'; -import { getHeicConverter } from '../ts/workers/heicConverterMain.js'; +} from '../ts/types/Settings.std.js'; +import * as ephemeralConfig from './ephemeral_config.main.js'; +import * as mainProcessLogging from '../ts/logging/main_process_logging.main.js'; +import { MainSQL } from '../ts/sql/main.main.js'; +import * as sqlChannels from './sql_channel.main.js'; +import * as windowState from './window_state.std.js'; +import type { CreateTemplateOptionsType } from './menu.std.js'; +import { createTemplate } from './menu.std.js'; +import { + installFileHandler, + installWebHandler, +} from './protocol_filter.node.js'; +import OS from '../ts/util/os/osMain.node.js'; +import { isNightly, isProduction } from '../ts/util/version.std.js'; +import { clearTimeoutIfNecessary } from '../ts/util/clearTimeoutIfNecessary.std.js'; +import { toggleMaximizedBrowserWindow } from '../ts/util/toggleMaximizedBrowserWindow.std.js'; +import { ChallengeMainHandler } from '../ts/main/challengeMain.main.js'; +import { NativeThemeNotifier } from '../ts/main/NativeThemeNotifier.main.js'; +import { PowerChannel } from '../ts/main/powerChannel.main.js'; +import { SettingsChannel } from '../ts/main/settingsChannel.main.js'; +import { maybeParseUrl, setUrlSearchParams } from '../ts/util/url.std.js'; +import { getHeicConverter } from '../ts/workers/heicConverterMain.main.js'; -import type { LocaleDirection, LocaleType } from './locale.js'; -import { load as loadLocale } from './locale.js'; +import type { LocaleDirection, LocaleType } from './locale.main.js'; +import { load as loadLocale } from './locale.main.js'; -import { HourCyclePreference } from '../ts/types/I18N.js'; -import { ScreenShareStatus } from '../ts/types/Calling.js'; -import type { ParsedSignalRoute } from '../ts/util/signalRoutes.js'; -import { parseSignalRoute } from '../ts/util/signalRoutes.js'; -import * as dns from '../ts/util/dns.js'; -import { ZoomFactorService } from '../ts/services/ZoomFactorService.js'; -import { SafeStorageBackendChangeError } from '../ts/types/SafeStorageBackendChangeError.js'; -import { SafeStorageDecryptionError } from '../ts/types/SafeStorageDecryptionError.js'; -import { LINUX_PASSWORD_STORE_FLAGS } from '../ts/util/linuxPasswordStoreFlags.js'; -import { getOwn } from '../ts/util/getOwn.js'; -import { safeParseLoose, safeParseUnknown } from '../ts/util/schemas.js'; -import { getAppErrorIcon } from '../ts/util/getAppErrorIcon.js'; -import { promptOSAuth } from '../ts/util/os/promptOSAuthMain.js'; +import { HourCyclePreference } from '../ts/types/I18N.std.js'; +import { ScreenShareStatus } from '../ts/types/Calling.std.js'; +import type { ParsedSignalRoute } from '../ts/util/signalRoutes.std.js'; +import { parseSignalRoute } from '../ts/util/signalRoutes.std.js'; +import * as dns from '../ts/util/dns.node.js'; +import { ZoomFactorService } from '../ts/services/ZoomFactorService.main.js'; +import { SafeStorageBackendChangeError } from '../ts/types/SafeStorageBackendChangeError.std.js'; +import { SafeStorageDecryptionError } from '../ts/types/SafeStorageDecryptionError.std.js'; +import { LINUX_PASSWORD_STORE_FLAGS } from '../ts/util/linuxPasswordStoreFlags.std.js'; +import { getOwn } from '../ts/util/getOwn.std.js'; +import { safeParseLoose, safeParseUnknown } from '../ts/util/schemas.std.js'; +import { getAppErrorIcon } from '../ts/util/getAppErrorIcon.node.js'; +import { promptOSAuth } from '../ts/util/os/promptOSAuthMain.main.js'; const { chmod, realpath, writeFile } = fsExtra; const { get, pick, isNumber, isBoolean, some, debounce, noop } = lodash; diff --git a/app/menu.ts b/app/menu.ts index 4c4281db12..dcd65c0b68 100644 --- a/app/menu.ts +++ b/app/menu.ts @@ -3,12 +3,12 @@ import lodash from 'lodash'; -import type { LocalizerType } from '../ts/types/I18N.js'; +import type { LocalizerType } from '../ts/types/I18N.std.js'; import type { MenuListType, MenuOptionsType, MenuActionsType, -} from '../ts/types/menu.js'; +} from '../ts/types/menu.std.js'; const { isString } = lodash; diff --git a/app/permissions.ts b/app/permissions.ts index 82a7082bb3..af5831204f 100644 --- a/app/permissions.ts +++ b/app/permissions.ts @@ -6,8 +6,8 @@ import type { session as ElectronSession, Session } from 'electron'; -import type { ConfigType } from './base_config.js'; -import { createLogger } from '../ts/logging/log.js'; +import type { ConfigType } from './base_config.node.js'; +import { createLogger } from '../ts/logging/log.std.js'; const log = createLogger('permissions'); diff --git a/app/protocol_filter.ts b/app/protocol_filter.ts index ef2f4d2fc4..483d1c4e40 100644 --- a/app/protocol_filter.ts +++ b/app/protocol_filter.ts @@ -14,8 +14,8 @@ import { getStickersPath, getTempPath, getUpdateCachePath, -} from './attachments.js'; -import { createLogger } from '../ts/logging/log.js'; +} from './attachments.node.js'; +import { createLogger } from '../ts/logging/log.std.js'; const log = createLogger('protocol_filter'); diff --git a/app/renderWindowsToast.tsx b/app/renderWindowsToast.tsx index dbf9d35fa1..3dcb1cab5c 100644 --- a/app/renderWindowsToast.tsx +++ b/app/renderWindowsToast.tsx @@ -4,16 +4,16 @@ import React from 'react'; import { renderToStaticMarkup } from 'react-dom/server'; -import type { WindowsNotificationData } from '../ts/services/notifications'; +import type { WindowsNotificationData } from '../ts/services/notifications.preload.js'; -import { NotificationType } from '../ts/services/notifications'; -import { missingCaseError } from '../ts/util/missingCaseError'; +import { NotificationType } from '../ts/types/notifications.std.js'; +import { missingCaseError } from '../ts/util/missingCaseError.std.js'; import { cancelPresentingRoute, showConversationRoute, showWindowRoute, startCallLobbyRoute, -} from '../ts/util/signalRoutes'; +} from '../ts/util/signalRoutes.std.js'; function pathToUri(path: string) { return `file:///${encodeURI(path.replace(/\\/g, '/'))}`; diff --git a/app/spell_check.ts b/app/spell_check.ts index cfb714f394..db897f7162 100644 --- a/app/spell_check.ts +++ b/app/spell_check.ts @@ -5,14 +5,14 @@ import type { BrowserWindow } from 'electron'; import { Menu, clipboard, nativeImage } from 'electron'; import * as LocaleMatcher from '@formatjs/intl-localematcher'; -import { maybeParseUrl } from '../ts/util/url.js'; +import { maybeParseUrl } from '../ts/util/url.std.js'; -import type { MenuListType } from '../ts/types/menu.js'; -import type { LocalizerType } from '../ts/types/Util.js'; -import { strictAssert } from '../ts/util/assert.js'; -import type { LoggerType } from '../ts/types/Logging.js'; -import { createLogger } from '../ts/logging/log.js'; -import { handleAttachmentRequest } from './attachment_channel.js'; +import type { MenuListType } from '../ts/types/menu.std.js'; +import type { LocalizerType } from '../ts/types/Util.std.js'; +import { strictAssert } from '../ts/util/assert.std.js'; +import type { LoggerType } from '../ts/types/Logging.std.js'; +import { createLogger } from '../ts/logging/log.std.js'; +import { handleAttachmentRequest } from './attachment_channel.main.js'; const log = createLogger('spell_check'); diff --git a/app/sql_channel.ts b/app/sql_channel.ts index 6141c79243..e8571ea062 100644 --- a/app/sql_channel.ts +++ b/app/sql_channel.ts @@ -3,9 +3,9 @@ import { ipcMain } from 'electron'; -import type { MainSQL } from '../ts/sql/main.js'; -import { remove as removeUserConfig } from './user_config.js'; -import { remove as removeEphemeralConfig } from './ephemeral_config.js'; +import type { MainSQL } from '../ts/sql/main.main.js'; +import { remove as removeUserConfig } from './user_config.main.js'; +import { remove as removeEphemeralConfig } from './ephemeral_config.main.js'; let sql: | Pick< diff --git a/app/startup_config.ts b/app/startup_config.ts index f8170eece5..f32bbd7565 100644 --- a/app/startup_config.ts +++ b/app/startup_config.ts @@ -3,9 +3,9 @@ import { app } from 'electron'; -import { name } from '../ts/util/packageJson.js'; -import { createLogger } from '../ts/logging/log.js'; -import * as GlobalErrors from './global_errors.js'; +import { name } from '../ts/util/packageJson.node.js'; +import { createLogger } from '../ts/logging/log.std.js'; +import * as GlobalErrors from './global_errors.main.js'; const log = createLogger('startup_config'); diff --git a/app/updateDefaultSession.ts b/app/updateDefaultSession.ts index c48e3f2b9b..6e8cba245e 100644 --- a/app/updateDefaultSession.ts +++ b/app/updateDefaultSession.ts @@ -5,10 +5,10 @@ import type { Session, DesktopCapturerSource, IpcMainEvent } from 'electron'; import { desktopCapturer, ipcMain, systemPreferences } from 'electron'; import { v4 as generateUuid } from 'uuid'; -import OS from '../ts/util/os/osMain.js'; -import type { LoggerType } from '../ts/types/Logging.js'; -import { strictAssert } from '../ts/util/assert.js'; -import { type IpcResponseType } from '../ts/util/desktopCapturer.js'; +import OS from '../ts/util/os/osMain.node.js'; +import type { LoggerType } from '../ts/types/Logging.std.js'; +import { strictAssert } from '../ts/util/assert.std.js'; +import { type IpcResponseType } from '../ts/util/desktopCapturer.preload.js'; const SPELL_CHECKER_DICTIONARY_DOWNLOAD_URL = `https://updates.signal.org/desktop/hunspell_dictionaries/${process.versions.electron}/`; diff --git a/app/user_config.ts b/app/user_config.ts index eb4fe58250..1d701d84d9 100644 --- a/app/user_config.ts +++ b/app/user_config.ts @@ -5,9 +5,9 @@ import { join } from 'node:path'; import { mkdirSync } from 'node:fs'; import { app } from 'electron'; -import { start } from './base_config.js'; -import config from './config.js'; -import * as Errors from '../ts/types/errors.js'; +import { start } from './base_config.node.js'; +import config from './config.main.js'; +import * as Errors from '../ts/types/errors.std.js'; let userData: string | undefined; // Use separate data directory for benchmarks & development diff --git a/build/intl-linter/linter.ts b/build/intl-linter/linter.ts index 5291ecab0d..eeb0f4ea9f 100644 --- a/build/intl-linter/linter.ts +++ b/build/intl-linter/linter.ts @@ -11,17 +11,17 @@ import { readFile } from 'node:fs/promises'; import { join as pathJoin, relative as pathRelative } from 'node:path'; import chalk from 'chalk'; import { deepEqual } from 'node:assert'; -import type { Rule } from './utils/rule.js'; +import type { Rule } from './utils/rule.std.js'; -import icuPrefix from './rules/icuPrefix.js'; -import wrapEmoji from './rules/wrapEmoji.js'; -import onePlural from './rules/onePlural.js'; -import noLegacyVariables from './rules/noLegacyVariables.js'; -import noNestedChoice from './rules/noNestedChoice.js'; -import noOffset from './rules/noOffset.js'; -import noOneChoice from './rules/noOneChoice.js'; -import noOrdinal from './rules/noOrdinal.js'; -import pluralPound from './rules/pluralPound.js'; +import icuPrefix from './rules/icuPrefix.std.js'; +import wrapEmoji from './rules/wrapEmoji.std.js'; +import onePlural from './rules/onePlural.std.js'; +import noLegacyVariables from './rules/noLegacyVariables.std.js'; +import noNestedChoice from './rules/noNestedChoice.std.js'; +import noOffset from './rules/noOffset.std.js'; +import noOneChoice from './rules/noOneChoice.std.js'; +import noOrdinal from './rules/noOrdinal.std.js'; +import pluralPound from './rules/pluralPound.std.js'; const RULES = [ icuPrefix, diff --git a/build/intl-linter/rules/icuPrefix.ts b/build/intl-linter/rules/icuPrefix.ts index 43e0ad155f..acacec0b80 100644 --- a/build/intl-linter/rules/icuPrefix.ts +++ b/build/intl-linter/rules/icuPrefix.ts @@ -1,7 +1,7 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { rule } from '../utils/rule.js'; +import { rule } from '../utils/rule.std.js'; export default rule('icuPrefix', context => { if (!context.messageId.startsWith('icu:')) { diff --git a/build/intl-linter/rules/noLegacyVariables.ts b/build/intl-linter/rules/noLegacyVariables.ts index d0d0130e0d..11b879e27c 100644 --- a/build/intl-linter/rules/noLegacyVariables.ts +++ b/build/intl-linter/rules/noLegacyVariables.ts @@ -1,7 +1,7 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { rule } from '../utils/rule.js'; +import { rule } from '../utils/rule.std.js'; export default rule('noLegacyVariables', context => { return { diff --git a/build/intl-linter/rules/noNestedChoice.ts b/build/intl-linter/rules/noNestedChoice.ts index 07192081f0..1cb54ef4b6 100644 --- a/build/intl-linter/rules/noNestedChoice.ts +++ b/build/intl-linter/rules/noNestedChoice.ts @@ -1,8 +1,8 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { Element } from '../utils/rule.js'; -import { rule } from '../utils/rule.js'; +import type { Element } from '../utils/rule.std.js'; +import { rule } from '../utils/rule.std.js'; export default rule('noNestedChoice', context => { let insideChoice = false; diff --git a/build/intl-linter/rules/noOffset.ts b/build/intl-linter/rules/noOffset.ts index 71c5c513ea..40c77fd4d0 100644 --- a/build/intl-linter/rules/noOffset.ts +++ b/build/intl-linter/rules/noOffset.ts @@ -1,7 +1,7 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { rule } from '../utils/rule.js'; +import { rule } from '../utils/rule.std.js'; export default rule('noOffset', context => { return { diff --git a/build/intl-linter/rules/noOneChoice.ts b/build/intl-linter/rules/noOneChoice.ts index c1235fe7e1..545adc4f80 100644 --- a/build/intl-linter/rules/noOneChoice.ts +++ b/build/intl-linter/rules/noOneChoice.ts @@ -1,7 +1,7 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { rule } from '../utils/rule.js'; +import { rule } from '../utils/rule.std.js'; export default rule('noOneChoice', context => { return { diff --git a/build/intl-linter/rules/noOrdinal.ts b/build/intl-linter/rules/noOrdinal.ts index cbebb2ce4e..f906b2a081 100644 --- a/build/intl-linter/rules/noOrdinal.ts +++ b/build/intl-linter/rules/noOrdinal.ts @@ -1,7 +1,7 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { rule } from '../utils/rule.js'; +import { rule } from '../utils/rule.std.js'; export default rule('noOrdinal', context => { return { diff --git a/build/intl-linter/rules/onePlural.ts b/build/intl-linter/rules/onePlural.ts index f6efb69eef..51c62a3073 100644 --- a/build/intl-linter/rules/onePlural.ts +++ b/build/intl-linter/rules/onePlural.ts @@ -1,7 +1,7 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { rule } from '../utils/rule.js'; +import { rule } from '../utils/rule.std.js'; export default rule('onePlural', context => { let plurals = 0; diff --git a/build/intl-linter/rules/pluralPound.ts b/build/intl-linter/rules/pluralPound.ts index 5d8fbe355c..06a6e8a2fc 100644 --- a/build/intl-linter/rules/pluralPound.ts +++ b/build/intl-linter/rules/pluralPound.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { PluralElement } from '@formatjs/icu-messageformat-parser'; -import { rule } from '../utils/rule.js'; +import { rule } from '../utils/rule.std.js'; export default rule('pluralPound', context => { const stack: Array = []; diff --git a/build/intl-linter/rules/wrapEmoji.ts b/build/intl-linter/rules/wrapEmoji.ts index c441724b6b..115bfe3df6 100644 --- a/build/intl-linter/rules/wrapEmoji.ts +++ b/build/intl-linter/rules/wrapEmoji.ts @@ -10,7 +10,7 @@ import { isTagElement, isLiteralElement, } from '@formatjs/icu-messageformat-parser'; -import { rule } from '../utils/rule.js'; +import { rule } from '../utils/rule.std.js'; function isEmojifyTag( element: MessageFormatElement | null diff --git a/build/intl-linter/utils/rule.ts b/build/intl-linter/utils/rule.ts index 41315eee73..33661b65cb 100644 --- a/build/intl-linter/utils/rule.ts +++ b/build/intl-linter/utils/rule.ts @@ -5,8 +5,8 @@ import type { MessageFormatElement, Location, } from '@formatjs/icu-messageformat-parser'; -import type { Visitor } from './traverse.js'; -import { traverse } from './traverse.js'; +import type { Visitor } from './traverse.std.js'; +import { traverse } from './traverse.std.js'; export type Element = MessageFormatElement; export type { Location }; diff --git a/test/test.js b/test/test.js index 3e11675eba..a979b79a9d 100644 --- a/test/test.js +++ b/test/test.js @@ -47,6 +47,3 @@ delete window.testUtilities.prepareTests; mocha.run(); })(); - -window.getPreferredSystemLocales = () => ['en']; -window.getLocaleOverride = () => null; diff --git a/ts/AttachmentCrypto.ts b/ts/AttachmentCrypto.ts index 263b16a21a..553deb1d92 100644 --- a/ts/AttachmentCrypto.ts +++ b/ts/AttachmentCrypto.ts @@ -26,7 +26,7 @@ import { import type { ChunkSizeChoice } from '@signalapp/libsignal-client/dist/incremental_mac.js'; import { isAbsolute } from 'node:path'; -import { createLogger } from './logging/log.js'; +import { createLogger } from './logging/log.std.js'; import { HashType, CipherType, @@ -36,24 +36,24 @@ import { DIGEST_LENGTH, ATTACHMENT_MAC_LENGTH, AES_KEY_LENGTH, -} from './types/Crypto.js'; -import { constantTimeEqual } from './Crypto.js'; -import { createName, getRelativePath } from './util/attachmentPath.js'; -import { appendPaddingStream } from './util/logPadding.js'; -import { prependStream } from './util/prependStream.js'; -import { appendMacStream } from './util/appendMacStream.js'; -import { finalStream } from './util/finalStream.js'; -import { getMacAndUpdateHmac } from './util/getMacAndUpdateHmac.js'; -import { trimPadding } from './util/trimPadding.js'; -import { assertDev, strictAssert } from './util/assert.js'; -import * as Errors from './types/errors.js'; -import { isNotNil } from './util/isNotNil.js'; -import { missingCaseError } from './util/missingCaseError.js'; -import { getEnvironment, Environment } from './environment.js'; -import { isNotEmpty, toBase64, toHex } from './Bytes.js'; -import { decipherWithAesKey } from './util/decipherWithAesKey.js'; -import { getAttachmentCiphertextSize } from './util/AttachmentCrypto.js'; -import { MediaTier } from './types/AttachmentDownload.js'; +} from './types/Crypto.std.js'; +import { constantTimeEqual } from './Crypto.node.js'; +import { createName, getRelativePath } from './util/attachmentPath.node.js'; +import { appendPaddingStream } from './util/logPadding.node.js'; +import { prependStream } from './util/prependStream.node.js'; +import { appendMacStream } from './util/appendMacStream.node.js'; +import { finalStream } from './util/finalStream.node.js'; +import { getMacAndUpdateHmac } from './util/getMacAndUpdateHmac.node.js'; +import { trimPadding } from './util/trimPadding.node.js'; +import { assertDev, strictAssert } from './util/assert.std.js'; +import * as Errors from './types/errors.std.js'; +import { isNotNil } from './util/isNotNil.std.js'; +import { missingCaseError } from './util/missingCaseError.std.js'; +import { getEnvironment, Environment } from './environment.std.js'; +import { isNotEmpty, toBase64, toHex } from './Bytes.std.js'; +import { decipherWithAesKey } from './util/decipherWithAesKey.node.js'; +import { getAttachmentCiphertextSize } from './util/AttachmentCrypto.std.js'; +import { MediaTier } from './types/AttachmentDownload.std.js'; const { ensureFile } = fsExtra; diff --git a/ts/Bytes.ts b/ts/Bytes.ts index 4310c49bfb..ccde15d8bc 100644 --- a/ts/Bytes.ts +++ b/ts/Bytes.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { Bytes } from './context/Bytes.js'; +import { Bytes } from './context/Bytes.std.js'; const bytes = globalThis.window?.SignalContext?.bytes || new Bytes(); diff --git a/ts/CI.ts b/ts/CI.ts index 2608702e14..7c8d9e84b0 100644 --- a/ts/CI.ts +++ b/ts/CI.ts @@ -4,22 +4,22 @@ import { format } from 'node:util'; import { ipcRenderer } from 'electron'; -import type { IPCResponse as ChallengeResponseType } from './challenge.js'; +import type { IPCResponse as ChallengeResponseType } from './challenge.dom.js'; import type { MessageAttributesType } from './model-types.d.ts'; -import { createLogger } from './logging/log.js'; -import { explodePromise } from './util/explodePromise.js'; -import { AccessType, ipcInvoke } from './sql/channels.js'; -import { backupsService } from './services/backups/index.js'; -import { notificationService } from './services/notifications.js'; -import { challengeHandler } from './services/challengeHandler.js'; -import { AttachmentBackupManager } from './jobs/AttachmentBackupManager.js'; -import { migrateAllMessages } from './messages/migrateMessageData.js'; -import { SECOND } from './util/durations/index.js'; -import { isSignalRoute } from './util/signalRoutes.js'; -import { strictAssert } from './util/assert.js'; -import { MessageModel } from './models/messages.js'; -import type { SocketStatuses } from './textsecure/SocketManager.js'; -import { itemStorage } from './textsecure/Storage.js'; +import { createLogger } from './logging/log.std.js'; +import { explodePromise } from './util/explodePromise.std.js'; +import { AccessType, ipcInvoke } from './sql/channels.preload.js'; +import { backupsService } from './services/backups/index.preload.js'; +import { notificationService } from './services/notifications.preload.js'; +import { challengeHandler } from './services/challengeHandler.preload.js'; +import { AttachmentBackupManager } from './jobs/AttachmentBackupManager.preload.js'; +import { migrateAllMessages } from './messages/migrateMessageData.preload.js'; +import { SECOND } from './util/durations/index.std.js'; +import { isSignalRoute } from './util/signalRoutes.std.js'; +import { strictAssert } from './util/assert.std.js'; +import { MessageModel } from './models/messages.preload.js'; +import type { SocketStatuses } from './textsecure/SocketManager.preload.js'; +import { itemStorage } from './textsecure/Storage.preload.js'; const log = createLogger('CI'); diff --git a/ts/CI/benchmarkConversationOpen.ts b/ts/CI/benchmarkConversationOpen.ts index c465066007..135b93470e 100644 --- a/ts/CI/benchmarkConversationOpen.ts +++ b/ts/CI/benchmarkConversationOpen.ts @@ -3,22 +3,22 @@ import { v4 as uuid } from 'uuid'; -import { incrementMessageCounter } from '../util/incrementMessageCounter.js'; -import { ReadStatus } from '../messages/MessageReadStatus.js'; -import { SendStatus } from '../messages/MessageSendState.js'; -import { DataWriter } from '../sql/Client.js'; -import { BodyRange } from '../types/BodyRange.js'; -import { CURRENT_SCHEMA_VERSION } from '../types/Message2.js'; -import { strictAssert } from '../util/assert.js'; -import { MINUTE } from '../util/durations/index.js'; -import { isOlderThan } from '../util/timestamp.js'; -import { sleep } from '../util/sleep.js'; -import { stats } from '../util/benchmark/stats.js'; -import type { StatsType } from '../util/benchmark/stats.js'; +import { incrementMessageCounter } from '../util/incrementMessageCounter.preload.js'; +import { ReadStatus } from '../messages/MessageReadStatus.std.js'; +import { SendStatus } from '../messages/MessageSendState.std.js'; +import { DataWriter } from '../sql/Client.preload.js'; +import { BodyRange } from '../types/BodyRange.std.js'; +import { CURRENT_SCHEMA_VERSION } from '../types/Message2.preload.js'; +import { strictAssert } from '../util/assert.std.js'; +import { MINUTE } from '../util/durations/index.std.js'; +import { isOlderThan } from '../util/timestamp.std.js'; +import { sleep } from '../util/sleep.std.js'; +import { stats } from '../util/benchmark/stats.std.js'; +import type { StatsType } from '../util/benchmark/stats.std.js'; import type { MessageAttributesType } from '../model-types.d.ts'; -import { createLogger } from '../logging/log.js'; -import { postSaveUpdates } from '../util/cleanup.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import { createLogger } from '../logging/log.std.js'; +import { postSaveUpdates } from '../util/cleanup.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const log = createLogger('benchmarkConversationOpen'); diff --git a/ts/ConversationController.ts b/ts/ConversationController.ts index 556cb550c9..1426a8fc7c 100644 --- a/ts/ConversationController.ts +++ b/ts/ConversationController.ts @@ -5,50 +5,53 @@ import lodash from 'lodash'; import PQueue from 'p-queue'; import { v4 as generateUuid } from 'uuid'; -import { DataReader, DataWriter } from './sql/Client.js'; -import { createLogger } from './logging/log.js'; -import * as Errors from './types/errors.js'; -import { getAuthorId } from './messages/sources.js'; -import { maybeDeriveGroupV2Id } from './groups.js'; -import { assertDev, strictAssert } from './util/assert.js'; -import { drop } from './util/drop.js'; +import { DataReader, DataWriter } from './sql/Client.preload.js'; +import { createLogger } from './logging/log.std.js'; +import * as Errors from './types/errors.std.js'; +import { getAuthorId } from './messages/sources.preload.js'; +import { maybeDeriveGroupV2Id } from './groups.preload.js'; +import { assertDev, strictAssert } from './util/assert.std.js'; +import { drop } from './util/drop.std.js'; import { isDirectConversation, isGroup, isGroupV1, isGroupV2, -} from './util/whatTypeOfConversation.js'; +} from './util/whatTypeOfConversation.dom.js'; import { doesAttachmentExist, deleteAttachmentData, -} from './util/migrations.js'; +} from './util/migrations.preload.js'; import { isServiceIdString, normalizePni, normalizeServiceId, -} from './types/ServiceId.js'; -import { normalizeAci } from './util/normalizeAci.js'; -import { sleep } from './util/sleep.js'; -import { isNotNil } from './util/isNotNil.js'; -import { MINUTE, SECOND } from './util/durations/index.js'; -import { getServiceIdsForE164s } from './util/getServiceIdsForE164s.js'; -import { SIGNAL_ACI, SIGNAL_AVATAR_PATH } from './types/SignalConversation.js'; -import { getTitleNoDefault } from './util/getTitle.js'; -import * as StorageService from './services/storage.js'; -import textsecureUtils from './textsecure/Helpers.js'; -import { cdsLookup } from './textsecure/WebAPI.js'; -import type { ConversationPropsForUnreadStats } from './util/countUnreadStats.js'; -import { countAllConversationsUnreadStats } from './util/countUnreadStats.js'; -import { isTestOrMockEnvironment } from './environment.js'; -import { isConversationAccepted } from './util/isConversationAccepted.js'; -import { areWePending } from './util/groupMembershipUtils.js'; -import { conversationJobQueue } from './jobs/conversationJobQueue.js'; -import { createBatcher } from './util/batcher.js'; -import { validateConversation } from './util/validateConversation.js'; -import { ConversationModel } from './models/conversations.js'; -import { INITIAL_EXPIRE_TIMER_VERSION } from './util/expirationTimer.js'; -import { missingCaseError } from './util/missingCaseError.js'; -import { signalProtocolStore } from './SignalProtocolStore.js'; +} from './types/ServiceId.std.js'; +import { normalizeAci } from './util/normalizeAci.std.js'; +import { sleep } from './util/sleep.std.js'; +import { isNotNil } from './util/isNotNil.std.js'; +import { MINUTE, SECOND } from './util/durations/index.std.js'; +import { getServiceIdsForE164s } from './util/getServiceIdsForE164s.dom.js'; +import { + SIGNAL_ACI, + SIGNAL_AVATAR_PATH, +} from './types/SignalConversation.std.js'; +import { getTitleNoDefault } from './util/getTitle.preload.js'; +import * as StorageService from './services/storage.preload.js'; +import textsecureUtils from './textsecure/Helpers.std.js'; +import { cdsLookup } from './textsecure/WebAPI.preload.js'; +import type { ConversationPropsForUnreadStats } from './util/countUnreadStats.std.js'; +import { countAllConversationsUnreadStats } from './util/countUnreadStats.std.js'; +import { isTestOrMockEnvironment } from './environment.std.js'; +import { isConversationAccepted } from './util/isConversationAccepted.preload.js'; +import { areWePending } from './util/groupMembershipUtils.preload.js'; +import { conversationJobQueue } from './jobs/conversationJobQueue.preload.js'; +import { createBatcher } from './util/batcher.std.js'; +import { validateConversation } from './util/validateConversation.dom.js'; +import { ConversationModel } from './models/conversations.preload.js'; +import { INITIAL_EXPIRE_TIMER_VERSION } from './util/expirationTimer.std.js'; +import { missingCaseError } from './util/missingCaseError.std.js'; +import { signalProtocolStore } from './SignalProtocolStore.preload.js'; import type { ConversationAttributesType, @@ -59,8 +62,8 @@ import type { ServiceIdString, AciString, PniString, -} from './types/ServiceId.js'; -import { itemStorage } from './textsecure/Storage.js'; +} from './types/ServiceId.std.js'; +import { itemStorage } from './textsecure/Storage.preload.js'; const { debounce, pick, uniq, without } = lodash; diff --git a/ts/Crypto.ts b/ts/Crypto.ts index 4f47a87bb3..052aed9f2e 100644 --- a/ts/Crypto.ts +++ b/ts/Crypto.ts @@ -7,19 +7,19 @@ import { Aci, Pni, hkdf } from '@signalapp/libsignal-client'; import type { PublicKey, PrivateKey } from '@signalapp/libsignal-client'; import { AccountEntropyPool } from '@signalapp/libsignal-client/dist/AccountKeys.js'; -import * as Bytes from './Bytes.js'; -import { Crypto } from './context/Crypto.js'; -import { calculateAgreement, generateKeyPair } from './Curve.js'; -import { HashType, CipherType } from './types/Crypto.js'; -import { AVATAR_COLOR_COUNT, AvatarColors } from './types/Colors.js'; -import { ProfileDecryptError } from './types/errors.js'; -import { getBytesSubarray } from './util/uuidToBytes.js'; -import { logPadSize } from './util/logPadSize.js'; -import { Environment, getEnvironment } from './environment.js'; -import { toWebSafeBase64 } from './util/webSafeBase64.js'; +import * as Bytes from './Bytes.std.js'; +import { Crypto } from './context/Crypto.node.js'; +import { calculateAgreement, generateKeyPair } from './Curve.node.js'; +import { HashType, CipherType } from './types/Crypto.std.js'; +import { AVATAR_COLOR_COUNT, AvatarColors } from './types/Colors.std.js'; +import { ProfileDecryptError } from './types/errors.std.js'; +import { getBytesSubarray } from './util/uuidToBytes.std.js'; +import { logPadSize } from './util/logPadSize.std.js'; +import { Environment, getEnvironment } from './environment.std.js'; +import { toWebSafeBase64 } from './util/webSafeBase64.std.js'; -import type { AciString, PniString } from './types/ServiceId.js'; -import type { AvatarColorType } from './types/Colors.js'; +import type { AciString, PniString } from './types/ServiceId.std.js'; +import type { AvatarColorType } from './types/Colors.std.js'; const { sample } = lodash; diff --git a/ts/Curve.ts b/ts/Curve.ts index 4339aa9b33..605734c712 100644 --- a/ts/Curve.ts +++ b/ts/Curve.ts @@ -4,14 +4,14 @@ import * as client from '@signalapp/libsignal-client'; import type { KyberPreKeyRecord } from '@signalapp/libsignal-client'; -import * as Bytes from './Bytes.js'; -import { constantTimeEqual } from './Crypto.js'; +import * as Bytes from './Bytes.std.js'; +import { constantTimeEqual } from './Crypto.node.js'; import type { KeyPairType, CompatPreKeyType, CompatSignedPreKeyType, } from './textsecure/Types.d.ts'; -import { createLogger } from './logging/log.js'; +import { createLogger } from './logging/log.std.js'; const log = createLogger('Curve'); diff --git a/ts/IdleDetector.ts b/ts/IdleDetector.ts index 1952f587d7..a70fb91810 100644 --- a/ts/IdleDetector.ts +++ b/ts/IdleDetector.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import EventEmitter from 'node:events'; -import { createLogger } from './logging/log.js'; -import { clearTimeoutIfNecessary } from './util/clearTimeoutIfNecessary.js'; +import { createLogger } from './logging/log.std.js'; +import { clearTimeoutIfNecessary } from './util/clearTimeoutIfNecessary.std.js'; const log = createLogger('IdleDetector'); diff --git a/ts/LibSignalStores.ts b/ts/LibSignalStores.ts index 9c3b9be9cf..e17661670e 100644 --- a/ts/LibSignalStores.ts +++ b/ts/LibSignalStores.ts @@ -26,13 +26,13 @@ import { SessionStore, SignedPreKeyStore, } from '@signalapp/libsignal-client'; -import { Address } from './types/Address.js'; -import { QualifiedAddress } from './types/QualifiedAddress.js'; -import type { ServiceIdString } from './types/ServiceId.js'; -import { normalizeServiceId } from './types/ServiceId.js'; -import { signalProtocolStore } from './SignalProtocolStore.js'; +import { Address } from './types/Address.std.js'; +import { QualifiedAddress } from './types/QualifiedAddress.std.js'; +import type { ServiceIdString } from './types/ServiceId.std.js'; +import { normalizeServiceId } from './types/ServiceId.std.js'; +import { signalProtocolStore } from './SignalProtocolStore.preload.js'; -import type { Zone } from './util/Zone.js'; +import type { Zone } from './util/Zone.std.js'; const { isNumber } = lodash; diff --git a/ts/RemoteConfig.ts b/ts/RemoteConfig.ts index 4306476204..7f146f9ee1 100644 --- a/ts/RemoteConfig.ts +++ b/ts/RemoteConfig.ts @@ -3,16 +3,16 @@ import lodash from 'lodash'; -import type { getConfig } from './textsecure/WebAPI.js'; -import { createLogger } from './logging/log.js'; -import type { AciString } from './types/ServiceId.js'; -import { parseIntOrThrow } from './util/parseIntOrThrow.js'; -import { HOUR } from './util/durations/index.js'; -import * as Bytes from './Bytes.js'; -import { uuidToBytes } from './util/uuidToBytes.js'; -import { HashType } from './types/Crypto.js'; -import { getCountryCode } from './types/PhoneNumber.js'; -import { parseRemoteClientExpiration } from './util/parseRemoteClientExpiration.js'; +import type { getConfig } from './textsecure/WebAPI.preload.js'; +import { createLogger } from './logging/log.std.js'; +import type { AciString } from './types/ServiceId.std.js'; +import { parseIntOrThrow } from './util/parseIntOrThrow.std.js'; +import { HOUR } from './util/durations/index.std.js'; +import * as Bytes from './Bytes.std.js'; +import { uuidToBytes } from './util/uuidToBytes.std.js'; +import { HashType } from './types/Crypto.std.js'; +import { getCountryCode } from './types/PhoneNumber.std.js'; +import { parseRemoteClientExpiration } from './util/parseRemoteClientExpiration.dom.js'; import type { StorageInterface } from './types/Storage.d.ts'; const { get, throttle } = lodash; diff --git a/ts/SignalProtocolStore.ts b/ts/SignalProtocolStore.ts index 1f378cfaa4..38d5ed09a7 100644 --- a/ts/SignalProtocolStore.ts +++ b/ts/SignalProtocolStore.ts @@ -19,15 +19,15 @@ import { SignedPreKeyRecord, } from '@signalapp/libsignal-client'; -import { DataReader, DataWriter } from './sql/Client.js'; -import type { ItemType, KyberPreKeyTripleType } from './sql/Interface.js'; -import * as Bytes from './Bytes.js'; -import { constantTimeEqual, sha256 } from './Crypto.js'; -import { assertDev, strictAssert } from './util/assert.js'; -import { isNotNil } from './util/isNotNil.js'; -import { drop } from './util/drop.js'; -import { Zone } from './util/Zone.js'; -import { isMoreRecentThan } from './util/timestamp.js'; +import { DataReader, DataWriter } from './sql/Client.preload.js'; +import type { ItemType, KyberPreKeyTripleType } from './sql/Interface.std.js'; +import * as Bytes from './Bytes.std.js'; +import { constantTimeEqual, sha256 } from './Crypto.node.js'; +import { assertDev, strictAssert } from './util/assert.std.js'; +import { isNotNil } from './util/isNotNil.std.js'; +import { drop } from './util/drop.std.js'; +import { Zone } from './util/Zone.std.js'; +import { isMoreRecentThan } from './util/timestamp.std.js'; import type { DeviceType, IdentityKeyType, @@ -53,21 +53,21 @@ import type { ServiceIdString, PniString, AciString, -} from './types/ServiceId.js'; -import { isServiceIdString, ServiceIdKind } from './types/ServiceId.js'; -import type { Address } from './types/Address.js'; -import type { QualifiedAddressStringType } from './types/QualifiedAddress.js'; -import { QualifiedAddress } from './types/QualifiedAddress.js'; -import { createLogger } from './logging/log.js'; -import * as Errors from './types/errors.js'; -import { MINUTE } from './util/durations/index.js'; +} from './types/ServiceId.std.js'; +import { isServiceIdString, ServiceIdKind } from './types/ServiceId.std.js'; +import type { Address } from './types/Address.std.js'; +import type { QualifiedAddressStringType } from './types/QualifiedAddress.std.js'; +import { QualifiedAddress } from './types/QualifiedAddress.std.js'; +import { createLogger } from './logging/log.std.js'; +import * as Errors from './types/errors.std.js'; +import { MINUTE } from './util/durations/index.std.js'; import { KYBER_KEY_ID_KEY, SIGNED_PRE_KEY_ID_KEY, -} from './textsecure/AccountManager.js'; -import { formatGroups, groupWhile } from './util/groupWhile.js'; -import { parseUnknown } from './util/schemas.js'; -import { itemStorage } from './textsecure/Storage.js'; +} from './textsecure/AccountManager.preload.js'; +import { formatGroups, groupWhile } from './util/groupWhile.std.js'; +import { parseUnknown } from './util/schemas.std.js'; +import { itemStorage } from './textsecure/Storage.preload.js'; const { omit } = lodash; diff --git a/ts/Timers.ts b/ts/Timers.ts index b1c3b78202..cc4f95ae72 100644 --- a/ts/Timers.ts +++ b/ts/Timers.ts @@ -3,7 +3,7 @@ const { timers } = window.SignalContext; -export type { Timeout } from './context/Timers.js'; +export type { Timeout } from './context/Timers.node.js'; export function setTimeout( ...args: Parameters diff --git a/ts/axo/AriaClickable.stories.tsx b/ts/axo/AriaClickable.stories.tsx index 5417058dbb..d667d6ef04 100644 --- a/ts/axo/AriaClickable.stories.tsx +++ b/ts/axo/AriaClickable.stories.tsx @@ -4,9 +4,9 @@ import type { ReactNode } from 'react'; import React, { useId } from 'react'; import type { Meta } from '@storybook/react'; import { action } from '@storybook/addon-actions'; -import { AriaClickable } from './AriaClickable.js'; -import { AxoButton } from './AxoButton.js'; -import { tw } from './tw.js'; +import { AriaClickable } from './AriaClickable.dom.js'; +import { AxoButton } from './AxoButton.dom.js'; +import { tw } from './tw.dom.js'; export default { title: 'Axo/AriaClickable', diff --git a/ts/axo/AriaClickable.tsx b/ts/axo/AriaClickable.tsx index 6a89c212df..f9aa7dab32 100644 --- a/ts/axo/AriaClickable.tsx +++ b/ts/axo/AriaClickable.tsx @@ -10,8 +10,8 @@ import React, { } from 'react'; import type { ReactNode, MouseEvent, FC } from 'react'; import { useLayoutEffect } from '@react-aria/utils'; -import { tw } from './tw.js'; -import { assert } from './_internal/assert.js'; +import { tw } from './tw.dom.js'; +import { assert } from './_internal/assert.dom.js'; const Namespace = 'AriaClickable'; diff --git a/ts/axo/AxoBadge.stories.tsx b/ts/axo/AxoBadge.stories.tsx index 7977928ad5..42c89cc455 100644 --- a/ts/axo/AxoBadge.stories.tsx +++ b/ts/axo/AxoBadge.stories.tsx @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { Meta } from '@storybook/react'; import React from 'react'; -import { ExperimentalAxoBadge } from './AxoBadge.js'; -import { tw } from './tw.js'; +import { ExperimentalAxoBadge } from './AxoBadge.dom.js'; +import { tw } from './tw.dom.js'; export default { title: 'Axo/AriaBadge (Experimental)', diff --git a/ts/axo/AxoBadge.tsx b/ts/axo/AxoBadge.tsx index ede14876bf..7c0da2bb0f 100644 --- a/ts/axo/AxoBadge.tsx +++ b/ts/axo/AxoBadge.tsx @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { FC } from 'react'; import React, { memo, useMemo } from 'react'; -import { AxoSymbol } from './AxoSymbol.js'; -import type { TailwindStyles } from './tw.js'; -import { tw } from './tw.js'; -import { unreachable } from './_internal/assert.js'; +import { AxoSymbol } from './AxoSymbol.dom.js'; +import type { TailwindStyles } from './tw.dom.js'; +import { tw } from './tw.dom.js'; +import { unreachable } from './_internal/assert.dom.js'; const Namespace = 'AxoBadge'; diff --git a/ts/axo/AxoButton.stories.tsx b/ts/axo/AxoButton.stories.tsx index a201b3d3c0..dac838028b 100644 --- a/ts/axo/AxoButton.stories.tsx +++ b/ts/axo/AxoButton.stories.tsx @@ -7,8 +7,8 @@ import { _getAllAxoButtonVariants, _getAllAxoButtonSizes, AxoButton, -} from './AxoButton.js'; -import { tw } from './tw.js'; +} from './AxoButton.dom.js'; +import { tw } from './tw.dom.js'; export default { title: 'Axo/AxoButton', diff --git a/ts/axo/AxoButton.tsx b/ts/axo/AxoButton.tsx index 1905acd520..9c218cf8af 100644 --- a/ts/axo/AxoButton.tsx +++ b/ts/axo/AxoButton.tsx @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo, forwardRef } from 'react'; import type { ButtonHTMLAttributes, FC, ForwardedRef, ReactNode } from 'react'; -import type { TailwindStyles } from './tw.js'; -import { tw } from './tw.js'; -import { AxoSymbol } from './AxoSymbol.js'; -import { assert } from './_internal/assert.js'; +import type { TailwindStyles } from './tw.dom.js'; +import { tw } from './tw.dom.js'; +import { AxoSymbol } from './AxoSymbol.dom.js'; +import { assert } from './_internal/assert.dom.js'; const Namespace = 'AxoButton'; diff --git a/ts/axo/AxoCheckbox.stories.tsx b/ts/axo/AxoCheckbox.stories.tsx index 61caaa8133..ec9fb4939e 100644 --- a/ts/axo/AxoCheckbox.stories.tsx +++ b/ts/axo/AxoCheckbox.stories.tsx @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useState } from 'react'; import type { Meta } from '@storybook/react'; -import { AxoCheckbox } from './AxoCheckbox.js'; -import { tw } from './tw.js'; +import { AxoCheckbox } from './AxoCheckbox.dom.js'; +import { tw } from './tw.dom.js'; export default { title: 'Axo/AxoCheckbox', diff --git a/ts/axo/AxoCheckbox.tsx b/ts/axo/AxoCheckbox.tsx index 2955b40d79..f8392aecad 100644 --- a/ts/axo/AxoCheckbox.tsx +++ b/ts/axo/AxoCheckbox.tsx @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo } from 'react'; import { Checkbox } from 'radix-ui'; -import { AxoSymbol } from './AxoSymbol.js'; -import { tw } from './tw.js'; +import { AxoSymbol } from './AxoSymbol.dom.js'; +import { tw } from './tw.dom.js'; const Namespace = 'AxoCheckbox'; diff --git a/ts/axo/AxoContextMenu.stories.tsx b/ts/axo/AxoContextMenu.stories.tsx index 72af31b8de..d473b5088c 100644 --- a/ts/axo/AxoContextMenu.stories.tsx +++ b/ts/axo/AxoContextMenu.stories.tsx @@ -3,8 +3,8 @@ import React, { useState } from 'react'; import type { Meta } from '@storybook/react'; import { action } from '@storybook/addon-actions'; -import { AxoContextMenu } from './AxoContextMenu.js'; -import { tw } from './tw.js'; +import { AxoContextMenu } from './AxoContextMenu.dom.js'; +import { tw } from './tw.dom.js'; export default { title: 'Axo/AxoContextMenu', diff --git a/ts/axo/AxoContextMenu.tsx b/ts/axo/AxoContextMenu.tsx index 9416093eb4..f1e9305667 100644 --- a/ts/axo/AxoContextMenu.tsx +++ b/ts/axo/AxoContextMenu.tsx @@ -3,9 +3,9 @@ import React, { memo } from 'react'; import { ContextMenu } from 'radix-ui'; import type { FC } from 'react'; -import { AxoSymbol } from './AxoSymbol.js'; -import { AxoBaseMenu } from './_internal/AxoBaseMenu.js'; -import { tw } from './tw.js'; +import { AxoSymbol } from './AxoSymbol.dom.js'; +import { AxoBaseMenu } from './_internal/AxoBaseMenu.dom.js'; +import { tw } from './tw.dom.js'; const Namespace = 'AxoContextMenu'; diff --git a/ts/axo/AxoDropdownMenu.stories.tsx b/ts/axo/AxoDropdownMenu.stories.tsx index f1156b8240..b7af09173f 100644 --- a/ts/axo/AxoDropdownMenu.stories.tsx +++ b/ts/axo/AxoDropdownMenu.stories.tsx @@ -4,9 +4,9 @@ import type { ReactNode } from 'react'; import React, { useState } from 'react'; import type { Meta } from '@storybook/react'; import { action } from '@storybook/addon-actions'; -import { AxoDropdownMenu } from './AxoDropdownMenu.js'; -import { AxoButton } from './AxoButton.js'; -import { tw } from './tw.js'; +import { AxoDropdownMenu } from './AxoDropdownMenu.dom.js'; +import { AxoButton } from './AxoButton.dom.js'; +import { tw } from './tw.dom.js'; export default { title: 'Axo/AxoDropdownMenu', diff --git a/ts/axo/AxoDropdownMenu.tsx b/ts/axo/AxoDropdownMenu.tsx index ff7a708c25..6115f8bcac 100644 --- a/ts/axo/AxoDropdownMenu.tsx +++ b/ts/axo/AxoDropdownMenu.tsx @@ -3,14 +3,14 @@ import React, { memo, useId } from 'react'; import { DropdownMenu } from 'radix-ui'; import type { FC, ReactNode } from 'react'; -import { AxoSymbol } from './AxoSymbol.js'; -import { AxoBaseMenu } from './_internal/AxoBaseMenu.js'; -import { tw } from './tw.js'; +import { AxoSymbol } from './AxoSymbol.dom.js'; +import { AxoBaseMenu } from './_internal/AxoBaseMenu.dom.js'; +import { tw } from './tw.dom.js'; import { AriaLabellingProvider, useAriaLabellingContext, useCreateAriaLabellingContext, -} from './_internal/AriaLabellingContext.js'; +} from './_internal/AriaLabellingContext.dom.js'; const Namespace = 'AxoDropdownMenu'; diff --git a/ts/axo/AxoMenuBuilder.stories.tsx b/ts/axo/AxoMenuBuilder.stories.tsx index cecf050ea5..b21c8403d6 100644 --- a/ts/axo/AxoMenuBuilder.stories.tsx +++ b/ts/axo/AxoMenuBuilder.stories.tsx @@ -4,9 +4,9 @@ import type { ReactNode } from 'react'; import React, { useState } from 'react'; import type { Meta } from '@storybook/react'; import { action } from '@storybook/addon-actions'; -import { AxoMenuBuilder } from './AxoMenuBuilder.js'; -import { AxoButton } from './AxoButton.js'; -import { tw } from './tw.js'; +import { AxoMenuBuilder } from './AxoMenuBuilder.dom.js'; +import { AxoButton } from './AxoButton.dom.js'; +import { tw } from './tw.dom.js'; export default { title: 'Axo/AxoMenuBuilder', diff --git a/ts/axo/AxoMenuBuilder.tsx b/ts/axo/AxoMenuBuilder.tsx index 44fc849862..c6d815df68 100644 --- a/ts/axo/AxoMenuBuilder.tsx +++ b/ts/axo/AxoMenuBuilder.tsx @@ -3,10 +3,10 @@ import type { FC } from 'react'; import React, { createContext, memo, useContext } from 'react'; -import type { AxoBaseMenu } from './_internal/AxoBaseMenu.js'; -import { assert, unreachable } from './_internal/assert.js'; -import { AxoDropdownMenu } from './AxoDropdownMenu.js'; -import { AxoContextMenu } from './AxoContextMenu.js'; +import type { AxoBaseMenu } from './_internal/AxoBaseMenu.dom.js'; +import { assert, unreachable } from './_internal/assert.dom.js'; +import { AxoDropdownMenu } from './AxoDropdownMenu.dom.js'; +import { AxoContextMenu } from './AxoContextMenu.dom.js'; const Namespace = 'AxoMenuBuilder'; diff --git a/ts/axo/AxoSegmentedControl.stories.tsx b/ts/axo/AxoSegmentedControl.stories.tsx index f827133d65..f6bbd7024d 100644 --- a/ts/axo/AxoSegmentedControl.stories.tsx +++ b/ts/axo/AxoSegmentedControl.stories.tsx @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { Meta } from '@storybook/react'; import React, { useState } from 'react'; -import { ExperimentalAxoSegmentedControl } from './AxoSegmentedControl.js'; -import { tw } from './tw.js'; +import { ExperimentalAxoSegmentedControl } from './AxoSegmentedControl.dom.js'; +import { tw } from './tw.dom.js'; export default { title: 'Axo/AxoSegmentedControl (Experimental)', diff --git a/ts/axo/AxoSegmentedControl.tsx b/ts/axo/AxoSegmentedControl.tsx index 06c88c4993..59d8560749 100644 --- a/ts/axo/AxoSegmentedControl.tsx +++ b/ts/axo/AxoSegmentedControl.tsx @@ -3,7 +3,7 @@ import type { ButtonHTMLAttributes, FC, ForwardedRef, ReactNode } from 'react'; import React, { forwardRef, memo, useCallback } from 'react'; import { ToggleGroup } from 'radix-ui'; -import { ExperimentalAxoBaseSegmentedControl } from './_internal/AxoBaseSegmentedControl.js'; +import { ExperimentalAxoBaseSegmentedControl } from './_internal/AxoBaseSegmentedControl.dom.js'; const Namespace = 'AxoSegmentedControl'; diff --git a/ts/axo/AxoSelect.stories.tsx b/ts/axo/AxoSelect.stories.tsx index b53c0ebd35..2c5a846eab 100644 --- a/ts/axo/AxoSelect.stories.tsx +++ b/ts/axo/AxoSelect.stories.tsx @@ -3,8 +3,8 @@ import type { ReactNode } from 'react'; import React, { useState } from 'react'; import type { Meta } from '@storybook/react'; -import { AxoSelect } from './AxoSelect.js'; -import { tw } from './tw.js'; +import { AxoSelect } from './AxoSelect.dom.js'; +import { tw } from './tw.dom.js'; export default { title: 'Axo/AxoSelect', diff --git a/ts/axo/AxoSelect.tsx b/ts/axo/AxoSelect.tsx index 15708b433b..bc0d891778 100644 --- a/ts/axo/AxoSelect.tsx +++ b/ts/axo/AxoSelect.tsx @@ -3,11 +3,11 @@ import React, { memo } from 'react'; import type { FC, ReactNode } from 'react'; import { Select } from 'radix-ui'; -import { AxoBaseMenu } from './_internal/AxoBaseMenu.js'; -import { AxoSymbol } from './AxoSymbol.js'; -import type { TailwindStyles } from './tw.js'; -import { tw } from './tw.js'; -import { ExperimentalAxoBadge } from './AxoBadge.js'; +import { AxoBaseMenu } from './_internal/AxoBaseMenu.dom.js'; +import { AxoSymbol } from './AxoSymbol.dom.js'; +import type { TailwindStyles } from './tw.dom.js'; +import { tw } from './tw.dom.js'; +import { ExperimentalAxoBadge } from './AxoBadge.dom.js'; const Namespace = 'AxoSelect'; diff --git a/ts/axo/AxoSwitch.stories.tsx b/ts/axo/AxoSwitch.stories.tsx index d0b64c081b..60e66a17d7 100644 --- a/ts/axo/AxoSwitch.stories.tsx +++ b/ts/axo/AxoSwitch.stories.tsx @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useState } from 'react'; import type { Meta } from '@storybook/react'; -import { AxoSwitch } from './AxoSwitch.js'; -import { tw } from './tw.js'; +import { AxoSwitch } from './AxoSwitch.dom.js'; +import { tw } from './tw.dom.js'; export default { title: 'Axo/AxoSwitch', diff --git a/ts/axo/AxoSwitch.tsx b/ts/axo/AxoSwitch.tsx index baf69e9a37..6ba1603bc5 100644 --- a/ts/axo/AxoSwitch.tsx +++ b/ts/axo/AxoSwitch.tsx @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo } from 'react'; import { Switch } from 'radix-ui'; -import { tw } from './tw.js'; -import { AxoSymbol } from './AxoSymbol.js'; +import { tw } from './tw.dom.js'; +import { AxoSymbol } from './AxoSymbol.dom.js'; const Namespace = 'AxoSwitch'; diff --git a/ts/axo/AxoSymbol.stories.tsx b/ts/axo/AxoSymbol.stories.tsx index 135da7ead3..bcba25dd04 100644 --- a/ts/axo/AxoSymbol.stories.tsx +++ b/ts/axo/AxoSymbol.stories.tsx @@ -4,12 +4,12 @@ import React, { memo, useMemo, useState } from 'react'; import type { Meta } from '@storybook/react'; import { Direction } from 'radix-ui'; import Fuse from 'fuse.js'; -import { AxoSymbol } from './AxoSymbol.js'; -import { tw } from './tw.js'; +import { AxoSymbol } from './AxoSymbol.dom.js'; +import { tw } from './tw.dom.js'; import { _getAllAxoSymbolInlineGlyphNames, getAxoSymbolInlineGlyph, -} from './_internal/AxoSymbolDefs.generated.js'; +} from './_internal/AxoSymbolDefs.generated.std.js'; export default { title: 'Axo/AxoSymbol', diff --git a/ts/axo/AxoSymbol.tsx b/ts/axo/AxoSymbol.tsx index 4877a32aef..c5a40d3988 100644 --- a/ts/axo/AxoSymbol.tsx +++ b/ts/axo/AxoSymbol.tsx @@ -4,15 +4,15 @@ import type { FC } from 'react'; import React, { memo, useMemo } from 'react'; import { Direction } from 'radix-ui'; import { VisuallyHidden } from 'react-aria'; -import { tw } from './tw.js'; +import { tw } from './tw.dom.js'; import { getAxoSymbolIcon, getAxoSymbolInlineGlyph, -} from './_internal/AxoSymbolDefs.generated.js'; +} from './_internal/AxoSymbolDefs.generated.std.js'; import type { AxoSymbolIconName, AxoSymbolInlineGlyphName, -} from './_internal/AxoSymbolDefs.generated.js'; +} from './_internal/AxoSymbolDefs.generated.std.js'; const { useDirection } = Direction; diff --git a/ts/axo/_internal/AriaLabellingContext.tsx b/ts/axo/_internal/AriaLabellingContext.tsx index 3c7f0a6f55..c455214147 100644 --- a/ts/axo/_internal/AriaLabellingContext.tsx +++ b/ts/axo/_internal/AriaLabellingContext.tsx @@ -3,7 +3,7 @@ import type { RefCallback } from 'react'; import { createContext, useContext, useMemo, useState } from 'react'; -import { assert } from './assert.js'; +import { assert } from './assert.dom.js'; type AriaLabellingContextType = Readonly<{ labelRef: RefCallback; diff --git a/ts/axo/_internal/AxoBaseMenu.tsx b/ts/axo/_internal/AxoBaseMenu.tsx index 00d806e0c0..7cd0d954ec 100644 --- a/ts/axo/_internal/AxoBaseMenu.tsx +++ b/ts/axo/_internal/AxoBaseMenu.tsx @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; import type { ReactNode } from 'react'; -import { tw } from '../tw.js'; -import { AxoSymbol } from '../AxoSymbol.js'; +import { tw } from '../tw.dom.js'; +import { AxoSymbol } from '../AxoSymbol.dom.js'; export namespace AxoBaseMenu { // diff --git a/ts/axo/_internal/AxoBaseSegmentedControl.tsx b/ts/axo/_internal/AxoBaseSegmentedControl.tsx index e1c794e805..ab745dbf02 100644 --- a/ts/axo/_internal/AxoBaseSegmentedControl.tsx +++ b/ts/axo/_internal/AxoBaseSegmentedControl.tsx @@ -18,9 +18,9 @@ import React, { } from 'react'; import type { Transition } from 'framer-motion'; import { motion } from 'framer-motion'; -import type { TailwindStyles } from '../tw.js'; -import { tw } from '../tw.js'; -import { ExperimentalAxoBadge } from '../AxoBadge.js'; +import type { TailwindStyles } from '../tw.dom.js'; +import { tw } from '../tw.dom.js'; +import { ExperimentalAxoBadge } from '../AxoBadge.dom.js'; const Namespace = 'AxoBaseSegmentedControl'; diff --git a/ts/background.ts b/ts/background.ts index 3a1dc5dc31..bceb72a632 100644 --- a/ts/background.ts +++ b/ts/background.ts @@ -7,97 +7,97 @@ import PQueue from 'p-queue'; import pMap from 'p-map'; import { v7 as generateUuid } from 'uuid'; -import * as Registration from './util/registration.js'; -import MessageReceiver from './textsecure/MessageReceiver.js'; -import { signalProtocolStore } from './SignalProtocolStore.js'; +import * as Registration from './util/registration.preload.js'; +import MessageReceiver from './textsecure/MessageReceiver.preload.js'; +import { signalProtocolStore } from './SignalProtocolStore.preload.js'; import type { SessionResetsType, ProcessedDataMessage, } from './textsecure/Types.d.ts'; -import { HTTPError } from './types/HTTPError.js'; +import { HTTPError } from './types/HTTPError.std.js'; import createTaskWithTimeout, { suspendTasksWithTimeout, resumeTasksWithTimeout, reportLongRunningTasks, -} from './textsecure/TaskWithTimeout.js'; +} from './textsecure/TaskWithTimeout.std.js'; import type { MessageAttributesType } from './model-types.d.ts'; -import * as Bytes from './Bytes.js'; -import * as Timers from './Timers.js'; -import * as indexedDb from './indexeddb.js'; -import type { MenuOptionsType } from './types/menu.js'; -import { SocketStatus } from './types/SocketStatus.js'; -import { DEFAULT_CONVERSATION_COLOR } from './types/Colors.js'; -import { ThemeType } from './types/Util.js'; -import * as durations from './util/durations/index.js'; -import { drop } from './util/drop.js'; -import { explodePromise } from './util/explodePromise.js'; -import { deliveryReceiptQueue } from './util/deliveryReceipt.js'; -import type { ExplodePromiseResultType } from './util/explodePromise.js'; -import { isWindowDragElement } from './util/isWindowDragElement.js'; -import { assertDev, strictAssert } from './util/assert.js'; -import { filter } from './util/iterables.js'; -import { isNotNil } from './util/isNotNil.js'; -import { areRemoteBackupsTurnedOn } from './util/isBackupEnabled.js'; -import { lightSessionResetQueue } from './util/lightSessionResetQueue.js'; -import { setAppLoadingScreenMessage } from './setAppLoadingScreenMessage.js'; -import { IdleDetector } from './IdleDetector.js'; -import { challengeHandler } from './services/challengeHandler.js'; +import * as Bytes from './Bytes.std.js'; +import * as Timers from './Timers.dom.js'; +import * as indexedDb from './indexeddb.dom.js'; +import type { MenuOptionsType } from './types/menu.std.js'; +import { SocketStatus } from './types/SocketStatus.std.js'; +import { DEFAULT_CONVERSATION_COLOR } from './types/Colors.std.js'; +import { ThemeType } from './types/Util.std.js'; +import * as durations from './util/durations/index.std.js'; +import { drop } from './util/drop.std.js'; +import { explodePromise } from './util/explodePromise.std.js'; +import { deliveryReceiptQueue } from './util/deliveryReceipt.preload.js'; +import type { ExplodePromiseResultType } from './util/explodePromise.std.js'; +import { isWindowDragElement } from './util/isWindowDragElement.std.js'; +import { assertDev, strictAssert } from './util/assert.std.js'; +import { filter } from './util/iterables.std.js'; +import { isNotNil } from './util/isNotNil.std.js'; +import { areRemoteBackupsTurnedOn } from './util/isBackupEnabled.preload.js'; +import { lightSessionResetQueue } from './util/lightSessionResetQueue.std.js'; +import { setAppLoadingScreenMessage } from './setAppLoadingScreenMessage.dom.js'; +import { IdleDetector } from './IdleDetector.preload.js'; +import { challengeHandler } from './services/challengeHandler.preload.js'; import { initialize as initializeExpiringMessageService, update as updateExpiringMessagesService, -} from './services/expiringMessagesDeletion.js'; +} from './services/expiringMessagesDeletion.preload.js'; import { initialize as initializeNotificationProfilesService, fastUpdate as updateNotificationProfileService, -} from './services/notificationProfilesService.js'; -import { tapToViewMessagesDeletionService } from './services/tapToViewMessagesDeletionService.js'; -import { senderCertificateService } from './services/senderCertificate.js'; +} from './services/notificationProfilesService.preload.js'; +import { tapToViewMessagesDeletionService } from './services/tapToViewMessagesDeletionService.preload.js'; +import { senderCertificateService } from './services/senderCertificate.preload.js'; import { GROUP_CREDENTIALS_KEY, initializeGroupCredentialFetcher, -} from './services/groupCredentialFetcher.js'; -import { initializeNetworkObserver } from './services/networkObserver.js'; -import * as KeyboardLayout from './services/keyboardLayout.js'; -import * as StorageService from './services/storage.js'; -import { usernameIntegrity } from './services/usernameIntegrity.js'; -import { updateIdentityKey } from './services/profiles.js'; -import { initializeUpdateListener } from './services/updateListener.js'; -import { RoutineProfileRefresher } from './routineProfileRefresh.js'; -import { isOlderThan } from './util/timestamp.js'; -import { isValidReactionEmoji } from './reactions/isValidReactionEmoji.js'; -import { safeParsePartial } from './util/schemas.js'; +} from './services/groupCredentialFetcher.preload.js'; +import { initializeNetworkObserver } from './services/networkObserver.preload.js'; +import * as KeyboardLayout from './services/keyboardLayout.dom.js'; +import * as StorageService from './services/storage.preload.js'; +import { usernameIntegrity } from './services/usernameIntegrity.preload.js'; +import { updateIdentityKey } from './services/profiles.preload.js'; +import { initializeUpdateListener } from './services/updateListener.preload.js'; +import { RoutineProfileRefresher } from './routineProfileRefresh.preload.js'; +import { isOlderThan } from './util/timestamp.std.js'; +import { isValidReactionEmoji } from './reactions/isValidReactionEmoji.std.js'; +import { safeParsePartial } from './util/schemas.std.js'; import { PollVoteSchema, PollTerminateSchema, isPollReceiveEnabled, -} from './types/Polls.js'; -import type { ConversationModel } from './models/conversations.js'; -import { isIncoming } from './messages/helpers.js'; -import { getAuthor } from './messages/sources.js'; -import { migrateBatchOfMessages } from './messages/migrateMessageData.js'; -import { createBatcher, waitForAllBatchers } from './util/batcher.js'; +} from './types/Polls.dom.js'; +import type { ConversationModel } from './models/conversations.preload.js'; +import { isIncoming } from './messages/helpers.std.js'; +import { getAuthor } from './messages/sources.preload.js'; +import { migrateBatchOfMessages } from './messages/migrateMessageData.preload.js'; +import { createBatcher, waitForAllBatchers } from './util/batcher.std.js'; import { flushAllWaitBatchers, waitForAllWaitBatchers, -} from './util/waitBatcher.js'; +} from './util/waitBatcher.std.js'; import { initializeAllJobQueues, shutdownAllJobQueues, -} from './jobs/initializeAllJobQueues.js'; -import { removeStorageKeyJobQueue } from './jobs/removeStorageKeyJobQueue.js'; -import { conversationJobQueue } from './jobs/conversationJobQueue.js'; -import { ourProfileKeyService } from './services/ourProfileKey.js'; -import { notificationService } from './services/notifications.js'; -import { areWeASubscriberService } from './services/areWeASubscriber.js'; +} from './jobs/initializeAllJobQueues.preload.js'; +import { removeStorageKeyJobQueue } from './jobs/removeStorageKeyJobQueue.preload.js'; +import { conversationJobQueue } from './jobs/conversationJobQueue.preload.js'; +import { ourProfileKeyService } from './services/ourProfileKey.std.js'; +import { notificationService } from './services/notifications.preload.js'; +import { areWeASubscriberService } from './services/areWeASubscriber.dom.js'; import { onContactSync, setIsInitialContactSync, -} from './services/contactSync.js'; -import { startTimeTravelDetector } from './util/startTimeTravelDetector.js'; -import { shouldRespondWithProfileKey } from './util/shouldRespondWithProfileKey.js'; -import { LatestQueue } from './util/LatestQueue.js'; -import { parseIntOrThrow } from './util/parseIntOrThrow.js'; -import { getProfile } from './util/getProfile.js'; +} from './services/contactSync.preload.js'; +import { startTimeTravelDetector } from './util/startTimeTravelDetector.std.js'; +import { shouldRespondWithProfileKey } from './util/shouldRespondWithProfileKey.dom.js'; +import { LatestQueue } from './util/LatestQueue.std.js'; +import { parseIntOrThrow } from './util/parseIntOrThrow.std.js'; +import { getProfile } from './util/getProfile.preload.js'; import type { AttachmentBackfillResponseSyncEvent, ConfigurationEvent, @@ -123,7 +123,7 @@ import type { ViewEvent, ViewOnceOpenSyncEvent, ViewSyncEvent, -} from './textsecure/messageReceiverEvents.js'; +} from './textsecure/messageReceiverEvents.std.js'; import { cancelInflightRequests, checkSockets, @@ -148,132 +148,139 @@ import { registerRequestHandler, reportMessage, unregisterRequestHandler, -} from './textsecure/WebAPI.js'; -import { accountManager } from './textsecure/AccountManager.js'; -import * as KeyChangeListener from './textsecure/KeyChangeListener.js'; -import { UpdateKeysListener } from './textsecure/UpdateKeysListener.js'; -import { isGroup } from './util/whatTypeOfConversation.js'; -import { BackOff, FIBONACCI_TIMEOUTS } from './util/BackOff.js'; -import { createApp as createAppRoot } from './state/roots/createApp.js'; -import { AppViewType } from './state/ducks/app.js'; -import { areAnyCallsActiveOrRinging } from './state/selectors/calling.js'; -import { badgeImageFileDownloader } from './badges/badgeImageFileDownloader.js'; -import * as Deletes from './messageModifiers/Deletes.js'; -import * as Edits from './messageModifiers/Edits.js'; -import * as MessageReceipts from './messageModifiers/MessageReceipts.js'; -import * as MessageRequests from './messageModifiers/MessageRequests.js'; -import * as Polls from './messageModifiers/Polls.js'; -import * as Reactions from './messageModifiers/Reactions.js'; -import * as ViewOnceOpenSyncs from './messageModifiers/ViewOnceOpenSyncs.js'; -import type { DeleteAttributesType } from './messageModifiers/Deletes.js'; -import type { EditAttributesType } from './messageModifiers/Edits.js'; -import type { MessageRequestAttributesType } from './messageModifiers/MessageRequests.js'; +} from './textsecure/WebAPI.preload.js'; +import { accountManager } from './textsecure/AccountManager.preload.js'; +import * as KeyChangeListener from './textsecure/KeyChangeListener.dom.js'; +import { UpdateKeysListener } from './textsecure/UpdateKeysListener.preload.js'; +import { isGroup } from './util/whatTypeOfConversation.dom.js'; +import { BackOff, FIBONACCI_TIMEOUTS } from './util/BackOff.std.js'; +import { createApp as createAppRoot } from './state/roots/createApp.preload.js'; +import { AppViewType } from './state/ducks/app.preload.js'; +import { areAnyCallsActiveOrRinging } from './state/selectors/calling.std.js'; +import { badgeImageFileDownloader } from './badges/badgeImageFileDownloader.preload.js'; +import * as Deletes from './messageModifiers/Deletes.preload.js'; +import * as Edits from './messageModifiers/Edits.preload.js'; +import * as MessageReceipts from './messageModifiers/MessageReceipts.preload.js'; +import * as MessageRequests from './messageModifiers/MessageRequests.preload.js'; +import * as Polls from './messageModifiers/Polls.preload.js'; +import * as Reactions from './messageModifiers/Reactions.preload.js'; +import * as ViewOnceOpenSyncs from './messageModifiers/ViewOnceOpenSyncs.preload.js'; +import type { DeleteAttributesType } from './messageModifiers/Deletes.preload.js'; +import type { EditAttributesType } from './messageModifiers/Edits.preload.js'; +import type { MessageRequestAttributesType } from './messageModifiers/MessageRequests.preload.js'; import type { PollVoteAttributesType, PollTerminateAttributesType, -} from './messageModifiers/Polls.js'; -import type { ReactionAttributesType } from './messageModifiers/Reactions.js'; -import type { ViewOnceOpenSyncAttributesType } from './messageModifiers/ViewOnceOpenSyncs.js'; -import { ReadStatus } from './messages/MessageReadStatus.js'; -import type { SendStateByConversationId } from './messages/MessageSendState.js'; -import { SendStatus } from './messages/MessageSendState.js'; -import * as Stickers from './types/Stickers.js'; -import * as Errors from './types/errors.js'; -import { InstallScreenStep } from './types/InstallScreen.js'; -import { getEnvironment } from './environment.js'; -import { SignalService as Proto } from './protobuf/index.js'; +} from './messageModifiers/Polls.preload.js'; +import type { ReactionAttributesType } from './messageModifiers/Reactions.preload.js'; +import type { ViewOnceOpenSyncAttributesType } from './messageModifiers/ViewOnceOpenSyncs.preload.js'; +import { ReadStatus } from './messages/MessageReadStatus.std.js'; +import type { SendStateByConversationId } from './messages/MessageSendState.std.js'; +import { SendStatus } from './messages/MessageSendState.std.js'; +import * as Stickers from './types/Stickers.preload.js'; +import * as Errors from './types/errors.std.js'; +import { InstallScreenStep } from './types/InstallScreen.std.js'; +import { getEnvironment } from './environment.std.js'; +import { SignalService as Proto } from './protobuf/index.std.js'; import { getOnDecryptionError, onRetryRequest, onInvalidPlaintextMessage, onSuccessfulDecrypt, -} from './util/handleRetry.js'; -import { themeChanged } from './shims/themeChanged.js'; -import { createIPCEvents } from './util/createIPCEvents.js'; -import type { ServiceIdString } from './types/ServiceId.js'; +} from './util/handleRetry.preload.js'; +import { themeChanged } from './shims/themeChanged.dom.js'; +import { createIPCEvents } from './util/createIPCEvents.preload.js'; +import type { ServiceIdString } from './types/ServiceId.std.js'; import { ServiceIdKind, isPniString, isServiceIdString, -} from './types/ServiceId.js'; -import { isAciString } from './util/isAciString.js'; -import { normalizeAci } from './util/normalizeAci.js'; -import { createLogger } from './logging/log.js'; -import { deleteAllLogs } from './util/deleteAllLogs.js'; -import { startInteractionMode } from './services/InteractionMode.js'; -import { calling } from './services/calling.js'; -import { ReactionSource } from './reactions/ReactionSource.js'; -import { singleProtoJobQueue } from './jobs/singleProtoJobQueue.js'; -import { SeenStatus } from './MessageSeenStatus.js'; -import { MessageSender } from './textsecure/SendMessage.js'; -import { onStoryRecipientUpdate } from './util/onStoryRecipientUpdate.js'; -import { flushAttachmentDownloadQueue } from './util/attachmentDownloadQueue.js'; -import { initializeRedux } from './state/initializeRedux.js'; -import { StartupQueue } from './util/StartupQueue.js'; -import { showConfirmationDialog } from './util/showConfirmationDialog.js'; -import { onCallEventSync } from './util/onCallEventSync.js'; -import { sleeper } from './util/sleeper.js'; -import { DAY, HOUR, SECOND } from './util/durations/index.js'; -import { copyDataMessageIntoMessage } from './util/copyDataMessageIntoMessage.js'; +} from './types/ServiceId.std.js'; +import { isAciString } from './util/isAciString.std.js'; +import { normalizeAci } from './util/normalizeAci.std.js'; +import { createLogger } from './logging/log.std.js'; +import { deleteAllLogs } from './util/deleteAllLogs.preload.js'; +import { startInteractionMode } from './services/InteractionMode.dom.js'; +import { calling } from './services/calling.preload.js'; +import { ReactionSource } from './reactions/ReactionSource.std.js'; +import { singleProtoJobQueue } from './jobs/singleProtoJobQueue.preload.js'; +import { SeenStatus } from './MessageSeenStatus.std.js'; +import { MessageSender } from './textsecure/SendMessage.preload.js'; +import { onStoryRecipientUpdate } from './util/onStoryRecipientUpdate.preload.js'; +import { flushAttachmentDownloadQueue } from './util/attachmentDownloadQueue.preload.js'; +import { initializeRedux } from './state/initializeRedux.preload.js'; +import { StartupQueue } from './util/StartupQueue.std.js'; +import { showConfirmationDialog } from './util/showConfirmationDialog.dom.js'; +import { onCallEventSync } from './util/onCallEventSync.preload.js'; +import { sleeper } from './util/sleeper.std.js'; +import { DAY, HOUR, SECOND } from './util/durations/index.std.js'; +import { copyDataMessageIntoMessage } from './util/copyDataMessageIntoMessage.std.js'; import { flushMessageCounter, incrementMessageCounter, initializeMessageCounter, -} from './util/incrementMessageCounter.js'; -import { generateMessageId } from './util/generateMessageId.js'; -import { retryPlaceholders } from './services/retryPlaceholders.js'; -import { setBatchingStrategy } from './util/messageBatcher.js'; -import { parseRemoteClientExpiration } from './util/parseRemoteClientExpiration.js'; -import { addGlobalKeyboardShortcuts } from './services/addGlobalKeyboardShortcuts.js'; -import { createEventHandler } from './quill/signal-clipboard/util.js'; -import { onCallLogEventSync } from './util/onCallLogEventSync.js'; -import { backupsService } from './services/backups/index.js'; +} from './util/incrementMessageCounter.preload.js'; +import { generateMessageId } from './util/generateMessageId.node.js'; +import { retryPlaceholders } from './services/retryPlaceholders.std.js'; +import { setBatchingStrategy } from './util/messageBatcher.preload.js'; +import { parseRemoteClientExpiration } from './util/parseRemoteClientExpiration.dom.js'; +import { addGlobalKeyboardShortcuts } from './services/addGlobalKeyboardShortcuts.preload.js'; +import { createEventHandler } from './quill/signal-clipboard/util.dom.js'; +import { onCallLogEventSync } from './util/onCallLogEventSync.preload.js'; +import { backupsService } from './services/backups/index.preload.js'; import { getCallIdFromEra, updateLocalGroupCallHistoryTimestamp, -} from './util/callDisposition.js'; -import { deriveStorageServiceKey, deriveMasterKey } from './Crypto.js'; -import { AttachmentDownloadManager } from './jobs/AttachmentDownloadManager.js'; -import { onCallLinkUpdateSync } from './util/onCallLinkUpdateSync.js'; -import { CallMode } from './types/CallDisposition.js'; -import type { SyncTaskType } from './util/syncTasks.js'; -import { queueSyncTasks, runAllSyncTasks } from './util/syncTasks.js'; -import type { ViewSyncTaskType } from './messageModifiers/ViewSyncs.js'; -import type { ReceiptSyncTaskType } from './messageModifiers/MessageReceipts.js'; -import type { ReadSyncTaskType } from './messageModifiers/ReadSyncs.js'; -import { AttachmentBackupManager } from './jobs/AttachmentBackupManager.js'; -import { getConversationIdForLogging } from './util/idForLogging.js'; -import { encryptConversationAttachments } from './util/encryptConversationAttachments.js'; -import { DataReader, DataWriter } from './sql/Client.js'; +} from './util/callDisposition.preload.js'; +import { deriveStorageServiceKey, deriveMasterKey } from './Crypto.node.js'; +import { AttachmentDownloadManager } from './jobs/AttachmentDownloadManager.preload.js'; +import { onCallLinkUpdateSync } from './util/onCallLinkUpdateSync.preload.js'; +import { CallMode } from './types/CallDisposition.std.js'; +import type { SyncTaskType } from './util/syncTasks.preload.js'; +import { queueSyncTasks, runAllSyncTasks } from './util/syncTasks.preload.js'; +import type { ViewSyncTaskType } from './messageModifiers/ViewSyncs.preload.js'; +import type { ReceiptSyncTaskType } from './messageModifiers/MessageReceipts.preload.js'; +import type { ReadSyncTaskType } from './messageModifiers/ReadSyncs.preload.js'; +import { AttachmentBackupManager } from './jobs/AttachmentBackupManager.preload.js'; +import { getConversationIdForLogging } from './util/idForLogging.preload.js'; +import { encryptConversationAttachments } from './util/encryptConversationAttachments.preload.js'; +import { DataReader, DataWriter } from './sql/Client.preload.js'; import { restoreRemoteConfigFromStorage, getValue as getRemoteConfigValue, onChange as onRemoteConfigChange, maybeRefreshRemoteConfig, forceRefreshRemoteConfig, -} from './RemoteConfig.js'; -import { getParametersForRedux, loadAll } from './services/allLoaders.js'; -import { checkFirstEnvelope } from './util/checkFirstEnvelope.js'; -import { BLOCKED_UUIDS_ID } from './textsecure/storage/Blocked.js'; -import { ReleaseNotesFetcher } from './services/releaseNotesFetcher.js'; -import { BuildExpirationService } from './services/buildExpiration.js'; +} from './RemoteConfig.dom.js'; +import { + getParametersForRedux, + loadAll, +} from './services/allLoaders.preload.js'; +import { checkFirstEnvelope } from './util/checkFirstEnvelope.dom.js'; +import { BLOCKED_UUIDS_ID } from './textsecure/storage/Blocked.std.js'; +import { ReleaseNotesFetcher } from './services/releaseNotesFetcher.preload.js'; +import { BuildExpirationService } from './services/buildExpiration.preload.js'; import { maybeQueueDeviceNameFetch, onDeviceNameChangeSync, -} from './util/onDeviceNameChangeSync.js'; -import { postSaveUpdates } from './util/cleanup.js'; -import { handleDataMessage } from './messages/handleDataMessage.js'; -import { MessageModel } from './models/messages.js'; -import { waitForEvent } from './shims/events.js'; -import { sendSyncRequests } from './textsecure/syncRequests.js'; -import { handleServerAlerts } from './util/handleServerAlerts.js'; -import { isLocalBackupsEnabled } from './util/isLocalBackupsEnabled.js'; -import { NavTab, SettingsPage, ProfileEditorPage } from './types/Nav.js'; -import { initialize as initializeDonationService } from './services/donations.js'; -import { MessageRequestResponseSource } from './types/MessageRequestResponseEvent.js'; -import { CURRENT_SCHEMA_VERSION, PRIVATE, GROUP } from './types/Message2.js'; -import { JobCancelReason } from './jobs/types.js'; -import { itemStorage } from './textsecure/Storage.js'; +} from './util/onDeviceNameChangeSync.preload.js'; +import { postSaveUpdates } from './util/cleanup.preload.js'; +import { handleDataMessage } from './messages/handleDataMessage.preload.js'; +import { MessageModel } from './models/messages.preload.js'; +import { waitForEvent } from './shims/events.dom.js'; +import { sendSyncRequests } from './textsecure/syncRequests.preload.js'; +import { handleServerAlerts } from './util/handleServerAlerts.preload.js'; +import { isLocalBackupsEnabled } from './util/isLocalBackupsEnabled.dom.js'; +import { NavTab, SettingsPage, ProfileEditorPage } from './types/Nav.std.js'; +import { initialize as initializeDonationService } from './services/donations.preload.js'; +import { MessageRequestResponseSource } from './types/MessageRequestResponseEvent.std.js'; +import { + CURRENT_SCHEMA_VERSION, + PRIVATE, + GROUP, +} from './types/Message2.preload.js'; +import { JobCancelReason } from './jobs/types.std.js'; +import { itemStorage } from './textsecure/Storage.preload.js'; const { isNumber, throttle } = lodash; diff --git a/ts/badges/BadgeCategory.ts b/ts/badges/BadgeCategory.ts index fadacdd298..be4053f935 100644 --- a/ts/badges/BadgeCategory.ts +++ b/ts/badges/BadgeCategory.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { makeEnumParser } from '../util/enum.js'; +import { makeEnumParser } from '../util/enum.std.js'; // The server may return "testing", which we should parse as "other". export enum BadgeCategory { diff --git a/ts/badges/BadgeImageTheme.ts b/ts/badges/BadgeImageTheme.ts index 831ad3d065..017199bdfa 100644 --- a/ts/badges/BadgeImageTheme.ts +++ b/ts/badges/BadgeImageTheme.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { makeEnumParser } from '../util/enum.js'; +import { makeEnumParser } from '../util/enum.std.js'; export enum BadgeImageTheme { Light = 'light', diff --git a/ts/badges/badgeImageFileDownloader.ts b/ts/badges/badgeImageFileDownloader.ts index b6db0bcfab..4cd92a043e 100644 --- a/ts/badges/badgeImageFileDownloader.ts +++ b/ts/badges/badgeImageFileDownloader.ts @@ -2,13 +2,13 @@ // SPDX-License-Identifier: AGPL-3.0-only import PQueue from 'p-queue'; -import { DataWriter } from '../sql/Client.js'; -import { createLogger } from '../logging/log.js'; -import { MINUTE } from '../util/durations/index.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { waitForOnline } from '../util/waitForOnline.js'; -import { writeNewBadgeImageFileData } from '../util/migrations.js'; -import { getBadgeImageFile, isOnline } from '../textsecure/WebAPI.js'; +import { DataWriter } from '../sql/Client.preload.js'; +import { createLogger } from '../logging/log.std.js'; +import { MINUTE } from '../util/durations/index.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { waitForOnline } from '../util/waitForOnline.dom.js'; +import { writeNewBadgeImageFileData } from '../util/migrations.preload.js'; +import { getBadgeImageFile, isOnline } from '../textsecure/WebAPI.preload.js'; const log = createLogger('badgeImageFileDownloader'); diff --git a/ts/badges/getBadgeImageFileLocalPath.ts b/ts/badges/getBadgeImageFileLocalPath.ts index cb88d7929b..a35d157783 100644 --- a/ts/badges/getBadgeImageFileLocalPath.ts +++ b/ts/badges/getBadgeImageFileLocalPath.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import lodash from 'lodash'; -import type { BadgeType } from './types.js'; -import { BadgeImageTheme } from './BadgeImageTheme.js'; +import type { BadgeType } from './types.std.js'; +import { BadgeImageTheme } from './BadgeImageTheme.std.js'; const { find, findLast, first, last } = lodash; diff --git a/ts/badges/isBadgeImageFileUrlValid.ts b/ts/badges/isBadgeImageFileUrlValid.ts index e8293911b8..c8fe784bce 100644 --- a/ts/badges/isBadgeImageFileUrlValid.ts +++ b/ts/badges/isBadgeImageFileUrlValid.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { maybeParseUrl } from '../util/url.js'; +import { maybeParseUrl } from '../util/url.std.js'; export function isBadgeImageFileUrlValid( url: string, diff --git a/ts/badges/isBadgeVisible.ts b/ts/badges/isBadgeVisible.ts index fc7f9c3bab..6b6da02cd8 100644 --- a/ts/badges/isBadgeVisible.ts +++ b/ts/badges/isBadgeVisible.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { BadgeType } from './types.js'; +import type { BadgeType } from './types.std.js'; export const isBadgeVisible = (badge: Readonly): boolean => 'isVisible' in badge ? badge.isVisible : true; diff --git a/ts/badges/parseBadgesFromServer.ts b/ts/badges/parseBadgesFromServer.ts index 1228a08fd6..eee9fded75 100644 --- a/ts/badges/parseBadgesFromServer.ts +++ b/ts/badges/parseBadgesFromServer.ts @@ -3,13 +3,16 @@ import * as z from 'zod'; import lodash from 'lodash'; -import { isRecord } from '../util/isRecord.js'; -import { isNormalNumber } from '../util/isNormalNumber.js'; -import { createLogger } from '../logging/log.js'; -import type { BadgeType, BadgeImageType } from './types.js'; -import { parseBadgeCategory } from './BadgeCategory.js'; -import { BadgeImageTheme, parseBadgeImageTheme } from './BadgeImageTheme.js'; -import { safeParseUnknown } from '../util/schemas.js'; +import { isRecord } from '../util/isRecord.std.js'; +import { isNormalNumber } from '../util/isNormalNumber.std.js'; +import { createLogger } from '../logging/log.std.js'; +import type { BadgeType, BadgeImageType } from './types.std.js'; +import { parseBadgeCategory } from './BadgeCategory.std.js'; +import { + BadgeImageTheme, + parseBadgeImageTheme, +} from './BadgeImageTheme.std.js'; +import { safeParseUnknown } from '../util/schemas.std.js'; const { isEmpty } = lodash; diff --git a/ts/badges/types.ts b/ts/badges/types.ts index a1cd87d0dc..74f3e771bb 100644 --- a/ts/badges/types.ts +++ b/ts/badges/types.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { BadgeCategory } from './BadgeCategory.js'; -import type { BadgeImageTheme } from './BadgeImageTheme.js'; +import type { BadgeCategory } from './BadgeCategory.std.js'; +import type { BadgeImageTheme } from './BadgeImageTheme.std.js'; type SomeoneElsesBadgeType = Readonly<{ category: BadgeCategory; diff --git a/ts/calling/VideoSupport.ts b/ts/calling/VideoSupport.ts index a0310772ac..07bf5b685c 100644 --- a/ts/calling/VideoSupport.ts +++ b/ts/calling/VideoSupport.ts @@ -9,7 +9,7 @@ import { videoPixelFormatToEnum } from '@signalapp/ringrtc'; import type { VideoFrameSender, VideoFrameSource } from '@signalapp/ringrtc'; import type { RefObject } from 'react'; -import { createLogger } from '../logging/log.js'; +import { createLogger } from '../logging/log.std.js'; const log = createLogger('VideoSupport'); diff --git a/ts/calling/useGetCallingFrameBuffer.ts b/ts/calling/useGetCallingFrameBuffer.ts index 79ebb33630..3c353dc77a 100644 --- a/ts/calling/useGetCallingFrameBuffer.ts +++ b/ts/calling/useGetCallingFrameBuffer.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { useRef, useCallback } from 'react'; -import { FRAME_BUFFER_SIZE } from './constants.js'; +import { FRAME_BUFFER_SIZE } from './constants.std.js'; /** * A hook that returns a function. This function returns a "singleton" `ArrayBuffer` to be diff --git a/ts/challenge.ts b/ts/challenge.ts index c4168b7281..e6c538c837 100644 --- a/ts/challenge.ts +++ b/ts/challenge.ts @@ -12,18 +12,18 @@ // are not immediately retried, however, until `.onOnline()` is called from // when we are actually online. -import { assertDev } from './util/assert.js'; -import { isOlderThan } from './util/timestamp.js'; -import { clearTimeoutIfNecessary } from './util/clearTimeoutIfNecessary.js'; -import { missingCaseError } from './util/missingCaseError.js'; +import { assertDev } from './util/assert.std.js'; +import { isOlderThan } from './util/timestamp.std.js'; +import { clearTimeoutIfNecessary } from './util/clearTimeoutIfNecessary.std.js'; +import { missingCaseError } from './util/missingCaseError.std.js'; import type { StorageInterface } from './types/Storage.d.ts'; -import * as Errors from './types/errors.js'; -import { HTTPError } from './types/HTTPError.js'; -import type { SendMessageChallengeData } from './textsecure/Errors.js'; -import { createLogger } from './logging/log.js'; -import { drop } from './util/drop.js'; -import { findRetryAfterTimeFromError } from './jobs/helpers/findRetryAfterTimeFromError.js'; -import { MINUTE } from './util/durations/index.js'; +import * as Errors from './types/errors.std.js'; +import { HTTPError } from './types/HTTPError.std.js'; +import type { SendMessageChallengeData } from './textsecure/Errors.std.js'; +import { createLogger } from './logging/log.std.js'; +import { drop } from './util/drop.std.js'; +import { findRetryAfterTimeFromError } from './jobs/helpers/findRetryAfterTimeFromError.std.js'; +import { MINUTE } from './util/durations/index.std.js'; const log = createLogger('challenge'); diff --git a/ts/components/About.stories.tsx b/ts/components/About.stories.tsx index 9c360cc31e..2b0d514200 100644 --- a/ts/components/About.stories.tsx +++ b/ts/components/About.stories.tsx @@ -3,9 +3,9 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { ComponentMeta } from '../storybook/types.js'; -import type { AboutProps } from './About.js'; -import { About } from './About.js'; +import type { ComponentMeta } from '../storybook/types.std.js'; +import type { AboutProps } from './About.dom.js'; +import { About } from './About.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/About.tsx b/ts/components/About.tsx index bd4bf82a17..45028a7b2d 100644 --- a/ts/components/About.tsx +++ b/ts/components/About.tsx @@ -3,8 +3,8 @@ import React from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import { useEscapeHandling } from '../hooks/useEscapeHandling.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { useEscapeHandling } from '../hooks/useEscapeHandling.dom.js'; export type AboutProps = Readonly<{ closeAbout: () => unknown; diff --git a/ts/components/AddGroupMemberErrorDialog.stories.tsx b/ts/components/AddGroupMemberErrorDialog.stories.tsx index fc61d40788..e4e58cbdb9 100644 --- a/ts/components/AddGroupMemberErrorDialog.stories.tsx +++ b/ts/components/AddGroupMemberErrorDialog.stories.tsx @@ -6,11 +6,11 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './AddGroupMemberErrorDialog.js'; +import type { PropsType } from './AddGroupMemberErrorDialog.dom.js'; import { AddGroupMemberErrorDialog, AddGroupMemberErrorDialogMode, -} from './AddGroupMemberErrorDialog.js'; +} from './AddGroupMemberErrorDialog.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/AddGroupMemberErrorDialog.tsx b/ts/components/AddGroupMemberErrorDialog.tsx index d289da573d..0311d12990 100644 --- a/ts/components/AddGroupMemberErrorDialog.tsx +++ b/ts/components/AddGroupMemberErrorDialog.tsx @@ -4,9 +4,9 @@ import type { ReactNode } from 'react'; import React from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import { Alert } from './Alert.js'; -import { missingCaseError } from '../util/missingCaseError.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { Alert } from './Alert.dom.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; export enum AddGroupMemberErrorDialogMode { MaximumGroupSize, diff --git a/ts/components/AddUserToAnotherGroupModal.stories.tsx b/ts/components/AddUserToAnotherGroupModal.stories.tsx index 1afca880e6..adbd3f03f2 100644 --- a/ts/components/AddUserToAnotherGroupModal.stories.tsx +++ b/ts/components/AddUserToAnotherGroupModal.stories.tsx @@ -5,12 +5,12 @@ import React from 'react'; import type { Meta, StoryFn } from '@storybook/react'; import { action } from '@storybook/addon-actions'; -import type { Props } from './AddUserToAnotherGroupModal.js'; +import type { Props } from './AddUserToAnotherGroupModal.dom.js'; import { getDefaultConversation, getDefaultGroup, -} from '../test-helpers/getDefaultConversation.js'; -import { AddUserToAnotherGroupModal } from './AddUserToAnotherGroupModal.js'; +} from '../test-helpers/getDefaultConversation.std.js'; +import { AddUserToAnotherGroupModal } from './AddUserToAnotherGroupModal.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/AddUserToAnotherGroupModal.tsx b/ts/components/AddUserToAnotherGroupModal.tsx index 7bbf9f311f..89d2f0a621 100644 --- a/ts/components/AddUserToAnotherGroupModal.tsx +++ b/ts/components/AddUserToAnotherGroupModal.tsx @@ -5,23 +5,23 @@ import lodash from 'lodash'; import React, { useCallback } from 'react'; import type { ListRowProps } from 'react-virtualized'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import type { LocalizerType } from '../types/Util.js'; -import { ToastType } from '../types/Toast.js'; -import { filterAndSortConversations } from '../util/filterAndSortConversations.js'; -import { ConfirmationDialog } from './ConfirmationDialog.js'; -import type { GroupListItemConversationType } from './conversationList/GroupListItem.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { ToastType } from '../types/Toast.dom.js'; +import { filterAndSortConversations } from '../util/filterAndSortConversations.std.js'; +import { ConfirmationDialog } from './ConfirmationDialog.dom.js'; +import type { GroupListItemConversationType } from './conversationList/GroupListItem.dom.js'; import { DisabledReason, GroupListItem, -} from './conversationList/GroupListItem.js'; -import { Modal } from './Modal.js'; -import { SearchInput } from './SearchInput.js'; -import { useRestoreFocus } from '../hooks/useRestoreFocus.js'; -import { ListView } from './ListView.js'; -import { ListTile } from './ListTile.js'; -import type { ShowToastAction } from '../state/ducks/toast.js'; -import { SizeObserver } from '../hooks/useSizeObserver.js'; +} from './conversationList/GroupListItem.dom.js'; +import { Modal } from './Modal.dom.js'; +import { SearchInput } from './SearchInput.dom.js'; +import { useRestoreFocus } from '../hooks/useRestoreFocus.dom.js'; +import { ListView } from './ListView.dom.js'; +import { ListTile } from './ListTile.dom.js'; +import type { ShowToastAction } from '../state/ducks/toast.preload.js'; +import { SizeObserver } from '../hooks/useSizeObserver.dom.js'; const { pick } = lodash; diff --git a/ts/components/Alert.stories.tsx b/ts/components/Alert.stories.tsx index aefedce45a..c628dee70a 100644 --- a/ts/components/Alert.stories.tsx +++ b/ts/components/Alert.stories.tsx @@ -4,8 +4,8 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './Alert.js'; -import { Alert } from './Alert.js'; +import type { PropsType } from './Alert.dom.js'; +import { Alert } from './Alert.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/Alert.tsx b/ts/components/Alert.tsx index a8be8728da..ff9ec8f72d 100644 --- a/ts/components/Alert.tsx +++ b/ts/components/Alert.tsx @@ -4,10 +4,10 @@ import type { ReactNode } from 'react'; import React from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import type { Theme } from '../util/theme.js'; -import { Button } from './Button.js'; -import { Modal } from './Modal.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import type { Theme } from '../util/theme.std.js'; +import { Button } from './Button.dom.js'; +import { Modal } from './Modal.dom.js'; export type PropsType = { body: ReactNode; diff --git a/ts/components/AnimatedEmojiGalore.stories.tsx b/ts/components/AnimatedEmojiGalore.stories.tsx index 3e2e6ace69..b6d5a5219e 100644 --- a/ts/components/AnimatedEmojiGalore.stories.tsx +++ b/ts/components/AnimatedEmojiGalore.stories.tsx @@ -5,8 +5,8 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './AnimatedEmojiGalore.js'; -import { AnimatedEmojiGalore } from './AnimatedEmojiGalore.js'; +import type { PropsType } from './AnimatedEmojiGalore.dom.js'; +import { AnimatedEmojiGalore } from './AnimatedEmojiGalore.dom.js'; export default { title: 'Components/AnimatedEmojiGalore', diff --git a/ts/components/AnimatedEmojiGalore.tsx b/ts/components/AnimatedEmojiGalore.tsx index cc0015aced..7e3273369e 100644 --- a/ts/components/AnimatedEmojiGalore.tsx +++ b/ts/components/AnimatedEmojiGalore.tsx @@ -4,14 +4,14 @@ import React from 'react'; import { animated, to as interpolate, useSprings } from '@react-spring/web'; import lodash from 'lodash'; -import { useReducedMotion } from '../hooks/useReducedMotion.js'; -import { FunStaticEmoji } from './fun/FunEmoji.js'; -import { strictAssert } from '../util/assert.js'; +import { useReducedMotion } from '../hooks/useReducedMotion.dom.js'; +import { FunStaticEmoji } from './fun/FunEmoji.dom.js'; +import { strictAssert } from '../util/assert.std.js'; import { getEmojiVariantByKey, getEmojiVariantKeyByValue, isEmojiVariantValue, -} from './fun/data/emojis.js'; +} from './fun/data/emojis.std.js'; const { random } = lodash; diff --git a/ts/components/AnnouncementsOnlyGroupBanner.tsx b/ts/components/AnnouncementsOnlyGroupBanner.tsx index 269e5efe6d..15f056cc01 100644 --- a/ts/components/AnnouncementsOnlyGroupBanner.tsx +++ b/ts/components/AnnouncementsOnlyGroupBanner.tsx @@ -6,11 +6,11 @@ import lodash from 'lodash'; import type { ConversationType, ShowConversationType, -} from '../state/ducks/conversations.js'; -import { I18n } from './I18n.js'; -import type { LocalizerType, ThemeType } from '../types/Util.js'; -import { Modal } from './Modal.js'; -import { ConversationListItem } from './conversationList/ConversationListItem.js'; +} from '../state/ducks/conversations.preload.js'; +import { I18n } from './I18n.dom.js'; +import type { LocalizerType, ThemeType } from '../types/Util.std.js'; +import { Modal } from './Modal.dom.js'; +import { ConversationListItem } from './conversationList/ConversationListItem.dom.js'; const { noop } = lodash; diff --git a/ts/components/App.tsx b/ts/components/App.tsx index 1e1551bb96..8b970faeca 100644 --- a/ts/components/App.tsx +++ b/ts/components/App.tsx @@ -4,14 +4,14 @@ import React, { useEffect } from 'react'; import classNames from 'classnames'; -import type { ViewStoryActionCreatorType } from '../state/ducks/stories.js'; -import type { VerificationTransport } from '../types/VerificationTransport.js'; -import { ThemeType } from '../types/Util.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { type AppStateType, AppViewType } from '../state/ducks/app.js'; -import { SmartInstallScreen } from '../state/smart/InstallScreen.js'; -import { StandaloneRegistration } from './StandaloneRegistration.js'; -import { usePageVisibility } from '../hooks/usePageVisibility.js'; +import type { ViewStoryActionCreatorType } from '../state/ducks/stories.preload.js'; +import type { VerificationTransport } from '../types/VerificationTransport.std.js'; +import { ThemeType } from '../types/Util.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { type AppStateType, AppViewType } from '../state/ducks/app.preload.js'; +import { SmartInstallScreen } from '../state/smart/InstallScreen.preload.js'; +import { StandaloneRegistration } from './StandaloneRegistration.dom.js'; +import { usePageVisibility } from '../hooks/usePageVisibility.dom.js'; type PropsType = { state: AppStateType; diff --git a/ts/components/AutoSizeInput.stories.tsx b/ts/components/AutoSizeInput.stories.tsx index d396fb2231..8f9965cad8 100644 --- a/ts/components/AutoSizeInput.stories.tsx +++ b/ts/components/AutoSizeInput.stories.tsx @@ -4,8 +4,8 @@ import React, { useState } from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './AutoSizeInput.js'; -import { AutoSizeInput } from './AutoSizeInput.js'; +import type { PropsType } from './AutoSizeInput.dom.js'; +import { AutoSizeInput } from './AutoSizeInput.dom.js'; export default { title: 'Components/AutoSizeInput', diff --git a/ts/components/AutoSizeInput.tsx b/ts/components/AutoSizeInput.tsx index 166e24776e..2b1d8f2b55 100644 --- a/ts/components/AutoSizeInput.tsx +++ b/ts/components/AutoSizeInput.tsx @@ -6,7 +6,7 @@ import React, { useCallback, useState, useEffect, useRef } from 'react'; import { createPortal } from 'react-dom'; import classNames from 'classnames'; -import { getClassNamesFor } from '../util/getClassNamesFor.js'; +import { getClassNamesFor } from '../util/getClassNamesFor.std.js'; export type PropsType = Readonly<{ disableSpellcheck?: boolean; diff --git a/ts/components/AutoSizeTextArea.tsx b/ts/components/AutoSizeTextArea.tsx index 4cc183f44f..c2e30af75a 100644 --- a/ts/components/AutoSizeTextArea.tsx +++ b/ts/components/AutoSizeTextArea.tsx @@ -3,9 +3,9 @@ import type { ForwardedRef } from 'react'; import React, { forwardRef, useEffect, useLayoutEffect, useRef } from 'react'; import { mergeRefs } from '@react-aria/utils'; -import { strictAssert } from '../util/assert.js'; -import type { PropsType } from './Input.js'; -import { Input } from './Input.js'; +import { strictAssert } from '../util/assert.std.js'; +import type { PropsType } from './Input.dom.js'; +import { Input } from './Input.dom.js'; export const AutoSizeTextArea = forwardRef(function AutoSizeTextArea( props: PropsType, diff --git a/ts/components/Avatar.stories.tsx b/ts/components/Avatar.stories.tsx index a41cc88a0a..90f6ceca1f 100644 --- a/ts/components/Avatar.stories.tsx +++ b/ts/components/Avatar.stories.tsx @@ -5,13 +5,13 @@ import type { Meta, StoryFn } from '@storybook/react'; import * as React from 'react'; import { action } from '@storybook/addon-actions'; import { expect, fn, within, userEvent } from '@storybook/test'; -import type { AvatarColorType } from '../types/Colors.js'; -import type { Props } from './Avatar.js'; -import { Avatar, AvatarBlur, AvatarSize } from './Avatar.js'; -import { AvatarColors } from '../types/Colors.js'; -import { HasStories } from '../types/Stories.js'; -import { ThemeType } from '../types/Util.js'; -import { getFakeBadge } from '../test-helpers/getFakeBadge.js'; +import type { AvatarColorType } from '../types/Colors.std.js'; +import type { Props } from './Avatar.dom.js'; +import { Avatar, AvatarBlur, AvatarSize } from './Avatar.dom.js'; +import { AvatarColors } from '../types/Colors.std.js'; +import { HasStories } from '../types/Stories.std.js'; +import { ThemeType } from '../types/Util.std.js'; +import { getFakeBadge } from '../test-helpers/getFakeBadge.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/Avatar.tsx b/ts/components/Avatar.tsx index a78cb95416..7fdbf9dfdb 100644 --- a/ts/components/Avatar.tsx +++ b/ts/components/Avatar.tsx @@ -13,20 +13,20 @@ import classNames from 'classnames'; import lodash from 'lodash'; import { filterDOMProps } from '@react-aria/utils'; -import type { AvatarColorType } from '../types/Colors.js'; -import type { BadgeType } from '../badges/types.js'; -import type { LocalizerType } from '../types/Util.js'; -import { createLogger } from '../logging/log.js'; -import { BadgeImageTheme } from '../badges/BadgeImageTheme.js'; -import { HasStories } from '../types/Stories.js'; -import { Spinner } from './Spinner.js'; -import { ThemeType } from '../types/Util.js'; -import { assertDev } from '../util/assert.js'; -import { getBadgeImageFileLocalPath } from '../badges/getBadgeImageFileLocalPath.js'; -import { getInitials } from '../util/getInitials.js'; -import { isBadgeVisible } from '../badges/isBadgeVisible.js'; -import { SIGNAL_AVATAR_PATH } from '../types/SignalConversation.js'; -import { getAvatarPlaceholderGradient } from '../utils/getAvatarPlaceholderGradient.js'; +import type { AvatarColorType } from '../types/Colors.std.js'; +import type { BadgeType } from '../badges/types.std.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { BadgeImageTheme } from '../badges/BadgeImageTheme.std.js'; +import { HasStories } from '../types/Stories.std.js'; +import { Spinner } from './Spinner.dom.js'; +import { ThemeType } from '../types/Util.std.js'; +import { assertDev } from '../util/assert.std.js'; +import { getBadgeImageFileLocalPath } from '../badges/getBadgeImageFileLocalPath.std.js'; +import { getInitials } from '../util/getInitials.std.js'; +import { isBadgeVisible } from '../badges/isBadgeVisible.std.js'; +import { SIGNAL_AVATAR_PATH } from '../types/SignalConversation.std.js'; +import { getAvatarPlaceholderGradient } from '../utils/getAvatarPlaceholderGradient.std.js'; const { noop } = lodash; diff --git a/ts/components/AvatarColorPicker.stories.tsx b/ts/components/AvatarColorPicker.stories.tsx index e534076bbf..ad6858c38d 100644 --- a/ts/components/AvatarColorPicker.stories.tsx +++ b/ts/components/AvatarColorPicker.stories.tsx @@ -5,9 +5,9 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './AvatarColorPicker.js'; -import { AvatarColorPicker } from './AvatarColorPicker.js'; -import { AvatarColors } from '../types/Colors.js'; +import type { PropsType } from './AvatarColorPicker.dom.js'; +import { AvatarColorPicker } from './AvatarColorPicker.dom.js'; +import { AvatarColors } from '../types/Colors.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/AvatarColorPicker.tsx b/ts/components/AvatarColorPicker.tsx index e4d2f5a3aa..c0137412ea 100644 --- a/ts/components/AvatarColorPicker.tsx +++ b/ts/components/AvatarColorPicker.tsx @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import type { AvatarColorType } from '../types/Colors.js'; -import { AvatarColors } from '../types/Colors.js'; -import type { LocalizerType } from '../types/Util.js'; -import { BetterAvatarBubble } from './BetterAvatarBubble.js'; +import type { AvatarColorType } from '../types/Colors.std.js'; +import { AvatarColors } from '../types/Colors.std.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { BetterAvatarBubble } from './BetterAvatarBubble.dom.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/AvatarEditor.stories.tsx b/ts/components/AvatarEditor.stories.tsx index 2370b117bc..872ce10a24 100644 --- a/ts/components/AvatarEditor.stories.tsx +++ b/ts/components/AvatarEditor.stories.tsx @@ -5,11 +5,11 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { AvatarColors } from '../types/Colors.js'; -import type { PropsType } from './AvatarEditor.js'; -import { AvatarEditor } from './AvatarEditor.js'; -import { getDefaultAvatars } from '../types/Avatar.js'; -import { createAvatarData } from '../util/createAvatarData.js'; +import { AvatarColors } from '../types/Colors.std.js'; +import type { PropsType } from './AvatarEditor.dom.js'; +import { AvatarEditor } from './AvatarEditor.dom.js'; +import { getDefaultAvatars } from '../types/Avatar.std.js'; +import { createAvatarData } from '../util/createAvatarData.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/AvatarEditor.tsx b/ts/components/AvatarEditor.tsx index fa0ddd7580..631884b788 100644 --- a/ts/components/AvatarEditor.tsx +++ b/ts/components/AvatarEditor.tsx @@ -4,25 +4,25 @@ import React, { useCallback, useEffect, useRef, useState } from 'react'; import lodash from 'lodash'; -import type { AvatarColorType } from '../types/Colors.js'; +import type { AvatarColorType } from '../types/Colors.std.js'; import type { AvatarDataType, DeleteAvatarFromDiskActionType, ReplaceAvatarActionType, SaveAvatarToDiskActionType, -} from '../types/Avatar.js'; -import { AvatarIconEditor } from './AvatarIconEditor.js'; -import { AvatarModalButtons } from './AvatarModalButtons.js'; -import { AvatarPreview } from './AvatarPreview.js'; -import { AvatarTextEditor } from './AvatarTextEditor.js'; -import { AvatarUploadButton } from './AvatarUploadButton.js'; -import { BetterAvatar } from './BetterAvatar.js'; -import type { LocalizerType } from '../types/Util.js'; -import { avatarDataToBytes } from '../util/avatarDataToBytes.js'; -import { createAvatarData } from '../util/createAvatarData.js'; -import { isSameAvatarData } from '../util/isSameAvatarData.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { useConfirmDiscard } from '../hooks/useConfirmDiscard.js'; +} from '../types/Avatar.std.js'; +import { AvatarIconEditor } from './AvatarIconEditor.dom.js'; +import { AvatarModalButtons } from './AvatarModalButtons.dom.js'; +import { AvatarPreview } from './AvatarPreview.dom.js'; +import { AvatarTextEditor } from './AvatarTextEditor.dom.js'; +import { AvatarUploadButton } from './AvatarUploadButton.dom.js'; +import { BetterAvatar } from './BetterAvatar.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { avatarDataToBytes } from '../util/avatarDataToBytes.dom.js'; +import { createAvatarData } from '../util/createAvatarData.std.js'; +import { isSameAvatarData } from '../util/isSameAvatarData.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { useConfirmDiscard } from '../hooks/useConfirmDiscard.dom.js'; const { isEqual } = lodash; diff --git a/ts/components/AvatarIconEditor.stories.tsx b/ts/components/AvatarIconEditor.stories.tsx index 3f159ce1c5..fd269c8652 100644 --- a/ts/components/AvatarIconEditor.stories.tsx +++ b/ts/components/AvatarIconEditor.stories.tsx @@ -5,11 +5,11 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './AvatarIconEditor.js'; -import { AvatarIconEditor } from './AvatarIconEditor.js'; -import { GroupAvatarIcons, PersonalAvatarIcons } from '../types/Avatar.js'; -import { AvatarColors } from '../types/Colors.js'; -import { createAvatarData } from '../util/createAvatarData.js'; +import type { PropsType } from './AvatarIconEditor.dom.js'; +import { AvatarIconEditor } from './AvatarIconEditor.dom.js'; +import { GroupAvatarIcons, PersonalAvatarIcons } from '../types/Avatar.std.js'; +import { AvatarColors } from '../types/Colors.std.js'; +import { createAvatarData } from '../util/createAvatarData.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/AvatarIconEditor.tsx b/ts/components/AvatarIconEditor.tsx index 33ff0c8794..d59624f67e 100644 --- a/ts/components/AvatarIconEditor.tsx +++ b/ts/components/AvatarIconEditor.tsx @@ -3,13 +3,13 @@ import React, { useCallback, useEffect, useState } from 'react'; -import { AvatarColorPicker } from './AvatarColorPicker.js'; -import type { AvatarColorType } from '../types/Colors.js'; -import type { AvatarDataType } from '../types/Avatar.js'; -import { AvatarModalButtons } from './AvatarModalButtons.js'; -import { AvatarPreview } from './AvatarPreview.js'; -import type { LocalizerType } from '../types/Util.js'; -import { avatarDataToBytes } from '../util/avatarDataToBytes.js'; +import { AvatarColorPicker } from './AvatarColorPicker.dom.js'; +import type { AvatarColorType } from '../types/Colors.std.js'; +import type { AvatarDataType } from '../types/Avatar.std.js'; +import { AvatarModalButtons } from './AvatarModalButtons.dom.js'; +import { AvatarPreview } from './AvatarPreview.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { avatarDataToBytes } from '../util/avatarDataToBytes.dom.js'; export type PropsType = { avatarData: AvatarDataType; diff --git a/ts/components/AvatarLightbox.stories.tsx b/ts/components/AvatarLightbox.stories.tsx index afa0d01d02..c64c3427d7 100644 --- a/ts/components/AvatarLightbox.stories.tsx +++ b/ts/components/AvatarLightbox.stories.tsx @@ -4,10 +4,10 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { AvatarColors } from '../types/Colors.js'; -import type { PropsType } from './AvatarLightbox.js'; -import { AvatarLightbox } from './AvatarLightbox.js'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; +import { AvatarColors } from '../types/Colors.std.js'; +import type { PropsType } from './AvatarLightbox.dom.js'; +import { AvatarLightbox } from './AvatarLightbox.dom.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/AvatarLightbox.tsx b/ts/components/AvatarLightbox.tsx index d2809574f5..28519716ae 100644 --- a/ts/components/AvatarLightbox.tsx +++ b/ts/components/AvatarLightbox.tsx @@ -4,10 +4,10 @@ import React from 'react'; import lodash from 'lodash'; -import type { AvatarColorType } from '../types/Colors.js'; -import { AvatarPreview } from './AvatarPreview.js'; -import { Lightbox } from './Lightbox.js'; -import type { LocalizerType } from '../types/Util.js'; +import type { AvatarColorType } from '../types/Colors.std.js'; +import { AvatarPreview } from './AvatarPreview.dom.js'; +import { Lightbox } from './Lightbox.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; const { noop } = lodash; diff --git a/ts/components/AvatarModalButtons.stories.tsx b/ts/components/AvatarModalButtons.stories.tsx index 3165affebb..b5cd4c163f 100644 --- a/ts/components/AvatarModalButtons.stories.tsx +++ b/ts/components/AvatarModalButtons.stories.tsx @@ -6,8 +6,8 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './AvatarModalButtons.js'; -import { AvatarModalButtons } from './AvatarModalButtons.js'; +import type { PropsType } from './AvatarModalButtons.dom.js'; +import { AvatarModalButtons } from './AvatarModalButtons.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/AvatarModalButtons.tsx b/ts/components/AvatarModalButtons.tsx index e976f89191..0b728d7608 100644 --- a/ts/components/AvatarModalButtons.tsx +++ b/ts/components/AvatarModalButtons.tsx @@ -3,10 +3,10 @@ import React, { useState } from 'react'; -import { Button, ButtonVariant } from './Button.js'; -import { ConfirmDiscardDialog } from './ConfirmDiscardDialog.js'; -import type { LocalizerType } from '../types/Util.js'; -import { Modal } from './Modal.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import { ConfirmDiscardDialog } from './ConfirmDiscardDialog.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { Modal } from './Modal.dom.js'; export type PropsType = { hasChanges: boolean; diff --git a/ts/components/AvatarPreview.stories.tsx b/ts/components/AvatarPreview.stories.tsx index ed0d8288ad..673bcbce41 100644 --- a/ts/components/AvatarPreview.stories.tsx +++ b/ts/components/AvatarPreview.stories.tsx @@ -7,9 +7,9 @@ import lodash from 'lodash'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './AvatarPreview.js'; -import { AvatarPreview } from './AvatarPreview.js'; -import { AvatarColors } from '../types/Colors.js'; +import type { PropsType } from './AvatarPreview.dom.js'; +import { AvatarPreview } from './AvatarPreview.dom.js'; +import { AvatarColors } from '../types/Colors.std.js'; const { chunk } = lodash; diff --git a/ts/components/AvatarPreview.tsx b/ts/components/AvatarPreview.tsx index d0333c5f63..b1cab6abb3 100644 --- a/ts/components/AvatarPreview.tsx +++ b/ts/components/AvatarPreview.tsx @@ -5,14 +5,14 @@ import type { CSSProperties } from 'react'; import React, { useEffect, useState } from 'react'; import lodash from 'lodash'; -import { createLogger } from '../logging/log.js'; -import type { LocalizerType } from '../types/Util.js'; -import { Spinner } from './Spinner.js'; -import type { AvatarColorType } from '../types/Colors.js'; -import { AvatarColors } from '../types/Colors.js'; -import { getInitials } from '../util/getInitials.js'; -import { imagePathToBytes } from '../util/imagePathToBytes.js'; -import { type ConversationType } from '../state/ducks/conversations.js'; +import { createLogger } from '../logging/log.std.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { Spinner } from './Spinner.dom.js'; +import type { AvatarColorType } from '../types/Colors.std.js'; +import { AvatarColors } from '../types/Colors.std.js'; +import { getInitials } from '../util/getInitials.std.js'; +import { imagePathToBytes } from '../util/imagePathToBytes.dom.js'; +import { type ConversationType } from '../state/ducks/conversations.preload.js'; const { noop } = lodash; diff --git a/ts/components/AvatarSpacer.tsx b/ts/components/AvatarSpacer.tsx index 5de80df697..f0891dcb48 100644 --- a/ts/components/AvatarSpacer.tsx +++ b/ts/components/AvatarSpacer.tsx @@ -3,7 +3,7 @@ import type { ReactElement } from 'react'; import React from 'react'; -import type { AvatarSize } from './Avatar.js'; +import type { AvatarSize } from './Avatar.dom.js'; export function AvatarSpacer({ size, diff --git a/ts/components/AvatarTextEditor.stories.tsx b/ts/components/AvatarTextEditor.stories.tsx index 997985ab32..de4246b04e 100644 --- a/ts/components/AvatarTextEditor.stories.tsx +++ b/ts/components/AvatarTextEditor.stories.tsx @@ -5,9 +5,9 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './AvatarTextEditor.js'; -import { AvatarTextEditor } from './AvatarTextEditor.js'; -import { AvatarColors } from '../types/Colors.js'; +import type { PropsType } from './AvatarTextEditor.dom.js'; +import { AvatarTextEditor } from './AvatarTextEditor.dom.js'; +import { AvatarColors } from '../types/Colors.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/AvatarTextEditor.tsx b/ts/components/AvatarTextEditor.tsx index ee984925c2..28b7b6829e 100644 --- a/ts/components/AvatarTextEditor.tsx +++ b/ts/components/AvatarTextEditor.tsx @@ -11,19 +11,19 @@ import React, { } from 'react'; import lodash from 'lodash'; -import * as grapheme from '../util/grapheme.js'; -import { AvatarColorPicker } from './AvatarColorPicker.js'; -import { AvatarColors } from '../types/Colors.js'; -import type { AvatarDataType } from '../types/Avatar.js'; -import { AvatarModalButtons } from './AvatarModalButtons.js'; -import { BetterAvatarBubble } from './BetterAvatarBubble.js'; -import type { LocalizerType } from '../types/Util.js'; -import { avatarDataToBytes } from '../util/avatarDataToBytes.js'; -import { createAvatarData } from '../util/createAvatarData.js'; +import * as grapheme from '../util/grapheme.std.js'; +import { AvatarColorPicker } from './AvatarColorPicker.dom.js'; +import { AvatarColors } from '../types/Colors.std.js'; +import type { AvatarDataType } from '../types/Avatar.std.js'; +import { AvatarModalButtons } from './AvatarModalButtons.dom.js'; +import { BetterAvatarBubble } from './BetterAvatarBubble.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { avatarDataToBytes } from '../util/avatarDataToBytes.dom.js'; +import { createAvatarData } from '../util/createAvatarData.std.js'; import { getFittedFontSize, getFontSizes, -} from '../util/avatarTextSizeCalculator.js'; +} from '../util/avatarTextSizeCalculator.std.js'; const { noop } = lodash; diff --git a/ts/components/AvatarUploadButton.stories.tsx b/ts/components/AvatarUploadButton.stories.tsx index b2d3d74ad3..5664b2338b 100644 --- a/ts/components/AvatarUploadButton.stories.tsx +++ b/ts/components/AvatarUploadButton.stories.tsx @@ -5,8 +5,8 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './AvatarUploadButton.js'; -import { AvatarUploadButton } from './AvatarUploadButton.js'; +import type { PropsType } from './AvatarUploadButton.dom.js'; +import { AvatarUploadButton } from './AvatarUploadButton.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/AvatarUploadButton.tsx b/ts/components/AvatarUploadButton.tsx index d243d9383b..d364ee6b30 100644 --- a/ts/components/AvatarUploadButton.tsx +++ b/ts/components/AvatarUploadButton.tsx @@ -5,8 +5,8 @@ import type { ChangeEventHandler } from 'react'; import React, { useEffect, useRef, useState } from 'react'; import lodash from 'lodash'; -import type { LocalizerType } from '../types/Util.js'; -import { processImageFile } from '../util/processImageFile.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { processImageFile } from '../util/processImageFile.dom.js'; const { noop } = lodash; diff --git a/ts/components/BackfillFailureModal.stories.tsx b/ts/components/BackfillFailureModal.stories.tsx index c5a802bfa6..b21b59521c 100644 --- a/ts/components/BackfillFailureModal.stories.tsx +++ b/ts/components/BackfillFailureModal.stories.tsx @@ -3,12 +3,12 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './BackfillFailureModal.js'; +import type { PropsType } from './BackfillFailureModal.dom.js'; import { BackfillFailureModal, BackfillFailureKind, -} from './BackfillFailureModal.js'; -import type { ComponentMeta } from '../storybook/types.js'; +} from './BackfillFailureModal.dom.js'; +import type { ComponentMeta } from '../storybook/types.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/BackfillFailureModal.tsx b/ts/components/BackfillFailureModal.tsx index 5814f5ca42..ee9a240208 100644 --- a/ts/components/BackfillFailureModal.tsx +++ b/ts/components/BackfillFailureModal.tsx @@ -3,10 +3,10 @@ import * as React from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { Modal } from './Modal.js'; -import { Button, ButtonVariant } from './Button.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { Modal } from './Modal.dom.js'; +import { Button, ButtonVariant } from './Button.dom.js'; export enum BackfillFailureKind { Timeout = 'Timeout', diff --git a/ts/components/BackupMediaDownloadCancelConfirmationDialog.tsx b/ts/components/BackupMediaDownloadCancelConfirmationDialog.tsx index bdd139bce1..41ee499a85 100644 --- a/ts/components/BackupMediaDownloadCancelConfirmationDialog.tsx +++ b/ts/components/BackupMediaDownloadCancelConfirmationDialog.tsx @@ -3,9 +3,9 @@ import React from 'react'; -import { ConfirmationDialog } from './ConfirmationDialog.js'; -import type { LocalizerType } from '../types/I18N.js'; -import { I18n } from './I18n.js'; +import { ConfirmationDialog } from './ConfirmationDialog.dom.js'; +import type { LocalizerType } from '../types/I18N.std.js'; +import { I18n } from './I18n.dom.js'; const BACKUP_AND_RESTORE_SUPPORT_PAGE = 'https://support.signal.org/hc/articles/360007059752-Backup-and-Restore-Messages'; diff --git a/ts/components/BackupMediaDownloadProgress.stories.tsx b/ts/components/BackupMediaDownloadProgress.stories.tsx index 29b1804b9c..dff2e74181 100644 --- a/ts/components/BackupMediaDownloadProgress.stories.tsx +++ b/ts/components/BackupMediaDownloadProgress.stories.tsx @@ -5,9 +5,9 @@ import React, { type ComponentProps } from 'react'; import type { Meta } from '@storybook/react'; import { action } from '@storybook/addon-actions'; -import { BackupMediaDownloadProgress } from './BackupMediaDownloadProgress.js'; -import { KIBIBYTE } from '../types/AttachmentSize.js'; -import { WidthBreakpoint } from './_util.js'; +import { BackupMediaDownloadProgress } from './BackupMediaDownloadProgress.dom.js'; +import { KIBIBYTE } from '../types/AttachmentSize.std.js'; +import { WidthBreakpoint } from './_util.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/BackupMediaDownloadProgress.tsx b/ts/components/BackupMediaDownloadProgress.tsx index 90c34c6520..92ef8ce30d 100644 --- a/ts/components/BackupMediaDownloadProgress.tsx +++ b/ts/components/BackupMediaDownloadProgress.tsx @@ -3,13 +3,13 @@ import React, { useState } from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import { formatFileSize } from '../util/formatFileSize.js'; -import { SpinnerV2 } from './SpinnerV2.js'; -import { ContextMenu } from './ContextMenu.js'; -import { BackupMediaDownloadCancelConfirmationDialog } from './BackupMediaDownloadCancelConfirmationDialog.js'; -import { LeftPaneDialog } from './LeftPaneDialog.js'; -import { WidthBreakpoint } from './_util.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { formatFileSize } from '../util/formatFileSize.std.js'; +import { SpinnerV2 } from './SpinnerV2.dom.js'; +import { ContextMenu } from './ContextMenu.dom.js'; +import { BackupMediaDownloadCancelConfirmationDialog } from './BackupMediaDownloadCancelConfirmationDialog.dom.js'; +import { LeftPaneDialog } from './LeftPaneDialog.dom.js'; +import { WidthBreakpoint } from './_util.std.js'; export type PropsType = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/BackupMediaDownloadProgressSettings.tsx b/ts/components/BackupMediaDownloadProgressSettings.tsx index a5b3acc13f..ab8c9b9bb4 100644 --- a/ts/components/BackupMediaDownloadProgressSettings.tsx +++ b/ts/components/BackupMediaDownloadProgressSettings.tsx @@ -3,12 +3,12 @@ import React, { useState } from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import { formatFileSize } from '../util/formatFileSize.js'; -import { roundFractionForProgressBar } from '../util/numbers.js'; -import { ProgressBar } from './ProgressBar.js'; -import { Button, ButtonSize, ButtonVariant } from './Button.js'; -import { BackupMediaDownloadCancelConfirmationDialog } from './BackupMediaDownloadCancelConfirmationDialog.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { formatFileSize } from '../util/formatFileSize.std.js'; +import { roundFractionForProgressBar } from '../util/numbers.std.js'; +import { ProgressBar } from './ProgressBar.dom.js'; +import { Button, ButtonSize, ButtonVariant } from './Button.dom.js'; +import { BackupMediaDownloadCancelConfirmationDialog } from './BackupMediaDownloadCancelConfirmationDialog.dom.js'; export type PropsType = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/BadgeCarouselIndex.tsx b/ts/components/BadgeCarouselIndex.tsx index d8332350ac..97ac558481 100644 --- a/ts/components/BadgeCarouselIndex.tsx +++ b/ts/components/BadgeCarouselIndex.tsx @@ -5,7 +5,7 @@ import React from 'react'; import classNames from 'classnames'; import lodash from 'lodash'; -import { strictAssert } from '../util/assert.js'; +import { strictAssert } from '../util/assert.std.js'; const { times } = lodash; diff --git a/ts/components/BadgeDescription.stories.tsx b/ts/components/BadgeDescription.stories.tsx index 507b79125b..cff2bed749 100644 --- a/ts/components/BadgeDescription.stories.tsx +++ b/ts/components/BadgeDescription.stories.tsx @@ -4,8 +4,8 @@ import React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './BadgeDescription.js'; -import { BadgeDescription } from './BadgeDescription.js'; +import type { Props } from './BadgeDescription.dom.js'; +import { BadgeDescription } from './BadgeDescription.dom.js'; export default { title: 'Components/BadgeDescription', diff --git a/ts/components/BadgeDescription.tsx b/ts/components/BadgeDescription.tsx index 7144a19c72..593b3c00e0 100644 --- a/ts/components/BadgeDescription.tsx +++ b/ts/components/BadgeDescription.tsx @@ -3,7 +3,7 @@ import type { ReactChild, ReactElement } from 'react'; import React from 'react'; -import { ContactName } from './conversation/ContactName.js'; +import { ContactName } from './conversation/ContactName.dom.js'; export type Props = Readonly<{ firstName?: string; diff --git a/ts/components/BadgeDialog.stories.tsx b/ts/components/BadgeDialog.stories.tsx index 9dfa865c7b..52b11d70c6 100644 --- a/ts/components/BadgeDialog.stories.tsx +++ b/ts/components/BadgeDialog.stories.tsx @@ -6,11 +6,14 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { getFakeBadge, getFakeBadges } from '../test-helpers/getFakeBadge.js'; -import { repeat, zipObject } from '../util/iterables.js'; -import { BadgeImageTheme } from '../badges/BadgeImageTheme.js'; -import type { PropsType } from './BadgeDialog.js'; -import { BadgeDialog } from './BadgeDialog.js'; +import { + getFakeBadge, + getFakeBadges, +} from '../test-helpers/getFakeBadge.std.js'; +import { repeat, zipObject } from '../util/iterables.std.js'; +import { BadgeImageTheme } from '../badges/BadgeImageTheme.std.js'; +import type { PropsType } from './BadgeDialog.dom.js'; +import { BadgeDialog } from './BadgeDialog.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/BadgeDialog.tsx b/ts/components/BadgeDialog.tsx index c2d885af52..d16321c8cc 100644 --- a/ts/components/BadgeDialog.tsx +++ b/ts/components/BadgeDialog.tsx @@ -4,16 +4,16 @@ import React, { useEffect, useState } from 'react'; import classNames from 'classnames'; -import { strictAssert } from '../util/assert.js'; -import type { LocalizerType } from '../types/Util.js'; -import type { BadgeType } from '../badges/types.js'; -import { BadgeCategory } from '../badges/BadgeCategory.js'; -import { Modal } from './Modal.js'; -import { Button, ButtonSize } from './Button.js'; -import { BadgeDescription } from './BadgeDescription.js'; -import { BadgeImage } from './BadgeImage.js'; -import { BadgeCarouselIndex } from './BadgeCarouselIndex.js'; -import { BadgeSustainerInstructionsDialog } from './BadgeSustainerInstructionsDialog.js'; +import { strictAssert } from '../util/assert.std.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import type { BadgeType } from '../badges/types.std.js'; +import { BadgeCategory } from '../badges/BadgeCategory.std.js'; +import { Modal } from './Modal.dom.js'; +import { Button, ButtonSize } from './Button.dom.js'; +import { BadgeDescription } from './BadgeDescription.dom.js'; +import { BadgeImage } from './BadgeImage.dom.js'; +import { BadgeCarouselIndex } from './BadgeCarouselIndex.dom.js'; +import { BadgeSustainerInstructionsDialog } from './BadgeSustainerInstructionsDialog.dom.js'; export type PropsType = Readonly<{ areWeASubscriber: boolean; diff --git a/ts/components/BadgeImage.tsx b/ts/components/BadgeImage.tsx index 204bfd9818..b650ae589a 100644 --- a/ts/components/BadgeImage.tsx +++ b/ts/components/BadgeImage.tsx @@ -3,10 +3,10 @@ import React from 'react'; -import type { BadgeType } from '../badges/types.js'; -import { Spinner } from './Spinner.js'; -import { getBadgeImageFileLocalPath } from '../badges/getBadgeImageFileLocalPath.js'; -import { BadgeImageTheme } from '../badges/BadgeImageTheme.js'; +import type { BadgeType } from '../badges/types.std.js'; +import { Spinner } from './Spinner.dom.js'; +import { getBadgeImageFileLocalPath } from '../badges/getBadgeImageFileLocalPath.std.js'; +import { BadgeImageTheme } from '../badges/BadgeImageTheme.std.js'; export function BadgeImage({ badge, diff --git a/ts/components/BadgeSustainerInstructionsDialog.tsx b/ts/components/BadgeSustainerInstructionsDialog.tsx index a3460bbb54..7f8fdc6100 100644 --- a/ts/components/BadgeSustainerInstructionsDialog.tsx +++ b/ts/components/BadgeSustainerInstructionsDialog.tsx @@ -3,8 +3,8 @@ import type { ReactElement } from 'react'; import React from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import { Modal } from './Modal.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { Modal } from './Modal.dom.js'; export function BadgeSustainerInstructionsDialog({ i18n, diff --git a/ts/components/BetterAvatar.stories.tsx b/ts/components/BetterAvatar.stories.tsx index 06a594ab1e..b1f30943ab 100644 --- a/ts/components/BetterAvatar.stories.tsx +++ b/ts/components/BetterAvatar.stories.tsx @@ -6,11 +6,11 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { AvatarColors } from '../types/Colors.js'; -import { GroupAvatarIcons, PersonalAvatarIcons } from '../types/Avatar.js'; -import type { PropsType } from './BetterAvatar.js'; -import { BetterAvatar } from './BetterAvatar.js'; -import { createAvatarData } from '../util/createAvatarData.js'; +import { AvatarColors } from '../types/Colors.std.js'; +import { GroupAvatarIcons, PersonalAvatarIcons } from '../types/Avatar.std.js'; +import type { PropsType } from './BetterAvatar.dom.js'; +import { BetterAvatar } from './BetterAvatar.dom.js'; +import { createAvatarData } from '../util/createAvatarData.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/BetterAvatar.tsx b/ts/components/BetterAvatar.tsx index 5bfc3b5137..d0af136bff 100644 --- a/ts/components/BetterAvatar.tsx +++ b/ts/components/BetterAvatar.tsx @@ -4,11 +4,11 @@ import type { MouseEvent } from 'react'; import React, { useEffect, useState } from 'react'; import lodash from 'lodash'; -import type { AvatarDataType } from '../types/Avatar.js'; -import { BetterAvatarBubble } from './BetterAvatarBubble.js'; -import type { LocalizerType } from '../types/Util.js'; -import { Spinner } from './Spinner.js'; -import { avatarDataToBytes } from '../util/avatarDataToBytes.js'; +import type { AvatarDataType } from '../types/Avatar.std.js'; +import { BetterAvatarBubble } from './BetterAvatarBubble.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { Spinner } from './Spinner.dom.js'; +import { avatarDataToBytes } from '../util/avatarDataToBytes.dom.js'; const { noop } = lodash; diff --git a/ts/components/BetterAvatarBubble.stories.tsx b/ts/components/BetterAvatarBubble.stories.tsx index c2f0b3e8a0..822c26e97d 100644 --- a/ts/components/BetterAvatarBubble.stories.tsx +++ b/ts/components/BetterAvatarBubble.stories.tsx @@ -6,9 +6,9 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { AvatarColors } from '../types/Colors.js'; -import type { PropsType } from './BetterAvatarBubble.js'; -import { BetterAvatarBubble } from './BetterAvatarBubble.js'; +import { AvatarColors } from '../types/Colors.std.js'; +import type { PropsType } from './BetterAvatarBubble.dom.js'; +import { BetterAvatarBubble } from './BetterAvatarBubble.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/BetterAvatarBubble.tsx b/ts/components/BetterAvatarBubble.tsx index 2fd6b8ce4a..8389ec30a6 100644 --- a/ts/components/BetterAvatarBubble.tsx +++ b/ts/components/BetterAvatarBubble.tsx @@ -5,8 +5,8 @@ import type { CSSProperties, MouseEvent, ReactNode } from 'react'; import React from 'react'; import classNames from 'classnames'; -import type { AvatarColorType } from '../types/Colors.js'; -import type { LocalizerType } from '../types/Util.js'; +import type { AvatarColorType } from '../types/Colors.std.js'; +import type { LocalizerType } from '../types/Util.std.js'; export type PropsType = { children?: ReactNode; diff --git a/ts/components/BrandedQRCode.stories.tsx b/ts/components/BrandedQRCode.stories.tsx index dda5968733..4fc7712aca 100644 --- a/ts/components/BrandedQRCode.stories.tsx +++ b/ts/components/BrandedQRCode.stories.tsx @@ -3,8 +3,8 @@ import React from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './BrandedQRCode.js'; -import { BrandedQRCode } from './BrandedQRCode.js'; +import type { PropsType } from './BrandedQRCode.dom.js'; +import { BrandedQRCode } from './BrandedQRCode.dom.js'; export default { title: 'Components/BrandedQRCode', diff --git a/ts/components/Button.stories.tsx b/ts/components/Button.stories.tsx index 4b62b81f46..b4d0a25eb9 100644 --- a/ts/components/Button.stories.tsx +++ b/ts/components/Button.stories.tsx @@ -4,8 +4,8 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './Button.js'; -import { Button, ButtonSize, ButtonVariant } from './Button.js'; +import type { PropsType } from './Button.dom.js'; +import { Button, ButtonSize, ButtonVariant } from './Button.dom.js'; export default { title: 'Components/Button', diff --git a/ts/components/Button.tsx b/ts/components/Button.tsx index 7f3ff15709..4dd7aafba1 100644 --- a/ts/components/Button.tsx +++ b/ts/components/Button.tsx @@ -10,9 +10,9 @@ import type { import React from 'react'; import classNames from 'classnames'; -import type { Theme } from '../util/theme.js'; -import { assertDev } from '../util/assert.js'; -import { themeClassName } from '../util/theme.js'; +import type { Theme } from '../util/theme.std.js'; +import { assertDev } from '../util/assert.std.js'; +import { themeClassName } from '../util/theme.std.js'; export enum ButtonSize { Large, diff --git a/ts/components/CallLinkAddNameModal.stories.tsx b/ts/components/CallLinkAddNameModal.stories.tsx index ba1b069a9a..abf495aa96 100644 --- a/ts/components/CallLinkAddNameModal.stories.tsx +++ b/ts/components/CallLinkAddNameModal.stories.tsx @@ -3,10 +3,10 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { CallLinkAddNameModalProps } from './CallLinkAddNameModal.js'; -import { CallLinkAddNameModal } from './CallLinkAddNameModal.js'; -import type { ComponentMeta } from '../storybook/types.js'; -import { FAKE_CALL_LINK_WITH_ADMIN_KEY } from '../test-helpers/fakeCallLink.js'; +import type { CallLinkAddNameModalProps } from './CallLinkAddNameModal.dom.js'; +import { CallLinkAddNameModal } from './CallLinkAddNameModal.dom.js'; +import type { ComponentMeta } from '../storybook/types.std.js'; +import { FAKE_CALL_LINK_WITH_ADMIN_KEY } from '../test-helpers/fakeCallLink.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CallLinkAddNameModal.tsx b/ts/components/CallLinkAddNameModal.tsx index 76257ea341..a0226e7d4d 100644 --- a/ts/components/CallLinkAddNameModal.tsx +++ b/ts/components/CallLinkAddNameModal.tsx @@ -2,17 +2,17 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useCallback, useMemo, useState } from 'react'; import { v4 as generateUuid } from 'uuid'; -import { Modal } from './Modal.js'; -import type { LocalizerType } from '../types/I18N.js'; -import { Button, ButtonVariant } from './Button.js'; -import { Avatar, AvatarSize } from './Avatar.js'; -import { Input } from './Input.js'; +import { Modal } from './Modal.dom.js'; +import type { LocalizerType } from '../types/I18N.std.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import { Avatar, AvatarSize } from './Avatar.dom.js'; +import { Input } from './Input.dom.js'; import { CallLinkNameMaxByteLength, CallLinkNameMaxLength, type CallLinkType, -} from '../types/CallLink.js'; -import { getColorForCallLink } from '../util/getColorForCallLink.js'; +} from '../types/CallLink.std.js'; +import { getColorForCallLink } from '../util/getColorForCallLink.std.js'; export type CallLinkAddNameModalProps = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/CallLinkDetails.stories.tsx b/ts/components/CallLinkDetails.stories.tsx index 519bc2027c..c2a194ea93 100644 --- a/ts/components/CallLinkDetails.stories.tsx +++ b/ts/components/CallLinkDetails.stories.tsx @@ -2,14 +2,14 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { ComponentMeta } from '../storybook/types.js'; -import type { CallLinkDetailsProps } from './CallLinkDetails.js'; -import { CallLinkDetails } from './CallLinkDetails.js'; +import type { ComponentMeta } from '../storybook/types.std.js'; +import type { CallLinkDetailsProps } from './CallLinkDetails.dom.js'; +import { CallLinkDetails } from './CallLinkDetails.dom.js'; import { FAKE_CALL_LINK, FAKE_CALL_LINK_WITH_ADMIN_KEY, -} from '../test-helpers/fakeCallLink.js'; -import { getFakeCallLinkHistoryGroup } from '../test-helpers/getFakeCallHistoryGroup.js'; +} from '../test-helpers/fakeCallLink.std.js'; +import { getFakeCallLinkHistoryGroup } from '../test-helpers/getFakeCallHistoryGroup.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CallLinkDetails.tsx b/ts/components/CallLinkDetails.tsx index 0b3aa9afae..92d8ed8240 100644 --- a/ts/components/CallLinkDetails.tsx +++ b/ts/components/CallLinkDetails.tsx @@ -2,28 +2,31 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useState } from 'react'; import classNames from 'classnames'; -import type { CallHistoryGroup } from '../types/CallDisposition.js'; -import type { LocalizerType } from '../types/I18N.js'; -import { CallHistoryGroupPanelSection } from './conversation/conversation-details/CallHistoryGroupPanelSection.js'; -import { PanelSection } from './conversation/conversation-details/PanelSection.js'; +import type { CallHistoryGroup } from '../types/CallDisposition.std.js'; +import type { LocalizerType } from '../types/I18N.std.js'; +import { CallHistoryGroupPanelSection } from './conversation/conversation-details/CallHistoryGroupPanelSection.dom.js'; +import { PanelSection } from './conversation/conversation-details/PanelSection.dom.js'; import { ConversationDetailsIcon, IconType, -} from './conversation/conversation-details/ConversationDetailsIcon.js'; -import { PanelRow } from './conversation/conversation-details/PanelRow.js'; -import type { CallLinkRestrictions, CallLinkType } from '../types/CallLink.js'; -import { linkCallRoute } from '../util/signalRoutes.js'; -import { drop } from '../util/drop.js'; -import { Avatar, AvatarSize } from './Avatar.js'; -import { Button, ButtonSize, ButtonVariant } from './Button.js'; -import { copyCallLink } from '../util/copyLinksWithToast.js'; -import { getColorForCallLink } from '../util/getColorForCallLink.js'; -import { isCallLinkAdmin } from '../types/CallLink.js'; -import { CallLinkRestrictionsSelect } from './CallLinkRestrictionsSelect.js'; -import { ConfirmationDialog } from './ConfirmationDialog.js'; -import { InAnotherCallTooltip } from './conversation/InAnotherCallTooltip.js'; -import { offsetDistanceModifier } from '../util/popperUtil.js'; -import { Tooltip, TooltipPlacement } from './Tooltip.js'; +} from './conversation/conversation-details/ConversationDetailsIcon.dom.js'; +import { PanelRow } from './conversation/conversation-details/PanelRow.dom.js'; +import type { + CallLinkRestrictions, + CallLinkType, +} from '../types/CallLink.std.js'; +import { linkCallRoute } from '../util/signalRoutes.std.js'; +import { drop } from '../util/drop.std.js'; +import { Avatar, AvatarSize } from './Avatar.dom.js'; +import { Button, ButtonSize, ButtonVariant } from './Button.dom.js'; +import { copyCallLink } from '../util/copyLinksWithToast.dom.js'; +import { getColorForCallLink } from '../util/getColorForCallLink.std.js'; +import { isCallLinkAdmin } from '../types/CallLink.std.js'; +import { CallLinkRestrictionsSelect } from './CallLinkRestrictionsSelect.dom.js'; +import { ConfirmationDialog } from './ConfirmationDialog.dom.js'; +import { InAnotherCallTooltip } from './conversation/InAnotherCallTooltip.dom.js'; +import { offsetDistanceModifier } from '../util/popperUtil.std.js'; +import { Tooltip, TooltipPlacement } from './Tooltip.dom.js'; function toUrlWithoutProtocol(url: URL): string { return `${url.hostname}${url.pathname}${url.search}${url.hash}`; diff --git a/ts/components/CallLinkEditModal.stories.tsx b/ts/components/CallLinkEditModal.stories.tsx index efc14258fe..2b38fc40a4 100644 --- a/ts/components/CallLinkEditModal.stories.tsx +++ b/ts/components/CallLinkEditModal.stories.tsx @@ -3,10 +3,10 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { CallLinkEditModalProps } from './CallLinkEditModal.js'; -import { CallLinkEditModal } from './CallLinkEditModal.js'; -import type { ComponentMeta } from '../storybook/types.js'; -import { FAKE_CALL_LINK_WITH_ADMIN_KEY } from '../test-helpers/fakeCallLink.js'; +import type { CallLinkEditModalProps } from './CallLinkEditModal.dom.js'; +import { CallLinkEditModal } from './CallLinkEditModal.dom.js'; +import type { ComponentMeta } from '../storybook/types.std.js'; +import { FAKE_CALL_LINK_WITH_ADMIN_KEY } from '../test-helpers/fakeCallLink.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CallLinkEditModal.tsx b/ts/components/CallLinkEditModal.tsx index 02fe2985e0..641b90fbca 100644 --- a/ts/components/CallLinkEditModal.tsx +++ b/ts/components/CallLinkEditModal.tsx @@ -4,15 +4,18 @@ import type { ReactNode } from 'react'; import React, { useMemo, useState } from 'react'; import { v4 as generateUuid } from 'uuid'; -import { Modal } from './Modal.js'; -import type { LocalizerType } from '../types/I18N.js'; -import type { CallLinkRestrictions, CallLinkType } from '../types/CallLink.js'; -import { linkCallRoute } from '../util/signalRoutes.js'; -import { Button, ButtonSize, ButtonVariant } from './Button.js'; -import { Avatar, AvatarSize } from './Avatar.js'; -import { getColorForCallLink } from '../util/getColorForCallLink.js'; -import { CallLinkRestrictionsSelect } from './CallLinkRestrictionsSelect.js'; -import { InAnotherCallTooltip } from './conversation/InAnotherCallTooltip.js'; +import { Modal } from './Modal.dom.js'; +import type { LocalizerType } from '../types/I18N.std.js'; +import type { + CallLinkRestrictions, + CallLinkType, +} from '../types/CallLink.std.js'; +import { linkCallRoute } from '../util/signalRoutes.std.js'; +import { Button, ButtonSize, ButtonVariant } from './Button.dom.js'; +import { Avatar, AvatarSize } from './Avatar.dom.js'; +import { getColorForCallLink } from '../util/getColorForCallLink.std.js'; +import { CallLinkRestrictionsSelect } from './CallLinkRestrictionsSelect.dom.js'; +import { InAnotherCallTooltip } from './conversation/InAnotherCallTooltip.dom.js'; const CallLinkEditModalRowIconClasses = { Edit: 'CallLinkEditModal__RowIcon--Edit', diff --git a/ts/components/CallLinkPendingParticipantModal.stories.tsx b/ts/components/CallLinkPendingParticipantModal.stories.tsx index 0de42ac74b..83f42b4cef 100644 --- a/ts/components/CallLinkPendingParticipantModal.stories.tsx +++ b/ts/components/CallLinkPendingParticipantModal.stories.tsx @@ -3,10 +3,10 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { CallLinkPendingParticipantModalProps } from './CallLinkPendingParticipantModal.js'; -import { CallLinkPendingParticipantModal } from './CallLinkPendingParticipantModal.js'; -import type { ComponentMeta } from '../storybook/types.js'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; +import type { CallLinkPendingParticipantModalProps } from './CallLinkPendingParticipantModal.dom.js'; +import { CallLinkPendingParticipantModal } from './CallLinkPendingParticipantModal.dom.js'; +import type { ComponentMeta } from '../storybook/types.std.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CallLinkPendingParticipantModal.tsx b/ts/components/CallLinkPendingParticipantModal.tsx index 688c8265d5..51aa63822c 100644 --- a/ts/components/CallLinkPendingParticipantModal.tsx +++ b/ts/components/CallLinkPendingParticipantModal.tsx @@ -2,17 +2,17 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useCallback, useEffect, useMemo } from 'react'; -import { Modal } from './Modal.js'; -import type { LocalizerType } from '../types/I18N.js'; -import { Avatar, AvatarSize } from './Avatar.js'; -import type { PendingUserActionPayloadType } from '../state/ducks/calling.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import { InContactsIcon } from './InContactsIcon.js'; -import { isInSystemContacts } from '../util/isInSystemContacts.js'; -import { ThemeType } from '../types/Util.js'; -import { Theme } from '../util/theme.js'; -import { UserText } from './UserText.js'; -import { SharedGroupNames } from './SharedGroupNames.js'; +import { Modal } from './Modal.dom.js'; +import type { LocalizerType } from '../types/I18N.std.js'; +import { Avatar, AvatarSize } from './Avatar.dom.js'; +import type { PendingUserActionPayloadType } from '../state/ducks/calling.preload.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import { InContactsIcon } from './InContactsIcon.dom.js'; +import { isInSystemContacts } from '../util/isInSystemContacts.std.js'; +import { ThemeType } from '../types/Util.std.js'; +import { Theme } from '../util/theme.std.js'; +import { UserText } from './UserText.dom.js'; +import { SharedGroupNames } from './SharedGroupNames.dom.js'; export type CallLinkPendingParticipantModalProps = { readonly i18n: LocalizerType; diff --git a/ts/components/CallLinkRestrictionsSelect.tsx b/ts/components/CallLinkRestrictionsSelect.tsx index a07cb5a5dc..0bb5ba4bf9 100644 --- a/ts/components/CallLinkRestrictionsSelect.tsx +++ b/ts/components/CallLinkRestrictionsSelect.tsx @@ -4,9 +4,9 @@ import React from 'react'; import { CallLinkRestrictions, toCallLinkRestrictions, -} from '../types/CallLink.js'; -import type { LocalizerType } from '../types/I18N.js'; -import { Select } from './Select.js'; +} from '../types/CallLink.std.js'; +import type { LocalizerType } from '../types/I18N.std.js'; +import { Select } from './Select.dom.js'; export type CallLinkRestrictionsSelectProps = Readonly<{ disabled?: boolean; diff --git a/ts/components/CallManager.stories.tsx b/ts/components/CallManager.stories.tsx index 2001f82153..f5f03d11a7 100644 --- a/ts/components/CallManager.stories.tsx +++ b/ts/components/CallManager.stories.tsx @@ -4,35 +4,35 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './CallManager.js'; -import { CallManager } from './CallManager.js'; +import type { PropsType } from './CallManager.dom.js'; +import { CallManager } from './CallManager.dom.js'; import { CallEndedReason, CallState, CallViewMode, GroupCallConnectionState, GroupCallJoinState, -} from '../types/Calling.js'; -import { CallMode } from '../types/CallDisposition.js'; +} from '../types/Calling.std.js'; +import { CallMode } from '../types/CallDisposition.std.js'; import type { ActiveGroupCallType, GroupCallRemoteParticipantType, -} from '../types/Calling.js'; +} from '../types/Calling.std.js'; import type { ConversationType, ConversationTypeType, -} from '../state/ducks/conversations.js'; -import { AvatarColors } from '../types/Colors.js'; -import { generateAci } from '../types/ServiceId.js'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; -import { fakeGetGroupCallVideoFrameSource } from '../test-helpers/fakeGetGroupCallVideoFrameSource.js'; -import { StorySendMode } from '../types/Stories.js'; +} from '../state/ducks/conversations.preload.js'; +import { AvatarColors } from '../types/Colors.std.js'; +import { generateAci } from '../types/ServiceId.std.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.std.js'; +import { fakeGetGroupCallVideoFrameSource } from '../test-helpers/fakeGetGroupCallVideoFrameSource.std.js'; +import { StorySendMode } from '../types/Stories.std.js'; import { FAKE_CALL_LINK, FAKE_CALL_LINK_WITH_ADMIN_KEY, getDefaultCallLinkConversation, -} from '../test-helpers/fakeCallLink.js'; -import { allRemoteParticipants } from './CallScreen.stories.js'; +} from '../test-helpers/fakeCallLink.std.js'; +import { allRemoteParticipants } from './CallScreen.dom.stories.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CallManager.tsx b/ts/components/CallManager.tsx index 6ccd41dbb7..3558bfe2f6 100644 --- a/ts/components/CallManager.tsx +++ b/ts/components/CallManager.tsx @@ -4,26 +4,26 @@ import React, { useCallback, useEffect } from 'react'; import lodash from 'lodash'; import type { VideoFrameSource } from '@signalapp/ringrtc'; -import { CallNeedPermissionScreen } from './CallNeedPermissionScreen.js'; -import { CallScreen } from './CallScreen.js'; -import { CallingLobby } from './CallingLobby.js'; -import { CallingParticipantsList } from './CallingParticipantsList.js'; -import { CallingSelectPresentingSourcesModal } from './CallingSelectPresentingSourcesModal.js'; -import { CallingPip } from './CallingPip.js'; -import { IncomingCallBar } from './IncomingCallBar.js'; +import { CallNeedPermissionScreen } from './CallNeedPermissionScreen.dom.js'; +import { CallScreen } from './CallScreen.dom.js'; +import { CallingLobby } from './CallingLobby.dom.js'; +import { CallingParticipantsList } from './CallingParticipantsList.dom.js'; +import { CallingSelectPresentingSourcesModal } from './CallingSelectPresentingSourcesModal.dom.js'; +import { CallingPip } from './CallingPip.dom.js'; +import { IncomingCallBar } from './IncomingCallBar.dom.js'; import type { ActiveCallType, CallViewMode, GroupCallConnectionState, GroupCallVideoRequest, -} from '../types/Calling.js'; +} from '../types/Calling.std.js'; import { CallEndedReason, CallState, GroupCallJoinState, -} from '../types/Calling.js'; -import { CallMode } from '../types/CallDisposition.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; +} from '../types/Calling.std.js'; +import { CallMode } from '../types/CallDisposition.std.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; import type { AcceptCallType, BatchUserActionPayloadType, @@ -40,25 +40,25 @@ import type { SetLocalVideoType, SetRendererCanvasType, StartCallType, -} from '../state/ducks/calling.js'; -import { CallLinkRestrictions } from '../types/CallLink.js'; -import type { CallLinkType } from '../types/CallLink.js'; -import type { LocalizerType } from '../types/Util.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { CallingToastProvider } from './CallingToast.js'; -import type { SmartReactionPicker } from '../state/smart/ReactionPicker.js'; -import { createLogger } from '../logging/log.js'; -import { isGroupOrAdhocActiveCall } from '../util/isGroupOrAdhocCall.js'; -import { CallingAdhocCallInfo } from './CallingAdhocCallInfo.js'; -import { callLinkRootKeyToUrl } from '../util/callLinkRootKeyToUrl.js'; -import { usePrevious } from '../hooks/usePrevious.js'; -import { copyCallLink } from '../util/copyLinksWithToast.js'; +} from '../state/ducks/calling.preload.js'; +import { CallLinkRestrictions } from '../types/CallLink.std.js'; +import type { CallLinkType } from '../types/CallLink.std.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { CallingToastProvider } from './CallingToast.dom.js'; +import type { SmartReactionPicker } from '../state/smart/ReactionPicker.dom.js'; +import { createLogger } from '../logging/log.std.js'; +import { isGroupOrAdhocActiveCall } from '../util/isGroupOrAdhocCall.std.js'; +import { CallingAdhocCallInfo } from './CallingAdhocCallInfo.dom.js'; +import { callLinkRootKeyToUrl } from '../util/callLinkRootKeyToUrl.std.js'; +import { usePrevious } from '../hooks/usePrevious.std.js'; +import { copyCallLink } from '../util/copyLinksWithToast.dom.js'; import { redactNotificationProfileId, shouldNotify, -} from '../types/NotificationProfile.js'; -import type { NotificationProfileType } from '../types/NotificationProfile.js'; -import { strictAssert } from '../util/assert.js'; +} from '../types/NotificationProfile.std.js'; +import type { NotificationProfileType } from '../types/NotificationProfile.std.js'; +import { strictAssert } from '../util/assert.std.js'; const { noop } = lodash; diff --git a/ts/components/CallNeedPermissionScreen.stories.tsx b/ts/components/CallNeedPermissionScreen.stories.tsx index 72e1cdb2ec..03916ef9de 100644 --- a/ts/components/CallNeedPermissionScreen.stories.tsx +++ b/ts/components/CallNeedPermissionScreen.stories.tsx @@ -3,10 +3,10 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { ComponentMeta } from '../storybook/types.js'; -import type { Props } from './CallNeedPermissionScreen.js'; -import { CallNeedPermissionScreen } from './CallNeedPermissionScreen.js'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; +import type { ComponentMeta } from '../storybook/types.std.js'; +import type { Props } from './CallNeedPermissionScreen.dom.js'; +import { CallNeedPermissionScreen } from './CallNeedPermissionScreen.dom.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CallNeedPermissionScreen.tsx b/ts/components/CallNeedPermissionScreen.tsx index 812491c56f..95baa6c5c1 100644 --- a/ts/components/CallNeedPermissionScreen.tsx +++ b/ts/components/CallNeedPermissionScreen.tsx @@ -2,12 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useRef, useEffect } from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import { AvatarColors } from '../types/Colors.js'; -import { Avatar, AvatarSize } from './Avatar.js'; -import { I18n } from './I18n.js'; -import { ContactName } from './conversation/ContactName.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { AvatarColors } from '../types/Colors.std.js'; +import { Avatar, AvatarSize } from './Avatar.dom.js'; +import { I18n } from './I18n.dom.js'; +import { ContactName } from './conversation/ContactName.dom.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; export type Props = { conversation: Pick< diff --git a/ts/components/CallParticipantCount.tsx b/ts/components/CallParticipantCount.tsx index 500b1f82b0..cec1af2d14 100644 --- a/ts/components/CallParticipantCount.tsx +++ b/ts/components/CallParticipantCount.tsx @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import { CallMode } from '../types/CallDisposition.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { CallMode } from '../types/CallDisposition.std.js'; export type PropsType = { callMode: CallMode.Group | CallMode.Adhoc; diff --git a/ts/components/CallReactionBurst.tsx b/ts/components/CallReactionBurst.tsx index 67b891cc04..66f6857e0a 100644 --- a/ts/components/CallReactionBurst.tsx +++ b/ts/components/CallReactionBurst.tsx @@ -12,8 +12,8 @@ import React, { } from 'react'; import { createPortal } from 'react-dom'; import { v4 as uuid } from 'uuid'; -import { useIsMounted } from '../hooks/useIsMounted.js'; -import { CallReactionBurstEmoji } from './CallReactionBurstEmoji.js'; +import { useIsMounted } from '../hooks/useIsMounted.std.js'; +import { CallReactionBurstEmoji } from './CallReactionBurstEmoji.dom.js'; const LIFETIME = 3000; diff --git a/ts/components/CallReactionBurstEmoji.tsx b/ts/components/CallReactionBurstEmoji.tsx index 91d16648f6..8f3c8aeada 100644 --- a/ts/components/CallReactionBurstEmoji.tsx +++ b/ts/components/CallReactionBurstEmoji.tsx @@ -5,8 +5,8 @@ import React from 'react'; import { animated, useSpring } from '@react-spring/web'; import lodash from 'lodash'; import { v4 as uuid } from 'uuid'; -import { Emojify } from './conversation/Emojify.js'; -import { useReducedMotion } from '../hooks/useReducedMotion.js'; +import { Emojify } from './conversation/Emojify.dom.js'; +import { useReducedMotion } from '../hooks/useReducedMotion.dom.js'; const { random } = lodash; diff --git a/ts/components/CallScreen.stories.tsx b/ts/components/CallScreen.stories.tsx index 42418c3f7d..20ce81eab7 100644 --- a/ts/components/CallScreen.stories.tsx +++ b/ts/components/CallScreen.stories.tsx @@ -11,30 +11,30 @@ import type { ActiveGroupCallType, GroupCallRemoteParticipantType, ObservedRemoteMuteType, -} from '../types/Calling.js'; +} from '../types/Calling.std.js'; import { CallViewMode, CallState, GroupCallConnectionState, GroupCallJoinState, -} from '../types/Calling.js'; -import { CallMode } from '../types/CallDisposition.js'; -import { generateAci } from '../types/ServiceId.js'; -import type { AciString } from '../types/ServiceId.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import { AvatarColors } from '../types/Colors.js'; -import type { PropsType } from './CallScreen.js'; -import { CallScreen as UnwrappedCallScreen } from './CallScreen.js'; -import { DEFAULT_PREFERRED_REACTION_EMOJI } from '../reactions/constants.js'; -import { missingCaseError } from '../util/missingCaseError.js'; +} from '../types/Calling.std.js'; +import { CallMode } from '../types/CallDisposition.std.js'; +import { generateAci } from '../types/ServiceId.std.js'; +import type { AciString } from '../types/ServiceId.std.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import { AvatarColors } from '../types/Colors.std.js'; +import type { PropsType } from './CallScreen.dom.js'; +import { CallScreen as UnwrappedCallScreen } from './CallScreen.dom.js'; +import { DEFAULT_PREFERRED_REACTION_EMOJI } from '../reactions/constants.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; import { getDefaultConversation, getDefaultConversationWithServiceId, -} from '../test-helpers/getDefaultConversation.js'; -import { fakeGetGroupCallVideoFrameSource } from '../test-helpers/fakeGetGroupCallVideoFrameSource.js'; -import { CallingToastProvider, useCallingToasts } from './CallingToast.js'; -import type { CallingImageDataCache } from './CallManager.js'; -import { MINUTE } from '../util/durations/index.js'; +} from '../test-helpers/getDefaultConversation.std.js'; +import { fakeGetGroupCallVideoFrameSource } from '../test-helpers/fakeGetGroupCallVideoFrameSource.std.js'; +import { CallingToastProvider, useCallingToasts } from './CallingToast.dom.js'; +import type { CallingImageDataCache } from './CallManager.dom.js'; +import { MINUTE } from '../util/durations/index.std.js'; const { sample, shuffle, times } = lodash; diff --git a/ts/components/CallScreen.tsx b/ts/components/CallScreen.tsx index 351b2cde18..e90f66e144 100644 --- a/ts/components/CallScreen.tsx +++ b/ts/components/CallScreen.tsx @@ -16,91 +16,94 @@ import type { SetLocalVideoType, SetRendererCanvasType, SetMutedByType, -} from '../state/ducks/calling.js'; -import { Avatar, AvatarSize } from './Avatar.js'; -import { CallingHeader, getCallViewIconClassname } from './CallingHeader.js'; -import { CallingPreCallInfo, RingMode } from './CallingPreCallInfo.js'; -import { CallingButton, CallingButtonType } from './CallingButton.js'; -import { Button, ButtonVariant } from './Button.js'; -import { TooltipPlacement } from './Tooltip.js'; -import { CallBackgroundBlur } from './CallBackgroundBlur.js'; +} from '../state/ducks/calling.preload.js'; +import { Avatar, AvatarSize } from './Avatar.dom.js'; +import { + CallingHeader, + getCallViewIconClassname, +} from './CallingHeader.dom.js'; +import { CallingPreCallInfo, RingMode } from './CallingPreCallInfo.dom.js'; +import { CallingButton, CallingButtonType } from './CallingButton.dom.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import { TooltipPlacement } from './Tooltip.dom.js'; +import { CallBackgroundBlur } from './CallBackgroundBlur.dom.js'; import type { ActiveCallType, ActiveCallReactionsType, ConversationsByDemuxIdType, GroupCallVideoRequest, -} from '../types/Calling.js'; +} from '../types/Calling.std.js'; import { CALLING_REACTIONS_LIFETIME, CallViewMode, CallState, GroupCallConnectionState, GroupCallJoinState, -} from '../types/Calling.js'; -import { CallMode } from '../types/CallDisposition.js'; -import type { ServiceIdString } from '../types/ServiceId.js'; -import { AvatarColors } from '../types/Colors.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; +} from '../types/Calling.std.js'; +import { CallMode } from '../types/CallDisposition.std.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; +import { AvatarColors } from '../types/Colors.std.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; import { CallingButtonToastsContainer, useScreenSharingStoppedToast, -} from './CallingToastManager.js'; -import { DirectCallRemoteParticipant } from './DirectCallRemoteParticipant.js'; -import { GroupCallRemoteParticipants } from './GroupCallRemoteParticipants.js'; -import { CallParticipantCount } from './CallParticipantCount.js'; -import type { LocalizerType } from '../types/Util.js'; -import { NeedsScreenRecordingPermissionsModal } from './NeedsScreenRecordingPermissionsModal.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import * as KeyboardLayout from '../services/keyboardLayout.js'; +} from './CallingToastManager.dom.js'; +import { DirectCallRemoteParticipant } from './DirectCallRemoteParticipant.dom.js'; +import { GroupCallRemoteParticipants } from './GroupCallRemoteParticipants.dom.js'; +import { CallParticipantCount } from './CallParticipantCount.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { NeedsScreenRecordingPermissionsModal } from './NeedsScreenRecordingPermissionsModal.dom.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import * as KeyboardLayout from '../services/keyboardLayout.dom.js'; import { usePresenter, useActivateSpeakerViewOnPresenting, -} from '../hooks/useActivateSpeakerViewOnPresenting.js'; +} from '../hooks/useActivateSpeakerViewOnPresenting.std.js'; import { CallingAudioIndicator, SPEAKING_LINGER_MS, -} from './CallingAudioIndicator.js'; +} from './CallingAudioIndicator.dom.js'; import { useActiveCallShortcuts, useKeyboardShortcuts, -} from '../hooks/useKeyboardShortcuts.js'; -import { useValueAtFixedRate } from '../hooks/useValueAtFixedRate.js'; -import { isReconnecting as callingIsReconnecting } from '../util/callingIsReconnecting.js'; -import { usePrevious } from '../hooks/usePrevious.js'; +} from '../hooks/useKeyboardShortcuts.dom.js'; +import { useValueAtFixedRate } from '../hooks/useValueAtFixedRate.std.js'; +import { isReconnecting as callingIsReconnecting } from '../util/callingIsReconnecting.std.js'; +import { usePrevious } from '../hooks/usePrevious.std.js'; import { CallingToastProvider, PersistentCallingToast, useCallingToasts, -} from './CallingToast.js'; -import { handleOutsideClick } from '../util/handleOutsideClick.js'; -import { Spinner } from './Spinner.js'; -import type { SmartReactionPicker } from '../state/smart/ReactionPicker.js'; +} from './CallingToast.dom.js'; +import { handleOutsideClick } from '../util/handleOutsideClick.dom.js'; +import { Spinner } from './Spinner.dom.js'; +import type { SmartReactionPicker } from '../state/smart/ReactionPicker.dom.js'; import { CallingRaisedHandsList, CallingRaisedHandsListButton, -} from './CallingRaisedHandsList.js'; -import type { CallReactionBurstType } from './CallReactionBurst.js'; +} from './CallingRaisedHandsList.dom.js'; +import type { CallReactionBurstType } from './CallReactionBurst.dom.js'; import { CallReactionBurstProvider, useCallReactionBursts, -} from './CallReactionBurst.js'; -import { isGroupOrAdhocActiveCall } from '../util/isGroupOrAdhocCall.js'; -import { assertDev, strictAssert } from '../util/assert.js'; -import { CallingPendingParticipants } from './CallingPendingParticipants.js'; -import type { CallingImageDataCache } from './CallManager.js'; -import { FunStaticEmoji } from './fun/FunEmoji.js'; +} from './CallReactionBurst.dom.js'; +import { isGroupOrAdhocActiveCall } from '../util/isGroupOrAdhocCall.std.js'; +import { assertDev, strictAssert } from '../util/assert.std.js'; +import { CallingPendingParticipants } from './CallingPendingParticipants.dom.js'; +import type { CallingImageDataCache } from './CallManager.dom.js'; +import { FunStaticEmoji } from './fun/FunEmoji.dom.js'; import { getEmojiParentByKey, getEmojiParentKeyByVariantKey, getEmojiVariantByKey, getEmojiVariantKeyByValue, isEmojiVariantValue, -} from './fun/data/emojis.js'; -import { useFunEmojiLocalizer } from './fun/useFunEmojiLocalizer.js'; +} from './fun/data/emojis.std.js'; +import { useFunEmojiLocalizer } from './fun/useFunEmojiLocalizer.dom.js'; import { BeforeNavigateResponse, beforeNavigateService, -} from '../services/BeforeNavigate.js'; +} from '../services/BeforeNavigate.std.js'; const { isEqual, noop } = lodash; diff --git a/ts/components/CallingAdhocCallInfo.stories.tsx b/ts/components/CallingAdhocCallInfo.stories.tsx index 8055c205cc..1638c199cc 100644 --- a/ts/components/CallingAdhocCallInfo.stories.tsx +++ b/ts/components/CallingAdhocCallInfo.stories.tsx @@ -6,14 +6,14 @@ import lodash from 'lodash'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './CallingAdhocCallInfo.js'; -import { CallingAdhocCallInfo } from './CallingAdhocCallInfo.js'; -import { AvatarColors } from '../types/Colors.js'; -import type { GroupCallRemoteParticipantType } from '../types/Calling.js'; -import { generateAci } from '../types/ServiceId.js'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; -import type { CallLinkType } from '../types/CallLink.js'; -import { CallLinkRestrictions } from '../types/CallLink.js'; +import type { PropsType } from './CallingAdhocCallInfo.dom.js'; +import { CallingAdhocCallInfo } from './CallingAdhocCallInfo.dom.js'; +import { AvatarColors } from '../types/Colors.std.js'; +import type { GroupCallRemoteParticipantType } from '../types/Calling.std.js'; +import { generateAci } from '../types/ServiceId.std.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.std.js'; +import type { CallLinkType } from '../types/CallLink.std.js'; +import { CallLinkRestrictions } from '../types/CallLink.std.js'; const { sample } = lodash; diff --git a/ts/components/CallingAdhocCallInfo.tsx b/ts/components/CallingAdhocCallInfo.tsx index 73846f3031..8d10dd604a 100644 --- a/ts/components/CallingAdhocCallInfo.tsx +++ b/ts/components/CallingAdhocCallInfo.tsx @@ -5,22 +5,22 @@ import React from 'react'; import classNames from 'classnames'; import lodash from 'lodash'; -import { Avatar, AvatarSize } from './Avatar.js'; -import { ContactName } from './conversation/ContactName.js'; -import { InContactsIcon } from './InContactsIcon.js'; -import type { CallLinkType } from '../types/CallLink.js'; -import type { LocalizerType } from '../types/Util.js'; -import type { ServiceIdString } from '../types/ServiceId.js'; -import { sortByTitle } from '../util/sortByTitle.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import { ModalHost } from './ModalHost.js'; -import { isInSystemContacts } from '../util/isInSystemContacts.js'; -import type { RemoveClientType } from '../state/ducks/calling.js'; -import { AVATAR_COLOR_COUNT, AvatarColors } from '../types/Colors.js'; -import { Button } from './Button.js'; -import { Modal } from './Modal.js'; -import { Theme } from '../util/theme.js'; -import { ConfirmationDialog } from './ConfirmationDialog.js'; +import { Avatar, AvatarSize } from './Avatar.dom.js'; +import { ContactName } from './conversation/ContactName.dom.js'; +import { InContactsIcon } from './InContactsIcon.dom.js'; +import type { CallLinkType } from '../types/CallLink.std.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; +import { sortByTitle } from '../util/sortByTitle.std.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import { ModalHost } from './ModalHost.dom.js'; +import { isInSystemContacts } from '../util/isInSystemContacts.std.js'; +import type { RemoveClientType } from '../state/ducks/calling.preload.js'; +import { AVATAR_COLOR_COUNT, AvatarColors } from '../types/Colors.std.js'; +import { Button } from './Button.dom.js'; +import { Modal } from './Modal.dom.js'; +import { Theme } from '../util/theme.std.js'; +import { ConfirmationDialog } from './ConfirmationDialog.dom.js'; const { partition } = lodash; diff --git a/ts/components/CallingAudioIndicator.stories.tsx b/ts/components/CallingAudioIndicator.stories.tsx index 0c575ace18..302fcd2158 100644 --- a/ts/components/CallingAudioIndicator.stories.tsx +++ b/ts/components/CallingAudioIndicator.stories.tsx @@ -3,13 +3,13 @@ import React, { useState, useEffect } from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './CallingAudioIndicator.js'; +import type { Props } from './CallingAudioIndicator.dom.js'; import { CallingAudioIndicator, SPEAKING_LINGER_MS, -} from './CallingAudioIndicator.js'; -import { AUDIO_LEVEL_INTERVAL_MS } from '../calling/constants.js'; -import { useValueAtFixedRate } from '../hooks/useValueAtFixedRate.js'; +} from './CallingAudioIndicator.dom.js'; +import { AUDIO_LEVEL_INTERVAL_MS } from '../calling/constants.std.js'; +import { useValueAtFixedRate } from '../hooks/useValueAtFixedRate.std.js'; export default { title: 'Components/CallingAudioIndicator', diff --git a/ts/components/CallingAudioIndicator.tsx b/ts/components/CallingAudioIndicator.tsx index 63e4293f92..8cf8fd864e 100644 --- a/ts/components/CallingAudioIndicator.tsx +++ b/ts/components/CallingAudioIndicator.tsx @@ -6,8 +6,8 @@ import type { ReactElement } from 'react'; import React, { useEffect } from 'react'; import { useSpring, animated } from '@react-spring/web'; -import { AUDIO_LEVEL_INTERVAL_MS } from '../calling/constants.js'; -import { missingCaseError } from '../util/missingCaseError.js'; +import { AUDIO_LEVEL_INTERVAL_MS } from '../calling/constants.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; export const SPEAKING_LINGER_MS = 200; const BASE_CLASS_NAME = 'CallingAudioIndicator'; diff --git a/ts/components/CallingButton.stories.tsx b/ts/components/CallingButton.stories.tsx index 857430c81e..847dbf3ffb 100644 --- a/ts/components/CallingButton.stories.tsx +++ b/ts/components/CallingButton.stories.tsx @@ -4,9 +4,9 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './CallingButton.js'; -import { CallingButton, CallingButtonType } from './CallingButton.js'; -import { TooltipPlacement } from './Tooltip.js'; +import type { PropsType } from './CallingButton.dom.js'; +import { CallingButton, CallingButtonType } from './CallingButton.dom.js'; +import { TooltipPlacement } from './Tooltip.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CallingButton.tsx b/ts/components/CallingButton.tsx index 4be3fea23a..c9cf7e39d7 100644 --- a/ts/components/CallingButton.tsx +++ b/ts/components/CallingButton.tsx @@ -4,10 +4,10 @@ import React, { useMemo } from 'react'; import classNames from 'classnames'; import { v4 as uuid } from 'uuid'; -import type { TooltipPlacement } from './Tooltip.js'; -import { Tooltip } from './Tooltip.js'; -import { Theme } from '../util/theme.js'; -import type { LocalizerType } from '../types/Util.js'; +import type { TooltipPlacement } from './Tooltip.dom.js'; +import { Tooltip } from './Tooltip.dom.js'; +import { Theme } from '../util/theme.std.js'; +import type { LocalizerType } from '../types/Util.std.js'; export enum CallingButtonType { AUDIO_DISABLED = 'AUDIO_DISABLED', diff --git a/ts/components/CallingDeviceSelection.stories.tsx b/ts/components/CallingDeviceSelection.stories.tsx index a0a775547b..d16bdf0efa 100644 --- a/ts/components/CallingDeviceSelection.stories.tsx +++ b/ts/components/CallingDeviceSelection.stories.tsx @@ -5,8 +5,8 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './CallingDeviceSelection.js'; -import { CallingDeviceSelection } from './CallingDeviceSelection.js'; +import type { Props } from './CallingDeviceSelection.dom.js'; +import { CallingDeviceSelection } from './CallingDeviceSelection.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CallingDeviceSelection.tsx b/ts/components/CallingDeviceSelection.tsx index 1b6ea549f6..de25c0458d 100644 --- a/ts/components/CallingDeviceSelection.tsx +++ b/ts/components/CallingDeviceSelection.tsx @@ -4,16 +4,16 @@ import * as React from 'react'; import type { AudioDevice } from '@signalapp/ringrtc'; -import type { Option } from './Select.js'; -import { Modal } from './Modal.js'; -import { Select } from './Select.js'; -import type { LocalizerType } from '../types/Util.js'; +import type { Option } from './Select.dom.js'; +import { Modal } from './Modal.dom.js'; +import { Select } from './Select.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; import type { ChangeIODevicePayloadType, MediaDeviceSettings, -} from '../types/Calling.js'; -import { CallingDeviceType } from '../types/Calling.js'; -import { Theme } from '../util/theme.js'; +} from '../types/Calling.std.js'; +import { CallingDeviceType } from '../types/Calling.std.js'; +import { Theme } from '../util/theme.std.js'; export type Props = MediaDeviceSettings & { changeIODevice: (payload: ChangeIODevicePayloadType) => void; diff --git a/ts/components/CallingHeader.stories.tsx b/ts/components/CallingHeader.stories.tsx index dd3cc46fd2..1812145cce 100644 --- a/ts/components/CallingHeader.stories.tsx +++ b/ts/components/CallingHeader.stories.tsx @@ -4,9 +4,9 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './CallingHeader.js'; -import { CallingHeader } from './CallingHeader.js'; -import { CallViewMode } from '../types/Calling.js'; +import type { PropsType } from './CallingHeader.dom.js'; +import { CallingHeader } from './CallingHeader.dom.js'; +import { CallViewMode } from '../types/Calling.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CallingHeader.tsx b/ts/components/CallingHeader.tsx index acd4b07361..de14e247f8 100644 --- a/ts/components/CallingHeader.tsx +++ b/ts/components/CallingHeader.tsx @@ -3,11 +3,11 @@ import classNames from 'classnames'; import React from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import { CallViewMode } from '../types/Calling.js'; -import { Tooltip } from './Tooltip.js'; -import { Theme } from '../util/theme.js'; -import { ContextMenu } from './ContextMenu.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { CallViewMode } from '../types/Calling.std.js'; +import { Tooltip } from './Tooltip.dom.js'; +import { Theme } from '../util/theme.std.js'; +import { ContextMenu } from './ContextMenu.dom.js'; export type PropsType = { callViewMode?: CallViewMode; diff --git a/ts/components/CallingLobby.stories.tsx b/ts/components/CallingLobby.stories.tsx index 765b2b261a..a89cc1914f 100644 --- a/ts/components/CallingLobby.stories.tsx +++ b/ts/components/CallingLobby.stories.tsx @@ -7,18 +7,18 @@ import { action } from '@storybook/addon-actions'; import { v4 as generateUuid } from 'uuid'; import type { Meta } from '@storybook/react'; -import { AvatarColors } from '../types/Colors.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import type { PropsType } from './CallingLobby.js'; -import { CallingLobby as UnwrappedCallingLobby } from './CallingLobby.js'; -import { generateAci } from '../types/ServiceId.js'; +import { AvatarColors } from '../types/Colors.std.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import type { PropsType } from './CallingLobby.dom.js'; +import { CallingLobby as UnwrappedCallingLobby } from './CallingLobby.dom.js'; +import { generateAci } from '../types/ServiceId.std.js'; import { getDefaultConversation, getDefaultConversationWithServiceId, -} from '../test-helpers/getDefaultConversation.js'; -import { CallingToastProvider } from './CallingToast.js'; -import { CallMode } from '../types/CallDisposition.js'; -import { getDefaultCallLinkConversation } from '../test-helpers/fakeCallLink.js'; +} from '../test-helpers/getDefaultConversation.std.js'; +import { CallingToastProvider } from './CallingToast.dom.js'; +import { CallMode } from '../types/CallDisposition.std.js'; +import { getDefaultCallLinkConversation } from '../test-helpers/fakeCallLink.std.js'; const { times } = lodash; diff --git a/ts/components/CallingLobby.tsx b/ts/components/CallingLobby.tsx index 42f1aff599..234e6b760a 100644 --- a/ts/components/CallingLobby.tsx +++ b/ts/components/CallingLobby.tsx @@ -7,27 +7,27 @@ import { FocusScope } from 'react-aria'; import type { SetLocalAudioType, SetLocalVideoType, -} from '../state/ducks/calling.js'; -import { CallingButton, CallingButtonType } from './CallingButton.js'; -import { TooltipPlacement } from './Tooltip.js'; -import { CallBackgroundBlur } from './CallBackgroundBlur.js'; -import { CallParticipantCount } from './CallParticipantCount.js'; -import { CallingHeader } from './CallingHeader.js'; -import { CallingPreCallInfo, RingMode } from './CallingPreCallInfo.js'; +} from '../state/ducks/calling.preload.js'; +import { CallingButton, CallingButtonType } from './CallingButton.dom.js'; +import { TooltipPlacement } from './Tooltip.dom.js'; +import { CallBackgroundBlur } from './CallBackgroundBlur.dom.js'; +import { CallParticipantCount } from './CallParticipantCount.dom.js'; +import { CallingHeader } from './CallingHeader.dom.js'; +import { CallingPreCallInfo, RingMode } from './CallingPreCallInfo.dom.js'; import { CallingLobbyJoinButton, CallingLobbyJoinButtonVariant, -} from './CallingLobbyJoinButton.js'; -import { CallMode } from '../types/CallDisposition.js'; -import type { CallingConversationType } from '../types/Calling.js'; -import type { LocalizerType } from '../types/Util.js'; -import * as KeyboardLayout from '../services/keyboardLayout.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import { useCallingToasts } from './CallingToast.js'; -import { CallingButtonToastsContainer } from './CallingToastManager.js'; -import { isGroupOrAdhocCallMode } from '../util/isGroupOrAdhocCall.js'; -import { Button, ButtonVariant } from './Button.js'; -import { SpinnerV2 } from './SpinnerV2.js'; +} from './CallingLobbyJoinButton.dom.js'; +import { CallMode } from '../types/CallDisposition.std.js'; +import type { CallingConversationType } from '../types/Calling.std.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import * as KeyboardLayout from '../services/keyboardLayout.dom.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import { useCallingToasts } from './CallingToast.dom.js'; +import { CallingButtonToastsContainer } from './CallingToastManager.dom.js'; +import { isGroupOrAdhocCallMode } from '../util/isGroupOrAdhocCall.std.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import { SpinnerV2 } from './SpinnerV2.dom.js'; export type PropsType = { availableCameras: Array; diff --git a/ts/components/CallingLobbyJoinButton.tsx b/ts/components/CallingLobbyJoinButton.tsx index 9b83911dac..d07f7d39ab 100644 --- a/ts/components/CallingLobbyJoinButton.tsx +++ b/ts/components/CallingLobbyJoinButton.tsx @@ -5,9 +5,9 @@ import type { ReactChild } from 'react'; import React, { useState } from 'react'; import lodash from 'lodash'; -import type { LocalizerType } from '../types/Util.js'; -import { Button, ButtonVariant } from './Button.js'; -import { Spinner } from './Spinner.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import { Spinner } from './Spinner.dom.js'; const { noop } = lodash; diff --git a/ts/components/CallingParticipantsList.stories.tsx b/ts/components/CallingParticipantsList.stories.tsx index 9ca636b499..2ec57f68e2 100644 --- a/ts/components/CallingParticipantsList.stories.tsx +++ b/ts/components/CallingParticipantsList.stories.tsx @@ -6,10 +6,10 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './CallingParticipantsList.js'; -import { CallingParticipantsList } from './CallingParticipantsList.js'; -import { generateAci } from '../types/ServiceId.js'; -import { createCallParticipant } from '../test-helpers/createCallParticipant.js'; +import type { PropsType } from './CallingParticipantsList.dom.js'; +import { CallingParticipantsList } from './CallingParticipantsList.dom.js'; +import { generateAci } from '../types/ServiceId.std.js'; +import { createCallParticipant } from '../test-helpers/createCallParticipant.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CallingParticipantsList.tsx b/ts/components/CallingParticipantsList.tsx index bcbe2fe555..5d4895722e 100644 --- a/ts/components/CallingParticipantsList.tsx +++ b/ts/components/CallingParticipantsList.tsx @@ -7,15 +7,15 @@ import React, { useContext } from 'react'; import { createPortal } from 'react-dom'; import classNames from 'classnames'; import { FocusScope } from 'react-aria'; -import { Avatar, AvatarSize } from './Avatar.js'; -import { ContactName } from './conversation/ContactName.js'; -import { InContactsIcon } from './InContactsIcon.js'; -import type { LocalizerType } from '../types/Util.js'; -import type { ServiceIdString } from '../types/ServiceId.js'; -import { sortByTitle } from '../util/sortByTitle.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import { isInSystemContacts } from '../util/isInSystemContacts.js'; -import { ModalContainerContext } from './ModalHost.js'; +import { Avatar, AvatarSize } from './Avatar.dom.js'; +import { ContactName } from './conversation/ContactName.dom.js'; +import { InContactsIcon } from './InContactsIcon.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; +import { sortByTitle } from '../util/sortByTitle.std.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import { isInSystemContacts } from '../util/isInSystemContacts.std.js'; +import { ModalContainerContext } from './ModalHost.dom.js'; type ParticipantType = ConversationType & { hasRemoteAudio?: boolean; diff --git a/ts/components/CallingPendingParticipants.stories.tsx b/ts/components/CallingPendingParticipants.stories.tsx index c60e276181..ae2277c26f 100644 --- a/ts/components/CallingPendingParticipants.stories.tsx +++ b/ts/components/CallingPendingParticipants.stories.tsx @@ -4,9 +4,9 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './CallingPendingParticipants.js'; -import { CallingPendingParticipants } from './CallingPendingParticipants.js'; -import { allRemoteParticipants } from './CallScreen.stories.js'; +import type { PropsType } from './CallingPendingParticipants.dom.js'; +import { CallingPendingParticipants } from './CallingPendingParticipants.dom.js'; +import { allRemoteParticipants } from './CallScreen.dom.stories.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CallingPendingParticipants.tsx b/ts/components/CallingPendingParticipants.tsx index def82be56f..335d7b9600 100644 --- a/ts/components/CallingPendingParticipants.tsx +++ b/ts/components/CallingPendingParticipants.tsx @@ -7,24 +7,24 @@ import React, { useCallback, useEffect, useRef, useState } from 'react'; import lodash from 'lodash'; import classNames from 'classnames'; import { animated, useSpring } from '@react-spring/web'; -import { Avatar, AvatarSize } from './Avatar.js'; -import { ContactName } from './conversation/ContactName.js'; -import { InContactsIcon } from './InContactsIcon.js'; -import type { LocalizerType } from '../types/Util.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import { isInSystemContacts } from '../util/isInSystemContacts.js'; +import { Avatar, AvatarSize } from './Avatar.dom.js'; +import { ContactName } from './conversation/ContactName.dom.js'; +import { InContactsIcon } from './InContactsIcon.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import { isInSystemContacts } from '../util/isInSystemContacts.std.js'; import type { BatchUserActionPayloadType, PendingUserActionPayloadType, -} from '../state/ducks/calling.js'; -import { Button, ButtonVariant } from './Button.js'; -import type { ServiceIdString } from '../types/ServiceId.js'; -import { handleOutsideClick } from '../util/handleOutsideClick.js'; -import { Theme } from '../util/theme.js'; -import { ConfirmationDialog } from './ConfirmationDialog.js'; -import { usePrevious } from '../hooks/usePrevious.js'; -import { useReducedMotion } from '../hooks/useReducedMotion.js'; -import { drop } from '../util/drop.js'; +} from '../state/ducks/calling.preload.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; +import { handleOutsideClick } from '../util/handleOutsideClick.dom.js'; +import { Theme } from '../util/theme.std.js'; +import { ConfirmationDialog } from './ConfirmationDialog.dom.js'; +import { usePrevious } from '../hooks/usePrevious.std.js'; +import { useReducedMotion } from '../hooks/useReducedMotion.dom.js'; +import { drop } from '../util/drop.std.js'; const { noop } = lodash; diff --git a/ts/components/CallingPip.stories.tsx b/ts/components/CallingPip.stories.tsx index a1576bd24b..b6120ce329 100644 --- a/ts/components/CallingPip.stories.tsx +++ b/ts/components/CallingPip.stories.tsx @@ -5,23 +5,23 @@ import * as React from 'react'; import lodash from 'lodash'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { AvatarColors } from '../types/Colors.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import type { PropsType } from './CallingPip.js'; -import { CallingPip } from './CallingPip.js'; -import type { ActiveDirectCallType } from '../types/Calling.js'; +import { AvatarColors } from '../types/Colors.std.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import type { PropsType } from './CallingPip.dom.js'; +import { CallingPip } from './CallingPip.dom.js'; +import type { ActiveDirectCallType } from '../types/Calling.std.js'; import { CallViewMode, CallState, GroupCallConnectionState, GroupCallJoinState, -} from '../types/Calling.js'; -import { CallMode } from '../types/CallDisposition.js'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; -import { fakeGetGroupCallVideoFrameSource } from '../test-helpers/fakeGetGroupCallVideoFrameSource.js'; -import { MINUTE } from '../util/durations/index.js'; -import type { SetRendererCanvasType } from '../state/ducks/calling.js'; -import { createCallParticipant } from '../test-helpers/createCallParticipant.js'; +} from '../types/Calling.std.js'; +import { CallMode } from '../types/CallDisposition.std.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.std.js'; +import { fakeGetGroupCallVideoFrameSource } from '../test-helpers/fakeGetGroupCallVideoFrameSource.std.js'; +import { MINUTE } from '../util/durations/index.std.js'; +import type { SetRendererCanvasType } from '../state/ducks/calling.preload.js'; +import { createCallParticipant } from '../test-helpers/createCallParticipant.std.js'; const { times } = lodash; diff --git a/ts/components/CallingPip.tsx b/ts/components/CallingPip.tsx index 1d6808d5bd..57641becd3 100644 --- a/ts/components/CallingPip.tsx +++ b/ts/components/CallingPip.tsx @@ -7,25 +7,25 @@ import lodash from 'lodash'; import type { VideoFrameSource } from '@signalapp/ringrtc'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { isGroupOrAdhocActiveCall } from '../util/isGroupOrAdhocCall.js'; -import { useActivateSpeakerViewOnPresenting } from '../hooks/useActivateSpeakerViewOnPresenting.js'; -import { CallMode } from '../types/CallDisposition.js'; -import { TooltipPlacement } from './Tooltip.js'; -import { CallingButton, CallingButtonType } from './CallingButton.js'; -import { CallingPipRemoteVideo } from './CallingPipRemoteVideo.js'; -import { CallBackgroundBlur } from './CallBackgroundBlur.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { isGroupOrAdhocActiveCall } from '../util/isGroupOrAdhocCall.std.js'; +import { useActivateSpeakerViewOnPresenting } from '../hooks/useActivateSpeakerViewOnPresenting.std.js'; +import { CallMode } from '../types/CallDisposition.std.js'; +import { TooltipPlacement } from './Tooltip.dom.js'; +import { CallingButton, CallingButtonType } from './CallingButton.dom.js'; +import { CallingPipRemoteVideo } from './CallingPipRemoteVideo.dom.js'; +import { CallBackgroundBlur } from './CallBackgroundBlur.dom.js'; -import type { LocalizerType } from '../types/Util.js'; +import type { LocalizerType } from '../types/Util.std.js'; import type { ActiveCallType, GroupCallVideoRequest, -} from '../types/Calling.js'; -import type { SetRendererCanvasType } from '../state/ducks/calling.js'; -import type { CallingImageDataCache } from './CallManager.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import { Avatar, AvatarSize } from './Avatar.js'; -import { AvatarColors } from '../types/Colors.js'; +} from '../types/Calling.std.js'; +import type { SetRendererCanvasType } from '../state/ducks/calling.preload.js'; +import type { CallingImageDataCache } from './CallManager.dom.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import { Avatar, AvatarSize } from './Avatar.dom.js'; +import { AvatarColors } from '../types/Colors.std.js'; const { minBy, debounce, noop } = lodash; diff --git a/ts/components/CallingPipRemoteVideo.tsx b/ts/components/CallingPipRemoteVideo.tsx index 92b97e0ab1..415053e035 100644 --- a/ts/components/CallingPipRemoteVideo.tsx +++ b/ts/components/CallingPipRemoteVideo.tsx @@ -4,34 +4,34 @@ import React, { useEffect } from 'react'; import lodash from 'lodash'; import type { VideoFrameSource } from '@signalapp/ringrtc'; -import { Avatar, AvatarSize } from './Avatar.js'; -import { CallBackgroundBlur } from './CallBackgroundBlur.js'; -import { DirectCallRemoteParticipant } from './DirectCallRemoteParticipant.js'; -import { GroupCallRemoteParticipant } from './GroupCallRemoteParticipant.js'; -import type { LocalizerType } from '../types/Util.js'; +import { Avatar, AvatarSize } from './Avatar.dom.js'; +import { CallBackgroundBlur } from './CallBackgroundBlur.dom.js'; +import { DirectCallRemoteParticipant } from './DirectCallRemoteParticipant.dom.js'; +import { GroupCallRemoteParticipant } from './GroupCallRemoteParticipant.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; import { GroupCallJoinState, type ActiveCallType, type GroupCallRemoteParticipantType, type GroupCallVideoRequest, -} from '../types/Calling.js'; -import { CallMode } from '../types/CallDisposition.js'; -import { AvatarColors } from '../types/Colors.js'; -import type { SetRendererCanvasType } from '../state/ducks/calling.js'; -import { useGetCallingFrameBuffer } from '../calling/useGetCallingFrameBuffer.js'; -import { MAX_FRAME_HEIGHT } from '../calling/constants.js'; -import { usePageVisibility } from '../hooks/usePageVisibility.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { nonRenderedRemoteParticipant } from '../util/ringrtc/nonRenderedRemoteParticipant.js'; -import { isReconnecting } from '../util/callingIsReconnecting.js'; -import { isGroupOrAdhocActiveCall } from '../util/isGroupOrAdhocCall.js'; -import { assertDev } from '../util/assert.js'; -import type { CallingImageDataCache } from './CallManager.js'; +} from '../types/Calling.std.js'; +import { CallMode } from '../types/CallDisposition.std.js'; +import { AvatarColors } from '../types/Colors.std.js'; +import type { SetRendererCanvasType } from '../state/ducks/calling.preload.js'; +import { useGetCallingFrameBuffer } from '../calling/useGetCallingFrameBuffer.std.js'; +import { MAX_FRAME_HEIGHT } from '../calling/constants.std.js'; +import { usePageVisibility } from '../hooks/usePageVisibility.dom.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { nonRenderedRemoteParticipant } from '../util/ringrtc/nonRenderedRemoteParticipant.std.js'; +import { isReconnecting } from '../util/callingIsReconnecting.std.js'; +import { isGroupOrAdhocActiveCall } from '../util/isGroupOrAdhocCall.std.js'; +import { assertDev } from '../util/assert.std.js'; +import type { CallingImageDataCache } from './CallManager.dom.js'; import { PIP_MAXIMUM_HEIGHT_MULTIPLIER, PIP_MINIMUM_HEIGHT_MULTIPLIER, PIP_WIDTH_NORMAL, -} from './CallingPip.js'; +} from './CallingPip.dom.js'; const { clamp, isNumber, maxBy } = lodash; diff --git a/ts/components/CallingPreCallInfo.stories.tsx b/ts/components/CallingPreCallInfo.stories.tsx index 480ac47625..48eff517b4 100644 --- a/ts/components/CallingPreCallInfo.stories.tsx +++ b/ts/components/CallingPreCallInfo.stories.tsx @@ -4,13 +4,13 @@ import React from 'react'; import lodash from 'lodash'; import type { Meta } from '@storybook/react'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; -import type { PropsType } from './CallingPreCallInfo.js'; -import { CallingPreCallInfo, RingMode } from './CallingPreCallInfo.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import { generateAci } from '../types/ServiceId.js'; -import { FAKE_CALL_LINK } from '../test-helpers/fakeCallLink.js'; -import { callLinkToConversation } from '../util/callLinks.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.std.js'; +import type { PropsType } from './CallingPreCallInfo.dom.js'; +import { CallingPreCallInfo, RingMode } from './CallingPreCallInfo.dom.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import { generateAci } from '../types/ServiceId.std.js'; +import { FAKE_CALL_LINK } from '../test-helpers/fakeCallLink.std.js'; +import { callLinkToConversation } from '../util/callLinks.std.js'; const { times } = lodash; diff --git a/ts/components/CallingPreCallInfo.tsx b/ts/components/CallingPreCallInfo.tsx index a027e80074..1a47ed6b26 100644 --- a/ts/components/CallingPreCallInfo.tsx +++ b/ts/components/CallingPreCallInfo.tsx @@ -3,13 +3,13 @@ import React from 'react'; import lodash from 'lodash'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import type { CallingConversationType } from '../types/Calling.js'; -import type { LocalizerType } from '../types/Util.js'; -import { Avatar, AvatarSize } from './Avatar.js'; -import { getParticipantName } from '../util/callingGetParticipantName.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { UserText } from './UserText.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import type { CallingConversationType } from '../types/Calling.std.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { Avatar, AvatarSize } from './Avatar.dom.js'; +import { getParticipantName } from '../util/callingGetParticipantName.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { UserText } from './UserText.dom.js'; const { partition } = lodash; diff --git a/ts/components/CallingRaisedHandsList.stories.tsx b/ts/components/CallingRaisedHandsList.stories.tsx index 2e00b5d8b1..96add0aef6 100644 --- a/ts/components/CallingRaisedHandsList.stories.tsx +++ b/ts/components/CallingRaisedHandsList.stories.tsx @@ -9,14 +9,14 @@ import type { Meta } from '@storybook/react'; import type { CallingRaisedHandsListButtonPropsType, PropsType, -} from './CallingRaisedHandsList.js'; +} from './CallingRaisedHandsList.dom.js'; import { CallingRaisedHandsList, CallingRaisedHandsListButton, -} from './CallingRaisedHandsList.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import { AvatarColors } from '../types/Colors.js'; -import { getDefaultConversationWithServiceId } from '../test-helpers/getDefaultConversation.js'; +} from './CallingRaisedHandsList.dom.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import { AvatarColors } from '../types/Colors.std.js'; +import { getDefaultConversationWithServiceId } from '../test-helpers/getDefaultConversation.std.js'; const { times } = lodash; diff --git a/ts/components/CallingRaisedHandsList.tsx b/ts/components/CallingRaisedHandsList.tsx index 6f7c277932..03efbd7dbb 100644 --- a/ts/components/CallingRaisedHandsList.tsx +++ b/ts/components/CallingRaisedHandsList.tsx @@ -4,17 +4,17 @@ import React from 'react'; import { animated, useSpring } from '@react-spring/web'; -import { Avatar, AvatarSize } from './Avatar.js'; -import { ContactName } from './conversation/ContactName.js'; -import type { ConversationsByDemuxIdType } from '../types/Calling.js'; -import type { ServiceIdString } from '../types/ServiceId.js'; -import type { LocalizerType } from '../types/Util.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import { ModalHost } from './ModalHost.js'; -import { drop } from '../util/drop.js'; -import { createLogger } from '../logging/log.js'; -import { usePrevious } from '../hooks/usePrevious.js'; -import { useReducedMotion } from '../hooks/useReducedMotion.js'; +import { Avatar, AvatarSize } from './Avatar.dom.js'; +import { ContactName } from './conversation/ContactName.dom.js'; +import type { ConversationsByDemuxIdType } from '../types/Calling.std.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import { ModalHost } from './ModalHost.dom.js'; +import { drop } from '../util/drop.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { usePrevious } from '../hooks/usePrevious.std.js'; +import { useReducedMotion } from '../hooks/useReducedMotion.dom.js'; const log = createLogger('CallingRaisedHandsList'); diff --git a/ts/components/CallingScreenSharingController.stories.tsx b/ts/components/CallingScreenSharingController.stories.tsx index 0ffc8faea4..f4cc7c7619 100644 --- a/ts/components/CallingScreenSharingController.stories.tsx +++ b/ts/components/CallingScreenSharingController.stories.tsx @@ -5,10 +5,10 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './CallingScreenSharingController.js'; -import { CallingScreenSharingController } from './CallingScreenSharingController.js'; +import type { PropsType } from './CallingScreenSharingController.dom.js'; +import { CallingScreenSharingController } from './CallingScreenSharingController.dom.js'; -import { ScreenShareStatus } from '../types/Calling.js'; +import { ScreenShareStatus } from '../types/Calling.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CallingScreenSharingController.tsx b/ts/components/CallingScreenSharingController.tsx index e63572ca6d..159a8feb41 100644 --- a/ts/components/CallingScreenSharingController.tsx +++ b/ts/components/CallingScreenSharingController.tsx @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import { Button, ButtonVariant } from './Button.js'; -import type { LocalizerType } from '../types/Util.js'; -import { ScreenShareStatus } from '../types/Calling.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { ScreenShareStatus } from '../types/Calling.std.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/CallingSelectPresentingSourcesModal.stories.tsx b/ts/components/CallingSelectPresentingSourcesModal.stories.tsx index f64291e507..c37eb393d9 100644 --- a/ts/components/CallingSelectPresentingSourcesModal.stories.tsx +++ b/ts/components/CallingSelectPresentingSourcesModal.stories.tsx @@ -5,8 +5,8 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './CallingSelectPresentingSourcesModal.js'; -import { CallingSelectPresentingSourcesModal } from './CallingSelectPresentingSourcesModal.js'; +import type { PropsType } from './CallingSelectPresentingSourcesModal.dom.js'; +import { CallingSelectPresentingSourcesModal } from './CallingSelectPresentingSourcesModal.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CallingSelectPresentingSourcesModal.tsx b/ts/components/CallingSelectPresentingSourcesModal.tsx index 26e8d18295..3e2399b6cf 100644 --- a/ts/components/CallingSelectPresentingSourcesModal.tsx +++ b/ts/components/CallingSelectPresentingSourcesModal.tsx @@ -4,12 +4,15 @@ import React, { useState } from 'react'; import classNames from 'classnames'; import lodash from 'lodash'; -import { Button, ButtonVariant } from './Button.js'; -import type { LocalizerType } from '../types/Util.js'; -import { Modal } from './Modal.js'; -import type { PresentedSource, PresentableSource } from '../types/Calling.js'; -import { Theme } from '../util/theme.js'; -import { strictAssert } from '../util/assert.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { Modal } from './Modal.dom.js'; +import type { + PresentedSource, + PresentableSource, +} from '../types/Calling.std.js'; +import { Theme } from '../util/theme.std.js'; +import { strictAssert } from '../util/assert.std.js'; const { groupBy } = lodash; diff --git a/ts/components/CallingToast.tsx b/ts/components/CallingToast.tsx index 40f8c324c8..93468e43d2 100644 --- a/ts/components/CallingToast.tsx +++ b/ts/components/CallingToast.tsx @@ -14,11 +14,11 @@ import { createPortal } from 'react-dom'; import { useTransition, animated } from '@react-spring/web'; import classNames from 'classnames'; import { v4 as uuid } from 'uuid'; -import { useIsMounted } from '../hooks/useIsMounted.js'; -import type { LocalizerType } from '../types/I18N.js'; -import { usePrevious } from '../hooks/usePrevious.js'; -import { difference } from '../util/setUtil.js'; -import { useReducedMotion } from '../hooks/useReducedMotion.js'; +import { useIsMounted } from '../hooks/useIsMounted.std.js'; +import type { LocalizerType } from '../types/I18N.std.js'; +import { usePrevious } from '../hooks/usePrevious.std.js'; +import { difference } from '../util/setUtil.std.js'; +import { useReducedMotion } from '../hooks/useReducedMotion.dom.js'; const DEFAULT_LIFETIME = 5000; const DEFAULT_TRANSITION_FROM = { diff --git a/ts/components/CallingToastManager.tsx b/ts/components/CallingToastManager.tsx index 16c32510c3..1e7ede9b9b 100644 --- a/ts/components/CallingToastManager.tsx +++ b/ts/components/CallingToastManager.tsx @@ -5,17 +5,17 @@ import React, { useEffect, useMemo, useRef } from 'react'; import type { ActiveCallType, ObservedRemoteMuteType, -} from '../types/Calling.js'; -import { CallMode } from '../types/CallDisposition.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import type { LocalizerType } from '../types/Util.js'; -import { CallingToastProvider, useCallingToasts } from './CallingToast.js'; -import { usePrevious } from '../hooks/usePrevious.js'; -import { difference as setDifference } from '../util/setUtil.js'; -import { isMoreRecentThan } from '../util/timestamp.js'; -import { isGroupOrAdhocActiveCall } from '../util/isGroupOrAdhocCall.js'; -import { SECOND } from '../util/durations/index.js'; -import type { SetMutedByType } from '../state/ducks/calling.js'; +} from '../types/Calling.std.js'; +import { CallMode } from '../types/CallDisposition.std.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { CallingToastProvider, useCallingToasts } from './CallingToast.dom.js'; +import { usePrevious } from '../hooks/usePrevious.std.js'; +import { difference as setDifference } from '../util/setUtil.std.js'; +import { isMoreRecentThan } from '../util/timestamp.std.js'; +import { isGroupOrAdhocActiveCall } from '../util/isGroupOrAdhocCall.std.js'; +import { SECOND } from '../util/durations/index.std.js'; +import type { SetMutedByType } from '../state/ducks/calling.preload.js'; type PropsType = { activeCall: ActiveCallType; diff --git a/ts/components/CallsList.tsx b/ts/components/CallsList.tsx index fd91edd120..d8dc055e20 100644 --- a/ts/components/CallsList.tsx +++ b/ts/components/CallsList.tsx @@ -12,15 +12,15 @@ import React, { import type { Index, IndexRange, ListRowProps } from 'react-virtualized'; import { InfiniteLoader, List } from 'react-virtualized'; import classNames from 'classnames'; -import type { LocalizerType } from '../types/I18N.js'; -import { ListTile } from './ListTile.js'; -import { Avatar, AvatarSize } from './Avatar.js'; -import { SearchInput } from './SearchInput.js'; +import type { LocalizerType } from '../types/I18N.std.js'; +import { ListTile } from './ListTile.dom.js'; +import { Avatar, AvatarSize } from './Avatar.dom.js'; +import { SearchInput } from './SearchInput.dom.js'; import type { CallHistoryFilterOptions, CallHistoryGroup, CallHistoryPagination, -} from '../types/CallDisposition.js'; +} from '../types/CallDisposition.std.js'; import { CallHistoryFilterStatus, CallDirection, @@ -29,49 +29,46 @@ import { GroupCallStatus, isSameCallHistoryGroup, CallMode, -} from '../types/CallDisposition.js'; -import { - formatDateTimeShort, - isMoreRecentThan, - toBoundedDate, -} from '../util/timestamp.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import { createLogger } from '../logging/log.js'; -import { refMerger } from '../util/refMerger.js'; -import { drop } from '../util/drop.js'; -import { strictAssert } from '../util/assert.js'; -import { UserText } from './UserText.js'; -import { I18n } from './I18n.js'; -import { NavSidebarSearchHeader, NavSidebarEmpty } from './NavSidebar.js'; -import { SizeObserver } from '../hooks/useSizeObserver.js'; +} from '../types/CallDisposition.std.js'; +import { isMoreRecentThan, toBoundedDate } from '../util/timestamp.std.js'; +import { formatDateTimeShort } from '../util/formatTimestamp.dom.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import { createLogger } from '../logging/log.std.js'; +import { refMerger } from '../util/refMerger.std.js'; +import { drop } from '../util/drop.std.js'; +import { strictAssert } from '../util/assert.std.js'; +import { UserText } from './UserText.dom.js'; +import { I18n } from './I18n.dom.js'; +import { NavSidebarSearchHeader, NavSidebarEmpty } from './NavSidebar.dom.js'; +import { SizeObserver } from '../hooks/useSizeObserver.dom.js'; import { formatCallHistoryGroup, getCallIdFromEra, -} from '../util/callDisposition.js'; -import { CallsNewCallButton } from './CallsNewCallButton.js'; -import { Tooltip, TooltipPlacement } from './Tooltip.js'; -import { Theme } from '../util/theme.js'; -import type { CallingConversationType } from '../types/Calling.js'; -import type { CallLinkType } from '../types/CallLink.js'; +} from '../util/callDisposition.preload.js'; +import { CallsNewCallButton } from './CallsNewCallButton.dom.js'; +import { Tooltip, TooltipPlacement } from './Tooltip.dom.js'; +import { Theme } from '../util/theme.std.js'; +import type { CallingConversationType } from '../types/Calling.std.js'; +import type { CallLinkType } from '../types/CallLink.std.js'; import { callLinkToConversation, getPlaceholderCallLinkConversation, -} from '../util/callLinks.js'; -import type { CallsTabSelectedView } from './CallsTab.js'; -import type { CallStateType } from '../state/selectors/calling.js'; +} from '../util/callLinks.std.js'; +import type { CallsTabSelectedView } from './CallsTab.preload.js'; +import type { CallStateType } from '../state/selectors/calling.std.js'; import { isGroupOrAdhocCallMode, isGroupOrAdhocCallState, -} from '../util/isGroupOrAdhocCall.js'; -import { isAnybodyInGroupCall } from '../state/ducks/callingHelpers.js'; +} from '../util/isGroupOrAdhocCall.std.js'; +import { isAnybodyInGroupCall } from '../state/ducks/callingHelpers.std.js'; import type { ActiveCallStateType, PeekNotConnectedGroupCallType, -} from '../state/ducks/calling.js'; -import { DAY, MINUTE, SECOND } from '../util/durations/index.js'; -import type { StartCallData } from './ConfirmLeaveCallModal.js'; -import { Button, ButtonVariant } from './Button.js'; -import type { ICUJSXMessageParamsByKeyType } from '../types/Util.js'; +} from '../state/ducks/calling.preload.js'; +import { DAY, MINUTE, SECOND } from '../util/durations/index.std.js'; +import type { StartCallData } from './ConfirmLeaveCallModal.dom.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import type { ICUJSXMessageParamsByKeyType } from '../types/Util.std.js'; const log = createLogger('CallsList'); diff --git a/ts/components/CallsNewCallButton.tsx b/ts/components/CallsNewCallButton.tsx index 13651eca52..05619b727b 100644 --- a/ts/components/CallsNewCallButton.tsx +++ b/ts/components/CallsNewCallButton.tsx @@ -7,23 +7,23 @@ import lodash from 'lodash'; import type { ListRowProps } from 'react-virtualized'; import { List } from 'react-virtualized'; import classNames from 'classnames'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import type { LocalizerType } from '../types/I18N.js'; -import { SearchInput } from './SearchInput.js'; -import { filterAndSortConversations } from '../util/filterAndSortConversations.js'; -import { NavSidebarSearchHeader } from './NavSidebar.js'; -import { ListTile } from './ListTile.js'; -import { strictAssert } from '../util/assert.js'; -import { UserText } from './UserText.js'; -import { Avatar, AvatarSize } from './Avatar.js'; -import { I18n } from './I18n.js'; -import { SizeObserver } from '../hooks/useSizeObserver.js'; -import { CallType } from '../types/CallDisposition.js'; -import type { CallsTabSelectedView } from './CallsTab.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import type { LocalizerType } from '../types/I18N.std.js'; +import { SearchInput } from './SearchInput.dom.js'; +import { filterAndSortConversations } from '../util/filterAndSortConversations.std.js'; +import { NavSidebarSearchHeader } from './NavSidebar.dom.js'; +import { ListTile } from './ListTile.dom.js'; +import { strictAssert } from '../util/assert.std.js'; +import { UserText } from './UserText.dom.js'; +import { Avatar, AvatarSize } from './Avatar.dom.js'; +import { I18n } from './I18n.dom.js'; +import { SizeObserver } from '../hooks/useSizeObserver.dom.js'; +import { CallType } from '../types/CallDisposition.std.js'; +import type { CallsTabSelectedView } from './CallsTab.preload.js'; import { InAnotherCallTooltip, getTooltipContent, -} from './conversation/InAnotherCallTooltip.js'; +} from './conversation/InAnotherCallTooltip.dom.js'; const { partition } = lodash; diff --git a/ts/components/CallsTab.tsx b/ts/components/CallsTab.tsx index f9b985d8d3..8dbd06f042 100644 --- a/ts/components/CallsTab.tsx +++ b/ts/components/CallsTab.tsx @@ -2,29 +2,29 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useCallback, useEffect, useState } from 'react'; -import type { LocalizerType } from '../types/I18N.js'; -import { NavSidebar, NavSidebarActionButton } from './NavSidebar.js'; -import { CallsList } from './CallsList.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; +import type { LocalizerType } from '../types/I18N.std.js'; +import { NavSidebar, NavSidebarActionButton } from './NavSidebar.dom.js'; +import { CallsList } from './CallsList.preload.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; import type { CallHistoryFilterOptions, CallHistoryGroup, CallHistoryPagination, -} from '../types/CallDisposition.js'; -import { CallsNewCall } from './CallsNewCallButton.js'; -import { useEscapeHandling } from '../hooks/useEscapeHandling.js'; +} from '../types/CallDisposition.std.js'; +import { CallsNewCall } from './CallsNewCallButton.dom.js'; +import { useEscapeHandling } from '../hooks/useEscapeHandling.dom.js'; import type { ActiveCallStateType, PeekNotConnectedGroupCallType, -} from '../state/ducks/calling.js'; -import { ConfirmationDialog } from './ConfirmationDialog.js'; -import type { UnreadStats } from '../util/countUnreadStats.js'; -import type { WidthBreakpoint } from './_util.js'; -import type { CallLinkType } from '../types/CallLink.js'; -import type { CallStateType } from '../state/selectors/calling.js'; -import type { StartCallData } from './ConfirmLeaveCallModal.js'; -import { I18n } from './I18n.js'; -import { AxoDropdownMenu } from '../axo/AxoDropdownMenu.js'; +} from '../state/ducks/calling.preload.js'; +import { ConfirmationDialog } from './ConfirmationDialog.dom.js'; +import type { UnreadStats } from '../util/countUnreadStats.std.js'; +import type { WidthBreakpoint } from './_util.std.js'; +import type { CallLinkType } from '../types/CallLink.std.js'; +import type { CallStateType } from '../state/selectors/calling.std.js'; +import type { StartCallData } from './ConfirmLeaveCallModal.dom.js'; +import { I18n } from './I18n.dom.js'; +import { AxoDropdownMenu } from '../axo/AxoDropdownMenu.dom.js'; enum CallsTabSidebarView { CallsListView, diff --git a/ts/components/CaptchaDialog.stories.tsx b/ts/components/CaptchaDialog.stories.tsx index 37ffaee480..f7e55caddb 100644 --- a/ts/components/CaptchaDialog.stories.tsx +++ b/ts/components/CaptchaDialog.stories.tsx @@ -4,9 +4,9 @@ import React, { useState } from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './CaptchaDialog.js'; -import { CaptchaDialog } from './CaptchaDialog.js'; -import { Button } from './Button.js'; +import type { PropsType } from './CaptchaDialog.dom.js'; +import { CaptchaDialog } from './CaptchaDialog.dom.js'; +import { Button } from './Button.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CaptchaDialog.tsx b/ts/components/CaptchaDialog.tsx index 2e4f0ff9ac..7a556f9b44 100644 --- a/ts/components/CaptchaDialog.tsx +++ b/ts/components/CaptchaDialog.tsx @@ -3,10 +3,10 @@ import React, { useRef, useState } from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import { Button, ButtonVariant } from './Button.js'; -import { Modal } from './Modal.js'; -import { Spinner } from './Spinner.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import { Modal } from './Modal.dom.js'; +import { Spinner } from './Spinner.dom.js'; export type PropsType = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/ChatColorPicker.stories.tsx b/ts/components/ChatColorPicker.stories.tsx index af5383badc..d4694b74a3 100644 --- a/ts/components/ChatColorPicker.stories.tsx +++ b/ts/components/ChatColorPicker.stories.tsx @@ -4,9 +4,9 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './ChatColorPicker.js'; -import { ChatColorPicker } from './ChatColorPicker.js'; -import { ConversationColors } from '../types/Colors.js'; +import type { PropsType } from './ChatColorPicker.dom.js'; +import { ChatColorPicker } from './ChatColorPicker.dom.js'; +import { ConversationColors } from '../types/Colors.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/ChatColorPicker.tsx b/ts/components/ChatColorPicker.tsx index 9580f0ebc8..da72998ef7 100644 --- a/ts/components/ChatColorPicker.tsx +++ b/ts/components/ChatColorPicker.tsx @@ -5,21 +5,21 @@ import type { KeyboardEvent, MouseEvent } from 'react'; import React, { useRef, useState } from 'react'; import classNames from 'classnames'; import { ContextMenu, ContextMenuTrigger, MenuItem } from 'react-contextmenu'; -import { ConfirmationDialog } from './ConfirmationDialog.js'; -import { CustomColorEditor } from './CustomColorEditor.js'; -import { Modal } from './Modal.js'; +import { ConfirmationDialog } from './ConfirmationDialog.dom.js'; +import { CustomColorEditor } from './CustomColorEditor.dom.js'; +import { Modal } from './Modal.dom.js'; import type { ConversationColorType, CustomColorType, -} from '../types/Colors.js'; -import { ConversationColors } from '../types/Colors.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import type { LocalizerType } from '../types/Util.js'; -import { SampleMessageBubbles } from './SampleMessageBubbles.js'; -import { PanelRow } from './conversation/conversation-details/PanelRow.js'; -import { getCustomColorStyle } from '../util/getCustomColorStyle.js'; +} from '../types/Colors.std.js'; +import { ConversationColors } from '../types/Colors.std.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { SampleMessageBubbles } from './SampleMessageBubbles.dom.js'; +import { PanelRow } from './conversation/conversation-details/PanelRow.dom.js'; +import { getCustomColorStyle } from '../util/getCustomColorStyle.dom.js'; -import { useDelayedRestoreFocus } from '../hooks/useRestoreFocus.js'; +import { useDelayedRestoreFocus } from '../hooks/useRestoreFocus.dom.js'; type CustomColorDataType = { id?: string; diff --git a/ts/components/ChatsTab.stories.tsx b/ts/components/ChatsTab.stories.tsx index d44018a425..9b53ef0c31 100644 --- a/ts/components/ChatsTab.stories.tsx +++ b/ts/components/ChatsTab.stories.tsx @@ -3,9 +3,9 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { ComponentMeta } from '../storybook/types.js'; -import type { ChatsTabProps } from './ChatsTab.js'; -import { ChatsTab } from './ChatsTab.js'; +import type { ComponentMeta } from '../storybook/types.std.js'; +import type { ChatsTabProps } from './ChatsTab.dom.js'; +import { ChatsTab } from './ChatsTab.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/ChatsTab.tsx b/ts/components/ChatsTab.tsx index 14cd935c70..46808e71d4 100644 --- a/ts/components/ChatsTab.tsx +++ b/ts/components/ChatsTab.tsx @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import type { LocalizerType } from '../types/I18N.js'; -import type { NavTabPanelProps } from './NavTabs.js'; -import { WhatsNewLink } from './WhatsNewLink.js'; -import type { UnreadStats } from '../util/countUnreadStats.js'; -import type { SmartConversationViewProps } from '../state/smart/ConversationView.js'; +import type { LocalizerType } from '../types/I18N.std.js'; +import type { NavTabPanelProps } from './NavTabs.dom.js'; +import { WhatsNewLink } from './WhatsNewLink.dom.js'; +import type { UnreadStats } from '../util/countUnreadStats.std.js'; +import type { SmartConversationViewProps } from '../state/smart/ConversationView.preload.js'; export type ChatsTabProps = Readonly<{ otherTabsUnreadStats: UnreadStats; diff --git a/ts/components/Checkbox.stories.tsx b/ts/components/Checkbox.stories.tsx index bf69cf98d7..02b54aa354 100644 --- a/ts/components/Checkbox.stories.tsx +++ b/ts/components/Checkbox.stories.tsx @@ -5,8 +5,8 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './Checkbox.js'; -import { Checkbox } from './Checkbox.js'; +import type { PropsType } from './Checkbox.dom.js'; +import { Checkbox } from './Checkbox.dom.js'; const createProps = (): PropsType => ({ checked: false, diff --git a/ts/components/Checkbox.tsx b/ts/components/Checkbox.tsx index a11e882d2d..1fab8ca655 100644 --- a/ts/components/Checkbox.tsx +++ b/ts/components/Checkbox.tsx @@ -5,7 +5,7 @@ import type { ReactNode } from 'react'; import React, { forwardRef, useMemo } from 'react'; import { v4 as uuid } from 'uuid'; -import { getClassNamesFor } from '../util/getClassNamesFor.js'; +import { getClassNamesFor } from '../util/getClassNamesFor.std.js'; export type PropsType = { checked?: boolean; diff --git a/ts/components/CircleCheckbox.stories.tsx b/ts/components/CircleCheckbox.stories.tsx index 464d686f72..9d72a3b94d 100644 --- a/ts/components/CircleCheckbox.stories.tsx +++ b/ts/components/CircleCheckbox.stories.tsx @@ -4,8 +4,8 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './CircleCheckbox.js'; -import { CircleCheckbox, Variant } from './CircleCheckbox.js'; +import type { Props } from './CircleCheckbox.dom.js'; +import { CircleCheckbox, Variant } from './CircleCheckbox.dom.js'; const createProps = (): Props => ({ checked: false, diff --git a/ts/components/CircleCheckbox.tsx b/ts/components/CircleCheckbox.tsx index d836e302d3..1f0fbc6038 100644 --- a/ts/components/CircleCheckbox.tsx +++ b/ts/components/CircleCheckbox.tsx @@ -4,8 +4,8 @@ import React, { useCallback } from 'react'; import classNames from 'classnames'; -import { getClassNamesFor } from '../util/getClassNamesFor.js'; -import { missingCaseError } from '../util/missingCaseError.js'; +import { getClassNamesFor } from '../util/getClassNamesFor.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; export enum Variant { Normal = 'Normal', diff --git a/ts/components/ClearingData.stories.tsx b/ts/components/ClearingData.stories.tsx index 8e9ace0497..a402af9eb4 100644 --- a/ts/components/ClearingData.stories.tsx +++ b/ts/components/ClearingData.stories.tsx @@ -4,8 +4,8 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './ClearingData.js'; -import { ClearingData } from './ClearingData.js'; +import type { PropsType } from './ClearingData.dom.js'; +import { ClearingData } from './ClearingData.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/ClearingData.tsx b/ts/components/ClearingData.tsx index fd16e9b451..22186c50a3 100644 --- a/ts/components/ClearingData.tsx +++ b/ts/components/ClearingData.tsx @@ -3,10 +3,10 @@ import React, { useEffect } from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import { TitlebarDragArea } from './TitlebarDragArea.js'; -import { ProgressBar } from './ProgressBar.js'; -import { InstallScreenSignalLogo } from './installScreen/InstallScreenSignalLogo.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { TitlebarDragArea } from './TitlebarDragArea.dom.js'; +import { ProgressBar } from './ProgressBar.dom.js'; +import { InstallScreenSignalLogo } from './installScreen/InstallScreenSignalLogo.dom.js'; export type PropsType = { deleteAllData: () => void; diff --git a/ts/components/CollidingAvatars.stories.tsx b/ts/components/CollidingAvatars.stories.tsx index 3a6e526f60..b1fef9eb5a 100644 --- a/ts/components/CollidingAvatars.stories.tsx +++ b/ts/components/CollidingAvatars.stories.tsx @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import type { PropsType } from './CollidingAvatars.js'; -import { CollidingAvatars } from './CollidingAvatars.js'; -import { type ComponentMeta } from '../storybook/types.js'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; +import type { PropsType } from './CollidingAvatars.dom.js'; +import { CollidingAvatars } from './CollidingAvatars.dom.js'; +import { type ComponentMeta } from '../storybook/types.std.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CollidingAvatars.tsx b/ts/components/CollidingAvatars.tsx index 75bf1137e5..d0a5e2f613 100644 --- a/ts/components/CollidingAvatars.tsx +++ b/ts/components/CollidingAvatars.tsx @@ -4,9 +4,9 @@ import { v4 as uuid } from 'uuid'; import React, { useMemo, useCallback } from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import { Avatar, AvatarSize } from './Avatar.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import { Avatar, AvatarSize } from './Avatar.dom.js'; export type PropsType = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/CompositionArea.stories.tsx b/ts/components/CompositionArea.stories.tsx index a627f433ef..163216f135 100644 --- a/ts/components/CompositionArea.stories.tsx +++ b/ts/components/CompositionArea.stories.tsx @@ -4,18 +4,18 @@ import React, { useContext, useState } from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { IMAGE_JPEG } from '../types/MIME.js'; -import type { Props } from './CompositionArea.js'; -import { CompositionArea } from './CompositionArea.js'; +import { IMAGE_JPEG } from '../types/MIME.std.js'; +import type { Props } from './CompositionArea.dom.js'; +import { CompositionArea } from './CompositionArea.dom.js'; import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext.js'; -import { fakeDraftAttachment } from '../test-helpers/fakeAttachment.js'; -import { landscapeGreenUrl } from '../storybook/Fixtures.js'; -import { RecordingState } from '../types/AudioRecorder.js'; -import { ConversationColors } from '../types/Colors.js'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; -import { PaymentEventKind } from '../types/Payment.js'; -import { EmojiSkinTone } from './fun/data/emojis.js'; +import { fakeDraftAttachment } from '../test-helpers/fakeAttachment.std.js'; +import { landscapeGreenUrl } from '../storybook/Fixtures.std.js'; +import { RecordingState } from '../types/AudioRecorder.std.js'; +import { ConversationColors } from '../types/Colors.std.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.std.js'; +import { PaymentEventKind } from '../types/Payment.std.js'; +import { EmojiSkinTone } from './fun/data/emojis.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CompositionArea.tsx b/ts/components/CompositionArea.tsx index 71e9120dab..7c8f380ac0 100644 --- a/ts/components/CompositionArea.tsx +++ b/ts/components/CompositionArea.tsx @@ -7,75 +7,75 @@ import type { ReadonlyDeep } from 'type-fest'; import type { DraftBodyRanges, HydratedBodyRangesType, -} from '../types/BodyRange.js'; -import type { LocalizerType, ThemeType } from '../types/Util.js'; -import type { ErrorDialogAudioRecorderType } from '../types/AudioRecorder.js'; -import { RecordingState } from '../types/AudioRecorder.js'; -import type { imageToBlurHash } from '../util/imageToBlurHash.js'; -import { dropNull } from '../util/dropNull.js'; -import { Spinner } from './Spinner.js'; +} from '../types/BodyRange.std.js'; +import type { LocalizerType, ThemeType } from '../types/Util.std.js'; +import type { ErrorDialogAudioRecorderType } from '../types/AudioRecorder.std.js'; +import { RecordingState } from '../types/AudioRecorder.std.js'; +import type { imageToBlurHash } from '../util/imageToBlurHash.dom.js'; +import { dropNull } from '../util/dropNull.std.js'; +import { Spinner } from './Spinner.dom.js'; import type { InputApi, Props as CompositionInputProps, -} from './CompositionInput.js'; -import { CompositionInput } from './CompositionInput.js'; -import type { Props as MessageRequestActionsProps } from './conversation/MessageRequestActions.js'; -import { MessageRequestActions } from './conversation/MessageRequestActions.js'; -import type { PropsType as GroupV1DisabledActionsPropsType } from './conversation/GroupV1DisabledActions.js'; -import { GroupV1DisabledActions } from './conversation/GroupV1DisabledActions.js'; -import type { PropsType as GroupV2PendingApprovalActionsPropsType } from './conversation/GroupV2PendingApprovalActions.js'; -import { GroupV2PendingApprovalActions } from './conversation/GroupV2PendingApprovalActions.js'; -import { AnnouncementsOnlyGroupBanner } from './AnnouncementsOnlyGroupBanner.js'; -import { AttachmentList } from './conversation/AttachmentList.js'; +} from './CompositionInput.dom.js'; +import { CompositionInput } from './CompositionInput.dom.js'; +import type { Props as MessageRequestActionsProps } from './conversation/MessageRequestActions.dom.js'; +import { MessageRequestActions } from './conversation/MessageRequestActions.dom.js'; +import type { PropsType as GroupV1DisabledActionsPropsType } from './conversation/GroupV1DisabledActions.dom.js'; +import { GroupV1DisabledActions } from './conversation/GroupV1DisabledActions.dom.js'; +import type { PropsType as GroupV2PendingApprovalActionsPropsType } from './conversation/GroupV2PendingApprovalActions.dom.js'; +import { GroupV2PendingApprovalActions } from './conversation/GroupV2PendingApprovalActions.dom.js'; +import { AnnouncementsOnlyGroupBanner } from './AnnouncementsOnlyGroupBanner.dom.js'; +import { AttachmentList } from './conversation/AttachmentList.dom.js'; import type { AttachmentDraftType, InMemoryAttachmentDraftType, -} from '../types/Attachment.js'; -import { isImageAttachment, isVoiceMessage } from '../util/Attachment.js'; -import type { AciString } from '../types/ServiceId.js'; -import { AudioCapture } from './conversation/AudioCapture.js'; -import { CompositionUpload } from './CompositionUpload.js'; +} from '../types/Attachment.std.js'; +import { isImageAttachment, isVoiceMessage } from '../util/Attachment.std.js'; +import type { AciString } from '../types/ServiceId.std.js'; +import { AudioCapture } from './conversation/AudioCapture.dom.js'; +import { CompositionUpload } from './CompositionUpload.dom.js'; import type { ConversationRemovalStage, ConversationType, PushPanelForConversationActionType, ShowConversationType, -} from '../state/ducks/conversations.js'; -import type { GetConversationByIdType } from '../state/selectors/conversations.js'; -import type { LinkPreviewForUIType } from '../types/message/LinkPreviews.js'; -import { isSameLinkPreview } from '../types/message/LinkPreviews.js'; +} from '../state/ducks/conversations.preload.js'; +import type { GetConversationByIdType } from '../state/selectors/conversations.dom.js'; +import type { LinkPreviewForUIType } from '../types/message/LinkPreviews.std.js'; +import { isSameLinkPreview } from '../types/message/LinkPreviews.std.js'; -import { MandatoryProfileSharingActions } from './conversation/MandatoryProfileSharingActions.js'; -import { MediaQualitySelector } from './MediaQualitySelector.js'; -import type { Props as QuoteProps } from './conversation/Quote.js'; -import { Quote } from './conversation/Quote.js'; +import { MandatoryProfileSharingActions } from './conversation/MandatoryProfileSharingActions.dom.js'; +import { MediaQualitySelector } from './MediaQualitySelector.dom.js'; +import type { Props as QuoteProps } from './conversation/Quote.dom.js'; +import { Quote } from './conversation/Quote.dom.js'; import { useAttachFileShortcut, useEditLastMessageSent, useKeyboardShortcutsConditionally, -} from '../hooks/useKeyboardShortcuts.js'; -import { MediaEditor } from './MediaEditor.js'; -import { isImageTypeSupported } from '../util/GoogleChrome.js'; -import * as KeyboardLayout from '../services/keyboardLayout.js'; -import { usePrevious } from '../hooks/usePrevious.js'; -import { PanelType } from '../types/Panels.js'; -import type { SmartCompositionRecordingDraftProps } from '../state/smart/CompositionRecordingDraft.js'; -import { useEscapeHandling } from '../hooks/useEscapeHandling.js'; -import SelectModeActions from './conversation/SelectModeActions.js'; -import type { ShowToastAction } from '../state/ducks/toast.js'; +} from '../hooks/useKeyboardShortcuts.dom.js'; +import { MediaEditor } from './MediaEditor.dom.js'; +import { isImageTypeSupported } from '../util/GoogleChrome.std.js'; +import * as KeyboardLayout from '../services/keyboardLayout.dom.js'; +import { usePrevious } from '../hooks/usePrevious.std.js'; +import { PanelType } from '../types/Panels.std.js'; +import type { SmartCompositionRecordingDraftProps } from '../state/smart/CompositionRecordingDraft.preload.js'; +import { useEscapeHandling } from '../hooks/useEscapeHandling.dom.js'; +import SelectModeActions from './conversation/SelectModeActions.dom.js'; +import type { ShowToastAction } from '../state/ducks/toast.preload.js'; import type { DraftEditMessageType } from '../model-types.d.ts'; -import type { ForwardMessagesPayload } from '../state/ducks/globalModals.js'; -import { ForwardMessagesModalType } from './ForwardMessagesModal.js'; -import { SignalConversationMuteToggle } from './conversation/SignalConversationMuteToggle.js'; -import { FunPicker } from './fun/FunPicker.js'; -import type { FunEmojiSelection } from './fun/panels/FunPanelEmojis.js'; -import type { FunStickerSelection } from './fun/panels/FunPanelStickers.js'; -import type { FunGifSelection } from './fun/panels/FunPanelGifs.js'; -import type { SmartDraftGifMessageSendModalProps } from '../state/smart/DraftGifMessageSendModal.js'; -import { strictAssert } from '../util/assert.js'; -import { ConfirmationDialog } from './ConfirmationDialog.js'; -import type { EmojiSkinTone } from './fun/data/emojis.js'; -import { FunPickerButton } from './fun/FunButton.js'; +import type { ForwardMessagesPayload } from '../state/ducks/globalModals.preload.js'; +import { ForwardMessagesModalType } from './ForwardMessagesModal.dom.js'; +import { SignalConversationMuteToggle } from './conversation/SignalConversationMuteToggle.dom.js'; +import { FunPicker } from './fun/FunPicker.dom.js'; +import type { FunEmojiSelection } from './fun/panels/FunPanelEmojis.dom.js'; +import type { FunStickerSelection } from './fun/panels/FunPanelStickers.dom.js'; +import type { FunGifSelection } from './fun/panels/FunPanelGifs.dom.js'; +import type { SmartDraftGifMessageSendModalProps } from '../state/smart/DraftGifMessageSendModal.preload.js'; +import { strictAssert } from '../util/assert.std.js'; +import { ConfirmationDialog } from './ConfirmationDialog.dom.js'; +import type { EmojiSkinTone } from './fun/data/emojis.std.js'; +import { FunPickerButton } from './fun/FunButton.dom.js'; export type OwnProps = Readonly<{ acceptedMessageRequest: boolean | null; diff --git a/ts/components/CompositionInput.stories.tsx b/ts/components/CompositionInput.stories.tsx index 17393ce92c..c992fa3f51 100644 --- a/ts/components/CompositionInput.stories.tsx +++ b/ts/components/CompositionInput.stories.tsx @@ -6,12 +6,12 @@ import * as React from 'react'; import '@signalapp/quill-cjs/dist/quill.core.css'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; -import type { Props } from './CompositionInput.js'; -import { CompositionInput } from './CompositionInput.js'; -import { generateAci } from '../types/ServiceId.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.std.js'; +import type { Props } from './CompositionInput.dom.js'; +import { CompositionInput } from './CompositionInput.dom.js'; +import { generateAci } from '../types/ServiceId.std.js'; import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext.js'; -import { EmojiSkinTone } from './fun/data/emojis.js'; +import { EmojiSkinTone } from './fun/data/emojis.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CompositionInput.tsx b/ts/components/CompositionInput.tsx index de3144f898..3703bb3323 100644 --- a/ts/components/CompositionInput.tsx +++ b/ts/components/CompositionInput.tsx @@ -15,37 +15,37 @@ import Emitter from '@signalapp/quill-cjs/core/emitter.js'; import type { Context } from '@signalapp/quill-cjs/modules/keyboard.js'; import type { Range as RangeStatic } from '@signalapp/quill-cjs'; -import { MentionCompletion } from '../quill/mentions/completion.js'; +import { MentionCompletion } from '../quill/mentions/completion.dom.js'; import { FormattingMenu, QuillFormattingStyle, -} from '../quill/formatting/menu.js'; -import { MonospaceBlot } from '../quill/formatting/monospaceBlot.js'; -import { SpoilerBlot } from '../quill/formatting/spoilerBlot.js'; -import { EmojiBlot, EmojiCompletion } from '../quill/emoji/index.js'; +} from '../quill/formatting/menu.dom.js'; +import { MonospaceBlot } from '../quill/formatting/monospaceBlot.std.js'; +import { SpoilerBlot } from '../quill/formatting/spoilerBlot.std.js'; +import { EmojiBlot, EmojiCompletion } from '../quill/emoji/index.dom.js'; import type { DraftBodyRanges, HydratedBodyRangesType, RangeNode, -} from '../types/BodyRange.js'; +} from '../types/BodyRange.std.js'; import { BodyRange, areBodyRangesEqual, collapseRangeTree, insertRange, -} from '../types/BodyRange.js'; -import type { LocalizerType, ThemeType } from '../types/Util.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; -import { isAciString } from '../util/isAciString.js'; -import { MentionBlot } from '../quill/mentions/blot.js'; +} from '../types/BodyRange.std.js'; +import type { LocalizerType, ThemeType } from '../types/Util.std.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.preload.js'; +import { isAciString } from '../util/isAciString.std.js'; +import { MentionBlot } from '../quill/mentions/blot.dom.js'; import { matchEmojiImage, matchEmojiBlot, matchEmojiText, -} from '../quill/emoji/matchers.js'; -import { matchMention } from '../quill/mentions/matchers.js'; -import { MemberRepository } from '../quill/memberRepository.js'; +} from '../quill/emoji/matchers.dom.js'; +import { matchMention } from '../quill/mentions/matchers.std.js'; +import { MemberRepository } from '../quill/memberRepository.std.js'; import { getDeltaToRemoveStaleMentions, getTextAndRangesFromOps, @@ -55,35 +55,38 @@ import { getDeltaToRestartEmoji, insertEmojiOps, insertFormattingAndMentionsOps, -} from '../quill/util.js'; -import { SignalClipboard } from '../quill/signal-clipboard/index.js'; -import { DirectionalBlot } from '../quill/block/blot.js'; -import { getClassNamesFor } from '../util/getClassNamesFor.js'; -import { isNotNil } from '../util/isNotNil.js'; -import { createLogger } from '../logging/log.js'; -import type { LinkPreviewForUIType } from '../types/message/LinkPreviews.js'; -import { StagedLinkPreview } from './conversation/StagedLinkPreview.js'; +} from '../quill/util.dom.js'; +import { SignalClipboard } from '../quill/signal-clipboard/index.dom.js'; +import { DirectionalBlot } from '../quill/block/blot.dom.js'; +import { getClassNamesFor } from '../util/getClassNamesFor.std.js'; +import { isNotNil } from '../util/isNotNil.std.js'; +import { createLogger } from '../logging/log.std.js'; +import type { LinkPreviewForUIType } from '../types/message/LinkPreviews.std.js'; +import { StagedLinkPreview } from './conversation/StagedLinkPreview.dom.js'; import type { DraftEditMessageType } from '../model-types.d.ts'; -import { usePrevious } from '../hooks/usePrevious.js'; +import { usePrevious } from '../hooks/usePrevious.std.js'; import { matchBold, matchItalic, matchMonospace, matchSpoiler, matchStrikethrough, -} from '../quill/formatting/matchers.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import type { AutoSubstituteAsciiEmojisOptions } from '../quill/auto-substitute-ascii-emojis/index.js'; -import { AutoSubstituteAsciiEmojis } from '../quill/auto-substitute-ascii-emojis/index.js'; -import { dropNull } from '../util/dropNull.js'; -import { SimpleQuillWrapper } from './SimpleQuillWrapper.js'; -import { getEmojiVariantByKey, type EmojiSkinTone } from './fun/data/emojis.js'; -import { FUN_STATIC_EMOJI_CLASS } from './fun/FunEmoji.js'; -import { useFunEmojiSearch } from './fun/useFunEmojiSearch.js'; -import type { EmojiCompletionOptions } from '../quill/emoji/completion.js'; -import { useFunEmojiLocalizer } from './fun/useFunEmojiLocalizer.js'; -import { MAX_BODY_ATTACHMENT_BYTE_LENGTH } from '../util/longAttachment.js'; -import type { FunEmojiSelection } from './fun/panels/FunPanelEmojis.js'; +} from '../quill/formatting/matchers.dom.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import type { AutoSubstituteAsciiEmojisOptions } from '../quill/auto-substitute-ascii-emojis/index.dom.js'; +import { AutoSubstituteAsciiEmojis } from '../quill/auto-substitute-ascii-emojis/index.dom.js'; +import { dropNull } from '../util/dropNull.std.js'; +import { SimpleQuillWrapper } from './SimpleQuillWrapper.dom.js'; +import { + getEmojiVariantByKey, + type EmojiSkinTone, +} from './fun/data/emojis.std.js'; +import { FUN_STATIC_EMOJI_CLASS } from './fun/FunEmoji.dom.js'; +import { useFunEmojiSearch } from './fun/useFunEmojiSearch.dom.js'; +import type { EmojiCompletionOptions } from '../quill/emoji/completion.dom.js'; +import { useFunEmojiLocalizer } from './fun/useFunEmojiLocalizer.dom.js'; +import { MAX_BODY_ATTACHMENT_BYTE_LENGTH } from '../util/longAttachment.std.js'; +import type { FunEmojiSelection } from './fun/panels/FunPanelEmojis.dom.js'; const log = createLogger('CompositionInput'); diff --git a/ts/components/CompositionRecording.stories.tsx b/ts/components/CompositionRecording.stories.tsx index 98b1ca3814..6c0c9769c3 100644 --- a/ts/components/CompositionRecording.stories.tsx +++ b/ts/components/CompositionRecording.stories.tsx @@ -4,8 +4,8 @@ import React, { useState } from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './CompositionRecording.js'; -import { CompositionRecording } from './CompositionRecording.js'; +import type { Props } from './CompositionRecording.dom.js'; +import { CompositionRecording } from './CompositionRecording.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CompositionRecording.tsx b/ts/components/CompositionRecording.tsx index 0fafafd5db..be0dbecc21 100644 --- a/ts/components/CompositionRecording.tsx +++ b/ts/components/CompositionRecording.tsx @@ -3,17 +3,20 @@ import lodash from 'lodash'; import React, { useEffect, useRef, useState } from 'react'; -import { useEscapeHandling } from '../hooks/useEscapeHandling.js'; -import type { HideToastAction, ShowToastAction } from '../state/ducks/toast.js'; -import type { InMemoryAttachmentDraftType } from '../types/Attachment.js'; -import { ErrorDialogAudioRecorderType } from '../types/AudioRecorder.js'; -import type { LocalizerType } from '../types/Util.js'; -import type { AnyToast } from '../types/Toast.js'; -import { ToastType } from '../types/Toast.js'; -import { DurationInSeconds, SECOND } from '../util/durations/index.js'; -import { durationToPlaybackText } from '../util/durationToPlaybackText.js'; -import { ConfirmationDialog } from './ConfirmationDialog.js'; -import { RecordingComposer } from './RecordingComposer.js'; +import { useEscapeHandling } from '../hooks/useEscapeHandling.dom.js'; +import type { + HideToastAction, + ShowToastAction, +} from '../state/ducks/toast.preload.js'; +import type { InMemoryAttachmentDraftType } from '../types/Attachment.std.js'; +import { ErrorDialogAudioRecorderType } from '../types/AudioRecorder.std.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import type { AnyToast } from '../types/Toast.dom.js'; +import { ToastType } from '../types/Toast.dom.js'; +import { DurationInSeconds, SECOND } from '../util/durations/index.std.js'; +import { durationToPlaybackText } from '../util/durationToPlaybackText.std.js'; +import { ConfirmationDialog } from './ConfirmationDialog.dom.js'; +import { RecordingComposer } from './RecordingComposer.dom.js'; const { noop } = lodash; diff --git a/ts/components/CompositionRecordingDraft.stories.tsx b/ts/components/CompositionRecordingDraft.stories.tsx index 85b11088c3..bccab43bda 100644 --- a/ts/components/CompositionRecordingDraft.stories.tsx +++ b/ts/components/CompositionRecordingDraft.stories.tsx @@ -4,8 +4,8 @@ import React, { useState } from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './CompositionRecordingDraft.js'; -import { CompositionRecordingDraft } from './CompositionRecordingDraft.js'; +import type { Props } from './CompositionRecordingDraft.dom.js'; +import { CompositionRecordingDraft } from './CompositionRecordingDraft.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CompositionRecordingDraft.tsx b/ts/components/CompositionRecordingDraft.tsx index 8db5846d9c..3f626daf7d 100644 --- a/ts/components/CompositionRecordingDraft.tsx +++ b/ts/components/CompositionRecordingDraft.tsx @@ -2,14 +2,14 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useState, useCallback, useRef } from 'react'; -import { useComputePeaks } from '../hooks/useComputePeaks.js'; -import type { LocalizerType } from '../types/Util.js'; -import { WaveformScrubber } from './conversation/WaveformScrubber.js'; -import { PlaybackButton } from './PlaybackButton.js'; -import { RecordingComposer } from './RecordingComposer.js'; -import { createLogger } from '../logging/log.js'; -import type { Size } from '../hooks/useSizeObserver.js'; -import { SizeObserver } from '../hooks/useSizeObserver.js'; +import { useComputePeaks } from '../hooks/useComputePeaks.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { WaveformScrubber } from './conversation/WaveformScrubber.dom.js'; +import { PlaybackButton } from './PlaybackButton.dom.js'; +import { RecordingComposer } from './RecordingComposer.dom.js'; +import { createLogger } from '../logging/log.std.js'; +import type { Size } from '../hooks/useSizeObserver.dom.js'; +import { SizeObserver } from '../hooks/useSizeObserver.dom.js'; const log = createLogger('CompositionRecordingDraft'); diff --git a/ts/components/CompositionTextArea.tsx b/ts/components/CompositionTextArea.tsx index 2fb10688ef..7c2e09088d 100644 --- a/ts/components/CompositionTextArea.tsx +++ b/ts/components/CompositionTextArea.tsx @@ -2,22 +2,22 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useRef, useCallback, useState } from 'react'; -import type { LocalizerType } from '../types/I18N.js'; -import type { InputApi } from './CompositionInput.js'; -import { CompositionInput } from './CompositionInput.js'; +import type { LocalizerType } from '../types/I18N.std.js'; +import type { InputApi } from './CompositionInput.dom.js'; +import { CompositionInput } from './CompositionInput.dom.js'; import { hydrateRanges, type DraftBodyRanges, type HydratedBodyRangesType, -} from '../types/BodyRange.js'; -import type { ThemeType } from '../types/Util.js'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; -import * as grapheme from '../util/grapheme.js'; -import { FunEmojiPicker } from './fun/FunEmojiPicker.js'; -import type { FunEmojiSelection } from './fun/panels/FunPanelEmojis.js'; -import type { EmojiSkinTone } from './fun/data/emojis.js'; -import { FunEmojiPickerButton } from './fun/FunButton.js'; -import type { GetConversationByIdType } from '../state/selectors/conversations.js'; +} from '../types/BodyRange.std.js'; +import type { ThemeType } from '../types/Util.std.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.preload.js'; +import * as grapheme from '../util/grapheme.std.js'; +import { FunEmojiPicker } from './fun/FunEmojiPicker.dom.js'; +import type { FunEmojiSelection } from './fun/panels/FunPanelEmojis.dom.js'; +import type { EmojiSkinTone } from './fun/data/emojis.std.js'; +import { FunEmojiPickerButton } from './fun/FunButton.dom.js'; +import type { GetConversationByIdType } from '../state/selectors/conversations.dom.js'; export type CompositionTextAreaProps = { bodyRanges: HydratedBodyRangesType | null; diff --git a/ts/components/CompositionUpload.tsx b/ts/components/CompositionUpload.tsx index cfcb45ebb9..b0b62086d8 100644 --- a/ts/components/CompositionUpload.tsx +++ b/ts/components/CompositionUpload.tsx @@ -4,14 +4,17 @@ import type { ChangeEventHandler } from 'react'; import React, { forwardRef } from 'react'; -import type { AttachmentDraftType } from '../types/Attachment.js'; -import { isVideoAttachment, isImageAttachment } from '../util/Attachment.js'; -import type { LocalizerType } from '../types/Util.js'; +import type { AttachmentDraftType } from '../types/Attachment.std.js'; +import { + isVideoAttachment, + isImageAttachment, +} from '../util/Attachment.std.js'; +import type { LocalizerType } from '../types/Util.std.js'; import { getSupportedImageTypes, getSupportedVideoTypes, -} from '../util/GoogleChrome.js'; +} from '../util/GoogleChrome.std.js'; export type PropsType = { conversationId: string; diff --git a/ts/components/ConfirmDiscardDialog.stories.tsx b/ts/components/ConfirmDiscardDialog.stories.tsx index 31bd0f3793..8073fcf1db 100644 --- a/ts/components/ConfirmDiscardDialog.stories.tsx +++ b/ts/components/ConfirmDiscardDialog.stories.tsx @@ -5,8 +5,8 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { ConfirmDialogProps } from './ConfirmDiscardDialog.js'; -import { ConfirmDiscardDialog } from './ConfirmDiscardDialog.js'; +import type { ConfirmDialogProps } from './ConfirmDiscardDialog.dom.js'; +import { ConfirmDiscardDialog } from './ConfirmDiscardDialog.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/ConfirmDiscardDialog.tsx b/ts/components/ConfirmDiscardDialog.tsx index 2bd58c3835..ecce50362f 100644 --- a/ts/components/ConfirmDiscardDialog.tsx +++ b/ts/components/ConfirmDiscardDialog.tsx @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import { ConfirmationDialog } from './ConfirmationDialog.js'; -import type { LocalizerType } from '../types/Util.js'; +import { ConfirmationDialog } from './ConfirmationDialog.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; export type ConfirmDialogProps = { i18n: LocalizerType; diff --git a/ts/components/ConfirmLeaveCallModal.tsx b/ts/components/ConfirmLeaveCallModal.tsx index ee289c7353..4b2c5c7bfc 100644 --- a/ts/components/ConfirmLeaveCallModal.tsx +++ b/ts/components/ConfirmLeaveCallModal.tsx @@ -3,14 +3,14 @@ import React from 'react'; -import { ConfirmationDialog } from './ConfirmationDialog.js'; +import { ConfirmationDialog } from './ConfirmationDialog.dom.js'; -import type { LocalizerType } from '../types/Util.js'; +import type { LocalizerType } from '../types/Util.std.js'; import type { StartCallingLobbyType, StartCallLinkLobbyByRoomIdType, StartCallLinkLobbyType, -} from '../state/ducks/calling.js'; +} from '../state/ducks/calling.preload.js'; export type StartCallData = | ({ diff --git a/ts/components/ConfirmationDialog.stories.tsx b/ts/components/ConfirmationDialog.stories.tsx index e0aa7b1433..e612e42342 100644 --- a/ts/components/ConfirmationDialog.stories.tsx +++ b/ts/components/ConfirmationDialog.stories.tsx @@ -5,8 +5,8 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './ConfirmationDialog.js'; -import { ConfirmationDialog } from './ConfirmationDialog.js'; +import type { Props } from './ConfirmationDialog.dom.js'; +import { ConfirmationDialog } from './ConfirmationDialog.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/ConfirmationDialog.tsx b/ts/components/ConfirmationDialog.tsx index 56c1aeb9ae..d18209ac75 100644 --- a/ts/components/ConfirmationDialog.tsx +++ b/ts/components/ConfirmationDialog.tsx @@ -4,13 +4,13 @@ import type { MouseEvent } from 'react'; import React, { useCallback } from 'react'; import { animated } from '@react-spring/web'; -import { Button, ButtonVariant } from './Button.js'; -import type { LocalizerType } from '../types/Util.js'; -import { ModalHost } from './ModalHost.js'; -import { ModalPage } from './Modal.js'; -import type { Theme } from '../util/theme.js'; -import { useAnimated } from '../hooks/useAnimated.js'; -import { Spinner } from './Spinner.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { ModalHost } from './ModalHost.dom.js'; +import { ModalPage } from './Modal.dom.js'; +import type { Theme } from '../util/theme.std.js'; +import { useAnimated } from '../hooks/useAnimated.dom.js'; +import { Spinner } from './Spinner.dom.js'; export type ActionSpec = { action: () => unknown; diff --git a/ts/components/ContactPill.tsx b/ts/components/ContactPill.tsx index facec14f43..f3882804d8 100644 --- a/ts/components/ContactPill.tsx +++ b/ts/components/ContactPill.tsx @@ -3,10 +3,10 @@ import React from 'react'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import type { LocalizerType } from '../types/Util.js'; -import { ContactName } from './conversation/ContactName.js'; -import { Avatar, AvatarSize } from './Avatar.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { ContactName } from './conversation/ContactName.dom.js'; +import { Avatar, AvatarSize } from './Avatar.dom.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/ContactPills.stories.tsx b/ts/components/ContactPills.stories.tsx index b64879230b..fb808a4715 100644 --- a/ts/components/ContactPills.stories.tsx +++ b/ts/components/ContactPills.stories.tsx @@ -7,11 +7,11 @@ import lodash from 'lodash'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { ContactPills } from './ContactPills.js'; -import type { PropsType as ContactPillPropsType } from './ContactPill.js'; -import { ContactPill } from './ContactPill.js'; -import { gifUrl } from '../storybook/Fixtures.js'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; +import { ContactPills } from './ContactPills.dom.js'; +import type { PropsType as ContactPillPropsType } from './ContactPill.dom.js'; +import { ContactPill } from './ContactPill.dom.js'; +import { gifUrl } from '../storybook/Fixtures.std.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.std.js'; const { times } = lodash; diff --git a/ts/components/ContactPills.tsx b/ts/components/ContactPills.tsx index 298acabe10..25011bc5ed 100644 --- a/ts/components/ContactPills.tsx +++ b/ts/components/ContactPills.tsx @@ -5,8 +5,8 @@ import type { ReactNode } from 'react'; import React, { useRef, useEffect, Children } from 'react'; import classNames from 'classnames'; -import { usePrevious } from '../hooks/usePrevious.js'; -import { scrollToBottom } from '../util/scrollUtil.js'; +import { usePrevious } from '../hooks/usePrevious.std.js'; +import { scrollToBottom } from '../util/scrollUtil.std.js'; type PropsType = { moduleClassName?: string; diff --git a/ts/components/ContextMenu.stories.tsx b/ts/components/ContextMenu.stories.tsx index 0b501c6c35..b530f36755 100644 --- a/ts/components/ContextMenu.stories.tsx +++ b/ts/components/ContextMenu.stories.tsx @@ -5,8 +5,8 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './ContextMenu.js'; -import { ContextMenu } from './ContextMenu.js'; +import type { PropsType } from './ContextMenu.dom.js'; +import { ContextMenu } from './ContextMenu.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/ContextMenu.tsx b/ts/components/ContextMenu.tsx index f0ee1025ec..b71d458b19 100644 --- a/ts/components/ContextMenu.tsx +++ b/ts/components/ContextMenu.tsx @@ -9,11 +9,11 @@ import classNames from 'classnames'; import { usePopper } from 'react-popper'; import lodash from 'lodash'; -import type { Theme } from '../util/theme.js'; -import type { LocalizerType } from '../types/Util.js'; -import { getClassNamesFor } from '../util/getClassNamesFor.js'; -import { themeClassName } from '../util/theme.js'; -import { handleOutsideClick } from '../util/handleOutsideClick.js'; +import type { Theme } from '../util/theme.std.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { getClassNamesFor } from '../util/getClassNamesFor.std.js'; +import { themeClassName } from '../util/theme.std.js'; +import { handleOutsideClick } from '../util/handleOutsideClick.dom.js'; const { noop } = lodash; diff --git a/ts/components/ConversationList.stories.tsx b/ts/components/ConversationList.stories.tsx index 7ca1148c16..077f4977c0 100644 --- a/ts/components/ConversationList.stories.tsx +++ b/ts/components/ConversationList.stories.tsx @@ -6,16 +6,16 @@ import lodash from 'lodash'; import { v4 as generateUuid } from 'uuid'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Row, PropsType } from './ConversationList.js'; -import { ConversationList, RowType } from './ConversationList.js'; -import { MessageSearchResult } from './conversationList/MessageSearchResult.js'; -import type { PropsData as ConversationListItemPropsType } from './conversationList/ConversationListItem.js'; -import { MessageStatuses } from '../types/message/MessageStatus.js'; -import { ContactCheckboxDisabledReason } from './conversationList/ContactCheckbox.js'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; -import { ThemeType } from '../types/Util.js'; +import type { Row, PropsType } from './ConversationList.dom.js'; +import { ConversationList, RowType } from './ConversationList.dom.js'; +import { MessageSearchResult } from './conversationList/MessageSearchResult.dom.js'; +import type { PropsData as ConversationListItemPropsType } from './conversationList/ConversationListItem.dom.js'; +import { MessageStatuses } from '../types/message/MessageStatus.std.js'; +import { ContactCheckboxDisabledReason } from './conversationList/ContactCheckbox.dom.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.std.js'; +import { ThemeType } from '../types/Util.std.js'; import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext.js'; -import { makeFakeLookupConversationWithoutServiceId } from '../test-helpers/fakeLookupConversationWithoutServiceId.js'; +import { makeFakeLookupConversationWithoutServiceId } from '../test-helpers/fakeLookupConversationWithoutServiceId.std.js'; const { times, omit } = lodash; diff --git a/ts/components/ConversationList.tsx b/ts/components/ConversationList.tsx index 78799fcaf9..e84e6d305b 100644 --- a/ts/components/ConversationList.tsx +++ b/ts/components/ConversationList.tsx @@ -7,38 +7,38 @@ import type { ListRowRenderer } from 'react-virtualized'; import classNames from 'classnames'; import lodash from 'lodash'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { assertDev } from '../util/assert.js'; -import type { ParsedE164Type } from '../util/libphonenumberInstance.js'; -import type { LocalizerType, ThemeType } from '../types/Util.js'; -import { ScrollBehavior } from '../types/Util.js'; -import { getNavSidebarWidthBreakpoint } from './_util.js'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; -import type { LookupConversationWithoutServiceIdActionsType } from '../util/lookupConversationWithoutServiceId.js'; -import type { ShowConversationType } from '../state/ducks/conversations.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { assertDev } from '../util/assert.std.js'; +import type { ParsedE164Type } from '../util/libphonenumberInstance.std.js'; +import type { LocalizerType, ThemeType } from '../types/Util.std.js'; +import { ScrollBehavior } from '../types/Util.std.js'; +import { getNavSidebarWidthBreakpoint } from './_util.std.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.preload.js'; +import type { LookupConversationWithoutServiceIdActionsType } from '../util/lookupConversationWithoutServiceId.preload.js'; +import type { ShowConversationType } from '../state/ducks/conversations.preload.js'; -import type { PropsData as ConversationListItemPropsType } from './conversationList/ConversationListItem.js'; -import type { ContactCheckboxDisabledReason } from './conversationList/ContactCheckbox.js'; -import type { ContactListItemConversationType as ContactListItemPropsType } from './conversationList/ContactListItem.js'; -import type { GroupListItemConversationType } from './conversationList/GroupListItem.js'; -import { ConversationListItem } from './conversationList/ConversationListItem.js'; -import { ContactListItem } from './conversationList/ContactListItem.js'; -import { ContactCheckbox as ContactCheckboxComponent } from './conversationList/ContactCheckbox.js'; -import { PhoneNumberCheckbox as PhoneNumberCheckboxComponent } from './conversationList/PhoneNumberCheckbox.js'; -import { UsernameCheckbox as UsernameCheckboxComponent } from './conversationList/UsernameCheckbox.js'; +import type { PropsData as ConversationListItemPropsType } from './conversationList/ConversationListItem.dom.js'; +import type { ContactCheckboxDisabledReason } from './conversationList/ContactCheckbox.dom.js'; +import type { ContactListItemConversationType as ContactListItemPropsType } from './conversationList/ContactListItem.dom.js'; +import type { GroupListItemConversationType } from './conversationList/GroupListItem.dom.js'; +import { ConversationListItem } from './conversationList/ConversationListItem.dom.js'; +import { ContactListItem } from './conversationList/ContactListItem.dom.js'; +import { ContactCheckbox as ContactCheckboxComponent } from './conversationList/ContactCheckbox.dom.js'; +import { PhoneNumberCheckbox as PhoneNumberCheckboxComponent } from './conversationList/PhoneNumberCheckbox.dom.js'; +import { UsernameCheckbox as UsernameCheckboxComponent } from './conversationList/UsernameCheckbox.dom.js'; import { ComposeStepButton, Icon as ComposeStepButtonIcon, -} from './conversationList/ComposeStepButton.js'; -import { StartNewConversation as StartNewConversationComponent } from './conversationList/StartNewConversation.js'; -import { SearchResultsLoadingFakeHeader as SearchResultsLoadingFakeHeaderComponent } from './conversationList/SearchResultsLoadingFakeHeader.js'; -import { SearchResultsLoadingFakeRow as SearchResultsLoadingFakeRowComponent } from './conversationList/SearchResultsLoadingFakeRow.js'; -import { UsernameSearchResultListItem } from './conversationList/UsernameSearchResultListItem.js'; -import { GroupListItem } from './conversationList/GroupListItem.js'; -import { ListView } from './ListView.js'; -import { Button, ButtonVariant } from './Button.js'; -import { ListTile } from './ListTile.js'; -import type { RenderConversationListItemContextMenuProps } from './conversationList/BaseConversationListItem.js'; +} from './conversationList/ComposeStepButton.dom.js'; +import { StartNewConversation as StartNewConversationComponent } from './conversationList/StartNewConversation.dom.js'; +import { SearchResultsLoadingFakeHeader as SearchResultsLoadingFakeHeaderComponent } from './conversationList/SearchResultsLoadingFakeHeader.dom.js'; +import { SearchResultsLoadingFakeRow as SearchResultsLoadingFakeRowComponent } from './conversationList/SearchResultsLoadingFakeRow.dom.js'; +import { UsernameSearchResultListItem } from './conversationList/UsernameSearchResultListItem.dom.js'; +import { GroupListItem } from './conversationList/GroupListItem.dom.js'; +import { ListView } from './ListView.dom.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import { ListTile } from './ListTile.dom.js'; +import type { RenderConversationListItemContextMenuProps } from './conversationList/BaseConversationListItem.dom.js'; const { get, pick } = lodash; diff --git a/ts/components/CountryCodeSelect.stories.tsx b/ts/components/CountryCodeSelect.stories.tsx index ed38333ebd..f955668aca 100644 --- a/ts/components/CountryCodeSelect.stories.tsx +++ b/ts/components/CountryCodeSelect.stories.tsx @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useState } from 'react'; -import type { PropsType } from './CountryCodeSelect.js'; -import { CountryCodeSelect } from './CountryCodeSelect.js'; -import { type ComponentMeta } from '../storybook/types.js'; +import type { PropsType } from './CountryCodeSelect.dom.js'; +import { CountryCodeSelect } from './CountryCodeSelect.dom.js'; +import { type ComponentMeta } from '../storybook/types.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CountryCodeSelect.tsx b/ts/components/CountryCodeSelect.tsx index a2441fe0ac..b0838519be 100644 --- a/ts/components/CountryCodeSelect.tsx +++ b/ts/components/CountryCodeSelect.tsx @@ -4,10 +4,10 @@ import React, { useState, useCallback, useMemo } from 'react'; import Fuse from 'fuse.js'; -import type { LocalizerType } from '../types/Util.js'; -import type { CountryDataType } from '../util/getCountryData.js'; -import { Modal } from './Modal.js'; -import { SearchInput } from './SearchInput.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import type { CountryDataType } from '../util/getCountryData.dom.js'; +import { Modal } from './Modal.dom.js'; +import { SearchInput } from './SearchInput.dom.js'; export type PropsType = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/CrashReportDialog.stories.tsx b/ts/components/CrashReportDialog.stories.tsx index d53618220a..a236ea73ea 100644 --- a/ts/components/CrashReportDialog.stories.tsx +++ b/ts/components/CrashReportDialog.stories.tsx @@ -5,9 +5,9 @@ import React, { useState } from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './CrashReportDialog.js'; -import { CrashReportDialog } from './CrashReportDialog.js'; -import { sleep } from '../util/sleep.js'; +import type { PropsType } from './CrashReportDialog.dom.js'; +import { CrashReportDialog } from './CrashReportDialog.dom.js'; +import { sleep } from '../util/sleep.std.js'; export default { title: 'Components/CrashReportDialog', diff --git a/ts/components/CrashReportDialog.tsx b/ts/components/CrashReportDialog.tsx index c6b8ae6603..e108247cf4 100644 --- a/ts/components/CrashReportDialog.tsx +++ b/ts/components/CrashReportDialog.tsx @@ -3,10 +3,10 @@ import React from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import { Button, ButtonVariant } from './Button.js'; -import { Modal } from './Modal.js'; -import { Spinner } from './Spinner.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import { Modal } from './Modal.dom.js'; +import { Spinner } from './Spinner.dom.js'; type PropsActionsType = { writeCrashReportsToLog: () => void; diff --git a/ts/components/CriticalIdlePrimaryDeviceDialog.tsx b/ts/components/CriticalIdlePrimaryDeviceDialog.tsx index ca16ecfe3d..97ef43e48d 100644 --- a/ts/components/CriticalIdlePrimaryDeviceDialog.tsx +++ b/ts/components/CriticalIdlePrimaryDeviceDialog.tsx @@ -3,10 +3,10 @@ import React from 'react'; -import { LeftPaneDialog } from './LeftPaneDialog.js'; -import type { WidthBreakpoint } from './_util.js'; -import type { LocalizerType } from '../types/I18N.js'; -import { I18n } from './I18n.js'; +import { LeftPaneDialog } from './LeftPaneDialog.dom.js'; +import type { WidthBreakpoint } from './_util.std.js'; +import type { LocalizerType } from '../types/I18N.std.js'; +import { I18n } from './I18n.dom.js'; export type PropsType = { containerWidthBreakpoint: WidthBreakpoint; diff --git a/ts/components/CriticalIdlePrimaryDeviceModal.stories.tsx b/ts/components/CriticalIdlePrimaryDeviceModal.stories.tsx index ca09de0bea..86d258708a 100644 --- a/ts/components/CriticalIdlePrimaryDeviceModal.stories.tsx +++ b/ts/components/CriticalIdlePrimaryDeviceModal.stories.tsx @@ -5,7 +5,7 @@ import type { Meta, StoryFn } from '@storybook/react'; import React, { type ComponentProps } from 'react'; import { action } from '@storybook/addon-actions'; -import { CriticalIdlePrimaryDeviceModal } from './CriticalIdlePrimaryDeviceModal.js'; +import { CriticalIdlePrimaryDeviceModal } from './CriticalIdlePrimaryDeviceModal.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CriticalIdlePrimaryDeviceModal.tsx b/ts/components/CriticalIdlePrimaryDeviceModal.tsx index 6481291552..0dda2987ef 100644 --- a/ts/components/CriticalIdlePrimaryDeviceModal.tsx +++ b/ts/components/CriticalIdlePrimaryDeviceModal.tsx @@ -3,11 +3,11 @@ import * as React from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import { Modal } from './Modal.js'; -import { Button, ButtonVariant } from './Button.js'; -import { CRITICAL_IDLE_PRIMARY_DEVICE_SUPPORT_PAGE } from './CriticalIdlePrimaryDeviceDialog.js'; -import { I18n } from './I18n.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { Modal } from './Modal.dom.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import { CRITICAL_IDLE_PRIMARY_DEVICE_SUPPORT_PAGE } from './CriticalIdlePrimaryDeviceDialog.dom.js'; +import { I18n } from './I18n.dom.js'; type PropsType = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/CustomColorEditor.stories.tsx b/ts/components/CustomColorEditor.stories.tsx index 293097a517..bbe9dbf3d7 100644 --- a/ts/components/CustomColorEditor.stories.tsx +++ b/ts/components/CustomColorEditor.stories.tsx @@ -6,8 +6,8 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './CustomColorEditor.js'; -import { CustomColorEditor } from './CustomColorEditor.js'; +import type { PropsType } from './CustomColorEditor.dom.js'; +import { CustomColorEditor } from './CustomColorEditor.dom.js'; export default { title: 'Components/CustomColorEditor', diff --git a/ts/components/CustomColorEditor.tsx b/ts/components/CustomColorEditor.tsx index f94bcd15de..5e0da87f72 100644 --- a/ts/components/CustomColorEditor.tsx +++ b/ts/components/CustomColorEditor.tsx @@ -2,15 +2,15 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useState } from 'react'; -import { Button, ButtonVariant } from './Button.js'; -import { GradientDial, KnobType } from './GradientDial.js'; -import { SampleMessageBubbles } from './SampleMessageBubbles.js'; -import { Slider } from './Slider.js'; -import { Tabs } from './Tabs.js'; -import type { CustomColorType } from '../types/Colors.js'; -import type { LocalizerType } from '../types/Util.js'; -import { getHSL } from '../util/getHSL.js'; -import { getCustomColorStyle } from '../util/getCustomColorStyle.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import { GradientDial, KnobType } from './GradientDial.dom.js'; +import { SampleMessageBubbles } from './SampleMessageBubbles.dom.js'; +import { Slider } from './Slider.dom.js'; +import { Tabs } from './Tabs.dom.js'; +import type { CustomColorType } from '../types/Colors.std.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { getHSL } from '../util/getHSL.std.js'; +import { getCustomColorStyle } from '../util/getCustomColorStyle.dom.js'; export type PropsType = { customColor?: CustomColorType; diff --git a/ts/components/CustomizingPreferredReactionsModal.stories.tsx b/ts/components/CustomizingPreferredReactionsModal.stories.tsx index b044941d23..ca10bb1f1a 100644 --- a/ts/components/CustomizingPreferredReactionsModal.stories.tsx +++ b/ts/components/CustomizingPreferredReactionsModal.stories.tsx @@ -6,10 +6,10 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { DEFAULT_PREFERRED_REACTION_EMOJI } from '../reactions/constants.js'; -import type { PropsType } from './CustomizingPreferredReactionsModal.js'; -import { CustomizingPreferredReactionsModal } from './CustomizingPreferredReactionsModal.js'; -import { EmojiSkinTone } from './fun/data/emojis.js'; +import { DEFAULT_PREFERRED_REACTION_EMOJI } from '../reactions/constants.std.js'; +import type { PropsType } from './CustomizingPreferredReactionsModal.dom.js'; +import { CustomizingPreferredReactionsModal } from './CustomizingPreferredReactionsModal.dom.js'; +import { EmojiSkinTone } from './fun/data/emojis.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/CustomizingPreferredReactionsModal.tsx b/ts/components/CustomizingPreferredReactionsModal.tsx index 61d8e111b8..a1de4d6434 100644 --- a/ts/components/CustomizingPreferredReactionsModal.tsx +++ b/ts/components/CustomizingPreferredReactionsModal.tsx @@ -4,22 +4,22 @@ import React, { useState, useCallback, useRef } from 'react'; import lodash from 'lodash'; -import type { LocalizerType } from '../types/Util.js'; -import { Modal } from './Modal.js'; -import { Button, ButtonVariant } from './Button.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { Modal } from './Modal.dom.js'; +import { Button, ButtonVariant } from './Button.dom.js'; import { ReactionPickerPicker, ReactionPickerPickerEmojiButton, ReactionPickerPickerStyle, -} from './ReactionPickerPicker.js'; -import { DEFAULT_PREFERRED_REACTION_EMOJI_PARENT_KEYS } from '../reactions/constants.js'; +} from './ReactionPickerPicker.dom.js'; +import { DEFAULT_PREFERRED_REACTION_EMOJI_PARENT_KEYS } from '../reactions/constants.std.js'; import { EmojiSkinTone, getEmojiVariantByKey, getEmojiVariantByParentKeyAndSkinTone, -} from './fun/data/emojis.js'; -import { FunEmojiPicker } from './fun/FunEmojiPicker.js'; -import type { FunEmojiSelection } from './fun/panels/FunPanelEmojis.js'; +} from './fun/data/emojis.std.js'; +import { FunEmojiPicker } from './fun/FunEmojiPicker.dom.js'; +import type { FunEmojiSelection } from './fun/panels/FunPanelEmojis.dom.js'; const { isEqual } = lodash; diff --git a/ts/components/DebugLogErrorModal.stories.tsx b/ts/components/DebugLogErrorModal.stories.tsx index 3edea1aee3..587495700d 100644 --- a/ts/components/DebugLogErrorModal.stories.tsx +++ b/ts/components/DebugLogErrorModal.stories.tsx @@ -5,8 +5,8 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './DebugLogErrorModal.js'; -import { DebugLogErrorModal } from './DebugLogErrorModal.js'; +import type { PropsType } from './DebugLogErrorModal.dom.js'; +import { DebugLogErrorModal } from './DebugLogErrorModal.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/DebugLogErrorModal.tsx b/ts/components/DebugLogErrorModal.tsx index 163bd52193..7c5afabd5d 100644 --- a/ts/components/DebugLogErrorModal.tsx +++ b/ts/components/DebugLogErrorModal.tsx @@ -3,9 +3,9 @@ import * as React from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import { Modal } from './Modal.js'; -import { Button, ButtonVariant } from './Button.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { Modal } from './Modal.dom.js'; +import { Button, ButtonVariant } from './Button.dom.js'; export type PropsType = { description?: string; diff --git a/ts/components/DebugLogWindow.stories.tsx b/ts/components/DebugLogWindow.stories.tsx index 4c8a50e35a..35f413647f 100644 --- a/ts/components/DebugLogWindow.stories.tsx +++ b/ts/components/DebugLogWindow.stories.tsx @@ -5,9 +5,9 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './DebugLogWindow.js'; -import { DebugLogWindow } from './DebugLogWindow.js'; -import { sleep } from '../util/sleep.js'; +import type { PropsType } from './DebugLogWindow.dom.js'; +import { DebugLogWindow } from './DebugLogWindow.dom.js'; +import { sleep } from '../util/sleep.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/DebugLogWindow.tsx b/ts/components/DebugLogWindow.tsx index f0920ad280..caf2f8f9b7 100644 --- a/ts/components/DebugLogWindow.tsx +++ b/ts/components/DebugLogWindow.tsx @@ -4,18 +4,18 @@ import type { MouseEvent } from 'react'; import React, { useEffect, useState } from 'react'; import copyText from 'copy-text-to-clipboard'; -import type { LocalizerType } from '../types/Util.js'; -import * as Errors from '../types/errors.js'; -import type { AnyToast } from '../types/Toast.js'; -import { ToastType } from '../types/Toast.js'; -import { createLogger } from '../logging/log.js'; -import { Button, ButtonVariant } from './Button.js'; -import { Spinner } from './Spinner.js'; -import { ToastManager } from './ToastManager.js'; -import { createSupportUrl } from '../util/createSupportUrl.js'; -import { shouldNeverBeCalled } from '../util/shouldNeverBeCalled.js'; -import { openLinkInWebBrowser } from '../util/openLinkInWebBrowser.js'; -import { useEscapeHandling } from '../hooks/useEscapeHandling.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import * as Errors from '../types/errors.std.js'; +import type { AnyToast } from '../types/Toast.dom.js'; +import { ToastType } from '../types/Toast.dom.js'; +import { createLogger } from '../logging/log.std.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import { Spinner } from './Spinner.dom.js'; +import { ToastManager } from './ToastManager.dom.js'; +import { createSupportUrl } from '../util/createSupportUrl.std.js'; +import { shouldNeverBeCalled } from '../util/shouldNeverBeCalled.std.js'; +import { openLinkInWebBrowser } from '../util/openLinkInWebBrowser.dom.js'; +import { useEscapeHandling } from '../hooks/useEscapeHandling.dom.js'; const log = createLogger('DebugLogWindow'); diff --git a/ts/components/DeleteMessagesConfirmationDialog.tsx b/ts/components/DeleteMessagesConfirmationDialog.tsx index d6df82d18f..6cb16bd022 100644 --- a/ts/components/DeleteMessagesConfirmationDialog.tsx +++ b/ts/components/DeleteMessagesConfirmationDialog.tsx @@ -1,9 +1,9 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import type { LocalizerType } from '../types/I18N.js'; -import { ConfirmationDialog } from './ConfirmationDialog.js'; -import { LocalDeleteWarningModal } from './LocalDeleteWarningModal.js'; +import type { LocalizerType } from '../types/I18N.std.js'; +import { ConfirmationDialog } from './ConfirmationDialog.dom.js'; +import { LocalDeleteWarningModal } from './LocalDeleteWarningModal.dom.js'; export function DeleteMessagesConfirmationDialog({ i18n, diff --git a/ts/components/DeleteMessagesModal.stories.tsx b/ts/components/DeleteMessagesModal.stories.tsx index 457aae3ad9..6f23ff3095 100644 --- a/ts/components/DeleteMessagesModal.stories.tsx +++ b/ts/components/DeleteMessagesModal.stories.tsx @@ -5,8 +5,8 @@ import React from 'react'; import type { Meta, StoryFn } from '@storybook/react'; import { action } from '@storybook/addon-actions'; -import DeleteMessagesModal from './DeleteMessagesModal.js'; -import type { DeleteMessagesModalProps } from './DeleteMessagesModal.js'; +import DeleteMessagesModal from './DeleteMessagesModal.dom.js'; +import type { DeleteMessagesModalProps } from './DeleteMessagesModal.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/DeleteMessagesModal.tsx b/ts/components/DeleteMessagesModal.tsx index 6f1511298c..01611f9804 100644 --- a/ts/components/DeleteMessagesModal.tsx +++ b/ts/components/DeleteMessagesModal.tsx @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import type { ActionSpec } from './ConfirmationDialog.js'; -import { ConfirmationDialog } from './ConfirmationDialog.js'; -import type { LocalizerType } from '../types/Util.js'; -import type { ShowToastAction } from '../state/ducks/toast.js'; -import { ToastType } from '../types/Toast.js'; +import type { ActionSpec } from './ConfirmationDialog.dom.js'; +import { ConfirmationDialog } from './ConfirmationDialog.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import type { ShowToastAction } from '../state/ducks/toast.preload.js'; +import { ToastType } from '../types/Toast.dom.js'; export type DeleteMessagesModalProps = Readonly<{ isMe: boolean; diff --git a/ts/components/DialogExpiredBuild.stories.tsx b/ts/components/DialogExpiredBuild.stories.tsx index d86a9289d6..11e6da6ca0 100644 --- a/ts/components/DialogExpiredBuild.stories.tsx +++ b/ts/components/DialogExpiredBuild.stories.tsx @@ -3,10 +3,10 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './DialogExpiredBuild.js'; -import { DialogExpiredBuild } from './DialogExpiredBuild.js'; -import { WidthBreakpoint } from './_util.js'; -import { FakeLeftPaneContainer } from '../test-helpers/FakeLeftPaneContainer.js'; +import type { PropsType } from './DialogExpiredBuild.dom.js'; +import { DialogExpiredBuild } from './DialogExpiredBuild.dom.js'; +import { WidthBreakpoint } from './_util.std.js'; +import { FakeLeftPaneContainer } from '../test-helpers/FakeLeftPaneContainer.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/DialogExpiredBuild.tsx b/ts/components/DialogExpiredBuild.tsx index b6bf9d8c61..ef929c7bef 100644 --- a/ts/components/DialogExpiredBuild.tsx +++ b/ts/components/DialogExpiredBuild.tsx @@ -3,11 +3,11 @@ import React from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import type { WidthBreakpoint } from './_util.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import type { WidthBreakpoint } from './_util.std.js'; -import { LeftPaneDialog } from './LeftPaneDialog.js'; -import { openLinkInWebBrowser } from '../util/openLinkInWebBrowser.js'; +import { LeftPaneDialog } from './LeftPaneDialog.dom.js'; +import { openLinkInWebBrowser } from '../util/openLinkInWebBrowser.dom.js'; export type PropsType = { containerWidthBreakpoint: WidthBreakpoint; diff --git a/ts/components/DialogNetworkStatus.stories.tsx b/ts/components/DialogNetworkStatus.stories.tsx index 5779e1da1f..2b2b6df474 100644 --- a/ts/components/DialogNetworkStatus.stories.tsx +++ b/ts/components/DialogNetworkStatus.stories.tsx @@ -5,11 +5,11 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './DialogNetworkStatus.js'; -import { DialogNetworkStatus } from './DialogNetworkStatus.js'; -import { SocketStatus } from '../types/SocketStatus.js'; -import { WidthBreakpoint } from './_util.js'; -import { FakeLeftPaneContainer } from '../test-helpers/FakeLeftPaneContainer.js'; +import type { PropsType } from './DialogNetworkStatus.dom.js'; +import { DialogNetworkStatus } from './DialogNetworkStatus.dom.js'; +import { SocketStatus } from '../types/SocketStatus.std.js'; +import { WidthBreakpoint } from './_util.std.js'; +import { FakeLeftPaneContainer } from '../test-helpers/FakeLeftPaneContainer.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/DialogNetworkStatus.tsx b/ts/components/DialogNetworkStatus.tsx index 8e4ab354e1..370146bd3f 100644 --- a/ts/components/DialogNetworkStatus.tsx +++ b/ts/components/DialogNetworkStatus.tsx @@ -3,13 +3,13 @@ import React, { useEffect } from 'react'; -import { LeftPaneDialog } from './LeftPaneDialog.js'; -import { Spinner } from './Spinner.js'; -import type { LocalizerType } from '../types/Util.js'; -import { SocketStatus } from '../types/SocketStatus.js'; -import type { NetworkStateType } from '../state/ducks/network.js'; -import type { WidthBreakpoint } from './_util.js'; -import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.js'; +import { LeftPaneDialog } from './LeftPaneDialog.dom.js'; +import { Spinner } from './Spinner.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { SocketStatus } from '../types/SocketStatus.std.js'; +import type { NetworkStateType } from '../state/ducks/network.dom.js'; +import type { WidthBreakpoint } from './_util.std.js'; +import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.std.js'; const FIVE_SECONDS = 5 * 1000; diff --git a/ts/components/DialogRelink.stories.tsx b/ts/components/DialogRelink.stories.tsx index 6d716b2945..8b01b02ee4 100644 --- a/ts/components/DialogRelink.stories.tsx +++ b/ts/components/DialogRelink.stories.tsx @@ -4,10 +4,10 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './DialogRelink.js'; -import { DialogRelink } from './DialogRelink.js'; -import { WidthBreakpoint } from './_util.js'; -import { FakeLeftPaneContainer } from '../test-helpers/FakeLeftPaneContainer.js'; +import type { PropsType } from './DialogRelink.dom.js'; +import { DialogRelink } from './DialogRelink.dom.js'; +import { WidthBreakpoint } from './_util.std.js'; +import { FakeLeftPaneContainer } from '../test-helpers/FakeLeftPaneContainer.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/DialogRelink.tsx b/ts/components/DialogRelink.tsx index 3ad37cdf0d..019977cb72 100644 --- a/ts/components/DialogRelink.tsx +++ b/ts/components/DialogRelink.tsx @@ -3,10 +3,10 @@ import React from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import type { WidthBreakpoint } from './_util.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import type { WidthBreakpoint } from './_util.std.js'; -import { LeftPaneDialog } from './LeftPaneDialog.js'; +import { LeftPaneDialog } from './LeftPaneDialog.dom.js'; export type PropsType = { containerWidthBreakpoint: WidthBreakpoint; diff --git a/ts/components/DialogUpdate.stories.tsx b/ts/components/DialogUpdate.stories.tsx index 406fd4c517..ccf5da1082 100644 --- a/ts/components/DialogUpdate.stories.tsx +++ b/ts/components/DialogUpdate.stories.tsx @@ -4,12 +4,12 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './DialogUpdate.js'; -import { DialogUpdate } from './DialogUpdate.js'; -import { DialogType } from '../types/Dialogs.js'; -import { WidthBreakpoint } from './_util.js'; -import { SECOND } from '../util/durations/index.js'; -import { FakeLeftPaneContainer } from '../test-helpers/FakeLeftPaneContainer.js'; +import type { PropsType } from './DialogUpdate.dom.js'; +import { DialogUpdate } from './DialogUpdate.dom.js'; +import { DialogType } from '../types/Dialogs.std.js'; +import { WidthBreakpoint } from './_util.std.js'; +import { SECOND } from '../util/durations/index.std.js'; +import { FakeLeftPaneContainer } from '../test-helpers/FakeLeftPaneContainer.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/DialogUpdate.tsx b/ts/components/DialogUpdate.tsx index 84d57a9c69..9248023dc2 100644 --- a/ts/components/DialogUpdate.tsx +++ b/ts/components/DialogUpdate.tsx @@ -4,19 +4,19 @@ import type { ReactNode } from 'react'; import React, { useCallback } from 'react'; -import { isBeta } from '../util/version.js'; -import { DialogType } from '../types/Dialogs.js'; +import { isBeta } from '../util/version.std.js'; +import { DialogType } from '../types/Dialogs.std.js'; import { PRODUCTION_DOWNLOAD_URL, BETA_DOWNLOAD_URL, -} from '../types/support.js'; -import { I18n } from './I18n.js'; -import { LeftPaneDialog } from './LeftPaneDialog.js'; -import { formatFileSize } from '../util/formatFileSize.js'; +} from '../types/support.std.js'; +import { I18n } from './I18n.dom.js'; +import { LeftPaneDialog } from './LeftPaneDialog.dom.js'; +import { formatFileSize } from '../util/formatFileSize.std.js'; -import type { LocalizerType } from '../types/Util.js'; -import type { DismissOptions } from './LeftPaneDialog.js'; -import type { WidthBreakpoint } from './_util.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import type { DismissOptions } from './LeftPaneDialog.dom.js'; +import type { WidthBreakpoint } from './_util.std.js'; function contactSupportLink(parts: ReactNode): JSX.Element { return ( diff --git a/ts/components/DirectCallRemoteParticipant.tsx b/ts/components/DirectCallRemoteParticipant.tsx index ad71e096e5..758812cae0 100644 --- a/ts/components/DirectCallRemoteParticipant.tsx +++ b/ts/components/DirectCallRemoteParticipant.tsx @@ -3,12 +3,12 @@ import React, { useRef, useEffect } from 'react'; import classNames from 'classnames'; -import type { SetRendererCanvasType } from '../state/ducks/calling.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import type { LocalizerType } from '../types/Util.js'; -import { AvatarColors } from '../types/Colors.js'; -import { Avatar, AvatarSize } from './Avatar.js'; -import { CallBackgroundBlur } from './CallBackgroundBlur.js'; +import type { SetRendererCanvasType } from '../state/ducks/calling.preload.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { AvatarColors } from '../types/Colors.std.js'; +import { Avatar, AvatarSize } from './Avatar.dom.js'; +import { CallBackgroundBlur } from './CallBackgroundBlur.dom.js'; type PropsType = { conversation: ConversationType; diff --git a/ts/components/DisappearingTimeDialog.stories.tsx b/ts/components/DisappearingTimeDialog.stories.tsx index cdc25ee067..ee041dc2c0 100644 --- a/ts/components/DisappearingTimeDialog.stories.tsx +++ b/ts/components/DisappearingTimeDialog.stories.tsx @@ -4,9 +4,9 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './DisappearingTimeDialog.js'; -import { DisappearingTimeDialog } from './DisappearingTimeDialog.js'; -import { EXPIRE_TIMERS } from '../test-helpers/expireTimers.js'; +import type { PropsType } from './DisappearingTimeDialog.dom.js'; +import { DisappearingTimeDialog } from './DisappearingTimeDialog.dom.js'; +import { EXPIRE_TIMERS } from '../test-helpers/expireTimers.std.js'; export default { title: 'Components/DisappearingTimeDialog', diff --git a/ts/components/DisappearingTimeDialog.tsx b/ts/components/DisappearingTimeDialog.tsx index b97c097e94..ccfddc8775 100644 --- a/ts/components/DisappearingTimeDialog.tsx +++ b/ts/components/DisappearingTimeDialog.tsx @@ -3,11 +3,11 @@ import React, { useState } from 'react'; -import { ConfirmationDialog } from './ConfirmationDialog.js'; -import { Select } from './Select.js'; -import type { LocalizerType } from '../types/Util.js'; -import type { Theme } from '../util/theme.js'; -import { DurationInSeconds } from '../util/durations/index.js'; +import { ConfirmationDialog } from './ConfirmationDialog.dom.js'; +import { Select } from './Select.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import type { Theme } from '../util/theme.std.js'; +import { DurationInSeconds } from '../util/durations/index.std.js'; const CSS_MODULE = 'module-disappearing-time-dialog'; diff --git a/ts/components/DisappearingTimerSelect.stories.tsx b/ts/components/DisappearingTimerSelect.stories.tsx index 72d62d0ac3..bb8025713e 100644 --- a/ts/components/DisappearingTimerSelect.stories.tsx +++ b/ts/components/DisappearingTimerSelect.stories.tsx @@ -3,9 +3,9 @@ import React, { useState } from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './DisappearingTimerSelect.js'; -import { DisappearingTimerSelect } from './DisappearingTimerSelect.js'; -import { DurationInSeconds } from '../util/durations/index.js'; +import type { Props } from './DisappearingTimerSelect.dom.js'; +import { DisappearingTimerSelect } from './DisappearingTimerSelect.dom.js'; +import { DurationInSeconds } from '../util/durations/index.std.js'; export default { title: 'Components/DisappearingTimerSelect', diff --git a/ts/components/DisappearingTimerSelect.tsx b/ts/components/DisappearingTimerSelect.tsx index 27817e4966..72a543f0f0 100644 --- a/ts/components/DisappearingTimerSelect.tsx +++ b/ts/components/DisappearingTimerSelect.tsx @@ -3,12 +3,12 @@ import type { ReactNode } from 'react'; import React, { useCallback, useState, useMemo } from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import * as expirationTimer from '../util/expirationTimer.js'; -import { DurationInSeconds } from '../util/durations/index.js'; -import { DisappearingTimeDialog } from './DisappearingTimeDialog.js'; -import { AxoSelect } from '../axo/AxoSelect.js'; -import { tw } from '../axo/tw.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import * as expirationTimer from '../util/expirationTimer.std.js'; +import { DurationInSeconds } from '../util/durations/index.std.js'; +import { DisappearingTimeDialog } from './DisappearingTimeDialog.dom.js'; +import { AxoSelect } from '../axo/AxoSelect.dom.js'; +import { tw } from '../axo/tw.dom.js'; export type Props = { i18n: LocalizerType; diff --git a/ts/components/DonationErrorModal.stories.tsx b/ts/components/DonationErrorModal.stories.tsx index 1aad4bb3d6..26e977eb4b 100644 --- a/ts/components/DonationErrorModal.stories.tsx +++ b/ts/components/DonationErrorModal.stories.tsx @@ -6,9 +6,9 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './DonationErrorModal.js'; -import { DonationErrorModal } from './DonationErrorModal.js'; -import { donationErrorTypeSchema } from '../types/Donations.js'; +import type { PropsType } from './DonationErrorModal.dom.js'; +import { DonationErrorModal } from './DonationErrorModal.dom.js'; +import { donationErrorTypeSchema } from '../types/Donations.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/DonationErrorModal.tsx b/ts/components/DonationErrorModal.tsx index 0fcb76ea4f..023099779b 100644 --- a/ts/components/DonationErrorModal.tsx +++ b/ts/components/DonationErrorModal.tsx @@ -4,13 +4,13 @@ import React from 'react'; import type { ReactNode } from 'react'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { donationErrorTypeSchema } from '../types/Donations.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { donationErrorTypeSchema } from '../types/Donations.std.js'; -import type { LocalizerType } from '../types/Util.js'; -import type { DonationErrorType } from '../types/Donations.js'; -import { Button } from './Button.js'; -import { Modal } from './Modal.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import type { DonationErrorType } from '../types/Donations.std.js'; +import { Button } from './Button.dom.js'; +import { Modal } from './Modal.dom.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/DonationInterruptedModal.stories.tsx b/ts/components/DonationInterruptedModal.stories.tsx index e57f486462..b53a645c48 100644 --- a/ts/components/DonationInterruptedModal.stories.tsx +++ b/ts/components/DonationInterruptedModal.stories.tsx @@ -6,8 +6,8 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './DonationInterruptedModal.js'; -import { DonationInterruptedModal } from './DonationInterruptedModal.js'; +import type { PropsType } from './DonationInterruptedModal.dom.js'; +import { DonationInterruptedModal } from './DonationInterruptedModal.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/DonationInterruptedModal.tsx b/ts/components/DonationInterruptedModal.tsx index 697678a168..80ef15affb 100644 --- a/ts/components/DonationInterruptedModal.tsx +++ b/ts/components/DonationInterruptedModal.tsx @@ -3,9 +3,9 @@ import React from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import { Modal } from './Modal.js'; -import { Button, ButtonVariant } from './Button.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { Modal } from './Modal.dom.js'; +import { Button, ButtonVariant } from './Button.dom.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/DonationPrivacyInformationModal.tsx b/ts/components/DonationPrivacyInformationModal.tsx index 4673ef3062..6aeb362ad0 100644 --- a/ts/components/DonationPrivacyInformationModal.tsx +++ b/ts/components/DonationPrivacyInformationModal.tsx @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useCallback } from 'react'; -import { Modal } from './Modal.js'; -import { Button, ButtonSize } from './Button.js'; -import { I18n } from './I18n.js'; -import type { LocalizerType } from '../types/Util.js'; -import { openLinkInWebBrowser } from '../util/openLinkInWebBrowser.js'; +import { Modal } from './Modal.dom.js'; +import { Button, ButtonSize } from './Button.dom.js'; +import { I18n } from './I18n.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { openLinkInWebBrowser } from '../util/openLinkInWebBrowser.dom.js'; export type DonationPrivacyInformationModalProps = { i18n: LocalizerType; diff --git a/ts/components/DonationProgressModal.stories.tsx b/ts/components/DonationProgressModal.stories.tsx index a01859db5e..e7983d2fa6 100644 --- a/ts/components/DonationProgressModal.stories.tsx +++ b/ts/components/DonationProgressModal.stories.tsx @@ -6,8 +6,8 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './DonationProgressModal.js'; -import { DonationProgressModal } from './DonationProgressModal.js'; +import type { PropsType } from './DonationProgressModal.dom.js'; +import { DonationProgressModal } from './DonationProgressModal.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/DonationProgressModal.tsx b/ts/components/DonationProgressModal.tsx index c75c447eb9..f2c716790f 100644 --- a/ts/components/DonationProgressModal.tsx +++ b/ts/components/DonationProgressModal.tsx @@ -3,10 +3,10 @@ import React, { useEffect } from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import { Modal } from './Modal.js'; -import { SpinnerV2 } from './SpinnerV2.js'; -import { SECOND } from '../util/durations/index.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { Modal } from './Modal.dom.js'; +import { SpinnerV2 } from './SpinnerV2.dom.js'; +import { SECOND } from '../util/durations/index.std.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/DonationStillProcessingModal.stories.tsx b/ts/components/DonationStillProcessingModal.stories.tsx index 60c3f2127a..380cf5ff42 100644 --- a/ts/components/DonationStillProcessingModal.stories.tsx +++ b/ts/components/DonationStillProcessingModal.stories.tsx @@ -6,8 +6,8 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './DonationStillProcessingModal.js'; -import { DonationStillProcessingModal } from './DonationStillProcessingModal.js'; +import type { PropsType } from './DonationStillProcessingModal.dom.js'; +import { DonationStillProcessingModal } from './DonationStillProcessingModal.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/DonationStillProcessingModal.tsx b/ts/components/DonationStillProcessingModal.tsx index 1c3a3bc161..f51d81876b 100644 --- a/ts/components/DonationStillProcessingModal.tsx +++ b/ts/components/DonationStillProcessingModal.tsx @@ -3,9 +3,9 @@ import React from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import { Modal } from './Modal.js'; -import { Button } from './Button.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { Modal } from './Modal.dom.js'; +import { Button } from './Button.dom.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/DonationThanksModal.stories.tsx b/ts/components/DonationThanksModal.stories.tsx index 3bfb06f343..97d65fef28 100644 --- a/ts/components/DonationThanksModal.stories.tsx +++ b/ts/components/DonationThanksModal.stories.tsx @@ -5,9 +5,9 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta, StoryFn } from '@storybook/react'; -import type { PropsType } from './DonationThanksModal.js'; -import { DonationThanksModal } from './DonationThanksModal.js'; -import { getFakeBadge } from '../test-helpers/getFakeBadge.js'; +import type { PropsType } from './DonationThanksModal.dom.js'; +import { DonationThanksModal } from './DonationThanksModal.dom.js'; +import { getFakeBadge } from '../test-helpers/getFakeBadge.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/DonationThanksModal.tsx b/ts/components/DonationThanksModal.tsx index d548e20bab..32226ec10a 100644 --- a/ts/components/DonationThanksModal.tsx +++ b/ts/components/DonationThanksModal.tsx @@ -3,13 +3,13 @@ import React, { useState } from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import type { BadgeType } from '../badges/types.js'; -import { Modal } from './Modal.js'; -import { Button, ButtonVariant } from './Button.js'; -import { Checkbox } from './Checkbox.js'; -import { BadgeImage } from './BadgeImage.js'; -import { Spinner } from './Spinner.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import type { BadgeType } from '../badges/types.std.js'; +import { Modal } from './Modal.dom.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import { Checkbox } from './Checkbox.dom.js'; +import { BadgeImage } from './BadgeImage.dom.js'; +import { Spinner } from './Spinner.dom.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/DonationVerificationModal.stories.tsx b/ts/components/DonationVerificationModal.stories.tsx index 5e43045cd5..32cbc68839 100644 --- a/ts/components/DonationVerificationModal.stories.tsx +++ b/ts/components/DonationVerificationModal.stories.tsx @@ -6,9 +6,9 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './DonationVerificationModal.js'; -import { DonationVerificationModal } from './DonationVerificationModal.js'; -import { SECOND } from '../util/durations/index.js'; +import type { PropsType } from './DonationVerificationModal.dom.js'; +import { DonationVerificationModal } from './DonationVerificationModal.dom.js'; +import { SECOND } from '../util/durations/index.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/DonationVerificationModal.tsx b/ts/components/DonationVerificationModal.tsx index cfcd3812fd..f8a2c8175c 100644 --- a/ts/components/DonationVerificationModal.tsx +++ b/ts/components/DonationVerificationModal.tsx @@ -3,10 +3,10 @@ import React, { useEffect, useState } from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import { Modal } from './Modal.js'; -import { Button, ButtonVariant } from './Button.js'; -import { DAY } from '../util/durations/index.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { Modal } from './Modal.dom.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import { DAY } from '../util/durations/index.std.js'; export type PropsType = { // Test-only diff --git a/ts/components/DonationsErrorBoundary.tsx b/ts/components/DonationsErrorBoundary.tsx index 7a9791f95f..84fa67581e 100644 --- a/ts/components/DonationsErrorBoundary.tsx +++ b/ts/components/DonationsErrorBoundary.tsx @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { ReactNode, ErrorInfo } from 'react'; import React, { Component, useCallback } from 'react'; -import { createLogger } from '../logging/log.js'; -import * as Errors from '../types/errors.js'; +import { createLogger } from '../logging/log.std.js'; +import * as Errors from '../types/errors.std.js'; const log = createLogger('DonationsErrorBoundary'); diff --git a/ts/components/DraftGifMessageSendModal.stories.tsx b/ts/components/DraftGifMessageSendModal.stories.tsx index f6ec3364d8..6ab9316289 100644 --- a/ts/components/DraftGifMessageSendModal.stories.tsx +++ b/ts/components/DraftGifMessageSendModal.stories.tsx @@ -6,15 +6,15 @@ import { action } from '@storybook/addon-actions'; import { DraftGifMessageSendModal, type DraftGifMessageSendModalProps, -} from './DraftGifMessageSendModal.js'; -import { ThemeType } from '../types/Util.js'; -import { CompositionTextArea } from './CompositionTextArea.js'; -import type { SmartCompositionTextAreaProps } from '../state/smart/CompositionTextArea.js'; -import { EmojiSkinTone } from './fun/data/emojis.js'; -import { LoadingState } from '../util/loadable.js'; -import { VIDEO_MP4 } from '../types/MIME.js'; -import { drop } from '../util/drop.js'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; +} from './DraftGifMessageSendModal.dom.js'; +import { ThemeType } from '../types/Util.std.js'; +import { CompositionTextArea } from './CompositionTextArea.dom.js'; +import type { SmartCompositionTextAreaProps } from '../state/smart/CompositionTextArea.preload.js'; +import { EmojiSkinTone } from './fun/data/emojis.std.js'; +import { LoadingState } from '../util/loadable.std.js'; +import { VIDEO_MP4 } from '../types/MIME.std.js'; +import { drop } from '../util/drop.std.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/DraftGifMessageSendModal.tsx b/ts/components/DraftGifMessageSendModal.tsx index 288baa0431..746fabc524 100644 --- a/ts/components/DraftGifMessageSendModal.tsx +++ b/ts/components/DraftGifMessageSendModal.tsx @@ -2,17 +2,17 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { type ComponentType, useEffect, useMemo, useId } from 'react'; import { VisuallyHidden } from 'react-aria'; -import type { LocalizerType } from '../types/I18N.js'; -import { Button, ButtonVariant } from './Button.js'; -import { Modal } from './Modal.js'; -import type { HydratedBodyRangesType } from '../types/BodyRange.js'; -import type { SmartCompositionTextAreaProps } from '../state/smart/CompositionTextArea.js'; -import type { ThemeType } from '../types/Util.js'; -import { EmojiSkinTone } from './fun/data/emojis.js'; -import { FunGifPreview } from './fun/FunGif.js'; -import type { FunGifSelection } from './fun/panels/FunPanelGifs.js'; -import type { GifDownloadState } from '../state/smart/DraftGifMessageSendModal.js'; -import { LoadingState } from '../util/loadable.js'; +import type { LocalizerType } from '../types/I18N.std.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import { Modal } from './Modal.dom.js'; +import type { HydratedBodyRangesType } from '../types/BodyRange.std.js'; +import type { SmartCompositionTextAreaProps } from '../state/smart/CompositionTextArea.preload.js'; +import type { ThemeType } from '../types/Util.std.js'; +import { EmojiSkinTone } from './fun/data/emojis.std.js'; +import { FunGifPreview } from './fun/FunGif.dom.js'; +import type { FunGifSelection } from './fun/panels/FunPanelGifs.dom.js'; +import type { GifDownloadState } from '../state/smart/DraftGifMessageSendModal.preload.js'; +import { LoadingState } from '../util/loadable.std.js'; export type DraftGifMessageSendModalProps = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/EditHistoryMessagesModal.tsx b/ts/components/EditHistoryMessagesModal.tsx index 861fada49c..e56fbcdb91 100644 --- a/ts/components/EditHistoryMessagesModal.tsx +++ b/ts/components/EditHistoryMessagesModal.tsx @@ -4,18 +4,18 @@ import React, { useCallback, useState, useRef } from 'react'; import lodash from 'lodash'; -import type { AttachmentType } from '../types/Attachment.js'; -import type { LocalizerType } from '../types/Util.js'; -import type { MessagePropsType } from '../state/selectors/message.js'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; -import { Message, TextDirection } from './conversation/Message.js'; -import { Modal } from './Modal.js'; -import { WidthBreakpoint } from './_util.js'; -import { shouldNeverBeCalled } from '../util/shouldNeverBeCalled.js'; -import { useTheme } from '../hooks/useTheme.js'; -import { isSameDay } from '../util/timestamp.js'; -import { TimelineDateHeader } from './conversation/TimelineDateHeader.js'; -import { drop } from '../util/drop.js'; +import type { AttachmentType } from '../types/Attachment.std.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import type { MessagePropsType } from '../state/selectors/message.preload.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.preload.js'; +import { Message, TextDirection } from './conversation/Message.dom.js'; +import { Modal } from './Modal.dom.js'; +import { WidthBreakpoint } from './_util.std.js'; +import { shouldNeverBeCalled } from '../util/shouldNeverBeCalled.std.js'; +import { useTheme } from '../hooks/useTheme.dom.js'; +import { isSameDay } from '../util/timestamp.std.js'; +import { TimelineDateHeader } from './conversation/TimelineDateHeader.dom.js'; +import { drop } from '../util/drop.std.js'; const { noop } = lodash; diff --git a/ts/components/EditNicknameAndNoteModal.stories.tsx b/ts/components/EditNicknameAndNoteModal.stories.tsx index d661811f46..5a99ac481a 100644 --- a/ts/components/EditNicknameAndNoteModal.stories.tsx +++ b/ts/components/EditNicknameAndNoteModal.stories.tsx @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import { action } from '@storybook/addon-actions'; import * as React from 'react'; -import type { ComponentMeta } from '../storybook/types.js'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; -import type { EditNicknameAndNoteModalProps } from './EditNicknameAndNoteModal.js'; -import { EditNicknameAndNoteModal } from './EditNicknameAndNoteModal.js'; +import type { ComponentMeta } from '../storybook/types.std.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.std.js'; +import type { EditNicknameAndNoteModalProps } from './EditNicknameAndNoteModal.dom.js'; +import { EditNicknameAndNoteModal } from './EditNicknameAndNoteModal.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/EditNicknameAndNoteModal.tsx b/ts/components/EditNicknameAndNoteModal.tsx index 9f176f1438..855d1eae9d 100644 --- a/ts/components/EditNicknameAndNoteModal.tsx +++ b/ts/components/EditNicknameAndNoteModal.tsx @@ -4,18 +4,18 @@ import type { FormEvent } from 'react'; import React, { useCallback, useMemo, useState } from 'react'; import { v4 as uuid } from 'uuid'; import { z } from 'zod'; -import { Modal } from './Modal.js'; -import type { LocalizerType } from '../types/I18N.js'; -import { Avatar, AvatarSize } from './Avatar.js'; +import { Modal } from './Modal.dom.js'; +import type { LocalizerType } from '../types/I18N.std.js'; +import { Avatar, AvatarSize } from './Avatar.dom.js'; import type { ConversationType, NicknameAndNote, -} from '../state/ducks/conversations.js'; -import { Input } from './Input.js'; -import { AutoSizeTextArea } from './AutoSizeTextArea.js'; -import { Button, ButtonVariant } from './Button.js'; -import { strictAssert } from '../util/assert.js'; -import { safeParsePartial } from '../util/schemas.js'; +} from '../state/ducks/conversations.preload.js'; +import { Input } from './Input.dom.js'; +import { AutoSizeTextArea } from './AutoSizeTextArea.dom.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import { strictAssert } from '../util/assert.std.js'; +import { safeParsePartial } from '../util/schemas.std.js'; const formSchema = z.object({ nickname: z diff --git a/ts/components/ErrorBoundary.tsx b/ts/components/ErrorBoundary.tsx index f2a4dded24..0c51b67806 100644 --- a/ts/components/ErrorBoundary.tsx +++ b/ts/components/ErrorBoundary.tsx @@ -4,9 +4,9 @@ import type { ReactNode, ErrorInfo } from 'react'; import React from 'react'; -import * as Errors from '../types/errors.js'; -import { createLogger } from '../logging/log.js'; -import { ToastType } from '../types/Toast.js'; +import * as Errors from '../types/errors.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { ToastType } from '../types/Toast.dom.js'; const log = createLogger('ErrorBoundary'); diff --git a/ts/components/ErrorModal.stories.tsx b/ts/components/ErrorModal.stories.tsx index cd81d84159..3318217f53 100644 --- a/ts/components/ErrorModal.stories.tsx +++ b/ts/components/ErrorModal.stories.tsx @@ -5,10 +5,10 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './ErrorModal.js'; -import { ErrorModal } from './ErrorModal.js'; +import type { PropsType } from './ErrorModal.dom.js'; +import { ErrorModal } from './ErrorModal.dom.js'; -import { ButtonVariant } from './Button.js'; +import { ButtonVariant } from './Button.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/ErrorModal.tsx b/ts/components/ErrorModal.tsx index a4aee6e409..54a473dce3 100644 --- a/ts/components/ErrorModal.tsx +++ b/ts/components/ErrorModal.tsx @@ -3,9 +3,9 @@ import * as React from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import { Modal } from './Modal.js'; -import { Button, ButtonVariant } from './Button.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { Modal } from './Modal.dom.js'; +import { Button, ButtonVariant } from './Button.dom.js'; export type PropsType = { buttonVariant?: ButtonVariant; diff --git a/ts/components/FileThumbnail.stories.tsx b/ts/components/FileThumbnail.stories.tsx index 6424fcdb0d..568c67992c 100644 --- a/ts/components/FileThumbnail.stories.tsx +++ b/ts/components/FileThumbnail.stories.tsx @@ -3,8 +3,8 @@ import React from 'react'; import type { Meta } from '@storybook/react'; -import { FileThumbnail } from './FileThumbnail.js'; -import { APPLICATION_OCTET_STREAM } from '../types/MIME.js'; +import { FileThumbnail } from './FileThumbnail.dom.js'; +import { APPLICATION_OCTET_STREAM } from '../types/MIME.std.js'; export default { title: 'FileThumbnail', diff --git a/ts/components/FileThumbnail.tsx b/ts/components/FileThumbnail.tsx index db56e29c52..a4c7a7e4e0 100644 --- a/ts/components/FileThumbnail.tsx +++ b/ts/components/FileThumbnail.tsx @@ -3,9 +3,9 @@ import React from 'react'; -import { getExtensionForDisplay } from '../util/Attachment.js'; -import { isFileDangerous } from '../util/isFileDangerous.js'; -import { tw } from '../axo/tw.js'; +import { getExtensionForDisplay } from '../util/Attachment.std.js'; +import { isFileDangerous } from '../util/isFileDangerous.std.js'; +import { tw } from '../axo/tw.dom.js'; export type PropsType = Readonly[0]>; diff --git a/ts/components/ForwardMessagesModal.stories.tsx b/ts/components/ForwardMessagesModal.stories.tsx index fbb11935bf..40ac15c62a 100644 --- a/ts/components/ForwardMessagesModal.stories.tsx +++ b/ts/components/ForwardMessagesModal.stories.tsx @@ -4,18 +4,18 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { AttachmentForUIType } from '../types/Attachment.js'; -import type { PropsType } from './ForwardMessagesModal.js'; +import type { AttachmentForUIType } from '../types/Attachment.std.js'; +import type { PropsType } from './ForwardMessagesModal.dom.js'; import { ForwardMessagesModal, ForwardMessagesModalType, -} from './ForwardMessagesModal.js'; -import { IMAGE_JPEG, VIDEO_MP4, stringToMIMEType } from '../types/MIME.js'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; +} from './ForwardMessagesModal.dom.js'; +import { IMAGE_JPEG, VIDEO_MP4, stringToMIMEType } from '../types/MIME.std.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.std.js'; import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext.js'; -import { CompositionTextArea } from './CompositionTextArea.js'; -import type { MessageForwardDraft } from '../types/ForwardDraft.js'; -import { EmojiSkinTone } from './fun/data/emojis.js'; +import { CompositionTextArea } from './CompositionTextArea.dom.js'; +import type { MessageForwardDraft } from '../types/ForwardDraft.std.js'; +import { EmojiSkinTone } from './fun/data/emojis.std.js'; const createAttachment = ( props: Partial = {} diff --git a/ts/components/ForwardMessagesModal.tsx b/ts/components/ForwardMessagesModal.tsx index b454beac0f..57816d422f 100644 --- a/ts/components/ForwardMessagesModal.tsx +++ b/ts/components/ForwardMessagesModal.tsx @@ -10,41 +10,41 @@ import React, { useState, Fragment, } from 'react'; -import { AttachmentList } from './conversation/AttachmentList.js'; -import type { AttachmentForUIType } from '../types/Attachment.js'; -import { Button } from './Button.js'; -import { ConfirmationDialog } from './ConfirmationDialog.js'; -import { ContactCheckboxDisabledReason } from './conversationList/ContactCheckbox.js'; -import type { Row } from './ConversationList.js'; -import { ConversationList, RowType } from './ConversationList.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; -import type { LocalizerType, ThemeType } from '../types/Util.js'; -import type { SmartCompositionTextAreaProps } from '../state/smart/CompositionTextArea.js'; -import { SearchInput } from './SearchInput.js'; -import { StagedLinkPreview } from './conversation/StagedLinkPreview.js'; -import { filterAndSortConversations } from '../util/filterAndSortConversations.js'; +import { AttachmentList } from './conversation/AttachmentList.dom.js'; +import type { AttachmentForUIType } from '../types/Attachment.std.js'; +import { Button } from './Button.dom.js'; +import { ConfirmationDialog } from './ConfirmationDialog.dom.js'; +import { ContactCheckboxDisabledReason } from './conversationList/ContactCheckbox.dom.js'; +import type { Row } from './ConversationList.dom.js'; +import { ConversationList, RowType } from './ConversationList.dom.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.preload.js'; +import type { LocalizerType, ThemeType } from '../types/Util.std.js'; +import type { SmartCompositionTextAreaProps } from '../state/smart/CompositionTextArea.preload.js'; +import { SearchInput } from './SearchInput.dom.js'; +import { StagedLinkPreview } from './conversation/StagedLinkPreview.dom.js'; +import { filterAndSortConversations } from '../util/filterAndSortConversations.std.js'; import { shouldNeverBeCalled, asyncShouldNeverBeCalled, -} from '../util/shouldNeverBeCalled.js'; -import type { LinkPreviewForUIType } from '../types/message/LinkPreviews.js'; -import { LinkPreviewSourceType } from '../types/LinkPreview.js'; -import { ToastType } from '../types/Toast.js'; -import type { ShowToastAction } from '../state/ducks/toast.js'; -import type { HydratedBodyRangesType } from '../types/BodyRange.js'; -import { applyRangesToText } from '../types/BodyRange.js'; -import { UserText } from './UserText.js'; -import { Modal } from './Modal.js'; -import { SizeObserver } from '../hooks/useSizeObserver.js'; +} from '../util/shouldNeverBeCalled.std.js'; +import type { LinkPreviewForUIType } from '../types/message/LinkPreviews.std.js'; +import { LinkPreviewSourceType } from '../types/LinkPreview.std.js'; +import { ToastType } from '../types/Toast.dom.js'; +import type { ShowToastAction } from '../state/ducks/toast.preload.js'; +import type { HydratedBodyRangesType } from '../types/BodyRange.std.js'; +import { applyRangesToText } from '../types/BodyRange.std.js'; +import { UserText } from './UserText.dom.js'; +import { Modal } from './Modal.dom.js'; +import { SizeObserver } from '../hooks/useSizeObserver.dom.js'; import { isDraftEditable, isDraftForwardable, type MessageForwardDraft, -} from '../types/ForwardDraft.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { Theme } from '../util/theme.js'; -import { EmojiSkinTone } from './fun/data/emojis.js'; +} from '../types/ForwardDraft.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { Theme } from '../util/theme.std.js'; +import { EmojiSkinTone } from './fun/data/emojis.std.js'; export enum ForwardMessagesModalType { Forward, diff --git a/ts/components/GlobalModalContainer.tsx b/ts/components/GlobalModalContainer.tsx index bacb604506..565dce8146 100644 --- a/ts/components/GlobalModalContainer.tsx +++ b/ts/components/GlobalModalContainer.tsx @@ -11,28 +11,28 @@ import type { MessageRequestActionsConfirmationPropsType, SafetyNumberChangedBlockingDataType, UserNotFoundModalStateType, -} from '../state/ducks/globalModals.js'; -import type { LocalizerType, ThemeType } from '../types/Util.js'; -import { UsernameOnboardingState } from '../types/globalModals.js'; -import { missingCaseError } from '../util/missingCaseError.js'; +} from '../state/ducks/globalModals.preload.js'; +import type { LocalizerType, ThemeType } from '../types/Util.std.js'; +import { UsernameOnboardingState } from '../types/globalModals.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; -import { ButtonVariant } from './Button.js'; -import { ConfirmationDialog } from './ConfirmationDialog.js'; -import { SignalConnectionsModal } from './SignalConnectionsModal.js'; -import { WhatsNewModal } from './WhatsNewModal.js'; -import { MediaPermissionsModal } from './MediaPermissionsModal.js'; -import type { StartCallData } from './ConfirmLeaveCallModal.js'; +import { ButtonVariant } from './Button.dom.js'; +import { ConfirmationDialog } from './ConfirmationDialog.dom.js'; +import { SignalConnectionsModal } from './SignalConnectionsModal.dom.js'; +import { WhatsNewModal } from './WhatsNewModal.dom.js'; +import { MediaPermissionsModal } from './MediaPermissionsModal.dom.js'; +import type { StartCallData } from './ConfirmLeaveCallModal.dom.js'; import { TapToViewNotAvailableModal, type DataPropsType as TapToViewNotAvailablePropsType, -} from './TapToViewNotAvailableModal.js'; +} from './TapToViewNotAvailableModal.dom.js'; import { BackfillFailureModal, type DataPropsType as BackfillFailureModalPropsType, -} from './BackfillFailureModal.js'; -import type { SmartDraftGifMessageSendModalProps } from '../state/smart/DraftGifMessageSendModal.js'; -import { CriticalIdlePrimaryDeviceModal } from './CriticalIdlePrimaryDeviceModal.js'; -import { LowDiskSpaceBackupImportModal } from './LowDiskSpaceBackupImportModal.js'; +} from './BackfillFailureModal.dom.js'; +import type { SmartDraftGifMessageSendModalProps } from '../state/smart/DraftGifMessageSendModal.preload.js'; +import { CriticalIdlePrimaryDeviceModal } from './CriticalIdlePrimaryDeviceModal.dom.js'; +import { LowDiskSpaceBackupImportModal } from './LowDiskSpaceBackupImportModal.dom.js'; // NOTE: All types should be required for this component so that the smart // component gives you type errors when adding/removing props. diff --git a/ts/components/GradientDial.tsx b/ts/components/GradientDial.tsx index 7472581233..9e687dac9b 100644 --- a/ts/components/GradientDial.tsx +++ b/ts/components/GradientDial.tsx @@ -4,8 +4,8 @@ import type { CSSProperties, KeyboardEvent } from 'react'; import React, { useEffect, useRef, useState } from 'react'; import classNames from 'classnames'; -import { arrow } from '../util/keyboard.js'; -import type { LocalizerType } from '../types/Util.js'; +import { arrow } from '../util/keyboard.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; export enum KnobType { start = 'start', diff --git a/ts/components/GroupCallOverflowArea.stories.tsx b/ts/components/GroupCallOverflowArea.stories.tsx index 9da78c2841..ef6b41ee7d 100644 --- a/ts/components/GroupCallOverflowArea.stories.tsx +++ b/ts/components/GroupCallOverflowArea.stories.tsx @@ -5,14 +5,14 @@ import React from 'react'; import lodash from 'lodash'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './GroupCallOverflowArea.js'; -import { GroupCallOverflowArea } from './GroupCallOverflowArea.js'; -import { getDefaultConversationWithServiceId } from '../test-helpers/getDefaultConversation.js'; -import { fakeGetGroupCallVideoFrameSource } from '../test-helpers/fakeGetGroupCallVideoFrameSource.js'; -import { FRAME_BUFFER_SIZE } from '../calling/constants.js'; -import { generateAci } from '../types/ServiceId.js'; -import type { CallingImageDataCache } from './CallManager.js'; -import { MINUTE } from '../util/durations/index.js'; +import type { PropsType } from './GroupCallOverflowArea.dom.js'; +import { GroupCallOverflowArea } from './GroupCallOverflowArea.dom.js'; +import { getDefaultConversationWithServiceId } from '../test-helpers/getDefaultConversation.std.js'; +import { fakeGetGroupCallVideoFrameSource } from '../test-helpers/fakeGetGroupCallVideoFrameSource.std.js'; +import { FRAME_BUFFER_SIZE } from '../calling/constants.std.js'; +import { generateAci } from '../types/ServiceId.std.js'; +import type { CallingImageDataCache } from './CallManager.dom.js'; +import { MINUTE } from '../util/durations/index.std.js'; const { memoize, times } = lodash; diff --git a/ts/components/GroupCallOverflowArea.tsx b/ts/components/GroupCallOverflowArea.tsx index 537119169c..1457db9d56 100644 --- a/ts/components/GroupCallOverflowArea.tsx +++ b/ts/components/GroupCallOverflowArea.tsx @@ -5,10 +5,10 @@ import type { ReactElement } from 'react'; import React, { useRef, useState, useEffect } from 'react'; import classNames from 'classnames'; import type { VideoFrameSource } from '@signalapp/ringrtc'; -import type { LocalizerType } from '../types/Util.js'; -import type { GroupCallRemoteParticipantType } from '../types/Calling.js'; -import { GroupCallRemoteParticipant } from './GroupCallRemoteParticipant.js'; -import type { CallingImageDataCache } from './CallManager.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import type { GroupCallRemoteParticipantType } from '../types/Calling.std.js'; +import { GroupCallRemoteParticipant } from './GroupCallRemoteParticipant.dom.js'; +import type { CallingImageDataCache } from './CallManager.dom.js'; const OVERFLOW_SCROLLED_TO_EDGE_THRESHOLD = 20; const OVERFLOW_SCROLL_BUTTON_RATIO = 0.75; diff --git a/ts/components/GroupCallRemoteParticipant.stories.tsx b/ts/components/GroupCallRemoteParticipant.stories.tsx index 4abe0615c1..947808ff8c 100644 --- a/ts/components/GroupCallRemoteParticipant.stories.tsx +++ b/ts/components/GroupCallRemoteParticipant.stories.tsx @@ -4,13 +4,13 @@ import * as React from 'react'; import lodash from 'lodash'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './GroupCallRemoteParticipant.js'; -import { GroupCallRemoteParticipant } from './GroupCallRemoteParticipant.js'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; -import { FRAME_BUFFER_SIZE } from '../calling/constants.js'; -import { generateAci } from '../types/ServiceId.js'; -import type { CallingImageDataCache } from './CallManager.js'; -import { MINUTE } from '../util/durations/index.js'; +import type { PropsType } from './GroupCallRemoteParticipant.dom.js'; +import { GroupCallRemoteParticipant } from './GroupCallRemoteParticipant.dom.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.std.js'; +import { FRAME_BUFFER_SIZE } from '../calling/constants.std.js'; +import { generateAci } from '../types/ServiceId.std.js'; +import type { CallingImageDataCache } from './CallManager.dom.js'; +import { MINUTE } from '../util/durations/index.std.js'; const { memoize } = lodash; diff --git a/ts/components/GroupCallRemoteParticipant.tsx b/ts/components/GroupCallRemoteParticipant.tsx index 975d04addf..4fea8e898a 100644 --- a/ts/components/GroupCallRemoteParticipant.tsx +++ b/ts/components/GroupCallRemoteParticipant.tsx @@ -12,25 +12,25 @@ import React, { import classNames from 'classnames'; import lodash from 'lodash'; import type { VideoFrameSource } from '@signalapp/ringrtc'; -import type { GroupCallRemoteParticipantType } from '../types/Calling.js'; -import type { LocalizerType } from '../types/Util.js'; -import { AvatarColors } from '../types/Colors.js'; -import { CallBackgroundBlur } from './CallBackgroundBlur.js'; +import type { GroupCallRemoteParticipantType } from '../types/Calling.std.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { AvatarColors } from '../types/Colors.std.js'; +import { CallBackgroundBlur } from './CallBackgroundBlur.dom.js'; import { CallingAudioIndicator, SPEAKING_LINGER_MS, -} from './CallingAudioIndicator.js'; -import { Avatar, AvatarSize } from './Avatar.js'; -import { ConfirmationDialog } from './ConfirmationDialog.js'; -import { I18n } from './I18n.js'; -import { ContactName } from './conversation/ContactName.js'; -import { useIntersectionObserver } from '../hooks/useIntersectionObserver.js'; -import { MAX_FRAME_HEIGHT, MAX_FRAME_WIDTH } from '../calling/constants.js'; -import { useValueAtFixedRate } from '../hooks/useValueAtFixedRate.js'; -import { Theme } from '../util/theme.js'; -import { isOlderThan } from '../util/timestamp.js'; -import type { CallingImageDataCache } from './CallManager.js'; -import { usePrevious } from '../hooks/usePrevious.js'; +} from './CallingAudioIndicator.dom.js'; +import { Avatar, AvatarSize } from './Avatar.dom.js'; +import { ConfirmationDialog } from './ConfirmationDialog.dom.js'; +import { I18n } from './I18n.dom.js'; +import { ContactName } from './conversation/ContactName.dom.js'; +import { useIntersectionObserver } from '../hooks/useIntersectionObserver.std.js'; +import { MAX_FRAME_HEIGHT, MAX_FRAME_WIDTH } from '../calling/constants.std.js'; +import { useValueAtFixedRate } from '../hooks/useValueAtFixedRate.std.js'; +import { Theme } from '../util/theme.std.js'; +import { isOlderThan } from '../util/timestamp.std.js'; +import type { CallingImageDataCache } from './CallManager.dom.js'; +import { usePrevious } from '../hooks/usePrevious.std.js'; const { debounce, noop } = lodash; diff --git a/ts/components/GroupCallRemoteParticipants.tsx b/ts/components/GroupCallRemoteParticipants.tsx index fcfcbb1694..4b6489dea8 100644 --- a/ts/components/GroupCallRemoteParticipants.tsx +++ b/ts/components/GroupCallRemoteParticipants.tsx @@ -4,30 +4,30 @@ import React, { useCallback, useState, useMemo, useEffect } from 'react'; import lodash from 'lodash'; import type { VideoFrameSource } from '@signalapp/ringrtc'; -import { GroupCallRemoteParticipant } from './GroupCallRemoteParticipant.js'; +import { GroupCallRemoteParticipant } from './GroupCallRemoteParticipant.dom.js'; import { GroupCallOverflowArea, OVERFLOW_PARTICIPANT_WIDTH, -} from './GroupCallOverflowArea.js'; +} from './GroupCallOverflowArea.dom.js'; import type { GroupCallRemoteParticipantType, GroupCallVideoRequest, -} from '../types/Calling.js'; -import { CallViewMode } from '../types/Calling.js'; -import { useGetCallingFrameBuffer } from '../calling/useGetCallingFrameBuffer.js'; -import type { LocalizerType } from '../types/Util.js'; -import { usePageVisibility } from '../hooks/usePageVisibility.js'; -import { useDevicePixelRatio } from '../hooks/useDevicePixelRatio.js'; -import { nonRenderedRemoteParticipant } from '../util/ringrtc/nonRenderedRemoteParticipant.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { SECOND } from '../util/durations/index.js'; -import { filter, join } from '../util/iterables.js'; -import * as setUtil from '../util/setUtil.js'; -import { createLogger } from '../logging/log.js'; -import { MAX_FRAME_HEIGHT, MAX_FRAME_WIDTH } from '../calling/constants.js'; -import { SizeObserver } from '../hooks/useSizeObserver.js'; -import { strictAssert } from '../util/assert.js'; -import type { CallingImageDataCache } from './CallManager.js'; +} from '../types/Calling.std.js'; +import { CallViewMode } from '../types/Calling.std.js'; +import { useGetCallingFrameBuffer } from '../calling/useGetCallingFrameBuffer.std.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { usePageVisibility } from '../hooks/usePageVisibility.dom.js'; +import { useDevicePixelRatio } from '../hooks/useDevicePixelRatio.dom.js'; +import { nonRenderedRemoteParticipant } from '../util/ringrtc/nonRenderedRemoteParticipant.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { SECOND } from '../util/durations/index.std.js'; +import { filter, join } from '../util/iterables.std.js'; +import * as setUtil from '../util/setUtil.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { MAX_FRAME_HEIGHT, MAX_FRAME_WIDTH } from '../calling/constants.std.js'; +import { SizeObserver } from '../hooks/useSizeObserver.dom.js'; +import { strictAssert } from '../util/assert.std.js'; +import type { CallingImageDataCache } from './CallManager.dom.js'; const { clamp, chunk, maxBy, flatten, noop } = lodash; diff --git a/ts/components/GroupDescriptionInput.stories.tsx b/ts/components/GroupDescriptionInput.stories.tsx index 188a8a9ea6..700f1cc4ef 100644 --- a/ts/components/GroupDescriptionInput.stories.tsx +++ b/ts/components/GroupDescriptionInput.stories.tsx @@ -3,8 +3,8 @@ import React, { useState } from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './GroupDescriptionInput.js'; -import { GroupDescriptionInput } from './GroupDescriptionInput.js'; +import type { PropsType } from './GroupDescriptionInput.dom.js'; +import { GroupDescriptionInput } from './GroupDescriptionInput.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/GroupDescriptionInput.tsx b/ts/components/GroupDescriptionInput.tsx index d6cb057447..d095ba8288 100644 --- a/ts/components/GroupDescriptionInput.tsx +++ b/ts/components/GroupDescriptionInput.tsx @@ -3,8 +3,8 @@ import React, { forwardRef } from 'react'; -import { Input } from './Input.js'; -import type { LocalizerType } from '../types/Util.js'; +import { Input } from './Input.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; export type PropsType = { disabled?: boolean; diff --git a/ts/components/GroupDescriptionText.tsx b/ts/components/GroupDescriptionText.tsx index 489bc55b08..bc521fa99e 100644 --- a/ts/components/GroupDescriptionText.tsx +++ b/ts/components/GroupDescriptionText.tsx @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import type { RenderTextCallbackType } from '../types/Util.js'; -import { AddNewLines } from './conversation/AddNewLines.js'; -import { Emojify } from './conversation/Emojify.js'; -import { Linkify } from './conversation/Linkify.js'; +import type { RenderTextCallbackType } from '../types/Util.std.js'; +import { AddNewLines } from './conversation/AddNewLines.dom.js'; +import { Emojify } from './conversation/Emojify.dom.js'; +import { Linkify } from './conversation/Linkify.dom.js'; type PropsType = { text: string; diff --git a/ts/components/GroupDialog.tsx b/ts/components/GroupDialog.tsx index 6685968be4..bb05b6acf3 100644 --- a/ts/components/GroupDialog.tsx +++ b/ts/components/GroupDialog.tsx @@ -4,13 +4,13 @@ import type { ReactChild, ReactNode } from 'react'; import React from 'react'; -import type { LocalizerType, ThemeType } from '../types/Util.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; -import { ModalHost } from './ModalHost.js'; -import { Button, ButtonVariant } from './Button.js'; -import { Avatar, AvatarSize } from './Avatar.js'; -import { ContactName } from './conversation/ContactName.js'; +import type { LocalizerType, ThemeType } from '../types/Util.std.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.preload.js'; +import { ModalHost } from './ModalHost.dom.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import { Avatar, AvatarSize } from './Avatar.dom.js'; +import { ContactName } from './conversation/ContactName.dom.js'; type PropsType = { children: ReactNode; diff --git a/ts/components/GroupMembersNames.tsx b/ts/components/GroupMembersNames.tsx index daa6282b6c..89de192bce 100644 --- a/ts/components/GroupMembersNames.tsx +++ b/ts/components/GroupMembersNames.tsx @@ -5,10 +5,10 @@ import React, { useMemo } from 'react'; import type { ReactNode } from 'react'; import lodash from 'lodash'; -import { I18n } from './I18n.js'; -import type { LocalizerType } from '../types/Util.js'; -import { UserText } from './UserText.js'; -import type { GroupV2Membership } from './conversation/conversation-details/ConversationDetailsMembershipList.js'; +import { I18n } from './I18n.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { UserText } from './UserText.dom.js'; +import type { GroupV2Membership } from './conversation/conversation-details/ConversationDetailsMembershipList.dom.js'; const { take } = lodash; diff --git a/ts/components/GroupTitleInput.stories.tsx b/ts/components/GroupTitleInput.stories.tsx index 6a9770a916..97a558985d 100644 --- a/ts/components/GroupTitleInput.stories.tsx +++ b/ts/components/GroupTitleInput.stories.tsx @@ -3,8 +3,8 @@ import React, { useState } from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './GroupTitleInput.js'; -import { GroupTitleInput } from './GroupTitleInput.js'; +import type { PropsType } from './GroupTitleInput.dom.js'; +import { GroupTitleInput } from './GroupTitleInput.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/GroupTitleInput.tsx b/ts/components/GroupTitleInput.tsx index ece44168ab..8f053728ae 100644 --- a/ts/components/GroupTitleInput.tsx +++ b/ts/components/GroupTitleInput.tsx @@ -3,8 +3,8 @@ import React, { forwardRef } from 'react'; -import { Input } from './Input.js'; -import type { LocalizerType } from '../types/Util.js'; +import { Input } from './Input.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; export type PropsType = { disabled?: boolean; diff --git a/ts/components/GroupV1MigrationDialog.stories.tsx b/ts/components/GroupV1MigrationDialog.stories.tsx index c9a07f2680..f51b6cddc9 100644 --- a/ts/components/GroupV1MigrationDialog.stories.tsx +++ b/ts/components/GroupV1MigrationDialog.stories.tsx @@ -6,11 +6,11 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './GroupV1MigrationDialog.js'; -import { GroupV1MigrationDialog } from './GroupV1MigrationDialog.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; -import { ThemeType } from '../types/Util.js'; +import type { PropsType } from './GroupV1MigrationDialog.dom.js'; +import { GroupV1MigrationDialog } from './GroupV1MigrationDialog.dom.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.std.js'; +import { ThemeType } from '../types/Util.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/GroupV1MigrationDialog.tsx b/ts/components/GroupV1MigrationDialog.tsx index 788e72e7dd..1c0fb369eb 100644 --- a/ts/components/GroupV1MigrationDialog.tsx +++ b/ts/components/GroupV1MigrationDialog.tsx @@ -2,12 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import * as React from 'react'; -import type { LocalizerType, ThemeType } from '../types/Util.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; -import { GroupDialog } from './GroupDialog.js'; -import { sortByTitle } from '../util/sortByTitle.js'; -import { missingCaseError } from '../util/missingCaseError.js'; +import type { LocalizerType, ThemeType } from '../types/Util.std.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.preload.js'; +import { GroupDialog } from './GroupDialog.dom.js'; +import { sortByTitle } from '../util/sortByTitle.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; export type DataPropsType = { readonly areWeInvited: boolean; diff --git a/ts/components/GroupV2JoinDialog.stories.tsx b/ts/components/GroupV2JoinDialog.stories.tsx index 328baf03fc..563741f649 100644 --- a/ts/components/GroupV2JoinDialog.stories.tsx +++ b/ts/components/GroupV2JoinDialog.stories.tsx @@ -4,8 +4,8 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './GroupV2JoinDialog.js'; -import { GroupV2JoinDialog } from './GroupV2JoinDialog.js'; +import type { PropsType } from './GroupV2JoinDialog.dom.js'; +import { GroupV2JoinDialog } from './GroupV2JoinDialog.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/GroupV2JoinDialog.tsx b/ts/components/GroupV2JoinDialog.tsx index af32c4fd90..2ec452ee47 100644 --- a/ts/components/GroupV2JoinDialog.tsx +++ b/ts/components/GroupV2JoinDialog.tsx @@ -3,13 +3,13 @@ import * as React from 'react'; import classNames from 'classnames'; -import type { LocalizerType } from '../types/Util.js'; -import { Avatar, AvatarBlur } from './Avatar.js'; -import { Spinner } from './Spinner.js'; -import { Button, ButtonVariant } from './Button.js'; -import { GroupDescription } from './conversation/GroupDescription.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { Avatar, AvatarBlur } from './Avatar.dom.js'; +import { Spinner } from './Spinner.dom.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import { GroupDescription } from './conversation/GroupDescription.dom.js'; -import type { PreJoinConversationType } from '../state/ducks/conversations.js'; +import type { PreJoinConversationType } from '../state/ducks/conversations.preload.js'; type CallbackType = () => unknown; diff --git a/ts/components/I18n.stories.tsx b/ts/components/I18n.stories.tsx index c670b81fb4..087d79579d 100644 --- a/ts/components/I18n.stories.tsx +++ b/ts/components/I18n.stories.tsx @@ -3,9 +3,9 @@ import * as React from 'react'; -import type { ComponentMeta } from '../storybook/types.js'; -import type { Props } from './I18n.js'; -import { I18n } from './I18n.js'; +import type { ComponentMeta } from '../storybook/types.std.js'; +import type { Props } from './I18n.dom.js'; +import { I18n } from './I18n.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/I18n.tsx b/ts/components/I18n.tsx index da5e14bdea..0452b2a46e 100644 --- a/ts/components/I18n.tsx +++ b/ts/components/I18n.tsx @@ -6,8 +6,8 @@ import React from 'react'; import type { LocalizerType, ICUJSXMessageParamsByKeyType, -} from '../types/Util.js'; -import { strictAssert } from '../util/assert.js'; +} from '../types/Util.std.js'; +import { strictAssert } from '../util/assert.std.js'; export type Props = { /** The translation string id */ diff --git a/ts/components/IdenticonSVG.stories.tsx b/ts/components/IdenticonSVG.stories.tsx index 2d8ed204b3..0d569e7778 100644 --- a/ts/components/IdenticonSVG.stories.tsx +++ b/ts/components/IdenticonSVG.stories.tsx @@ -7,8 +7,8 @@ import { IdenticonSVGForCallLink, IdenticonSVGForContact, IdenticonSVGForGroup, -} from './IdenticonSVG.js'; -import { AvatarColorMap } from '../types/Colors.js'; +} from './IdenticonSVG.dom.js'; +import { AvatarColorMap } from '../types/Colors.std.js'; export default { title: 'Components/IdenticonSVG', diff --git a/ts/components/ImageOrBlurhash.stories.tsx b/ts/components/ImageOrBlurhash.stories.tsx index e84d771fb9..dc002859a8 100644 --- a/ts/components/ImageOrBlurhash.stories.tsx +++ b/ts/components/ImageOrBlurhash.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './ImageOrBlurhash.js'; -import { ImageOrBlurhash } from './ImageOrBlurhash.js'; +import type { Props } from './ImageOrBlurhash.dom.js'; +import { ImageOrBlurhash } from './ImageOrBlurhash.dom.js'; export default { title: 'Components/ImageOrBlurhash', diff --git a/ts/components/ImageOrBlurhash.tsx b/ts/components/ImageOrBlurhash.tsx index 58e7087d07..5e62fc1d2a 100644 --- a/ts/components/ImageOrBlurhash.tsx +++ b/ts/components/ImageOrBlurhash.tsx @@ -3,7 +3,7 @@ import React, { useMemo, useCallback, useState, useRef } from 'react'; -import { computeBlurHashUrl } from '../util/computeBlurHashUrl.js'; +import { computeBlurHashUrl } from '../util/computeBlurHashUrl.std.js'; export type Props = React.ImgHTMLAttributes & Readonly<{ diff --git a/ts/components/InContactsIcon.stories.tsx b/ts/components/InContactsIcon.stories.tsx index 801a08b1eb..da9849c5f9 100644 --- a/ts/components/InContactsIcon.stories.tsx +++ b/ts/components/InContactsIcon.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './InContactsIcon.js'; -import { InContactsIcon } from './InContactsIcon.js'; +import type { PropsType } from './InContactsIcon.dom.js'; +import { InContactsIcon } from './InContactsIcon.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/InContactsIcon.tsx b/ts/components/InContactsIcon.tsx index 14362474ff..a5b7af480f 100644 --- a/ts/components/InContactsIcon.tsx +++ b/ts/components/InContactsIcon.tsx @@ -4,8 +4,8 @@ import React from 'react'; import classNames from 'classnames'; -import { Tooltip } from './Tooltip.js'; -import type { LocalizerType } from '../types/Util.js'; +import { Tooltip } from './Tooltip.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; export type PropsType = { className?: string; diff --git a/ts/components/Inbox.stories.tsx b/ts/components/Inbox.stories.tsx index 1dc529b1e7..26af79e7a9 100644 --- a/ts/components/Inbox.stories.tsx +++ b/ts/components/Inbox.stories.tsx @@ -5,9 +5,9 @@ import React, { useState, useEffect, useMemo } from 'react'; import type { Meta, StoryFn } from '@storybook/react'; import lodash from 'lodash'; -import { Inbox } from './Inbox.js'; -import type { PropsType } from './Inbox.js'; -import { DAY, SECOND } from '../util/durations/index.js'; +import { Inbox } from './Inbox.dom.js'; +import type { PropsType } from './Inbox.dom.js'; +import { DAY, SECOND } from '../util/durations/index.std.js'; const { noop } = lodash; diff --git a/ts/components/Inbox.tsx b/ts/components/Inbox.tsx index f4bf56519e..3c7cd9da5e 100644 --- a/ts/components/Inbox.tsx +++ b/ts/components/Inbox.tsx @@ -4,10 +4,10 @@ import type { ReactNode } from 'react'; import React, { useEffect, useState, useMemo } from 'react'; import classNames from 'classnames'; -import type { LocalizerType } from '../types/Util.js'; -import { createLogger } from '../logging/log.js'; -import { SECOND, DAY } from '../util/durations/index.js'; -import type { SmartNavTabsProps } from '../state/smart/NavTabs.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { SECOND, DAY } from '../util/durations/index.std.js'; +import type { SmartNavTabsProps } from '../state/smart/NavTabs.preload.js'; const log = createLogger('Inbox'); diff --git a/ts/components/IncomingCallBar.stories.tsx b/ts/components/IncomingCallBar.stories.tsx index c11804a365..3b1fbd822c 100644 --- a/ts/components/IncomingCallBar.stories.tsx +++ b/ts/components/IncomingCallBar.stories.tsx @@ -4,10 +4,10 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './IncomingCallBar.js'; -import { IncomingCallBar } from './IncomingCallBar.js'; -import { CallMode } from '../types/CallDisposition.js'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; +import type { PropsType } from './IncomingCallBar.dom.js'; +import { IncomingCallBar } from './IncomingCallBar.dom.js'; +import { CallMode } from '../types/CallDisposition.std.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/IncomingCallBar.tsx b/ts/components/IncomingCallBar.tsx index 8245d7c75a..167db733c2 100644 --- a/ts/components/IncomingCallBar.tsx +++ b/ts/components/IncomingCallBar.tsx @@ -3,26 +3,26 @@ import type { ReactChild } from 'react'; import React, { useCallback, useEffect, useRef } from 'react'; -import { Avatar, AvatarSize } from './Avatar.js'; -import { Tooltip } from './Tooltip.js'; -import { I18n } from './I18n.js'; -import { Theme } from '../util/theme.js'; -import { getParticipantName } from '../util/callingGetParticipantName.js'; -import { ContactName } from './conversation/ContactName.js'; -import type { LocalizerType } from '../types/Util.js'; -import { AvatarColors } from '../types/Colors.js'; -import { CallMode } from '../types/CallDisposition.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; +import { Avatar, AvatarSize } from './Avatar.dom.js'; +import { Tooltip } from './Tooltip.dom.js'; +import { I18n } from './I18n.dom.js'; +import { Theme } from '../util/theme.std.js'; +import { getParticipantName } from '../util/callingGetParticipantName.std.js'; +import { ContactName } from './conversation/ContactName.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { AvatarColors } from '../types/Colors.std.js'; +import { CallMode } from '../types/CallDisposition.std.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; import type { AcceptCallType, DeclineCallType, -} from '../state/ducks/calling.js'; -import { missingCaseError } from '../util/missingCaseError.js'; +} from '../state/ducks/calling.preload.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; import { useIncomingCallShortcuts, useKeyboardShortcuts, -} from '../hooks/useKeyboardShortcuts.js'; -import { UserText } from './UserText.js'; +} from '../hooks/useKeyboardShortcuts.dom.js'; +import { UserText } from './UserText.dom.js'; export type PropsType = { acceptCall: (_: AcceptCallType) => void; diff --git a/ts/components/Input.stories.tsx b/ts/components/Input.stories.tsx index d8d6c5a916..052fb9e7ba 100644 --- a/ts/components/Input.stories.tsx +++ b/ts/components/Input.stories.tsx @@ -4,8 +4,8 @@ import React, { useState } from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './Input.js'; -import { Input } from './Input.js'; +import type { PropsType } from './Input.dom.js'; +import { Input } from './Input.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/Input.tsx b/ts/components/Input.tsx index b0bdc6fa92..be81507df9 100644 --- a/ts/components/Input.tsx +++ b/ts/components/Input.tsx @@ -11,11 +11,11 @@ import React, { } from 'react'; import classNames from 'classnames'; -import * as grapheme from '../util/grapheme.js'; -import type { LocalizerType } from '../types/Util.js'; -import { getClassNamesFor } from '../util/getClassNamesFor.js'; -import { useRefMerger } from '../hooks/useRefMerger.js'; -import { byteLength } from '../Bytes.js'; +import * as grapheme from '../util/grapheme.std.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { getClassNamesFor } from '../util/getClassNamesFor.std.js'; +import { useRefMerger } from '../hooks/useRefMerger.std.js'; +import { byteLength } from '../Bytes.std.js'; export type PropsType = { autoFocus?: boolean; diff --git a/ts/components/InstallScreen.tsx b/ts/components/InstallScreen.tsx index 21ab5af628..594a45f4a1 100644 --- a/ts/components/InstallScreen.tsx +++ b/ts/components/InstallScreen.tsx @@ -4,12 +4,12 @@ import type { ComponentProps, ReactElement } from 'react'; import React from 'react'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { InstallScreenStep } from '../types/InstallScreen.js'; -import { InstallScreenErrorStep } from './installScreen/InstallScreenErrorStep.js'; -import { InstallScreenLinkInProgressStep } from './installScreen/InstallScreenLinkInProgressStep.js'; -import { InstallScreenQrCodeNotScannedStep } from './installScreen/InstallScreenQrCodeNotScannedStep.js'; -import { InstallScreenBackupImportStep } from './installScreen/InstallScreenBackupImportStep.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { InstallScreenStep } from '../types/InstallScreen.std.js'; +import { InstallScreenErrorStep } from './installScreen/InstallScreenErrorStep.dom.js'; +import { InstallScreenLinkInProgressStep } from './installScreen/InstallScreenLinkInProgressStep.dom.js'; +import { InstallScreenQrCodeNotScannedStep } from './installScreen/InstallScreenQrCodeNotScannedStep.dom.js'; +import { InstallScreenBackupImportStep } from './installScreen/InstallScreenBackupImportStep.dom.js'; // We can't always use destructuring assignment because of the complexity of this props // type. diff --git a/ts/components/LeftPane.stories.tsx b/ts/components/LeftPane.stories.tsx index e48875b0b7..fdc3358920 100644 --- a/ts/components/LeftPane.stories.tsx +++ b/ts/components/LeftPane.stories.tsx @@ -4,39 +4,39 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './LeftPane.js'; -import { LeftPane } from './LeftPane.js'; -import { CaptchaDialog } from './CaptchaDialog.js'; -import { CrashReportDialog } from './CrashReportDialog.js'; -import { ToastManager } from './ToastManager.js'; -import type { PropsType as DialogNetworkStatusPropsType } from './DialogNetworkStatus.js'; -import { DialogExpiredBuild } from './DialogExpiredBuild.js'; -import { DialogNetworkStatus } from './DialogNetworkStatus.js'; -import { DialogRelink } from './DialogRelink.js'; -import type { PropsType as DialogUpdatePropsType } from './DialogUpdate.js'; -import { DialogUpdate } from './DialogUpdate.js'; -import { UnsupportedOSDialog } from './UnsupportedOSDialog.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import { MessageSearchResult } from './conversationList/MessageSearchResult.js'; -import { DurationInSeconds, DAY } from '../util/durations/index.js'; -import { LeftPaneMode } from '../types/leftPane.js'; -import { ThemeType } from '../types/Util.js'; +import type { PropsType } from './LeftPane.dom.js'; +import { LeftPane } from './LeftPane.dom.js'; +import { CaptchaDialog } from './CaptchaDialog.dom.js'; +import { CrashReportDialog } from './CrashReportDialog.dom.js'; +import { ToastManager } from './ToastManager.dom.js'; +import type { PropsType as DialogNetworkStatusPropsType } from './DialogNetworkStatus.dom.js'; +import { DialogExpiredBuild } from './DialogExpiredBuild.dom.js'; +import { DialogNetworkStatus } from './DialogNetworkStatus.dom.js'; +import { DialogRelink } from './DialogRelink.dom.js'; +import type { PropsType as DialogUpdatePropsType } from './DialogUpdate.dom.js'; +import { DialogUpdate } from './DialogUpdate.dom.js'; +import { UnsupportedOSDialog } from './UnsupportedOSDialog.dom.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import { MessageSearchResult } from './conversationList/MessageSearchResult.dom.js'; +import { DurationInSeconds, DAY } from '../util/durations/index.std.js'; +import { LeftPaneMode } from '../types/leftPane.std.js'; +import { ThemeType } from '../types/Util.std.js'; import { getDefaultConversation, getDefaultGroupListItem, -} from '../test-helpers/getDefaultConversation.js'; -import { DialogType } from '../types/Dialogs.js'; -import { SocketStatus } from '../types/SocketStatus.js'; +} from '../test-helpers/getDefaultConversation.std.js'; +import { DialogType } from '../types/Dialogs.std.js'; +import { SocketStatus } from '../types/SocketStatus.std.js'; import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext.js'; import { makeFakeLookupConversationWithoutServiceId, useUuidFetchState, -} from '../test-helpers/fakeLookupConversationWithoutServiceId.js'; -import type { GroupListItemConversationType } from './conversationList/GroupListItem.js'; -import { ServerAlert } from '../types/ServerAlert.js'; -import { LeftPaneChatFolders } from './leftPane/LeftPaneChatFolders.js'; -import { LeftPaneConversationListItemContextMenu } from './leftPane/LeftPaneConversationListItemContextMenu.js'; -import { CurrentChatFolders } from '../types/CurrentChatFolders.js'; +} from '../test-helpers/fakeLookupConversationWithoutServiceId.std.js'; +import type { GroupListItemConversationType } from './conversationList/GroupListItem.dom.js'; +import { ServerAlert } from '../types/ServerAlert.std.js'; +import { LeftPaneChatFolders } from './leftPane/LeftPaneChatFolders.dom.js'; +import { LeftPaneConversationListItemContextMenu } from './leftPane/LeftPaneConversationListItemContextMenu.dom.js'; +import { CurrentChatFolders } from '../types/CurrentChatFolders.std.js'; const { i18n } = window.SignalContext; @@ -207,6 +207,7 @@ const useProps = (overrideProps: OverridePropsType = {}): PropsType => { usernameLinkCorrupted: false, isUpdateDownloaded, isNotificationProfileActive: false, + isChatFoldersEnabled: true, navTabsCollapsed: false, setChallengeStatus: action('setChallengeStatus'), diff --git a/ts/components/LeftPane.tsx b/ts/components/LeftPane.tsx index 2366250e15..c66b66a9a1 100644 --- a/ts/components/LeftPane.tsx +++ b/ts/components/LeftPane.tsx @@ -5,66 +5,68 @@ import React, { useEffect, useCallback, useMemo, useRef } from 'react'; import classNames from 'classnames'; import lodash from 'lodash'; -import type { ToFindType } from './leftPane/LeftPaneHelper.js'; -import { FindDirection } from './leftPane/LeftPaneHelper.js'; -import type { LeftPaneInboxPropsType } from './leftPane/LeftPaneInboxHelper.js'; -import { LeftPaneInboxHelper } from './leftPane/LeftPaneInboxHelper.js'; -import type { LeftPaneSearchPropsType } from './leftPane/LeftPaneSearchHelper.js'; -import { LeftPaneSearchHelper } from './leftPane/LeftPaneSearchHelper.js'; -import type { LeftPaneArchivePropsType } from './leftPane/LeftPaneArchiveHelper.js'; -import { LeftPaneArchiveHelper } from './leftPane/LeftPaneArchiveHelper.js'; -import type { LeftPaneComposePropsType } from './leftPane/LeftPaneComposeHelper.js'; -import { LeftPaneComposeHelper } from './leftPane/LeftPaneComposeHelper.js'; -import type { LeftPaneFindByUsernamePropsType } from './leftPane/LeftPaneFindByUsernameHelper.js'; -import { LeftPaneFindByUsernameHelper } from './leftPane/LeftPaneFindByUsernameHelper.js'; -import type { LeftPaneFindByPhoneNumberPropsType } from './leftPane/LeftPaneFindByPhoneNumberHelper.js'; -import { LeftPaneFindByPhoneNumberHelper } from './leftPane/LeftPaneFindByPhoneNumberHelper.js'; -import type { LeftPaneChooseGroupMembersPropsType } from './leftPane/LeftPaneChooseGroupMembersHelper.js'; -import { LeftPaneChooseGroupMembersHelper } from './leftPane/LeftPaneChooseGroupMembersHelper.js'; -import type { LeftPaneSetGroupMetadataPropsType } from './leftPane/LeftPaneSetGroupMetadataHelper.js'; -import { LeftPaneSetGroupMetadataHelper } from './leftPane/LeftPaneSetGroupMetadataHelper.js'; +import type { ToFindType } from './leftPane/LeftPaneHelper.dom.js'; +import { FindDirection } from './leftPane/LeftPaneHelper.dom.js'; +import type { LeftPaneInboxPropsType } from './leftPane/LeftPaneInboxHelper.dom.js'; +import { LeftPaneInboxHelper } from './leftPane/LeftPaneInboxHelper.dom.js'; +import type { LeftPaneSearchPropsType } from './leftPane/LeftPaneSearchHelper.dom.js'; +import { LeftPaneSearchHelper } from './leftPane/LeftPaneSearchHelper.dom.js'; +import type { LeftPaneArchivePropsType } from './leftPane/LeftPaneArchiveHelper.dom.js'; +import { LeftPaneArchiveHelper } from './leftPane/LeftPaneArchiveHelper.dom.js'; +import type { LeftPaneComposePropsType } from './leftPane/LeftPaneComposeHelper.dom.js'; +import { LeftPaneComposeHelper } from './leftPane/LeftPaneComposeHelper.dom.js'; +import type { LeftPaneFindByUsernamePropsType } from './leftPane/LeftPaneFindByUsernameHelper.dom.js'; +import { LeftPaneFindByUsernameHelper } from './leftPane/LeftPaneFindByUsernameHelper.dom.js'; +import type { LeftPaneFindByPhoneNumberPropsType } from './leftPane/LeftPaneFindByPhoneNumberHelper.dom.js'; +import { LeftPaneFindByPhoneNumberHelper } from './leftPane/LeftPaneFindByPhoneNumberHelper.dom.js'; +import type { LeftPaneChooseGroupMembersPropsType } from './leftPane/LeftPaneChooseGroupMembersHelper.dom.js'; +import { LeftPaneChooseGroupMembersHelper } from './leftPane/LeftPaneChooseGroupMembersHelper.dom.js'; +import type { LeftPaneSetGroupMetadataPropsType } from './leftPane/LeftPaneSetGroupMetadataHelper.dom.js'; +import { LeftPaneSetGroupMetadataHelper } from './leftPane/LeftPaneSetGroupMetadataHelper.dom.js'; -import { LeftPaneMode } from '../types/leftPane.js'; -import type { LocalizerType, ThemeType } from '../types/Util.js'; -import { ScrollBehavior } from '../types/Util.js'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; -import { usePrevious } from '../hooks/usePrevious.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import type { DurationInSeconds } from '../util/durations/index.js'; -import { WidthBreakpoint, getNavSidebarWidthBreakpoint } from './_util.js'; -import * as KeyboardLayout from '../services/keyboardLayout.js'; -import type { LookupConversationWithoutServiceIdActionsType } from '../util/lookupConversationWithoutServiceId.js'; -import type { ShowConversationType } from '../state/ducks/conversations.js'; -import type { PropsType as UnsupportedOSDialogPropsType } from '../state/smart/UnsupportedOSDialog.js'; +import { LeftPaneMode } from '../types/leftPane.std.js'; +import type { LocalizerType, ThemeType } from '../types/Util.std.js'; +import { ScrollBehavior } from '../types/Util.std.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.preload.js'; +import { usePrevious } from '../hooks/usePrevious.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import type { DurationInSeconds } from '../util/durations/index.std.js'; +import { WidthBreakpoint, getNavSidebarWidthBreakpoint } from './_util.std.js'; +import * as KeyboardLayout from '../services/keyboardLayout.dom.js'; +import type { LookupConversationWithoutServiceIdActionsType } from '../util/lookupConversationWithoutServiceId.preload.js'; +import type { ShowConversationType } from '../state/ducks/conversations.preload.js'; +import type { PropsType as UnsupportedOSDialogPropsType } from '../state/smart/UnsupportedOSDialog.preload.js'; -import { ConversationList } from './ConversationList.js'; -import { ContactCheckboxDisabledReason } from './conversationList/ContactCheckbox.js'; -import type { PropsType as DialogExpiredBuildPropsType } from './DialogExpiredBuild.js'; -import { LeftPaneBanner } from './LeftPaneBanner.js'; +import { ConversationList } from './ConversationList.dom.js'; +import { ContactCheckboxDisabledReason } from './conversationList/ContactCheckbox.dom.js'; +import type { PropsType as DialogExpiredBuildPropsType } from './DialogExpiredBuild.dom.js'; +import { LeftPaneBanner } from './LeftPaneBanner.dom.js'; import type { DeleteAvatarFromDiskActionType, ReplaceAvatarActionType, SaveAvatarToDiskActionType, -} from '../types/Avatar.js'; -import { useSizeObserver } from '../hooks/useSizeObserver.js'; +} from '../types/Avatar.std.js'; +import { useSizeObserver } from '../hooks/useSizeObserver.dom.js'; import { NavSidebar, NavSidebarActionButton, NavSidebarSearchHeader, -} from './NavSidebar.js'; -import type { UnreadStats } from '../util/countUnreadStats.js'; -import { BackupMediaDownloadProgress } from './BackupMediaDownloadProgress.js'; -import type { ServerAlertsType, ServerAlert } from '../types/ServerAlert.js'; -import { getServerAlertDialog } from './ServerAlerts.js'; -import { NavTab, SettingsPage, ProfileEditorPage } from '../types/Nav.js'; -import type { Location } from '../types/Nav.js'; -import type { RenderConversationListItemContextMenuProps } from './conversationList/BaseConversationListItem.js'; -import { AxoDropdownMenu } from '../axo/AxoDropdownMenu.js'; -import type { ChatFolder } from '../types/ChatFolder.js'; -import { isChatFoldersEnabled } from '../types/ChatFolder.js'; -import { ProfileAvatar } from './PreferencesNotificationProfiles.js'; -import { tw } from '../axo/tw.js'; +} from './NavSidebar.dom.js'; +import type { UnreadStats } from '../util/countUnreadStats.std.js'; +import { BackupMediaDownloadProgress } from './BackupMediaDownloadProgress.dom.js'; +import type { + ServerAlertsType, + ServerAlert, +} from '../types/ServerAlert.std.js'; +import { getServerAlertDialog } from './ServerAlerts.dom.js'; +import { NavTab, SettingsPage, ProfileEditorPage } from '../types/Nav.std.js'; +import type { Location } from '../types/Nav.std.js'; +import type { RenderConversationListItemContextMenuProps } from './conversationList/BaseConversationListItem.dom.js'; +import { AxoDropdownMenu } from '../axo/AxoDropdownMenu.dom.js'; +import type { ChatFolder } from '../types/ChatFolder.std.js'; +import { ProfileAvatar } from './PreferencesNotificationProfiles.dom.js'; +import { tw } from '../axo/tw.dom.js'; const { isNumber } = lodash; @@ -124,6 +126,7 @@ export type PropsType = { i18n: LocalizerType; isMacOS: boolean; isNotificationProfileActive: boolean; + isChatFoldersEnabled: boolean; preferredWidthFromStorage: number; selectedChatFolder: ChatFolder | null; selectedConversationId: undefined | string; @@ -241,6 +244,7 @@ export function LeftPane({ lookupConversationWithoutServiceId, isMacOS, isNotificationProfileActive, + isChatFoldersEnabled, isOnline, isUpdateDownloaded, modeSpecificProps, @@ -807,7 +811,7 @@ export function LeftPane({ > {i18n('icu:avatarMenuViewArchive')} - {isChatFoldersEnabled() && !hasAnyCurrentCustomChatFolders && ( + {isChatFoldersEnabled && !hasAnyCurrentCustomChatFolders && ( )} - {isChatFoldersEnabled() && hasAnyCurrentCustomChatFolders && ( + {isChatFoldersEnabled && hasAnyCurrentCustomChatFolders && ( void; diff --git a/ts/components/Lightbox.stories.tsx b/ts/components/Lightbox.stories.tsx index 9c0fa24e9e..3977ec6be2 100644 --- a/ts/components/Lightbox.stories.tsx +++ b/ts/components/Lightbox.stories.tsx @@ -5,9 +5,9 @@ import React, { useState } from 'react'; import { action } from '@storybook/addon-actions'; import lodash from 'lodash'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './Lightbox.js'; -import { Lightbox } from './Lightbox.js'; -import type { MediaItemType } from '../types/MediaItem.js'; +import type { PropsType } from './Lightbox.dom.js'; +import { Lightbox } from './Lightbox.dom.js'; +import type { MediaItemType } from '../types/MediaItem.std.js'; import { AUDIO_MP3, IMAGE_JPEG, @@ -15,9 +15,9 @@ import { VIDEO_QUICKTIME, stringToMIMEType, type MIMEType, -} from '../types/MIME.js'; +} from '../types/MIME.std.js'; -import { fakeAttachment } from '../test-helpers/fakeAttachment.js'; +import { fakeAttachment } from '../test-helpers/fakeAttachment.std.js'; const { noop } = lodash; diff --git a/ts/components/Lightbox.tsx b/ts/components/Lightbox.tsx index 8e1b95b186..24830d1da7 100644 --- a/ts/components/Lightbox.tsx +++ b/ts/components/Lightbox.tsx @@ -12,29 +12,29 @@ import type { ReadonlyDeep } from 'type-fest'; import type { ConversationType, SaveAttachmentActionCreatorType, -} from '../state/ducks/conversations.js'; -import type { LocalizerType } from '../types/Util.js'; -import type { MediaItemType } from '../types/MediaItem.js'; -import * as GoogleChrome from '../util/GoogleChrome.js'; -import { createLogger } from '../logging/log.js'; -import * as Errors from '../types/errors.js'; -import { Avatar, AvatarSize } from './Avatar.js'; -import { IMAGE_PNG, isImage, isVideo } from '../types/MIME.js'; -import { formatDateTimeForAttachment } from '../util/timestamp.js'; -import { formatDuration } from '../util/formatDuration.js'; -import { isGIF, isIncremental } from '../util/Attachment.js'; -import { useRestoreFocus } from '../hooks/useRestoreFocus.js'; -import { usePrevious } from '../hooks/usePrevious.js'; -import { arrow } from '../util/keyboard.js'; -import { drop } from '../util/drop.js'; -import { isCmdOrCtrl } from '../hooks/useKeyboardShortcuts.js'; -import type { ForwardMessagesPayload } from '../state/ducks/globalModals.js'; -import { ForwardMessagesModalType } from './ForwardMessagesModal.js'; -import { useReducedMotion } from '../hooks/useReducedMotion.js'; -import { formatFileSize } from '../util/formatFileSize.js'; -import { SECOND } from '../util/durations/index.js'; -import { Toast } from './Toast.js'; -import { isAbortError } from '../util/isAbortError.js'; +} from '../state/ducks/conversations.preload.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import type { MediaItemType } from '../types/MediaItem.std.js'; +import * as GoogleChrome from '../util/GoogleChrome.std.js'; +import { createLogger } from '../logging/log.std.js'; +import * as Errors from '../types/errors.std.js'; +import { Avatar, AvatarSize } from './Avatar.dom.js'; +import { IMAGE_PNG, isImage, isVideo } from '../types/MIME.std.js'; +import { formatDateTimeForAttachment } from '../util/formatTimestamp.dom.js'; +import { formatDuration } from '../util/formatDuration.std.js'; +import { isGIF, isIncremental } from '../util/Attachment.std.js'; +import { useRestoreFocus } from '../hooks/useRestoreFocus.dom.js'; +import { usePrevious } from '../hooks/usePrevious.std.js'; +import { arrow } from '../util/keyboard.dom.js'; +import { drop } from '../util/drop.std.js'; +import { isCmdOrCtrl } from '../hooks/useKeyboardShortcuts.dom.js'; +import type { ForwardMessagesPayload } from '../state/ducks/globalModals.preload.js'; +import { ForwardMessagesModalType } from './ForwardMessagesModal.dom.js'; +import { useReducedMotion } from '../hooks/useReducedMotion.dom.js'; +import { formatFileSize } from '../util/formatFileSize.std.js'; +import { SECOND } from '../util/durations/index.std.js'; +import { Toast } from './Toast.dom.js'; +import { isAbortError } from '../util/isAbortError.std.js'; const { noop } = lodash; diff --git a/ts/components/ListTile.stories.tsx b/ts/components/ListTile.stories.tsx index 12fb1b1c6d..200f291931 100644 --- a/ts/components/ListTile.stories.tsx +++ b/ts/components/ListTile.stories.tsx @@ -3,10 +3,10 @@ import type { Meta, StoryFn } from '@storybook/react'; import React from 'react'; -import { ListTile } from './ListTile.js'; -import type { Props } from './ListTile.js'; -import { CircleCheckbox } from './CircleCheckbox.js'; -import { UserText } from './UserText.js'; +import { ListTile } from './ListTile.dom.js'; +import type { Props } from './ListTile.dom.js'; +import { CircleCheckbox } from './CircleCheckbox.dom.js'; +import { UserText } from './UserText.dom.js'; export default { title: 'Components/ListTile', diff --git a/ts/components/ListTile.tsx b/ts/components/ListTile.tsx index 410b3ab435..1bf88104dd 100644 --- a/ts/components/ListTile.tsx +++ b/ts/components/ListTile.tsx @@ -4,8 +4,8 @@ import classNames from 'classnames'; import React, { useMemo } from 'react'; import { v4 as uuid } from 'uuid'; -import { getClassNamesFor } from '../util/getClassNamesFor.js'; -import { CircleCheckbox } from './CircleCheckbox.js'; +import { getClassNamesFor } from '../util/getClassNamesFor.std.js'; +import { CircleCheckbox } from './CircleCheckbox.dom.js'; export type Props = { title: string | JSX.Element; diff --git a/ts/components/ListView.tsx b/ts/components/ListView.tsx index 3095999825..61f3214a70 100644 --- a/ts/components/ListView.tsx +++ b/ts/components/ListView.tsx @@ -5,7 +5,7 @@ import classNames from 'classnames'; import React, { useRef, useCallback, useMemo, useLayoutEffect } from 'react'; import type { Index, ListRowRenderer } from 'react-virtualized'; import { List } from 'react-virtualized'; -import { ScrollBehavior } from '../types/Util.js'; +import { ScrollBehavior } from '../types/Util.std.js'; type Props = { width: number; diff --git a/ts/components/LocalDeleteWarningModal.stories.tsx b/ts/components/LocalDeleteWarningModal.stories.tsx index 5143c82d32..96c7fcf3e6 100644 --- a/ts/components/LocalDeleteWarningModal.stories.tsx +++ b/ts/components/LocalDeleteWarningModal.stories.tsx @@ -5,8 +5,8 @@ import type { Meta, StoryFn } from '@storybook/react'; import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './LocalDeleteWarningModal.js'; -import { LocalDeleteWarningModal } from './LocalDeleteWarningModal.js'; +import type { PropsType } from './LocalDeleteWarningModal.dom.js'; +import { LocalDeleteWarningModal } from './LocalDeleteWarningModal.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/LocalDeleteWarningModal.tsx b/ts/components/LocalDeleteWarningModal.tsx index 6492292d69..8422858e34 100644 --- a/ts/components/LocalDeleteWarningModal.tsx +++ b/ts/components/LocalDeleteWarningModal.tsx @@ -3,10 +3,10 @@ import React from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import { Button, ButtonVariant } from './Button.js'; -import { I18n } from './I18n.js'; -import { Modal } from './Modal.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import { I18n } from './I18n.dom.js'; +import { Modal } from './Modal.dom.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/LowDiskSpaceBackupImportModal.stories.tsx b/ts/components/LowDiskSpaceBackupImportModal.stories.tsx index d30bfbd005..99608963d4 100644 --- a/ts/components/LowDiskSpaceBackupImportModal.stories.tsx +++ b/ts/components/LowDiskSpaceBackupImportModal.stories.tsx @@ -5,8 +5,8 @@ import type { Meta, StoryFn } from '@storybook/react'; import React, { type ComponentProps } from 'react'; import { action } from '@storybook/addon-actions'; -import { LowDiskSpaceBackupImportModal } from './LowDiskSpaceBackupImportModal.js'; -import { MEBIBYTE } from '../types/AttachmentSize.js'; +import { LowDiskSpaceBackupImportModal } from './LowDiskSpaceBackupImportModal.dom.js'; +import { MEBIBYTE } from '../types/AttachmentSize.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/LowDiskSpaceBackupImportModal.tsx b/ts/components/LowDiskSpaceBackupImportModal.tsx index 0ce0b18c39..ab0ba0e85c 100644 --- a/ts/components/LowDiskSpaceBackupImportModal.tsx +++ b/ts/components/LowDiskSpaceBackupImportModal.tsx @@ -3,10 +3,10 @@ import * as React from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import { Modal } from './Modal.js'; -import { Button, ButtonVariant } from './Button.js'; -import { formatFileSize } from '../util/formatFileSize.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { Modal } from './Modal.dom.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import { formatFileSize } from '../util/formatFileSize.std.js'; export type PropsType = Readonly<{ bytesNeeded: number; diff --git a/ts/components/MediaEditor.stories.tsx b/ts/components/MediaEditor.stories.tsx index 3fb6efd2f8..4e8509884b 100644 --- a/ts/components/MediaEditor.stories.tsx +++ b/ts/components/MediaEditor.stories.tsx @@ -5,9 +5,9 @@ import type { Meta, StoryFn } from '@storybook/react'; import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './MediaEditor.js'; -import { MediaEditor } from './MediaEditor.js'; -import { EmojiSkinTone } from './fun/data/emojis.js'; +import type { PropsType } from './MediaEditor.dom.js'; +import { MediaEditor } from './MediaEditor.dom.js'; +import { EmojiSkinTone } from './fun/data/emojis.std.js'; const { i18n } = window.SignalContext; const IMAGE_1 = '/fixtures/nathan-anderson-316188-unsplash.jpg'; diff --git a/ts/components/MediaEditor.tsx b/ts/components/MediaEditor.tsx index e43d9db9e5..0672b66682 100644 --- a/ts/components/MediaEditor.tsx +++ b/ts/components/MediaEditor.tsx @@ -13,56 +13,56 @@ import classNames from 'classnames'; import { createPortal } from 'react-dom'; import { fabric } from 'fabric'; import lodash from 'lodash'; -import type { DraftBodyRanges } from '../types/BodyRange.js'; -import type { ImageStateType } from '../mediaEditor/ImageStateType.js'; +import type { DraftBodyRanges } from '../types/BodyRange.std.js'; +import type { ImageStateType } from '../mediaEditor/ImageStateType.std.js'; import type { InputApi, Props as CompositionInputProps, -} from './CompositionInput.js'; -import type { LocalizerType } from '../types/Util.js'; -import type { MIMEType } from '../types/MIME.js'; -import type { imageToBlurHash } from '../util/imageToBlurHash.js'; -import { MediaEditorFabricAnalogTimeSticker } from '../mediaEditor/MediaEditorFabricAnalogTimeSticker.js'; -import { MediaEditorFabricCropRect } from '../mediaEditor/MediaEditorFabricCropRect.js'; -import { MediaEditorFabricDigitalTimeSticker } from '../mediaEditor/MediaEditorFabricDigitalTimeSticker.js'; -import { MediaEditorFabricIText } from '../mediaEditor/MediaEditorFabricIText.js'; -import { MediaEditorFabricPencilBrush } from '../mediaEditor/MediaEditorFabricPencilBrush.js'; -import { MediaEditorFabricSticker } from '../mediaEditor/MediaEditorFabricSticker.js'; -import { fabricEffectListener } from '../mediaEditor/fabricEffectListener.js'; -import { getRGBA, getHSL } from '../mediaEditor/util/color.js'; +} from './CompositionInput.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import type { MIMEType } from '../types/MIME.std.js'; +import type { imageToBlurHash } from '../util/imageToBlurHash.dom.js'; +import { MediaEditorFabricAnalogTimeSticker } from '../mediaEditor/MediaEditorFabricAnalogTimeSticker.dom.js'; +import { MediaEditorFabricCropRect } from '../mediaEditor/MediaEditorFabricCropRect.dom.js'; +import { MediaEditorFabricDigitalTimeSticker } from '../mediaEditor/MediaEditorFabricDigitalTimeSticker.dom.js'; +import { MediaEditorFabricIText } from '../mediaEditor/MediaEditorFabricIText.dom.js'; +import { MediaEditorFabricPencilBrush } from '../mediaEditor/MediaEditorFabricPencilBrush.dom.js'; +import { MediaEditorFabricSticker } from '../mediaEditor/MediaEditorFabricSticker.dom.js'; +import { fabricEffectListener } from '../mediaEditor/fabricEffectListener.std.js'; +import { getRGBA, getHSL } from '../mediaEditor/util/color.std.js'; import { getTextStyleAttributes, TextStyle, -} from '../mediaEditor/util/getTextStyleAttributes.js'; -import { createLogger } from '../logging/log.js'; -import { Button, ButtonVariant } from './Button.js'; -import { CompositionInput } from './CompositionInput.js'; -import { ContextMenu } from './ContextMenu.js'; -import { IMAGE_PNG } from '../types/MIME.js'; -import { SizeObserver } from '../hooks/useSizeObserver.js'; -import { Slider } from './Slider.js'; -import { Spinner } from './Spinner.js'; -import { Theme } from '../util/theme.js'; -import { ThemeType } from '../types/Util.js'; -import { arrow } from '../util/keyboard.js'; -import { canvasToBytes } from '../util/canvasToBytes.js'; -import { loadImage } from '../util/loadImage.js'; -import { hydrateRanges } from '../types/BodyRange.js'; -import { useConfirmDiscard } from '../hooks/useConfirmDiscard.js'; -import { useFabricHistory } from '../mediaEditor/useFabricHistory.js'; -import { usePortal } from '../hooks/usePortal.js'; -import { FunEmojiPicker } from './fun/FunEmojiPicker.js'; +} from '../mediaEditor/util/getTextStyleAttributes.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import { CompositionInput } from './CompositionInput.dom.js'; +import { ContextMenu } from './ContextMenu.dom.js'; +import { IMAGE_PNG } from '../types/MIME.std.js'; +import { SizeObserver } from '../hooks/useSizeObserver.dom.js'; +import { Slider } from './Slider.dom.js'; +import { Spinner } from './Spinner.dom.js'; +import { Theme } from '../util/theme.std.js'; +import { ThemeType } from '../types/Util.std.js'; +import { arrow } from '../util/keyboard.dom.js'; +import { canvasToBytes } from '../util/canvasToBytes.std.js'; +import { loadImage } from '../util/loadImage.std.js'; +import { hydrateRanges } from '../types/BodyRange.std.js'; +import { useConfirmDiscard } from '../hooks/useConfirmDiscard.dom.js'; +import { useFabricHistory } from '../mediaEditor/useFabricHistory.dom.js'; +import { usePortal } from '../hooks/usePortal.dom.js'; +import { FunEmojiPicker } from './fun/FunEmojiPicker.dom.js'; import { FunEmojiPickerButton, FunStickerPickerButton, -} from './fun/FunButton.js'; -import type { FunEmojiSelection } from './fun/panels/FunPanelEmojis.js'; -import { FunStickerPicker } from './fun/FunStickerPicker.js'; -import type { FunStickerSelection } from './fun/panels/FunPanelStickers.js'; -import { drop } from '../util/drop.js'; -import type { FunTimeStickerStyle } from './fun/constants.js'; -import * as Errors from '../types/errors.js'; -import type { GetConversationByIdType } from '../state/selectors/conversations.js'; +} from './fun/FunButton.dom.js'; +import type { FunEmojiSelection } from './fun/panels/FunPanelEmojis.dom.js'; +import { FunStickerPicker } from './fun/FunStickerPicker.dom.js'; +import type { FunStickerSelection } from './fun/panels/FunPanelStickers.dom.js'; +import { drop } from '../util/drop.std.js'; +import type { FunTimeStickerStyle } from './fun/constants.dom.js'; +import * as Errors from '../types/errors.std.js'; +import type { GetConversationByIdType } from '../state/selectors/conversations.dom.js'; const { get, has, noop } = lodash; diff --git a/ts/components/MediaPermissionsModal.stories.tsx b/ts/components/MediaPermissionsModal.stories.tsx index 5f70d376a8..0792859b6e 100644 --- a/ts/components/MediaPermissionsModal.stories.tsx +++ b/ts/components/MediaPermissionsModal.stories.tsx @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; import { action } from '@storybook/addon-actions'; -import { type ComponentMeta } from '../storybook/types.js'; -import type { PropsType } from './MediaPermissionsModal.js'; -import { MediaPermissionsModal } from './MediaPermissionsModal.js'; +import { type ComponentMeta } from '../storybook/types.std.js'; +import type { PropsType } from './MediaPermissionsModal.dom.js'; +import { MediaPermissionsModal } from './MediaPermissionsModal.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/MediaPermissionsModal.tsx b/ts/components/MediaPermissionsModal.tsx index 0be03bd656..7b073f8eba 100644 --- a/ts/components/MediaPermissionsModal.tsx +++ b/ts/components/MediaPermissionsModal.tsx @@ -3,11 +3,11 @@ import React, { useCallback } from 'react'; -import { Modal } from './Modal.js'; -import { tw } from '../axo/tw.js'; -import type { LocalizerType } from '../types/Util.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { Button } from './Button.js'; +import { Modal } from './Modal.dom.js'; +import { tw } from '../axo/tw.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { Button } from './Button.dom.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/MediaQualitySelector.stories.tsx b/ts/components/MediaQualitySelector.stories.tsx index 746b90f50d..082b68b5c1 100644 --- a/ts/components/MediaQualitySelector.stories.tsx +++ b/ts/components/MediaQualitySelector.stories.tsx @@ -4,8 +4,8 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './MediaQualitySelector.js'; -import { MediaQualitySelector } from './MediaQualitySelector.js'; +import type { PropsType } from './MediaQualitySelector.dom.js'; +import { MediaQualitySelector } from './MediaQualitySelector.dom.js'; export default { title: 'Components/MediaQualitySelector', diff --git a/ts/components/MediaQualitySelector.tsx b/ts/components/MediaQualitySelector.tsx index cc1cb794f0..e6ef58fb33 100644 --- a/ts/components/MediaQualitySelector.tsx +++ b/ts/components/MediaQualitySelector.tsx @@ -7,9 +7,9 @@ import lodash from 'lodash'; import { createPortal } from 'react-dom'; import classNames from 'classnames'; import { Manager, Popper, Reference } from 'react-popper'; -import type { LocalizerType } from '../types/Util.js'; -import { useRefMerger } from '../hooks/useRefMerger.js'; -import { handleOutsideClick } from '../util/handleOutsideClick.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { useRefMerger } from '../hooks/useRefMerger.std.js'; +import { handleOutsideClick } from '../util/handleOutsideClick.dom.js'; const { noop } = lodash; diff --git a/ts/components/MiniPlayer.stories.tsx b/ts/components/MiniPlayer.stories.tsx index f72dbfac55..b27070ead3 100644 --- a/ts/components/MiniPlayer.stories.tsx +++ b/ts/components/MiniPlayer.stories.tsx @@ -3,8 +3,8 @@ import React, { useEffect, useState } from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './MiniPlayer.js'; -import { MiniPlayer, PlayerState } from './MiniPlayer.js'; +import type { Props } from './MiniPlayer.dom.js'; +import { MiniPlayer, PlayerState } from './MiniPlayer.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/MiniPlayer.tsx b/ts/components/MiniPlayer.tsx index cb1b509d55..1c63fdb910 100644 --- a/ts/components/MiniPlayer.tsx +++ b/ts/components/MiniPlayer.tsx @@ -3,11 +3,11 @@ import classnames from 'classnames'; import React, { useCallback } from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import { durationToPlaybackText } from '../util/durationToPlaybackText.js'; -import { PlaybackButton } from './PlaybackButton.js'; -import { PlaybackRateButton } from './PlaybackRateButton.js'; -import { UserText } from './UserText.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { durationToPlaybackText } from '../util/durationToPlaybackText.std.js'; +import { PlaybackButton } from './PlaybackButton.dom.js'; +import { PlaybackRateButton } from './PlaybackRateButton.dom.js'; +import { UserText } from './UserText.dom.js'; export enum PlayerState { loading = 'loading', diff --git a/ts/components/Modal.stories.tsx b/ts/components/Modal.stories.tsx index eb3d24a3f3..27bd2a336d 100644 --- a/ts/components/Modal.stories.tsx +++ b/ts/components/Modal.stories.tsx @@ -5,9 +5,9 @@ import React from 'react'; import lodash from 'lodash'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { Button } from './Button.js'; -import type { ModalPropsType } from './Modal.js'; -import { Modal } from './Modal.js'; +import { Button } from './Button.dom.js'; +import type { ModalPropsType } from './Modal.dom.js'; +import { Modal } from './Modal.dom.js'; const { noop } = lodash; diff --git a/ts/components/Modal.tsx b/ts/components/Modal.tsx index d7900dd06e..2978a86e15 100644 --- a/ts/components/Modal.tsx +++ b/ts/components/Modal.tsx @@ -8,20 +8,20 @@ import lodash from 'lodash'; import { animated } from '@react-spring/web'; import { v4 as uuid } from 'uuid'; -import type { LocalizerType } from '../types/Util.js'; -import { ModalHost } from './ModalHost.js'; -import type { Theme } from '../util/theme.js'; -import { assertDev } from '../util/assert.js'; -import { getClassNamesFor } from '../util/getClassNamesFor.js'; -import { useAnimated } from '../hooks/useAnimated.js'; -import { useHasWrapped } from '../hooks/useHasWrapped.js'; -import { createLogger } from '../logging/log.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { ModalHost } from './ModalHost.dom.js'; +import type { Theme } from '../util/theme.std.js'; +import { assertDev } from '../util/assert.std.js'; +import { getClassNamesFor } from '../util/getClassNamesFor.std.js'; +import { useAnimated } from '../hooks/useAnimated.dom.js'; +import { useHasWrapped } from '../hooks/useHasWrapped.std.js'; +import { createLogger } from '../logging/log.std.js'; import { isScrollOverflowVertical, isScrollAtTop, isScrollAtBottom, useScrollObserver, -} from '../hooks/useSizeObserver.js'; +} from '../hooks/useSizeObserver.dom.js'; const { noop } = lodash; diff --git a/ts/components/ModalContainer.tsx b/ts/components/ModalContainer.tsx index 0f5590a541..0f2c8865cb 100644 --- a/ts/components/ModalContainer.tsx +++ b/ts/components/ModalContainer.tsx @@ -4,7 +4,7 @@ import React from 'react'; import type { ReactNode } from 'react'; import ReactDOM from 'react-dom'; -import { ModalContainerContext } from './ModalHost.js'; +import { ModalContainerContext } from './ModalHost.dom.js'; type Props = { children: ReactNode; diff --git a/ts/components/ModalHost.tsx b/ts/components/ModalHost.tsx index 19feb650c9..cbe3516819 100644 --- a/ts/components/ModalHost.tsx +++ b/ts/components/ModalHost.tsx @@ -8,15 +8,15 @@ import { animated } from '@react-spring/web'; import classNames from 'classnames'; import lodash from 'lodash'; import { FocusScope } from 'react-aria'; -import type { ModalConfigType } from '../hooks/useAnimated.js'; -import type { Theme } from '../util/theme.js'; -import { assertDev } from '../util/assert.js'; -import { getClassNamesFor } from '../util/getClassNamesFor.js'; -import { themeClassName } from '../util/theme.js'; -import { useEscapeHandling } from '../hooks/useEscapeHandling.js'; -import { usePrevious } from '../hooks/usePrevious.js'; -import { handleOutsideClick } from '../util/handleOutsideClick.js'; -import { createLogger } from '../logging/log.js'; +import type { ModalConfigType } from '../hooks/useAnimated.dom.js'; +import type { Theme } from '../util/theme.std.js'; +import { assertDev } from '../util/assert.std.js'; +import { getClassNamesFor } from '../util/getClassNamesFor.std.js'; +import { themeClassName } from '../util/theme.std.js'; +import { useEscapeHandling } from '../hooks/useEscapeHandling.dom.js'; +import { usePrevious } from '../hooks/usePrevious.std.js'; +import { handleOutsideClick } from '../util/handleOutsideClick.dom.js'; +import { createLogger } from '../logging/log.std.js'; const { noop } = lodash; diff --git a/ts/components/MyStories.stories.tsx b/ts/components/MyStories.stories.tsx index 773511f80c..18dd43e2eb 100644 --- a/ts/components/MyStories.stories.tsx +++ b/ts/components/MyStories.stories.tsx @@ -8,13 +8,13 @@ import { v4 as uuid } from 'uuid'; import { expect, fn, within, userEvent } from '@storybook/test'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './MyStories.js'; -import { MY_STORY_ID } from '../types/Stories.js'; -import { MyStories } from './MyStories.js'; -import { SendStatus } from '../messages/MessageSendState.js'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; -import { getFakeMyStory } from '../test-helpers/getFakeStory.js'; -import { sleep } from '../util/sleep.js'; +import type { PropsType } from './MyStories.dom.js'; +import { MY_STORY_ID } from '../types/Stories.std.js'; +import { MyStories } from './MyStories.dom.js'; +import { SendStatus } from '../messages/MessageSendState.std.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.std.js'; +import { getFakeMyStory } from '../test-helpers/getFakeStory.dom.js'; +import { sleep } from '../util/sleep.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/MyStories.tsx b/ts/components/MyStories.tsx index 26398452db..8cf0ebfe80 100644 --- a/ts/components/MyStories.tsx +++ b/ts/components/MyStories.tsx @@ -2,26 +2,26 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useState } from 'react'; -import type { MyStoryType, StoryViewType } from '../types/Stories.js'; +import type { MyStoryType, StoryViewType } from '../types/Stories.std.js'; import { ResolvedSendStatus, StoryViewTargetType, StoryViewModeType, -} from '../types/Stories.js'; -import type { LocalizerType } from '../types/Util.js'; -import { ThemeType } from '../types/Util.js'; -import type { ViewStoryActionCreatorType } from '../state/ducks/stories.js'; -import { ConfirmationDialog } from './ConfirmationDialog.js'; -import { ContextMenu } from './ContextMenu.js'; -import { MessageTimestamp } from './conversation/MessageTimestamp.js'; -import { StoryDistributionListName } from './StoryDistributionListName.js'; -import { StoryImage } from './StoryImage.js'; -import { Theme } from '../util/theme.js'; -import { resolveStorySendStatus } from '../util/resolveStorySendStatus.js'; -import { useRetryStorySend } from '../hooks/useRetryStorySend.js'; -import { NavSidebar } from './NavSidebar.js'; -import type { WidthBreakpoint } from './_util.js'; -import type { UnreadStats } from '../util/countUnreadStats.js'; +} from '../types/Stories.std.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { ThemeType } from '../types/Util.std.js'; +import type { ViewStoryActionCreatorType } from '../state/ducks/stories.preload.js'; +import { ConfirmationDialog } from './ConfirmationDialog.dom.js'; +import { ContextMenu } from './ContextMenu.dom.js'; +import { MessageTimestamp } from './conversation/MessageTimestamp.dom.js'; +import { StoryDistributionListName } from './StoryDistributionListName.dom.js'; +import { StoryImage } from './StoryImage.dom.js'; +import { Theme } from '../util/theme.std.js'; +import { resolveStorySendStatus } from '../util/resolveStorySendStatus.std.js'; +import { useRetryStorySend } from '../hooks/useRetryStorySend.dom.js'; +import { NavSidebar } from './NavSidebar.dom.js'; +import type { WidthBreakpoint } from './_util.std.js'; +import type { UnreadStats } from '../util/countUnreadStats.std.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/MyStoryButton.stories.tsx b/ts/components/MyStoryButton.stories.tsx index ac245954b6..e2edf78e9f 100644 --- a/ts/components/MyStoryButton.stories.tsx +++ b/ts/components/MyStoryButton.stories.tsx @@ -7,12 +7,12 @@ import React from 'react'; import { expect, fn, within, userEvent } from '@storybook/test'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './MyStoryButton.js'; -import { MyStoryButton } from './MyStoryButton.js'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; -import { getFakeMyStory } from '../test-helpers/getFakeStory.js'; -import { SendStatus } from '../messages/MessageSendState.js'; -import { ResolvedSendStatus } from '../types/Stories.js'; +import type { PropsType } from './MyStoryButton.dom.js'; +import { MyStoryButton } from './MyStoryButton.dom.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.std.js'; +import { getFakeMyStory } from '../test-helpers/getFakeStory.dom.js'; +import { SendStatus } from '../messages/MessageSendState.std.js'; +import { ResolvedSendStatus } from '../types/Stories.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/MyStoryButton.tsx b/ts/components/MyStoryButton.tsx index 030530fbe8..eaf8136af5 100644 --- a/ts/components/MyStoryButton.tsx +++ b/ts/components/MyStoryButton.tsx @@ -3,17 +3,17 @@ import React, { useState } from 'react'; import classNames from 'classnames'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import type { LocalizerType } from '../types/Util.js'; -import type { MyStoryType, StoryViewType } from '../types/Stories.js'; -import type { ShowToastAction } from '../state/ducks/toast.js'; -import { Avatar, AvatarSize } from './Avatar.js'; -import { HasStories, ResolvedSendStatus } from '../types/Stories.js'; -import { MessageTimestamp } from './conversation/MessageTimestamp.js'; -import { StoriesAddStoryButton } from './StoriesAddStoryButton.js'; -import { StoryImage } from './StoryImage.js'; -import { getAvatarColor } from '../types/Colors.js'; -import { reduceStorySendStatus } from '../util/resolveStorySendStatus.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import type { MyStoryType, StoryViewType } from '../types/Stories.std.js'; +import type { ShowToastAction } from '../state/ducks/toast.preload.js'; +import { Avatar, AvatarSize } from './Avatar.dom.js'; +import { HasStories, ResolvedSendStatus } from '../types/Stories.std.js'; +import { MessageTimestamp } from './conversation/MessageTimestamp.dom.js'; +import { StoriesAddStoryButton } from './StoriesAddStoryButton.dom.js'; +import { StoryImage } from './StoryImage.dom.js'; +import { getAvatarColor } from '../types/Colors.std.js'; +import { reduceStorySendStatus } from '../util/resolveStorySendStatus.std.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/NavSidebar.tsx b/ts/components/NavSidebar.tsx index d6e1e77cd1..3af063ca7a 100644 --- a/ts/components/NavSidebar.tsx +++ b/ts/components/NavSidebar.tsx @@ -5,16 +5,16 @@ import type { ButtonHTMLAttributes, ReactNode } from 'react'; import React, { createContext, useEffect, useState } from 'react'; import classNames from 'classnames'; import { useMove } from 'react-aria'; -import { NavTabsToggle } from './NavTabs.js'; -import type { LocalizerType } from '../types/I18N.js'; +import { NavTabsToggle } from './NavTabs.dom.js'; +import type { LocalizerType } from '../types/I18N.std.js'; import { MAX_WIDTH, MIN_FULL_WIDTH, MIN_WIDTH, getWidthFromPreferredWidth, -} from '../util/leftPaneWidth.js'; -import { WidthBreakpoint, getNavSidebarWidthBreakpoint } from './_util.js'; -import type { UnreadStats } from '../util/countUnreadStats.js'; +} from '../util/leftPaneWidth.std.js'; +import { WidthBreakpoint, getNavSidebarWidthBreakpoint } from './_util.std.js'; +import type { UnreadStats } from '../util/countUnreadStats.std.js'; export const NavSidebarWidthBreakpointContext = createContext(null); diff --git a/ts/components/NavTabs.stories.tsx b/ts/components/NavTabs.stories.tsx index 7d6fe2d31d..b4dcb973af 100644 --- a/ts/components/NavTabs.stories.tsx +++ b/ts/components/NavTabs.stories.tsx @@ -5,11 +5,11 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { NavTabsProps } from './NavTabs.js'; -import { NavTabs } from './NavTabs.js'; -import { NavTab } from '../types/Nav.js'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; -import { ThemeType } from '../types/Util.js'; +import type { NavTabsProps } from './NavTabs.dom.js'; +import { NavTabs } from './NavTabs.dom.js'; +import { NavTab } from '../types/Nav.std.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.std.js'; +import { ThemeType } from '../types/Util.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/NavTabs.tsx b/ts/components/NavTabs.tsx index 9bd782c5f8..11e4faae49 100644 --- a/ts/components/NavTabs.tsx +++ b/ts/components/NavTabs.tsx @@ -5,16 +5,16 @@ import type { Key, ReactNode } from 'react'; import React, { useState } from 'react'; import { Tabs, TabList, Tab, TabPanel } from 'react-aria-components'; import classNames from 'classnames'; -import { Avatar, AvatarSize } from './Avatar.js'; -import type { LocalizerType, ThemeType } from '../types/Util.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import type { BadgeType } from '../badges/types.js'; -import { NavTab, ProfileEditorPage, SettingsPage } from '../types/Nav.js'; -import type { Location } from '../types/Nav.js'; -import { Tooltip, TooltipPlacement } from './Tooltip.js'; -import { Theme } from '../util/theme.js'; -import type { UnreadStats } from '../util/countUnreadStats.js'; -import { ProfileMovedModal } from './ProfileMovedModal.js'; +import { Avatar, AvatarSize } from './Avatar.dom.js'; +import type { LocalizerType, ThemeType } from '../types/Util.std.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import type { BadgeType } from '../badges/types.std.js'; +import { NavTab, ProfileEditorPage, SettingsPage } from '../types/Nav.std.js'; +import type { Location } from '../types/Nav.std.js'; +import { Tooltip, TooltipPlacement } from './Tooltip.dom.js'; +import { Theme } from '../util/theme.std.js'; +import type { UnreadStats } from '../util/countUnreadStats.std.js'; +import { ProfileMovedModal } from './ProfileMovedModal.dom.js'; type NavTabsItemBadgesProps = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/NeedsScreenRecordingPermissionsModal.tsx b/ts/components/NeedsScreenRecordingPermissionsModal.tsx index 19265a84c8..46f513bea1 100644 --- a/ts/components/NeedsScreenRecordingPermissionsModal.tsx +++ b/ts/components/NeedsScreenRecordingPermissionsModal.tsx @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import { Theme } from '../util/theme.js'; -import { Modal } from './Modal.js'; -import { Button, ButtonVariant } from './Button.js'; -import { tw } from '../axo/tw.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { Theme } from '../util/theme.std.js'; +import { Modal } from './Modal.dom.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import { tw } from '../axo/tw.dom.js'; type PropsType = { i18n: LocalizerType; diff --git a/ts/components/NewlyCreatedGroupInvitedContactsDialog.stories.tsx b/ts/components/NewlyCreatedGroupInvitedContactsDialog.stories.tsx index d81f446210..1232ab82d1 100644 --- a/ts/components/NewlyCreatedGroupInvitedContactsDialog.stories.tsx +++ b/ts/components/NewlyCreatedGroupInvitedContactsDialog.stories.tsx @@ -6,11 +6,11 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './NewlyCreatedGroupInvitedContactsDialog.js'; -import { NewlyCreatedGroupInvitedContactsDialog } from './NewlyCreatedGroupInvitedContactsDialog.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; -import { ThemeType } from '../types/Util.js'; +import type { PropsType } from './NewlyCreatedGroupInvitedContactsDialog.dom.js'; +import { NewlyCreatedGroupInvitedContactsDialog } from './NewlyCreatedGroupInvitedContactsDialog.dom.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.std.js'; +import { ThemeType } from '../types/Util.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/NewlyCreatedGroupInvitedContactsDialog.tsx b/ts/components/NewlyCreatedGroupInvitedContactsDialog.tsx index ea04e02fb0..08fc42bfe5 100644 --- a/ts/components/NewlyCreatedGroupInvitedContactsDialog.tsx +++ b/ts/components/NewlyCreatedGroupInvitedContactsDialog.tsx @@ -4,13 +4,13 @@ import type { ReactNode } from 'react'; import React from 'react'; -import type { LocalizerType, ThemeType } from '../types/Util.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; -import { I18n } from './I18n.js'; -import { ContactName } from './conversation/ContactName.js'; -import { GroupDialog } from './GroupDialog.js'; -import { openLinkInWebBrowser } from '../util/openLinkInWebBrowser.js'; +import type { LocalizerType, ThemeType } from '../types/Util.std.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.preload.js'; +import { I18n } from './I18n.dom.js'; +import { ContactName } from './conversation/ContactName.dom.js'; +import { GroupDialog } from './GroupDialog.dom.js'; +import { openLinkInWebBrowser } from '../util/openLinkInWebBrowser.dom.js'; export type PropsType = { contacts: Array; diff --git a/ts/components/NotePreviewModal.stories.tsx b/ts/components/NotePreviewModal.stories.tsx index 50b65c2c4b..d7fb837845 100644 --- a/ts/components/NotePreviewModal.stories.tsx +++ b/ts/components/NotePreviewModal.stories.tsx @@ -2,12 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import { action } from '@storybook/addon-actions'; import * as React from 'react'; -import type { ComponentMeta } from '../storybook/types.js'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; +import type { ComponentMeta } from '../storybook/types.std.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.std.js'; import { NotePreviewModal, type NotePreviewModalProps, -} from './NotePreviewModal.js'; +} from './NotePreviewModal.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/NotePreviewModal.tsx b/ts/components/NotePreviewModal.tsx index 9783b856ee..86b0cec6cf 100644 --- a/ts/components/NotePreviewModal.tsx +++ b/ts/components/NotePreviewModal.tsx @@ -2,13 +2,13 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import type { LocalizerType } from '../types/I18N.js'; -import { Button, ButtonVariant } from './Button.js'; -import { Modal } from './Modal.js'; -import { Linkify } from './conversation/Linkify.js'; -import type { RenderTextCallbackType } from '../types/Util.js'; -import { Emojify } from './conversation/Emojify.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import type { LocalizerType } from '../types/I18N.std.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import { Modal } from './Modal.dom.js'; +import { Linkify } from './conversation/Linkify.dom.js'; +import type { RenderTextCallbackType } from '../types/Util.std.js'; +import { Emojify } from './conversation/Emojify.dom.js'; export type NotePreviewModalProps = Readonly<{ conversation: ConversationType; diff --git a/ts/components/NotificationProfilesMenu.stories.tsx b/ts/components/NotificationProfilesMenu.stories.tsx index 365363e91b..11d51eea19 100644 --- a/ts/components/NotificationProfilesMenu.stories.tsx +++ b/ts/components/NotificationProfilesMenu.stories.tsx @@ -6,17 +6,17 @@ import { shuffle } from 'lodash'; import type { Meta, StoryFn } from '@storybook/react'; import { action } from '@storybook/addon-actions'; -import { NotificationProfilesMenu } from './NotificationProfilesMenu.js'; -import type { Props } from './NotificationProfilesMenu.js'; +import { NotificationProfilesMenu } from './NotificationProfilesMenu.dom.js'; +import type { Props } from './NotificationProfilesMenu.dom.js'; import { getDefaultConversation, getDefaultGroup, -} from '../test-helpers/getDefaultConversation.js'; -import { DayOfWeek } from '../types/NotificationProfile.js'; -import type { NotificationProfileIdString } from '../types/NotificationProfile.js'; -import { HOUR } from '../util/durations/index.js'; -import { AxoDropdownMenu } from '../axo/AxoDropdownMenu.js'; -import { AxoButton } from '../axo/AxoButton.js'; +} from '../test-helpers/getDefaultConversation.std.js'; +import { DayOfWeek } from '../types/NotificationProfile.std.js'; +import type { NotificationProfileIdString } from '../types/NotificationProfile.std.js'; +import { HOUR } from '../util/durations/index.std.js'; +import { AxoDropdownMenu } from '../axo/AxoDropdownMenu.dom.js'; +import { AxoButton } from '../axo/AxoButton.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/NotificationProfilesMenu.tsx b/ts/components/NotificationProfilesMenu.tsx index 22d9908a5e..3b8cd4bc9f 100644 --- a/ts/components/NotificationProfilesMenu.tsx +++ b/ts/components/NotificationProfilesMenu.tsx @@ -3,17 +3,17 @@ import React from 'react'; -import type { LocalizerType } from '../types/Util.js'; +import type { LocalizerType } from '../types/Util.std.js'; import { getMidnight, type NotificationProfileIdString, type NotificationProfileOverride, type NotificationProfileType, -} from '../types/NotificationProfile.js'; -import { DAY, HOUR, SECOND } from '../util/durations/index.js'; -import { formatTimestamp } from '../util/formatTimestamp.js'; -import { AxoDropdownMenu } from '../axo/AxoDropdownMenu.js'; -import { ProfileAvatar } from './PreferencesNotificationProfiles.js'; +} from '../types/NotificationProfile.std.js'; +import { DAY, HOUR, SECOND } from '../util/durations/index.std.js'; +import { formatTimestamp } from '../util/formatTimestamp.dom.js'; +import { AxoDropdownMenu } from '../axo/AxoDropdownMenu.dom.js'; +import { ProfileAvatar } from './PreferencesNotificationProfiles.dom.js'; export type Props = Readonly<{ activeProfileId: NotificationProfileIdString | undefined; diff --git a/ts/components/OutgoingGiftBadgeModal.stories.tsx b/ts/components/OutgoingGiftBadgeModal.stories.tsx index 8971a1a006..361210b511 100644 --- a/ts/components/OutgoingGiftBadgeModal.stories.tsx +++ b/ts/components/OutgoingGiftBadgeModal.stories.tsx @@ -4,9 +4,9 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './OutgoingGiftBadgeModal.js'; -import { OutgoingGiftBadgeModal } from './OutgoingGiftBadgeModal.js'; -import { BadgeCategory } from '../badges/BadgeCategory.js'; +import type { PropsType } from './OutgoingGiftBadgeModal.dom.js'; +import { OutgoingGiftBadgeModal } from './OutgoingGiftBadgeModal.dom.js'; +import { BadgeCategory } from '../badges/BadgeCategory.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/OutgoingGiftBadgeModal.tsx b/ts/components/OutgoingGiftBadgeModal.tsx index c4efa48dac..d652f0850f 100644 --- a/ts/components/OutgoingGiftBadgeModal.tsx +++ b/ts/components/OutgoingGiftBadgeModal.tsx @@ -4,12 +4,12 @@ import React from 'react'; import classNames from 'classnames'; -import { getBadgeImageFileLocalPath } from '../badges/getBadgeImageFileLocalPath.js'; -import { Modal } from './Modal.js'; -import { BadgeImageTheme } from '../badges/BadgeImageTheme.js'; +import { getBadgeImageFileLocalPath } from '../badges/getBadgeImageFileLocalPath.std.js'; +import { Modal } from './Modal.dom.js'; +import { BadgeImageTheme } from '../badges/BadgeImageTheme.std.js'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; -import type { LocalizerType } from '../types/Util.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.preload.js'; +import type { LocalizerType } from '../types/Util.std.js'; const CLASS_NAME = 'OutgoingGiftBadgeModal'; diff --git a/ts/components/PermissionsPopup.tsx b/ts/components/PermissionsPopup.tsx index dbd5fc25c0..6d58ae3c8d 100644 --- a/ts/components/PermissionsPopup.tsx +++ b/ts/components/PermissionsPopup.tsx @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import { Button, ButtonVariant } from './Button.js'; -import type { LocalizerType } from '../types/Util.js'; -import { useEscapeHandling } from '../hooks/useEscapeHandling.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { useEscapeHandling } from '../hooks/useEscapeHandling.dom.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/PlaybackButton.stories.tsx b/ts/components/PlaybackButton.stories.tsx index 352db9f140..8a9bf78366 100644 --- a/ts/components/PlaybackButton.stories.tsx +++ b/ts/components/PlaybackButton.stories.tsx @@ -5,11 +5,11 @@ import React, { useContext } from 'react'; import type { CSSProperties } from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { ButtonProps } from './PlaybackButton.js'; -import { PlaybackButton } from './PlaybackButton.js'; +import type { ButtonProps } from './PlaybackButton.dom.js'; +import { PlaybackButton } from './PlaybackButton.dom.js'; import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext.js'; -import { ThemeType } from '../types/Util.js'; -import { AUDIO_MP3 } from '../types/MIME.js'; +import { ThemeType } from '../types/Util.std.js'; +import { AUDIO_MP3 } from '../types/MIME.std.js'; export default { title: 'components/PlaybackButton', diff --git a/ts/components/PlaybackButton.tsx b/ts/components/PlaybackButton.tsx index 66d1b12094..132efcd363 100644 --- a/ts/components/PlaybackButton.tsx +++ b/ts/components/PlaybackButton.tsx @@ -4,9 +4,9 @@ import { animated, useSpring } from '@react-spring/web'; import classNames from 'classnames'; import React, { useCallback } from 'react'; -import { useReducedMotion } from '../hooks/useReducedMotion.js'; -import type { AttachmentForUIType } from '../types/Attachment.js'; -import { SpinnerV2 } from './SpinnerV2.js'; +import { useReducedMotion } from '../hooks/useReducedMotion.dom.js'; +import type { AttachmentForUIType } from '../types/Attachment.std.js'; +import { SpinnerV2 } from './SpinnerV2.dom.js'; const SPRING_CONFIG = { mass: 0.5, diff --git a/ts/components/PlaybackRateButton.tsx b/ts/components/PlaybackRateButton.tsx index e3e1e74c49..3d81a87250 100644 --- a/ts/components/PlaybackRateButton.tsx +++ b/ts/components/PlaybackRateButton.tsx @@ -4,8 +4,8 @@ import classNames from 'classnames'; import React, { useCallback, useState } from 'react'; import { animated, useSpring } from '@react-spring/web'; -import type { LocalizerType } from '../types/Util.js'; -import { useReducedMotion } from '../hooks/useReducedMotion.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { useReducedMotion } from '../hooks/useReducedMotion.dom.js'; const SPRING_CONFIG = { mass: 0.5, diff --git a/ts/components/Preferences.stories.tsx b/ts/components/Preferences.stories.tsx index 2f5441e05e..96090e6f34 100644 --- a/ts/components/Preferences.stories.tsx +++ b/ts/components/Preferences.stories.tsx @@ -7,53 +7,58 @@ import type { MutableRefObject } from 'react'; import { action } from '@storybook/addon-actions'; import lodash from 'lodash'; -import { Preferences } from './Preferences.js'; -import { DEFAULT_CONVERSATION_COLOR } from '../types/Colors.js'; -import { PhoneNumberSharingMode } from '../types/PhoneNumberSharingMode.js'; -import { PhoneNumberDiscoverability } from '../util/phoneNumberDiscoverability.js'; -import { EmojiSkinTone } from './fun/data/emojis.js'; -import { DAY, DurationInSeconds, HOUR, WEEK } from '../util/durations/index.js'; -import { DialogUpdate } from './DialogUpdate.js'; -import { DialogType } from '../types/Dialogs.js'; -import { ThemeType } from '../types/Util.js'; +import { Preferences } from './Preferences.dom.js'; +import { DEFAULT_CONVERSATION_COLOR } from '../types/Colors.std.js'; +import { PhoneNumberSharingMode } from '../types/PhoneNumberSharingMode.std.js'; +import { PhoneNumberDiscoverability } from '../util/phoneNumberDiscoverability.std.js'; +import { EmojiSkinTone } from './fun/data/emojis.std.js'; +import { + DAY, + DurationInSeconds, + HOUR, + WEEK, +} from '../util/durations/index.std.js'; +import { DialogUpdate } from './DialogUpdate.dom.js'; +import { DialogType } from '../types/Dialogs.std.js'; +import { ThemeType } from '../types/Util.std.js'; import { getDefaultConversation, getDefaultGroup, -} from '../test-helpers/getDefaultConversation.js'; -import { ProfileEditor } from './ProfileEditor.js'; +} from '../test-helpers/getDefaultConversation.std.js'; +import { ProfileEditor } from './ProfileEditor.dom.js'; import { UsernameEditState, UsernameLinkState, -} from '../state/ducks/usernameEnums.js'; -import type { SettingsLocation } from '../types/Nav.js'; -import { NavTab, ProfileEditorPage, SettingsPage } from '../types/Nav.js'; -import { PreferencesDonations } from './PreferencesDonations.js'; -import { strictAssert } from '../util/assert.js'; -import { PreferencesChatFoldersPage } from './preferences/chatFolders/PreferencesChatFoldersPage.js'; -import { PreferencesEditChatFolderPage } from './preferences/chatFolders/PreferencesEditChatFoldersPage.js'; -import { CHAT_FOLDER_DEFAULTS } from '../types/ChatFolder.js'; +} from '../state/ducks/usernameEnums.std.js'; +import type { SettingsLocation } from '../types/Nav.std.js'; +import { NavTab, ProfileEditorPage, SettingsPage } from '../types/Nav.std.js'; +import { PreferencesDonations } from './PreferencesDonations.dom.js'; +import { strictAssert } from '../util/assert.std.js'; +import { PreferencesChatFoldersPage } from './preferences/chatFolders/PreferencesChatFoldersPage.dom.js'; +import { PreferencesEditChatFolderPage } from './preferences/chatFolders/PreferencesEditChatFoldersPage.dom.js'; +import { CHAT_FOLDER_DEFAULTS } from '../types/ChatFolder.std.js'; import { NotificationProfilesHome, NotificationProfilesCreateFlow, -} from './PreferencesNotificationProfiles.js'; -import { DayOfWeek } from '../types/NotificationProfile.js'; +} from './PreferencesNotificationProfiles.dom.js'; +import { DayOfWeek } from '../types/NotificationProfile.std.js'; -import type { LocalizerType } from '../types/Util.js'; -import type { PropsType } from './Preferences.js'; -import type { WidthBreakpoint } from './_util.js'; -import type { MessageAttributesType } from '../model-types.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import type { PropsType } from './Preferences.dom.js'; +import type { WidthBreakpoint } from './_util.std.js'; +import type { MessageAttributesType } from '../model-types.d.ts'; import type { DonationReceipt, DonationWorkflow, OneTimeDonationHumanAmounts, -} from '../types/Donations.js'; -import type { AnyToast } from '../types/Toast.js'; -import type { SmartPreferencesChatFoldersPageProps } from '../state/smart/PreferencesChatFoldersPage.js'; -import type { SmartPreferencesEditChatFolderPageProps } from '../state/smart/PreferencesEditChatFolderPage.js'; -import { CurrentChatFolders } from '../types/CurrentChatFolders.js'; -import type { ExternalProps as SmartNotificationProfilesProps } from '../state/smart/PreferencesNotificationProfiles.js'; -import type { NotificationProfileIdString } from '../types/NotificationProfile.js'; -import { BackupLevel } from '../services/backups/types.js'; +} from '../types/Donations.std.js'; +import type { AnyToast } from '../types/Toast.dom.js'; +import type { SmartPreferencesChatFoldersPageProps } from '../state/smart/PreferencesChatFoldersPage.preload.js'; +import type { SmartPreferencesEditChatFolderPageProps } from '../state/smart/PreferencesEditChatFolderPage.preload.js'; +import { CurrentChatFolders } from '../types/CurrentChatFolders.std.js'; +import type { ExternalProps as SmartNotificationProfilesProps } from '../state/smart/PreferencesNotificationProfiles.preload.js'; +import type { NotificationProfileIdString } from '../types/NotificationProfile.std.js'; +import { BackupLevel } from '../services/backups/types.std.js'; const { shuffle } = lodash; @@ -404,6 +409,7 @@ export default { availableMicrophones, availableSpeakers, backupFeatureEnabled: false, + chatFoldersFeatureEnabled: true, backupFreeMediaDays: 45, backupKeyViewed: false, backupLocalBackupsEnabled: false, diff --git a/ts/components/Preferences.tsx b/ts/components/Preferences.tsx index 7b40e3505b..6961a92370 100644 --- a/ts/components/Preferences.tsx +++ b/ts/components/Preferences.tsx @@ -17,91 +17,90 @@ import type { MutableRefObject, ReactNode } from 'react'; import type { RowType } from '@signalapp/sqlcipher'; import type { BackupLevel } from '@signalapp/libsignal-client/zkgroup.js'; -import { Button, ButtonVariant } from './Button.js'; -import { ChatColorPicker } from './ChatColorPicker.js'; -import { Checkbox } from './Checkbox.js'; -import { WidthBreakpoint } from './_util.js'; -import { ConfirmationDialog } from './ConfirmationDialog.js'; -import { DisappearingTimeDialog } from './DisappearingTimeDialog.js'; -import { PhoneNumberDiscoverability } from '../util/phoneNumberDiscoverability.js'; -import { PhoneNumberSharingMode } from '../types/PhoneNumberSharingMode.js'; -import { Select } from './Select.js'; -import { Spinner } from './Spinner.js'; -import { getCustomColorStyle } from '../util/getCustomColorStyle.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import { ChatColorPicker } from './ChatColorPicker.dom.js'; +import { Checkbox } from './Checkbox.dom.js'; +import { WidthBreakpoint } from './_util.std.js'; +import { ConfirmationDialog } from './ConfirmationDialog.dom.js'; +import { DisappearingTimeDialog } from './DisappearingTimeDialog.dom.js'; +import { PhoneNumberDiscoverability } from '../util/phoneNumberDiscoverability.std.js'; +import { PhoneNumberSharingMode } from '../types/PhoneNumberSharingMode.std.js'; +import { Select } from './Select.dom.js'; +import { Spinner } from './Spinner.dom.js'; +import { getCustomColorStyle } from '../util/getCustomColorStyle.dom.js'; import { DEFAULT_DURATIONS_IN_SECONDS, DEFAULT_DURATIONS_SET, format as formatExpirationTimer, -} from '../util/expirationTimer.js'; -import { DurationInSeconds } from '../util/durations/index.js'; -import { focusableSelector } from '../util/focusableSelectors.js'; -import { Modal } from './Modal.js'; -import { SearchInput } from './SearchInput.js'; -import { removeDiacritics } from '../util/removeDiacritics.js'; -import { assertDev } from '../util/assert.js'; -import { I18n } from './I18n.js'; -import { FunSkinTonesList } from './fun/FunSkinTones.js'; -import { EMOJI_PARENT_KEY_CONSTANTS } from './fun/data/emojis.js'; +} from '../util/expirationTimer.std.js'; +import { DurationInSeconds } from '../util/durations/index.std.js'; +import { focusableSelector } from '../util/focusableSelectors.std.js'; +import { Modal } from './Modal.dom.js'; +import { SearchInput } from './SearchInput.dom.js'; +import { removeDiacritics } from '../util/removeDiacritics.std.js'; +import { assertDev } from '../util/assert.std.js'; +import { I18n } from './I18n.dom.js'; +import { FunSkinTonesList } from './fun/FunSkinTones.dom.js'; +import { EMOJI_PARENT_KEY_CONSTANTS } from './fun/data/emojis.std.js'; import { SettingsControl as Control, FlowingSettingsControl as FlowingControl, SettingsRadio, SettingsRow, -} from './PreferencesUtil.js'; -import { PreferencesBackups } from './PreferencesBackups.js'; -import { PreferencesInternal } from './PreferencesInternal.js'; -import { FunEmojiLocalizationProvider } from './fun/FunEmojiLocalizationProvider.js'; -import { Avatar, AvatarSize } from './Avatar.js'; -import { NavSidebar } from './NavSidebar.js'; -import type { SettingsLocation } from '../types/Nav.js'; -import { SettingsPage, ProfileEditorPage } from '../types/Nav.js'; -import { tw } from '../axo/tw.js'; -import { FullWidthButton } from './PreferencesNotificationProfiles.js'; -import type { EmojiSkinTone } from './fun/data/emojis.js'; -import type { MediaDeviceSettings } from '../types/Calling.js'; -import type { ValidationResultType as BackupValidationResultType } from '../services/backups/index.js'; +} from './PreferencesUtil.dom.js'; +import { PreferencesBackups } from './PreferencesBackups.dom.js'; +import { PreferencesInternal } from './PreferencesInternal.dom.js'; +import { FunEmojiLocalizationProvider } from './fun/FunEmojiLocalizationProvider.dom.js'; +import { Avatar, AvatarSize } from './Avatar.dom.js'; +import { NavSidebar } from './NavSidebar.dom.js'; +import type { SettingsLocation } from '../types/Nav.std.js'; +import { SettingsPage, ProfileEditorPage } from '../types/Nav.std.js'; +import { tw } from '../axo/tw.dom.js'; +import { FullWidthButton } from './PreferencesNotificationProfiles.dom.js'; +import type { EmojiSkinTone } from './fun/data/emojis.std.js'; +import type { MediaDeviceSettings } from '../types/Calling.std.js'; +import type { ValidationResultType as BackupValidationResultType } from '../services/backups/index.preload.js'; import type { AutoDownloadAttachmentType, NotificationSettingType, SentMediaQualitySettingType, ZoomFactorType, } from '../types/Storage.d.ts'; -import type { ThemeSettingType } from '../types/StorageUIKeys.js'; -import type { AnyToast } from '../types/Toast.js'; -import { ToastType } from '../types/Toast.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; +import type { ThemeSettingType } from '../types/StorageUIKeys.std.js'; +import type { AnyToast } from '../types/Toast.dom.js'; +import { ToastType } from '../types/Toast.dom.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; import type { ConversationColorType, CustomColorType, DefaultConversationColorType, -} from '../types/Colors.js'; +} from '../types/Colors.std.js'; import type { LocalizerType, SentMediaQualityType, ThemeType, -} from '../types/Util.js'; +} from '../types/Util.std.js'; import type { BackupMediaDownloadStatusType, BackupsSubscriptionType, BackupStatusType, -} from '../types/backups.js'; -import type { UnreadStats } from '../util/countUnreadStats.js'; -import type { BadgeType } from '../badges/types.js'; -import type { MessageCountBySchemaVersionType } from '../sql/Interface.js'; -import type { MessageAttributesType } from '../model-types.js'; -import { isBackupPage } from '../types/PreferencesBackupPage.js'; -import type { PreferencesBackupPage } from '../types/PreferencesBackupPage.js'; +} from '../types/backups.node.js'; +import type { UnreadStats } from '../util/countUnreadStats.std.js'; +import type { BadgeType } from '../badges/types.std.js'; +import type { MessageCountBySchemaVersionType } from '../sql/Interface.std.js'; +import type { MessageAttributesType } from '../model-types.d.ts'; +import { isBackupPage } from '../types/PreferencesBackupPage.std.js'; +import type { PreferencesBackupPage } from '../types/PreferencesBackupPage.std.js'; import type { PromptOSAuthReasonType, PromptOSAuthResultType, -} from '../util/os/promptOSAuthMain.js'; -import type { DonationReceipt } from '../types/Donations.js'; -import type { ChatFolderId } from '../types/ChatFolder.js'; -import { isChatFoldersEnabled } from '../types/ChatFolder.js'; -import type { SmartPreferencesEditChatFolderPageProps } from '../state/smart/PreferencesEditChatFolderPage.js'; -import type { SmartPreferencesChatFoldersPageProps } from '../state/smart/PreferencesChatFoldersPage.js'; -import { AxoButton } from '../axo/AxoButton.js'; -import type { ExternalProps as SmartNotificationProfilesProps } from '../state/smart/PreferencesNotificationProfiles.js'; +} from '../util/os/promptOSAuthMain.main.js'; +import type { DonationReceipt } from '../types/Donations.std.js'; +import type { ChatFolderId } from '../types/ChatFolder.std.js'; +import type { SmartPreferencesEditChatFolderPageProps } from '../state/smart/PreferencesEditChatFolderPage.preload.js'; +import type { SmartPreferencesChatFoldersPageProps } from '../state/smart/PreferencesChatFoldersPage.preload.js'; +import { AxoButton } from '../axo/AxoButton.dom.js'; +import type { ExternalProps as SmartNotificationProfilesProps } from '../state/smart/PreferencesNotificationProfiles.preload.js'; const { isNumber, noop, partition } = lodash; @@ -118,6 +117,7 @@ export type PropsDataType = { backupLocalBackupsEnabled: boolean; backupTier: BackupLevel | null; localBackupFolder: string | undefined; + chatFoldersFeatureEnabled: boolean; currentChatFoldersCount: number; cloudBackupStatus?: BackupStatusType; backupSubscriptionStatus: BackupsSubscriptionType; @@ -384,6 +384,7 @@ export function Preferences({ availableSpeakers, backupFeatureEnabled, backupMediaDownloadStatus, + chatFoldersFeatureEnabled, pauseBackupMediaDownload, resumeBackupMediaDownload, cancelBackupMediaDownload, @@ -1181,7 +1182,7 @@ export function Preferences({ /> - {isChatFoldersEnabled() && ( + {chatFoldersFeatureEnabled && ( ; export default { diff --git a/ts/components/ProgressDialog.stories.tsx b/ts/components/ProgressDialog.stories.tsx index cb595aaf57..909a4aec97 100644 --- a/ts/components/ProgressDialog.stories.tsx +++ b/ts/components/ProgressDialog.stories.tsx @@ -4,8 +4,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './ProgressDialog.js'; -import { ProgressDialog } from './ProgressDialog.js'; +import type { PropsType } from './ProgressDialog.dom.js'; +import { ProgressDialog } from './ProgressDialog.dom.js'; export default { title: 'Components/ProgressDialog', diff --git a/ts/components/ProgressDialog.tsx b/ts/components/ProgressDialog.tsx index 6031dc1ffa..6f86359956 100644 --- a/ts/components/ProgressDialog.tsx +++ b/ts/components/ProgressDialog.tsx @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import * as React from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import { Spinner } from './Spinner.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { Spinner } from './Spinner.dom.js'; export type PropsType = { readonly i18n: LocalizerType; diff --git a/ts/components/ProgressModal.stories.tsx b/ts/components/ProgressModal.stories.tsx index d16b30700f..0d34c6b8b2 100644 --- a/ts/components/ProgressModal.stories.tsx +++ b/ts/components/ProgressModal.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './ProgressModal.js'; -import { ProgressModal } from './ProgressModal.js'; +import type { PropsType } from './ProgressModal.dom.js'; +import { ProgressModal } from './ProgressModal.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/ProgressModal.tsx b/ts/components/ProgressModal.tsx index 74693701ec..238c7e9f41 100644 --- a/ts/components/ProgressModal.tsx +++ b/ts/components/ProgressModal.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import { createPortal } from 'react-dom'; -import { ProgressDialog } from './ProgressDialog.js'; -import type { LocalizerType } from '../types/Util.js'; +import { ProgressDialog } from './ProgressDialog.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; export type PropsType = { readonly i18n: LocalizerType; diff --git a/ts/components/QrCode.stories.tsx b/ts/components/QrCode.stories.tsx index 2921de475d..2d166f9ced 100644 --- a/ts/components/QrCode.stories.tsx +++ b/ts/components/QrCode.stories.tsx @@ -3,8 +3,8 @@ import React from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './QrCode.js'; -import { QrCode } from './QrCode.js'; +import type { PropsType } from './QrCode.dom.js'; +import { QrCode } from './QrCode.dom.js'; export default { title: 'Components/QrCode', diff --git a/ts/components/QrCode.tsx b/ts/components/QrCode.tsx index cbd0d23664..42a89ab0d0 100644 --- a/ts/components/QrCode.tsx +++ b/ts/components/QrCode.tsx @@ -4,7 +4,7 @@ import type { ReactElement } from 'react'; import React, { useMemo, useRef } from 'react'; import qrcode from 'qrcode-generator'; -import { getEnvironment, Environment } from '../environment.js'; +import { getEnvironment, Environment } from '../environment.std.js'; const AUTODETECT_TYPE_NUMBER = 0; const ERROR_CORRECTION_LEVEL = 'L'; diff --git a/ts/components/ReactionPickerPicker.tsx b/ts/components/ReactionPickerPicker.tsx index 2e1abf0a16..e63182da98 100644 --- a/ts/components/ReactionPickerPicker.tsx +++ b/ts/components/ReactionPickerPicker.tsx @@ -6,14 +6,14 @@ import React, { forwardRef } from 'react'; import classNames from 'classnames'; import { Button } from 'react-aria-components'; -import type { LocalizerType } from '../types/Util.js'; -import { FunStaticEmoji } from './fun/FunEmoji.js'; -import { strictAssert } from '../util/assert.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { FunStaticEmoji } from './fun/FunEmoji.dom.js'; +import { strictAssert } from '../util/assert.std.js'; import { getEmojiVariantByKey, getEmojiVariantKeyByValue, isEmojiVariantValue, -} from './fun/data/emojis.js'; +} from './fun/data/emojis.std.js'; export enum ReactionPickerPickerStyle { Picker, diff --git a/ts/components/RecordingComposer.tsx b/ts/components/RecordingComposer.tsx index 12e0d36a16..22c2000baa 100644 --- a/ts/components/RecordingComposer.tsx +++ b/ts/components/RecordingComposer.tsx @@ -3,8 +3,8 @@ import React from 'react'; import type { ReactNode } from 'react'; -import type { LocalizerType } from '../types/I18N.js'; -import { Button, ButtonSize, ButtonVariant } from './Button.js'; +import type { LocalizerType } from '../types/I18N.std.js'; +import { Button, ButtonSize, ButtonVariant } from './Button.dom.js'; type Props = { i18n: LocalizerType; diff --git a/ts/components/SafetyNumberChangeDialog.stories.tsx b/ts/components/SafetyNumberChangeDialog.stories.tsx index 2047c26d69..8948511379 100644 --- a/ts/components/SafetyNumberChangeDialog.stories.tsx +++ b/ts/components/SafetyNumberChangeDialog.stories.tsx @@ -4,13 +4,13 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './SafetyNumberChangeDialog.js'; -import { SafetyNumberChangeDialog } from './SafetyNumberChangeDialog.js'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; +import type { Props } from './SafetyNumberChangeDialog.dom.js'; +import { SafetyNumberChangeDialog } from './SafetyNumberChangeDialog.dom.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.std.js'; import { StorybookThemeContext } from '../../.storybook/StorybookThemeContext.js'; -import { getFakeBadge } from '../test-helpers/getFakeBadge.js'; -import { MY_STORY_ID } from '../types/Stories.js'; -import { generateStoryDistributionId } from '../types/StoryDistributionId.js'; +import { getFakeBadge } from '../test-helpers/getFakeBadge.std.js'; +import { MY_STORY_ID } from '../types/Stories.std.js'; +import { generateStoryDistributionId } from '../types/StoryDistributionId.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/SafetyNumberChangeDialog.tsx b/ts/components/SafetyNumberChangeDialog.tsx index 2a1a55576f..337f16d08d 100644 --- a/ts/components/SafetyNumberChangeDialog.tsx +++ b/ts/components/SafetyNumberChangeDialog.tsx @@ -5,25 +5,25 @@ import * as React from 'react'; import lodash from 'lodash'; import classNames from 'classnames'; -import { Avatar, AvatarSize } from './Avatar.js'; -import type { ActionSpec } from './ConfirmationDialog.js'; -import { ConfirmationDialog } from './ConfirmationDialog.js'; -import { InContactsIcon } from './InContactsIcon.js'; -import { Modal } from './Modal.js'; +import { Avatar, AvatarSize } from './Avatar.dom.js'; +import type { ActionSpec } from './ConfirmationDialog.dom.js'; +import { ConfirmationDialog } from './ConfirmationDialog.dom.js'; +import { InContactsIcon } from './InContactsIcon.dom.js'; +import { Modal } from './Modal.dom.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; -import type { LocalizerType } from '../types/Util.js'; -import { ThemeType } from '../types/Util.js'; -import { isInSystemContacts } from '../util/isInSystemContacts.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { ContextMenu } from './ContextMenu.js'; -import { Theme } from '../util/theme.js'; -import { isNotNil } from '../util/isNotNil.js'; -import { MY_STORY_ID } from '../types/Stories.js'; -import type { ServiceIdString } from '../types/ServiceId.js'; -import type { StoryDistributionIdString } from '../types/StoryDistributionId.js'; -import { UserText } from './UserText.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.preload.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { ThemeType } from '../types/Util.std.js'; +import { isInSystemContacts } from '../util/isInSystemContacts.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { ContextMenu } from './ContextMenu.dom.js'; +import { Theme } from '../util/theme.std.js'; +import { isNotNil } from '../util/isNotNil.std.js'; +import { MY_STORY_ID } from '../types/Stories.std.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; +import type { StoryDistributionIdString } from '../types/StoryDistributionId.std.js'; +import { UserText } from './UserText.dom.js'; const { noop } = lodash; diff --git a/ts/components/SafetyNumberModal.tsx b/ts/components/SafetyNumberModal.tsx index dec9a36f09..2b473fe060 100644 --- a/ts/components/SafetyNumberModal.tsx +++ b/ts/components/SafetyNumberModal.tsx @@ -3,11 +3,11 @@ import React from 'react'; -import { isSafetyNumberNotAvailable } from '../util/isSafetyNumberNotAvailable.js'; -import { Modal } from './Modal.js'; -import type { PropsType as SafetyNumberViewerPropsType } from './SafetyNumberViewer.js'; -import { SafetyNumberViewer } from './SafetyNumberViewer.js'; -import { SafetyNumberNotReady } from './SafetyNumberNotReady.js'; +import { isSafetyNumberNotAvailable } from '../util/isSafetyNumberNotAvailable.std.js'; +import { Modal } from './Modal.dom.js'; +import type { PropsType as SafetyNumberViewerPropsType } from './SafetyNumberViewer.dom.js'; +import { SafetyNumberViewer } from './SafetyNumberViewer.dom.js'; +import { SafetyNumberNotReady } from './SafetyNumberNotReady.dom.js'; type PropsType = { toggleSafetyNumberModal: () => unknown; diff --git a/ts/components/SafetyNumberNotReady.stories.tsx b/ts/components/SafetyNumberNotReady.stories.tsx index f234c1a08e..e785c81dc4 100644 --- a/ts/components/SafetyNumberNotReady.stories.tsx +++ b/ts/components/SafetyNumberNotReady.stories.tsx @@ -4,8 +4,8 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './SafetyNumberNotReady.js'; -import { SafetyNumberNotReady } from './SafetyNumberNotReady.js'; +import type { PropsType } from './SafetyNumberNotReady.dom.js'; +import { SafetyNumberNotReady } from './SafetyNumberNotReady.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/SafetyNumberNotReady.tsx b/ts/components/SafetyNumberNotReady.tsx index 65d1a2fdd5..e539387122 100644 --- a/ts/components/SafetyNumberNotReady.tsx +++ b/ts/components/SafetyNumberNotReady.tsx @@ -3,12 +3,12 @@ import React from 'react'; -import { Button, ButtonVariant } from './Button.js'; -import { Modal } from './Modal.js'; -import { I18n } from './I18n.js'; -import { openLinkInWebBrowser } from '../util/openLinkInWebBrowser.js'; -import type { LocalizerType } from '../types/Util.js'; -import { SAFETY_NUMBER_URL } from '../types/support.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import { Modal } from './Modal.dom.js'; +import { I18n } from './I18n.dom.js'; +import { openLinkInWebBrowser } from '../util/openLinkInWebBrowser.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { SAFETY_NUMBER_URL } from '../types/support.std.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/SafetyNumberViewer.stories.tsx b/ts/components/SafetyNumberViewer.stories.tsx index 51afddf16d..2fdff3bf8d 100644 --- a/ts/components/SafetyNumberViewer.stories.tsx +++ b/ts/components/SafetyNumberViewer.stories.tsx @@ -4,9 +4,9 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './SafetyNumberViewer.js'; -import { SafetyNumberViewer } from './SafetyNumberViewer.js'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; +import type { PropsType } from './SafetyNumberViewer.dom.js'; +import { SafetyNumberViewer } from './SafetyNumberViewer.dom.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.std.js'; function generateQRData() { const data = new Uint8Array(128); diff --git a/ts/components/SafetyNumberViewer.tsx b/ts/components/SafetyNumberViewer.tsx index 8815017ec3..251e454c4e 100644 --- a/ts/components/SafetyNumberViewer.tsx +++ b/ts/components/SafetyNumberViewer.tsx @@ -3,14 +3,14 @@ import React from 'react'; -import { Button, ButtonVariant } from './Button.js'; -import { QrCode } from './QrCode.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import { I18n } from './I18n.js'; -import { Emojify } from './conversation/Emojify.js'; -import type { LocalizerType } from '../types/Util.js'; -import type { SafetyNumberType } from '../types/safetyNumber.js'; -import { SAFETY_NUMBER_URL } from '../types/support.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import { QrCode } from './QrCode.dom.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import { I18n } from './I18n.dom.js'; +import { Emojify } from './conversation/Emojify.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import type { SafetyNumberType } from '../types/safetyNumber.std.js'; +import { SAFETY_NUMBER_URL } from '../types/support.std.js'; export type PropsType = { contact: ConversationType; diff --git a/ts/components/SafetyTipsModal.stories.tsx b/ts/components/SafetyTipsModal.stories.tsx index 75bf086d7c..a054136771 100644 --- a/ts/components/SafetyTipsModal.stories.tsx +++ b/ts/components/SafetyTipsModal.stories.tsx @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { ComponentMeta } from '../storybook/types.js'; -import type { SafetyTipsModalProps } from './SafetyTipsModal.js'; -import { SafetyTipsModal } from './SafetyTipsModal.js'; +import type { ComponentMeta } from '../storybook/types.std.js'; +import type { SafetyTipsModalProps } from './SafetyTipsModal.dom.js'; +import { SafetyTipsModal } from './SafetyTipsModal.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/SafetyTipsModal.tsx b/ts/components/SafetyTipsModal.tsx index 08720087ec..eb0cbf8b92 100644 --- a/ts/components/SafetyTipsModal.tsx +++ b/ts/components/SafetyTipsModal.tsx @@ -3,10 +3,10 @@ import type { UIEvent } from 'react'; import React, { useEffect, useMemo, useRef, useState } from 'react'; import { v4 as uuid } from 'uuid'; -import type { LocalizerType } from '../types/I18N.js'; -import { Modal } from './Modal.js'; -import { Button, ButtonVariant } from './Button.js'; -import { useReducedMotion } from '../hooks/useReducedMotion.js'; +import type { LocalizerType } from '../types/I18N.std.js'; +import { Modal } from './Modal.dom.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import { useReducedMotion } from '../hooks/useReducedMotion.dom.js'; export type SafetyTipsModalProps = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/SampleMessageBubbles.tsx b/ts/components/SampleMessageBubbles.tsx index 571a4b3321..d61a9fb212 100644 --- a/ts/components/SampleMessageBubbles.tsx +++ b/ts/components/SampleMessageBubbles.tsx @@ -3,9 +3,9 @@ import type { CSSProperties } from 'react'; import React from 'react'; -import type { ConversationColorType } from '../types/Colors.js'; -import type { LocalizerType } from '../types/Util.js'; -import { formatTime } from '../util/timestamp.js'; +import type { ConversationColorType } from '../types/Colors.std.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { formatTime } from '../util/formatTimestamp.dom.js'; export type PropsType = { backgroundStyle?: CSSProperties; diff --git a/ts/components/SearchInput.tsx b/ts/components/SearchInput.tsx index 58a0313137..354d98bb7c 100644 --- a/ts/components/SearchInput.tsx +++ b/ts/components/SearchInput.tsx @@ -9,8 +9,8 @@ import type { } from 'react'; import React, { forwardRef } from 'react'; import classNames from 'classnames'; -import type { LocalizerType } from '../types/Util.js'; -import { getClassNamesFor } from '../util/getClassNamesFor.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { getClassNamesFor } from '../util/getClassNamesFor.std.js'; export type PropTypes = Readonly<{ children?: ReactNode; diff --git a/ts/components/Select.stories.tsx b/ts/components/Select.stories.tsx index c9faaa4c44..004bfd6442 100644 --- a/ts/components/Select.stories.tsx +++ b/ts/components/Select.stories.tsx @@ -4,8 +4,8 @@ import React, { useState } from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './Select.js'; -import { Select } from './Select.js'; +import type { PropsType } from './Select.dom.js'; +import { Select } from './Select.dom.js'; export default { title: 'Components/Select', diff --git a/ts/components/SendStoryModal.stories.tsx b/ts/components/SendStoryModal.stories.tsx index 0998ab214a..934ee4eb0f 100644 --- a/ts/components/SendStoryModal.stories.tsx +++ b/ts/components/SendStoryModal.stories.tsx @@ -5,18 +5,18 @@ import type { Meta } from '@storybook/react'; import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './SendStoryModal.js'; -import { SendStoryModal } from './SendStoryModal.js'; +import type { PropsType } from './SendStoryModal.dom.js'; +import { SendStoryModal } from './SendStoryModal.dom.js'; import { getDefaultConversation, getDefaultGroup, -} from '../test-helpers/getDefaultConversation.js'; +} from '../test-helpers/getDefaultConversation.std.js'; import { getMyStories, getFakeDistributionListsWithMembers, -} from '../test-helpers/getFakeDistributionLists.js'; -import { VIDEO_MP4 } from '../types/MIME.js'; -import type { StoryDistributionIdString } from '../types/StoryDistributionId.js'; +} from '../test-helpers/getFakeDistributionLists.std.js'; +import { VIDEO_MP4 } from '../types/MIME.std.js'; +import type { StoryDistributionIdString } from '../types/StoryDistributionId.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/SendStoryModal.tsx b/ts/components/SendStoryModal.tsx index 5b4b594331..3db8c8794d 100644 --- a/ts/components/SendStoryModal.tsx +++ b/ts/components/SendStoryModal.tsx @@ -4,15 +4,15 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react'; import lodash from 'lodash'; -import { SearchInput } from './SearchInput.js'; -import { filterAndSortConversations } from '../util/filterAndSortConversations.js'; +import { SearchInput } from './SearchInput.dom.js'; +import { filterAndSortConversations } from '../util/filterAndSortConversations.std.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import type { ConversationWithStoriesType } from '../state/selectors/conversations.js'; -import type { LocalizerType } from '../types/Util.js'; -import { ThemeType } from '../types/Util.js'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; -import type { PropsType as StoriesSettingsModalPropsType } from './StoriesSettingsModal.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import type { ConversationWithStoriesType } from '../state/selectors/conversations.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { ThemeType } from '../types/Util.std.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.preload.js'; +import type { PropsType as StoriesSettingsModalPropsType } from './StoriesSettingsModal.dom.js'; import { getI18nForMyStory, getListViewers, @@ -20,29 +20,35 @@ import { EditDistributionListModal, EditMyStoryPrivacy, Page as StoriesSettingsPage, -} from './StoriesSettingsModal.js'; -import type { StoryDistributionListWithMembersDataType } from '../types/Stories.js'; -import type { StoryDistributionIdString } from '../types/StoryDistributionId.js'; -import type { ServiceIdString } from '../types/ServiceId.js'; -import { Alert } from './Alert.js'; -import { Avatar, AvatarSize } from './Avatar.js'; -import { Button, ButtonSize, ButtonVariant } from './Button.js'; -import { Checkbox } from './Checkbox.js'; -import { ConfirmationDialog } from './ConfirmationDialog.js'; -import { ContextMenu } from './ContextMenu.js'; +} from './StoriesSettingsModal.dom.js'; +import type { StoryDistributionListWithMembersDataType } from '../types/Stories.std.js'; +import type { StoryDistributionIdString } from '../types/StoryDistributionId.std.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; +import { Alert } from './Alert.dom.js'; +import { Avatar, AvatarSize } from './Avatar.dom.js'; +import { Button, ButtonSize, ButtonVariant } from './Button.dom.js'; +import { Checkbox } from './Checkbox.dom.js'; +import { ConfirmationDialog } from './ConfirmationDialog.dom.js'; +import { ContextMenu } from './ContextMenu.dom.js'; -import { MY_STORY_ID, getStoryDistributionListName } from '../types/Stories.js'; -import type { RenderModalPage, ModalPropsType } from './Modal.js'; -import { PagedModal, ModalPage } from './Modal.js'; -import { StoryDistributionListName } from './StoryDistributionListName.js'; -import { isNotNil } from '../util/isNotNil.js'; -import { StoryImage } from './StoryImage.js'; -import type { AttachmentType } from '../types/Attachment.js'; -import { useConfirmDiscard } from '../hooks/useConfirmDiscard.js'; -import { getStoryBackground } from '../util/getStoryBackground.js'; -import { makeObjectUrl, revokeObjectUrl } from '../types/VisualAttachment.js'; -import { UserText } from './UserText.js'; -import { Theme } from '../util/theme.js'; +import { + MY_STORY_ID, + getStoryDistributionListName, +} from '../types/Stories.std.js'; +import type { RenderModalPage, ModalPropsType } from './Modal.dom.js'; +import { PagedModal, ModalPage } from './Modal.dom.js'; +import { StoryDistributionListName } from './StoryDistributionListName.dom.js'; +import { isNotNil } from '../util/isNotNil.std.js'; +import { StoryImage } from './StoryImage.dom.js'; +import type { AttachmentType } from '../types/Attachment.std.js'; +import { useConfirmDiscard } from '../hooks/useConfirmDiscard.dom.js'; +import { getStoryBackground } from '../util/getStoryBackground.std.js'; +import { + makeObjectUrl, + revokeObjectUrl, +} from '../types/VisualAttachment.dom.js'; +import { UserText } from './UserText.dom.js'; +import { Theme } from '../util/theme.std.js'; const { noop, sortBy } = lodash; diff --git a/ts/components/ServerAlerts.tsx b/ts/components/ServerAlerts.tsx index 5d9c5f635c..345803c7ec 100644 --- a/ts/components/ServerAlerts.tsx +++ b/ts/components/ServerAlerts.tsx @@ -2,12 +2,15 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import { ServerAlert, type ServerAlertsType } from '../types/ServerAlert.js'; -import type { WidthBreakpoint } from './_util.js'; -import type { LocalizerType } from '../types/I18N.js'; -import { CriticalIdlePrimaryDeviceDialog } from './CriticalIdlePrimaryDeviceDialog.js'; -import { strictAssert } from '../util/assert.js'; -import { WarningIdlePrimaryDeviceDialog } from './WarningIdlePrimaryDeviceDialog.js'; +import { + ServerAlert, + type ServerAlertsType, +} from '../types/ServerAlert.std.js'; +import type { WidthBreakpoint } from './_util.std.js'; +import type { LocalizerType } from '../types/I18N.std.js'; +import { CriticalIdlePrimaryDeviceDialog } from './CriticalIdlePrimaryDeviceDialog.dom.js'; +import { strictAssert } from '../util/assert.std.js'; +import { WarningIdlePrimaryDeviceDialog } from './WarningIdlePrimaryDeviceDialog.dom.js'; export function getServerAlertDialog( alerts: ServerAlertsType | undefined, diff --git a/ts/components/SharedGroupNames.tsx b/ts/components/SharedGroupNames.tsx index 2c2fc87ca4..099f9a9331 100644 --- a/ts/components/SharedGroupNames.tsx +++ b/ts/components/SharedGroupNames.tsx @@ -4,9 +4,9 @@ import React from 'react'; import lodash from 'lodash'; -import { I18n } from './I18n.js'; -import type { LocalizerType } from '../types/Util.js'; -import { UserText } from './UserText.js'; +import { I18n } from './I18n.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { UserText } from './UserText.dom.js'; const { take } = lodash; diff --git a/ts/components/ShortcutGuide.stories.tsx b/ts/components/ShortcutGuide.stories.tsx index 27c7dd161b..b6c3a68fd8 100644 --- a/ts/components/ShortcutGuide.stories.tsx +++ b/ts/components/ShortcutGuide.stories.tsx @@ -4,8 +4,8 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './ShortcutGuide.js'; -import { ShortcutGuide } from './ShortcutGuide.js'; +import type { Props } from './ShortcutGuide.dom.js'; +import { ShortcutGuide } from './ShortcutGuide.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/ShortcutGuide.tsx b/ts/components/ShortcutGuide.tsx index 3c5d79c4fe..3a1f674f61 100644 --- a/ts/components/ShortcutGuide.tsx +++ b/ts/components/ShortcutGuide.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import classNames from 'classnames'; -import { useRestoreFocus } from '../hooks/useRestoreFocus.js'; -import type { LocalizerType } from '../types/Util.js'; +import { useRestoreFocus } from '../hooks/useRestoreFocus.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; export type Props = { platform: string; diff --git a/ts/components/ShortcutGuideModal.tsx b/ts/components/ShortcutGuideModal.tsx index 71720cdcdd..9ca3e6ff6f 100644 --- a/ts/components/ShortcutGuideModal.tsx +++ b/ts/components/ShortcutGuideModal.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import { createPortal } from 'react-dom'; -import type { LocalizerType } from '../types/Util.js'; -import { ShortcutGuide } from './ShortcutGuide.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { ShortcutGuide } from './ShortcutGuide.dom.js'; export type PropsType = { platform: string; diff --git a/ts/components/SignalConnectionsModal.stories.tsx b/ts/components/SignalConnectionsModal.stories.tsx index 0da94fd5f3..0d2e52b8c6 100644 --- a/ts/components/SignalConnectionsModal.stories.tsx +++ b/ts/components/SignalConnectionsModal.stories.tsx @@ -5,8 +5,8 @@ import type { Meta, StoryFn } from '@storybook/react'; import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './SignalConnectionsModal.js'; -import { SignalConnectionsModal } from './SignalConnectionsModal.js'; +import type { PropsType } from './SignalConnectionsModal.dom.js'; +import { SignalConnectionsModal } from './SignalConnectionsModal.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/SignalConnectionsModal.tsx b/ts/components/SignalConnectionsModal.tsx index 3e0db55c36..a19fec173f 100644 --- a/ts/components/SignalConnectionsModal.tsx +++ b/ts/components/SignalConnectionsModal.tsx @@ -3,9 +3,9 @@ import React from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import { I18n } from './I18n.js'; -import { Modal } from './Modal.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { I18n } from './I18n.dom.js'; +import { Modal } from './Modal.dom.js'; export type PropsType = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/Slider.stories.tsx b/ts/components/Slider.stories.tsx index dbb559a180..7799dcf102 100644 --- a/ts/components/Slider.stories.tsx +++ b/ts/components/Slider.stories.tsx @@ -6,8 +6,8 @@ import React, { useState } from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './Slider.js'; -import { Slider } from './Slider.js'; +import type { PropsType } from './Slider.dom.js'; +import { Slider } from './Slider.dom.js'; export default { title: 'Components/Slider', diff --git a/ts/components/Slider.tsx b/ts/components/Slider.tsx index 5674bf2d1a..4607970bd3 100644 --- a/ts/components/Slider.tsx +++ b/ts/components/Slider.tsx @@ -3,8 +3,8 @@ import type { CSSProperties, KeyboardEvent } from 'react'; import React, { useRef } from 'react'; -import { getClassNamesFor } from '../util/getClassNamesFor.js'; -import { arrow } from '../util/keyboard.js'; +import { getClassNamesFor } from '../util/getClassNamesFor.std.js'; +import { arrow } from '../util/keyboard.dom.js'; export type PropsType = { containerStyle?: CSSProperties; diff --git a/ts/components/Spinner.stories.tsx b/ts/components/Spinner.stories.tsx index bd9fd0c76a..04cd61d3dd 100644 --- a/ts/components/Spinner.stories.tsx +++ b/ts/components/Spinner.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './Spinner.js'; -import { Spinner, SpinnerDirections, SpinnerSvgSizes } from './Spinner.js'; +import type { Props } from './Spinner.dom.js'; +import { Spinner, SpinnerDirections, SpinnerSvgSizes } from './Spinner.dom.js'; export default { title: 'Components/Spinner', diff --git a/ts/components/Spinner.tsx b/ts/components/Spinner.tsx index f5f29819bd..5d90e75352 100644 --- a/ts/components/Spinner.tsx +++ b/ts/components/Spinner.tsx @@ -4,7 +4,7 @@ import React from 'react'; import classNames from 'classnames'; -import { getClassNamesFor } from '../util/getClassNamesFor.js'; +import { getClassNamesFor } from '../util/getClassNamesFor.std.js'; export const SpinnerSvgSizes = ['small', 'normal'] as const; export type SpinnerSvgSize = (typeof SpinnerSvgSizes)[number]; diff --git a/ts/components/SpinnerV2.stories.tsx b/ts/components/SpinnerV2.stories.tsx index 3feec9a196..9a621e1f12 100644 --- a/ts/components/SpinnerV2.stories.tsx +++ b/ts/components/SpinnerV2.stories.tsx @@ -3,11 +3,11 @@ import React, { useEffect, useState } from 'react'; -import { SpinnerV2 } from './SpinnerV2.js'; -import { tw } from '../axo/tw.js'; +import { SpinnerV2 } from './SpinnerV2.dom.js'; +import { tw } from '../axo/tw.dom.js'; -import type { ComponentMeta } from '../storybook/types.js'; -import type { Props } from './SpinnerV2.js'; +import type { ComponentMeta } from '../storybook/types.std.js'; +import type { Props } from './SpinnerV2.dom.js'; export default { title: 'Components/SpinnerV2', diff --git a/ts/components/SpinnerV2.tsx b/ts/components/SpinnerV2.tsx index d46ed6b24b..225ca3f05c 100644 --- a/ts/components/SpinnerV2.tsx +++ b/ts/components/SpinnerV2.tsx @@ -3,8 +3,8 @@ import React from 'react'; -import { tw, type TailwindStyles } from '../axo/tw.js'; -import { roundFractionForProgressBar } from '../util/numbers.js'; +import { tw, type TailwindStyles } from '../axo/tw.dom.js'; +import { roundFractionForProgressBar } from '../util/numbers.std.js'; export type Props = { value?: number | 'indeterminate'; // default: 'indeterminate' diff --git a/ts/components/StandaloneRegistration.stories.tsx b/ts/components/StandaloneRegistration.stories.tsx index 9beef4a78a..b2bc88fcba 100644 --- a/ts/components/StandaloneRegistration.stories.tsx +++ b/ts/components/StandaloneRegistration.stories.tsx @@ -5,10 +5,10 @@ import React from 'react'; import type { Meta, StoryFn } from '@storybook/react'; import { fn } from '@storybook/test'; -import { StandaloneRegistration } from './StandaloneRegistration.js'; -import type { PropsType } from './StandaloneRegistration.js'; -import { SECOND } from '../util/durations/index.js'; -import { sleep } from '../util/sleep.js'; +import { StandaloneRegistration } from './StandaloneRegistration.dom.js'; +import type { PropsType } from './StandaloneRegistration.dom.js'; +import { SECOND } from '../util/durations/index.std.js'; +import { sleep } from '../util/sleep.std.js'; export default { title: 'Components/StandaloneRegistration', diff --git a/ts/components/StandaloneRegistration.tsx b/ts/components/StandaloneRegistration.tsx index 35fd482f9d..4f94073719 100644 --- a/ts/components/StandaloneRegistration.tsx +++ b/ts/components/StandaloneRegistration.tsx @@ -6,10 +6,10 @@ import React, { useState, useEffect, useCallback, useRef } from 'react'; import type { Iti } from 'intl-tel-input'; import intlTelInput from 'intl-tel-input'; -import { strictAssert } from '../util/assert.js'; -import { parseNumber } from '../util/libphonenumberUtil.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { VerificationTransport } from '../types/VerificationTransport.js'; +import { strictAssert } from '../util/assert.std.js'; +import { parseNumber } from '../util/libphonenumberUtil.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { VerificationTransport } from '../types/VerificationTransport.std.js'; function PhoneInput({ initialValue, diff --git a/ts/components/StoriesAddStoryButton.tsx b/ts/components/StoriesAddStoryButton.tsx index 7ebadd77db..5da8fc023c 100644 --- a/ts/components/StoriesAddStoryButton.tsx +++ b/ts/components/StoriesAddStoryButton.tsx @@ -4,15 +4,15 @@ import type { ReactNode } from 'react'; import React, { useState, useCallback } from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import type { ShowToastAction } from '../state/ducks/toast.js'; -import { ContextMenu } from './ContextMenu.js'; -import { ToastType } from '../types/Toast.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import type { ShowToastAction } from '../state/ducks/toast.preload.js'; +import { ContextMenu } from './ContextMenu.dom.js'; +import { ToastType } from '../types/Toast.dom.js'; import { isVideoGoodForStories, ReasonVideoNotGood, -} from '../util/isVideoGoodForStories.js'; -import { ConfirmationDialog } from './ConfirmationDialog.js'; +} from '../util/isVideoGoodForStories.std.js'; +import { ConfirmationDialog } from './ConfirmationDialog.dom.js'; export type PropsType = { children?: ReactNode; diff --git a/ts/components/StoriesPane.tsx b/ts/components/StoriesPane.tsx index 8e88f557e7..14773515cd 100644 --- a/ts/components/StoriesPane.tsx +++ b/ts/components/StoriesPane.tsx @@ -8,17 +8,20 @@ import classNames from 'classnames'; import type { ConversationType, ShowConversationType, -} from '../state/ducks/conversations.js'; -import type { ConversationStoryType, MyStoryType } from '../types/Stories.js'; -import type { LocalizerType, ThemeType } from '../types/Util.js'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; -import type { ShowToastAction } from '../state/ducks/toast.js'; -import type { ViewUserStoriesActionCreatorType } from '../state/ducks/stories.js'; -import { MyStoryButton } from './MyStoryButton.js'; -import { SearchInput } from './SearchInput.js'; -import { StoryListItem } from './StoryListItem.js'; -import { isNotNil } from '../util/isNotNil.js'; -import { NavSidebarSearchHeader, NavSidebarEmpty } from './NavSidebar.js'; +} from '../state/ducks/conversations.preload.js'; +import type { + ConversationStoryType, + MyStoryType, +} from '../types/Stories.std.js'; +import type { LocalizerType, ThemeType } from '../types/Util.std.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.preload.js'; +import type { ShowToastAction } from '../state/ducks/toast.preload.js'; +import type { ViewUserStoriesActionCreatorType } from '../state/ducks/stories.preload.js'; +import { MyStoryButton } from './MyStoryButton.dom.js'; +import { SearchInput } from './SearchInput.dom.js'; +import { StoryListItem } from './StoryListItem.dom.js'; +import { isNotNil } from '../util/isNotNil.std.js'; +import { NavSidebarSearchHeader, NavSidebarEmpty } from './NavSidebar.dom.js'; const FUSE_OPTIONS: Fuse.IFuseOptions = { getFn: (story, path) => { diff --git a/ts/components/StoriesSettingsModal.stories.tsx b/ts/components/StoriesSettingsModal.stories.tsx index c86156c012..0efae1c6cf 100644 --- a/ts/components/StoriesSettingsModal.stories.tsx +++ b/ts/components/StoriesSettingsModal.stories.tsx @@ -5,16 +5,16 @@ import type { Meta, StoryFn } from '@storybook/react'; import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './StoriesSettingsModal.js'; -import { StoriesSettingsModal } from './StoriesSettingsModal.js'; +import type { PropsType } from './StoriesSettingsModal.dom.js'; +import { StoriesSettingsModal } from './StoriesSettingsModal.dom.js'; import { getDefaultConversation, getDefaultGroup, -} from '../test-helpers/getDefaultConversation.js'; +} from '../test-helpers/getDefaultConversation.std.js'; import { getMyStories, getFakeDistributionList, -} from '../test-helpers/getFakeDistributionLists.js'; +} from '../test-helpers/getFakeDistributionLists.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/StoriesSettingsModal.tsx b/ts/components/StoriesSettingsModal.tsx index 4b25466fed..50762d757d 100644 --- a/ts/components/StoriesSettingsModal.tsx +++ b/ts/components/StoriesSettingsModal.tsx @@ -11,39 +11,42 @@ import React, { } from 'react'; import lodash from 'lodash'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import type { ConversationWithStoriesType } from '../state/selectors/conversations.js'; -import type { LocalizerType, ThemeType } from '../types/Util.js'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; -import type { Row } from './ConversationList.js'; -import type { StoryDistributionListWithMembersDataType } from '../types/Stories.js'; -import type { StoryDistributionIdString } from '../types/StoryDistributionId.js'; -import type { ServiceIdString } from '../types/ServiceId.js'; -import type { RenderModalPage, ModalPropsType } from './Modal.js'; -import { Avatar, AvatarSize } from './Avatar.js'; -import { Button, ButtonVariant } from './Button.js'; -import { Checkbox } from './Checkbox.js'; -import { ConfirmationDialog } from './ConfirmationDialog.js'; -import { ContactPills } from './ContactPills.js'; -import { ContactPill } from './ContactPill.js'; -import { ConversationList, RowType } from './ConversationList.js'; -import { Input } from './Input.js'; -import { I18n } from './I18n.js'; -import { MY_STORY_ID, getStoryDistributionListName } from '../types/Stories.js'; -import { PagedModal, ModalPage } from './Modal.js'; -import { SearchInput } from './SearchInput.js'; -import { StoryDistributionListName } from './StoryDistributionListName.js'; -import { filterAndSortConversations } from '../util/filterAndSortConversations.js'; -import { isNotNil } from '../util/isNotNil.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import type { ConversationWithStoriesType } from '../state/selectors/conversations.dom.js'; +import type { LocalizerType, ThemeType } from '../types/Util.std.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.preload.js'; +import type { Row } from './ConversationList.dom.js'; +import type { StoryDistributionListWithMembersDataType } from '../types/Stories.std.js'; +import type { StoryDistributionIdString } from '../types/StoryDistributionId.std.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; +import type { RenderModalPage, ModalPropsType } from './Modal.dom.js'; +import { Avatar, AvatarSize } from './Avatar.dom.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import { Checkbox } from './Checkbox.dom.js'; +import { ConfirmationDialog } from './ConfirmationDialog.dom.js'; +import { ContactPills } from './ContactPills.dom.js'; +import { ContactPill } from './ContactPill.dom.js'; +import { ConversationList, RowType } from './ConversationList.dom.js'; +import { Input } from './Input.dom.js'; +import { I18n } from './I18n.dom.js'; +import { + MY_STORY_ID, + getStoryDistributionListName, +} from '../types/Stories.std.js'; +import { PagedModal, ModalPage } from './Modal.dom.js'; +import { SearchInput } from './SearchInput.dom.js'; +import { StoryDistributionListName } from './StoryDistributionListName.dom.js'; +import { filterAndSortConversations } from '../util/filterAndSortConversations.std.js'; +import { isNotNil } from '../util/isNotNil.std.js'; import { shouldNeverBeCalled, asyncShouldNeverBeCalled, -} from '../util/shouldNeverBeCalled.js'; -import { useConfirmDiscard } from '../hooks/useConfirmDiscard.js'; -import { getGroupMemberships } from '../util/getGroupMemberships.js'; -import { strictAssert } from '../util/assert.js'; -import { UserText } from './UserText.js'; -import { SizeObserver } from '../hooks/useSizeObserver.js'; +} from '../util/shouldNeverBeCalled.std.js'; +import { useConfirmDiscard } from '../hooks/useConfirmDiscard.dom.js'; +import { getGroupMemberships } from '../util/getGroupMemberships.dom.js'; +import { strictAssert } from '../util/assert.std.js'; +import { UserText } from './UserText.dom.js'; +import { SizeObserver } from '../hooks/useSizeObserver.dom.js'; const { noop } = lodash; diff --git a/ts/components/StoriesTab.stories.tsx b/ts/components/StoriesTab.stories.tsx index cfbf306572..71c94e9c2e 100644 --- a/ts/components/StoriesTab.stories.tsx +++ b/ts/components/StoriesTab.stories.tsx @@ -5,11 +5,14 @@ import type { Meta, StoryFn } from '@storybook/react'; import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './StoriesTab.js'; -import { StoriesTab } from './StoriesTab.js'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; -import { getFakeMyStory, getFakeStory } from '../test-helpers/getFakeStory.js'; -import * as durations from '../util/durations/index.js'; +import type { PropsType } from './StoriesTab.dom.js'; +import { StoriesTab } from './StoriesTab.dom.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.std.js'; +import { + getFakeMyStory, + getFakeStory, +} from '../test-helpers/getFakeStory.dom.js'; +import * as durations from '../util/durations/index.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/StoriesTab.tsx b/ts/components/StoriesTab.tsx index 3d32e30ef6..81eb23152c 100644 --- a/ts/components/StoriesTab.tsx +++ b/ts/components/StoriesTab.tsx @@ -5,28 +5,28 @@ import React, { useState } from 'react'; import type { ConversationType, ShowConversationType, -} from '../state/ducks/conversations.js'; +} from '../state/ducks/conversations.preload.js'; import type { ConversationStoryType, MyStoryType, StoryViewType, -} from '../types/Stories.js'; -import type { LocalizerType, ThemeType } from '../types/Util.js'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; -import type { ShowToastAction } from '../state/ducks/toast.js'; +} from '../types/Stories.std.js'; +import type { LocalizerType, ThemeType } from '../types/Util.std.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.preload.js'; +import type { ShowToastAction } from '../state/ducks/toast.preload.js'; import type { AddStoryData, ViewUserStoriesActionCreatorType, ViewStoryActionCreatorType, -} from '../state/ducks/stories.js'; -import { MyStories } from './MyStories.js'; -import { StoriesPane } from './StoriesPane.js'; -import { NavSidebar, NavSidebarActionButton } from './NavSidebar.js'; -import { StoriesAddStoryButton } from './StoriesAddStoryButton.js'; -import { I18n } from './I18n.js'; -import type { WidthBreakpoint } from './_util.js'; -import type { UnreadStats } from '../util/countUnreadStats.js'; -import { AxoDropdownMenu } from '../axo/AxoDropdownMenu.js'; +} from '../state/ducks/stories.preload.js'; +import { MyStories } from './MyStories.dom.js'; +import { StoriesPane } from './StoriesPane.dom.js'; +import { NavSidebar, NavSidebarActionButton } from './NavSidebar.dom.js'; +import { StoriesAddStoryButton } from './StoriesAddStoryButton.dom.js'; +import { I18n } from './I18n.dom.js'; +import type { WidthBreakpoint } from './_util.std.js'; +import type { UnreadStats } from '../util/countUnreadStats.std.js'; +import { AxoDropdownMenu } from '../axo/AxoDropdownMenu.dom.js'; export type PropsType = { addStoryData: AddStoryData; diff --git a/ts/components/StoryCreator.stories.tsx b/ts/components/StoryCreator.stories.tsx index bb86d4a5ab..7a1d8e36ca 100644 --- a/ts/components/StoryCreator.stories.tsx +++ b/ts/components/StoryCreator.stories.tsx @@ -5,15 +5,15 @@ import type { Meta, StoryFn } from '@storybook/react'; import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './StoryCreator.js'; -import { StoryCreator } from './StoryCreator.js'; -import { fakeAttachment } from '../test-helpers/fakeAttachment.js'; +import type { PropsType } from './StoryCreator.dom.js'; +import { StoryCreator } from './StoryCreator.dom.js'; +import { fakeAttachment } from '../test-helpers/fakeAttachment.std.js'; import { getDefaultConversation, getDefaultGroup, -} from '../test-helpers/getDefaultConversation.js'; -import { getFakeDistributionListsWithMembers } from '../test-helpers/getFakeDistributionLists.js'; -import { EmojiSkinTone } from './fun/data/emojis.js'; +} from '../test-helpers/getDefaultConversation.std.js'; +import { getFakeDistributionListsWithMembers } from '../test-helpers/getFakeDistributionLists.std.js'; +import { EmojiSkinTone } from './fun/data/emojis.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/StoryCreator.tsx b/ts/components/StoryCreator.tsx index d04253fdba..a9bc5efef9 100644 --- a/ts/components/StoryCreator.tsx +++ b/ts/components/StoryCreator.tsx @@ -5,23 +5,23 @@ import React, { useEffect, useState } from 'react'; import lodash from 'lodash'; import { createPortal } from 'react-dom'; -import type { AttachmentType } from '../types/Attachment.js'; -import type { LinkPreviewSourceType } from '../types/LinkPreview.js'; -import type { LinkPreviewForUIType } from '../types/message/LinkPreviews.js'; -import type { LocalizerType, ThemeType } from '../types/Util.js'; -import type { PropsType as SendStoryModalPropsType } from './SendStoryModal.js'; -import type { StoryDistributionIdString } from '../types/StoryDistributionId.js'; -import type { imageToBlurHash } from '../util/imageToBlurHash.js'; -import type { PropsType as MediaEditorPropsType } from './MediaEditor.js'; +import type { AttachmentType } from '../types/Attachment.std.js'; +import type { LinkPreviewSourceType } from '../types/LinkPreview.std.js'; +import type { LinkPreviewForUIType } from '../types/message/LinkPreviews.std.js'; +import type { LocalizerType, ThemeType } from '../types/Util.std.js'; +import type { PropsType as SendStoryModalPropsType } from './SendStoryModal.dom.js'; +import type { StoryDistributionIdString } from '../types/StoryDistributionId.std.js'; +import type { imageToBlurHash } from '../util/imageToBlurHash.dom.js'; +import type { PropsType as MediaEditorPropsType } from './MediaEditor.dom.js'; -import { TEXT_ATTACHMENT } from '../types/MIME.js'; -import { isVideoAttachment } from '../util/Attachment.js'; -import { SendStoryModal } from './SendStoryModal.js'; +import { TEXT_ATTACHMENT } from '../types/MIME.std.js'; +import { isVideoAttachment } from '../util/Attachment.std.js'; +import { SendStoryModal } from './SendStoryModal.dom.js'; -import { MediaEditor } from './MediaEditor.js'; -import { TextStoryCreator } from './TextStoryCreator.js'; -import type { DraftBodyRanges } from '../types/BodyRange.js'; -import type { processAttachment } from '../util/processAttachment.js'; +import { MediaEditor } from './MediaEditor.dom.js'; +import { TextStoryCreator } from './TextStoryCreator.dom.js'; +import type { DraftBodyRanges } from '../types/BodyRange.std.js'; +import type { processAttachment } from '../util/processAttachment.preload.js'; const { get, has } = lodash; diff --git a/ts/components/StoryDetailsModal.stories.tsx b/ts/components/StoryDetailsModal.stories.tsx index c08a6bc726..4caefbf25a 100644 --- a/ts/components/StoryDetailsModal.stories.tsx +++ b/ts/components/StoryDetailsModal.stories.tsx @@ -6,10 +6,10 @@ import React from 'react'; import casual from 'casual'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './StoryDetailsModal.js'; -import { SendStatus } from '../messages/MessageSendState.js'; -import { StoryDetailsModal } from './StoryDetailsModal.js'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; +import type { PropsType } from './StoryDetailsModal.dom.js'; +import { SendStatus } from '../messages/MessageSendState.std.js'; +import { StoryDetailsModal } from './StoryDetailsModal.dom.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/StoryDetailsModal.tsx b/ts/components/StoryDetailsModal.tsx index 1b1f85443f..1a9b6507e1 100644 --- a/ts/components/StoryDetailsModal.tsx +++ b/ts/components/StoryDetailsModal.tsx @@ -2,25 +2,28 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; -import type { StorySendStateType, StoryViewType } from '../types/Stories.js'; -import { Avatar, AvatarSize } from './Avatar.js'; -import { ContactName } from './conversation/ContactName.js'; -import { ContextMenu } from './ContextMenu.js'; -import { I18n } from './I18n.js'; -import { Modal } from './Modal.js'; -import { SendStatus } from '../messages/MessageSendState.js'; -import { Theme } from '../util/theme.js'; -import { formatDateTimeLong } from '../util/timestamp.js'; -import { DurationInSeconds } from '../util/durations/index.js'; -import type { SaveAttachmentActionCreatorType } from '../state/ducks/conversations.js'; -import type { AttachmentType } from '../types/Attachment.js'; -import { ThemeType } from '../types/Util.js'; -import { Time } from './Time.js'; -import { groupBy } from '../util/mapUtil.js'; -import { format as formatRelativeTime } from '../util/expirationTimer.js'; -import { formatFileSize } from '../util/formatFileSize.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.preload.js'; +import type { + StorySendStateType, + StoryViewType, +} from '../types/Stories.std.js'; +import { Avatar, AvatarSize } from './Avatar.dom.js'; +import { ContactName } from './conversation/ContactName.dom.js'; +import { ContextMenu } from './ContextMenu.dom.js'; +import { I18n } from './I18n.dom.js'; +import { Modal } from './Modal.dom.js'; +import { SendStatus } from '../messages/MessageSendState.std.js'; +import { Theme } from '../util/theme.std.js'; +import { formatDateTimeLong } from '../util/formatTimestamp.dom.js'; +import { DurationInSeconds } from '../util/durations/index.std.js'; +import type { SaveAttachmentActionCreatorType } from '../state/ducks/conversations.preload.js'; +import type { AttachmentType } from '../types/Attachment.std.js'; +import { ThemeType } from '../types/Util.std.js'; +import { Time } from './Time.dom.js'; +import { groupBy } from '../util/mapUtil.std.js'; +import { format as formatRelativeTime } from '../util/expirationTimer.std.js'; +import { formatFileSize } from '../util/formatFileSize.std.js'; export type PropsType = { getPreferredBadge: PreferredBadgeSelectorType; diff --git a/ts/components/StoryDistributionListName.tsx b/ts/components/StoryDistributionListName.tsx index 3a52c1d944..f4a79b6f31 100644 --- a/ts/components/StoryDistributionListName.tsx +++ b/ts/components/StoryDistributionListName.tsx @@ -3,10 +3,10 @@ import React from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import { getStoryDistributionListName } from '../types/Stories.js'; -import type { StoryDistributionIdString } from '../types/StoryDistributionId.js'; -import { UserText } from './UserText.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { getStoryDistributionListName } from '../types/Stories.std.js'; +import type { StoryDistributionIdString } from '../types/StoryDistributionId.std.js'; +import { UserText } from './UserText.dom.js'; type PropsType = { i18n: LocalizerType; diff --git a/ts/components/StoryImage.stories.tsx b/ts/components/StoryImage.stories.tsx index a5eee3a0c0..8f6b482dcd 100644 --- a/ts/components/StoryImage.stories.tsx +++ b/ts/components/StoryImage.stories.tsx @@ -7,13 +7,13 @@ import { action } from '@storybook/addon-actions'; import lodash from 'lodash'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './StoryImage.js'; -import { StoryImage } from './StoryImage.js'; +import type { PropsType } from './StoryImage.dom.js'; +import { StoryImage } from './StoryImage.dom.js'; import { fakeAttachment, fakeThumbnail, -} from '../test-helpers/fakeAttachment.js'; -import { VIDEO_MP4 } from '../types/MIME.js'; +} from '../test-helpers/fakeAttachment.std.js'; +import { VIDEO_MP4 } from '../types/MIME.std.js'; const { noop } = lodash; diff --git a/ts/components/StoryImage.tsx b/ts/components/StoryImage.tsx index 587f4bcbe6..e183cf918a 100644 --- a/ts/components/StoryImage.tsx +++ b/ts/components/StoryImage.tsx @@ -6,11 +6,11 @@ import React, { useEffect, useRef, useState } from 'react'; import classNames from 'classnames'; import { Blurhash } from 'react-blurhash'; -import type { AttachmentType } from '../types/Attachment.js'; -import type { LocalizerType } from '../types/Util.js'; -import { Spinner } from './Spinner.js'; -import { TextAttachment } from './TextAttachment.js'; -import { ThemeType } from '../types/Util.js'; +import type { AttachmentType } from '../types/Attachment.std.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { Spinner } from './Spinner.dom.js'; +import { TextAttachment } from './TextAttachment.dom.js'; +import { ThemeType } from '../types/Util.std.js'; import { defaultBlurHash, hasFailed, @@ -18,12 +18,12 @@ import { isDownloaded, isDownloading, isGIF, -} from '../util/Attachment.js'; -import { getClassNamesFor } from '../util/getClassNamesFor.js'; -import { isVideoTypeSupported } from '../util/GoogleChrome.js'; -import { createLogger } from '../logging/log.js'; -import * as Errors from '../types/errors.js'; -import { isAbortError } from '../util/isAbortError.js'; +} from '../util/Attachment.std.js'; +import { getClassNamesFor } from '../util/getClassNamesFor.std.js'; +import { isVideoTypeSupported } from '../util/GoogleChrome.std.js'; +import { createLogger } from '../logging/log.std.js'; +import * as Errors from '../types/errors.std.js'; +import { isAbortError } from '../util/isAbortError.std.js'; const log = createLogger('StoryImage'); diff --git a/ts/components/StoryLinkPreview.stories.tsx b/ts/components/StoryLinkPreview.stories.tsx index eecc44fef1..45e7020c54 100644 --- a/ts/components/StoryLinkPreview.stories.tsx +++ b/ts/components/StoryLinkPreview.stories.tsx @@ -4,10 +4,10 @@ import type { Meta, StoryFn } from '@storybook/react'; import React from 'react'; -import type { Props } from './StoryLinkPreview.js'; -import { StoryLinkPreview } from './StoryLinkPreview.js'; -import { fakeAttachment } from '../test-helpers/fakeAttachment.js'; -import { IMAGE_JPEG } from '../types/MIME.js'; +import type { Props } from './StoryLinkPreview.dom.js'; +import { StoryLinkPreview } from './StoryLinkPreview.dom.js'; +import { fakeAttachment } from '../test-helpers/fakeAttachment.std.js'; +import { IMAGE_JPEG } from '../types/MIME.std.js'; const LONG_TITLE = "This is a super-sweet site. And it's got some really amazing content in store for you if you just click that link. Can you click that link for me?"; diff --git a/ts/components/StoryLinkPreview.tsx b/ts/components/StoryLinkPreview.tsx index aab628de29..93cd7b4db9 100644 --- a/ts/components/StoryLinkPreview.tsx +++ b/ts/components/StoryLinkPreview.tsx @@ -5,11 +5,11 @@ import React from 'react'; import classNames from 'classnames'; import lodash from 'lodash'; -import type { LinkPreviewForUIType } from '../types/message/LinkPreviews.js'; -import type { LocalizerType } from '../types/Util.js'; -import { CurveType, Image } from './conversation/Image.js'; -import { isImageAttachment } from '../util/Attachment.js'; -import { getSafeDomain } from '../types/LinkPreview.js'; +import type { LinkPreviewForUIType } from '../types/message/LinkPreviews.std.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { CurveType, Image } from './conversation/Image.dom.js'; +import { isImageAttachment } from '../util/Attachment.std.js'; +import { getSafeDomain } from '../types/LinkPreview.std.js'; const { unescape } = lodash; diff --git a/ts/components/StoryListItem.stories.tsx b/ts/components/StoryListItem.stories.tsx index 33b7462a21..8f5dedeb9d 100644 --- a/ts/components/StoryListItem.stories.tsx +++ b/ts/components/StoryListItem.stories.tsx @@ -5,13 +5,13 @@ import type { Meta, StoryFn } from '@storybook/react'; import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './StoryListItem.js'; -import { StoryListItem } from './StoryListItem.js'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; +import type { PropsType } from './StoryListItem.dom.js'; +import { StoryListItem } from './StoryListItem.dom.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.std.js'; import { fakeAttachment, fakeThumbnail, -} from '../test-helpers/fakeAttachment.js'; +} from '../test-helpers/fakeAttachment.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/StoryListItem.tsx b/ts/components/StoryListItem.tsx index c4411477e1..53de7ee886 100644 --- a/ts/components/StoryListItem.tsx +++ b/ts/components/StoryListItem.tsx @@ -3,20 +3,23 @@ import React, { useState } from 'react'; import classNames from 'classnames'; -import type { ConversationStoryType, StoryViewType } from '../types/Stories.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import type { LocalizerType, ThemeType } from '../types/Util.js'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; -import type { ViewUserStoriesActionCreatorType } from '../state/ducks/stories.js'; -import { Avatar, AvatarSize } from './Avatar.js'; -import { ConfirmationDialog } from './ConfirmationDialog.js'; -import { ContextMenu } from './ContextMenu.js'; -import { SIGNAL_ACI } from '../types/SignalConversation.js'; -import { StoryViewTargetType, HasStories } from '../types/Stories.js'; +import type { + ConversationStoryType, + StoryViewType, +} from '../types/Stories.std.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import type { LocalizerType, ThemeType } from '../types/Util.std.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.preload.js'; +import type { ViewUserStoriesActionCreatorType } from '../state/ducks/stories.preload.js'; +import { Avatar, AvatarSize } from './Avatar.dom.js'; +import { ConfirmationDialog } from './ConfirmationDialog.dom.js'; +import { ContextMenu } from './ContextMenu.dom.js'; +import { SIGNAL_ACI } from '../types/SignalConversation.std.js'; +import { StoryViewTargetType, HasStories } from '../types/Stories.std.js'; -import { MessageTimestamp } from './conversation/MessageTimestamp.js'; -import { StoryImage } from './StoryImage.js'; -import { getAvatarColor } from '../types/Colors.js'; +import { MessageTimestamp } from './conversation/MessageTimestamp.dom.js'; +import { StoryImage } from './StoryImage.dom.js'; +import { getAvatarColor } from '../types/Colors.std.js'; export type PropsType = Pick & { conversationId: string; diff --git a/ts/components/StoryViewer.stories.tsx b/ts/components/StoryViewer.stories.tsx index 17eaf147b1..59c3700644 100644 --- a/ts/components/StoryViewer.stories.tsx +++ b/ts/components/StoryViewer.stories.tsx @@ -4,17 +4,17 @@ import type { Meta } from '@storybook/react'; import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './StoryViewer.js'; -import { SendStatus } from '../messages/MessageSendState.js'; -import { StoryViewModeType } from '../types/Stories.js'; -import { generateStoryDistributionId } from '../types/StoryDistributionId.js'; -import { StoryViewer } from './StoryViewer.js'; -import { VIDEO_MP4 } from '../types/MIME.js'; -import { fakeAttachment } from '../test-helpers/fakeAttachment.js'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; -import { getFakeStoryView } from '../test-helpers/getFakeStory.js'; -import { DEFAULT_PREFERRED_REACTION_EMOJI } from '../reactions/constants.js'; -import { EmojiSkinTone } from './fun/data/emojis.js'; +import type { PropsType } from './StoryViewer.dom.js'; +import { SendStatus } from '../messages/MessageSendState.std.js'; +import { StoryViewModeType } from '../types/Stories.std.js'; +import { generateStoryDistributionId } from '../types/StoryDistributionId.std.js'; +import { StoryViewer } from './StoryViewer.dom.js'; +import { VIDEO_MP4 } from '../types/MIME.std.js'; +import { fakeAttachment } from '../test-helpers/fakeAttachment.std.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.std.js'; +import { getFakeStoryView } from '../test-helpers/getFakeStory.dom.js'; +import { DEFAULT_PREFERRED_REACTION_EMOJI } from '../reactions/constants.std.js'; +import { EmojiSkinTone } from './fun/data/emojis.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/StoryViewer.tsx b/ts/components/StoryViewer.tsx index d9aee5ceac..7b4204dfda 100644 --- a/ts/components/StoryViewer.tsx +++ b/ts/components/StoryViewer.tsx @@ -5,54 +5,54 @@ import { FocusScope } from 'react-aria'; import type { UIEvent } from 'react'; import React, { useCallback, useEffect, useMemo, useState } from 'react'; import classNames from 'classnames'; -import type { DraftBodyRanges } from '../types/BodyRange.js'; -import type { LocalizerType } from '../types/Util.js'; -import type { ContextMenuOptionType } from './ContextMenu.js'; +import type { DraftBodyRanges } from '../types/BodyRange.std.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import type { ContextMenuOptionType } from './ContextMenu.dom.js'; import type { ConversationType, SaveAttachmentActionCreatorType, -} from '../state/ducks/conversations.js'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; -import type { ReplyStateType, StoryViewType } from '../types/Stories.js'; -import type { StoryDistributionIdString } from '../types/StoryDistributionId.js'; -import type { ShowToastAction } from '../state/ducks/toast.js'; -import type { ViewStoryActionCreatorType } from '../state/ducks/stories.js'; -import { createLogger } from '../logging/log.js'; -import { AnimatedEmojiGalore } from './AnimatedEmojiGalore.js'; -import { Avatar, AvatarSize } from './Avatar.js'; -import { ConfirmationDialog } from './ConfirmationDialog.js'; -import { ContextMenu } from './ContextMenu.js'; -import { I18n } from './I18n.js'; -import { MessageTimestamp } from './conversation/MessageTimestamp.js'; -import { SendStatus } from '../messages/MessageSendState.js'; -import { Spinner } from './Spinner.js'; -import { StoryDetailsModal } from './StoryDetailsModal.js'; -import { StoryDistributionListName } from './StoryDistributionListName.js'; -import { StoryImage } from './StoryImage.js'; +} from '../state/ducks/conversations.preload.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.preload.js'; +import type { ReplyStateType, StoryViewType } from '../types/Stories.std.js'; +import type { StoryDistributionIdString } from '../types/StoryDistributionId.std.js'; +import type { ShowToastAction } from '../state/ducks/toast.preload.js'; +import type { ViewStoryActionCreatorType } from '../state/ducks/stories.preload.js'; +import { createLogger } from '../logging/log.std.js'; +import { AnimatedEmojiGalore } from './AnimatedEmojiGalore.dom.js'; +import { Avatar, AvatarSize } from './Avatar.dom.js'; +import { ConfirmationDialog } from './ConfirmationDialog.dom.js'; +import { ContextMenu } from './ContextMenu.dom.js'; +import { I18n } from './I18n.dom.js'; +import { MessageTimestamp } from './conversation/MessageTimestamp.dom.js'; +import { SendStatus } from '../messages/MessageSendState.std.js'; +import { Spinner } from './Spinner.dom.js'; +import { StoryDetailsModal } from './StoryDetailsModal.dom.js'; +import { StoryDistributionListName } from './StoryDistributionListName.dom.js'; +import { StoryImage } from './StoryImage.dom.js'; import { ResolvedSendStatus, StoryViewDirectionType, StoryViewModeType, StoryViewTargetType, -} from '../types/Stories.js'; -import { StoryViewsNRepliesModal } from './StoryViewsNRepliesModal.js'; -import { Theme } from '../util/theme.js'; -import { ToastType } from '../types/Toast.js'; -import { getAvatarColor } from '../types/Colors.js'; -import { getStoryBackground } from '../util/getStoryBackground.js'; -import { getStoryDuration } from '../util/getStoryDuration.js'; -import { isVideoAttachment } from '../util/Attachment.js'; -import { graphemeAndLinkAwareSlice } from '../util/graphemeAndLinkAwareSlice.js'; -import { useEscapeHandling } from '../hooks/useEscapeHandling.js'; -import { useRetryStorySend } from '../hooks/useRetryStorySend.js'; -import { resolveStorySendStatus } from '../util/resolveStorySendStatus.js'; -import { strictAssert } from '../util/assert.js'; -import { MessageBody } from './conversation/MessageBody.js'; -import { RenderLocation } from './conversation/MessageTextRenderer.js'; -import { arrow } from '../util/keyboard.js'; -import { StoryProgressSegment } from './StoryProgressSegment.js'; -import type { EmojiSkinTone } from './fun/data/emojis.js'; -import type { FunEmojiSelection } from './fun/panels/FunPanelEmojis.js'; +} from '../types/Stories.std.js'; +import { StoryViewsNRepliesModal } from './StoryViewsNRepliesModal.dom.js'; +import { Theme } from '../util/theme.std.js'; +import { ToastType } from '../types/Toast.dom.js'; +import { getAvatarColor } from '../types/Colors.std.js'; +import { getStoryBackground } from '../util/getStoryBackground.std.js'; +import { getStoryDuration } from '../util/getStoryDuration.dom.js'; +import { isVideoAttachment } from '../util/Attachment.std.js'; +import { graphemeAndLinkAwareSlice } from '../util/graphemeAndLinkAwareSlice.std.js'; +import { useEscapeHandling } from '../hooks/useEscapeHandling.dom.js'; +import { useRetryStorySend } from '../hooks/useRetryStorySend.dom.js'; +import { resolveStorySendStatus } from '../util/resolveStorySendStatus.std.js'; +import { strictAssert } from '../util/assert.std.js'; +import { MessageBody } from './conversation/MessageBody.dom.js'; +import { RenderLocation } from './conversation/MessageTextRenderer.dom.js'; +import { arrow } from '../util/keyboard.dom.js'; +import { StoryProgressSegment } from './StoryProgressSegment.dom.js'; +import type { EmojiSkinTone } from './fun/data/emojis.std.js'; +import type { FunEmojiSelection } from './fun/panels/FunPanelEmojis.dom.js'; const log = createLogger('StoryViewer'); diff --git a/ts/components/StoryViewsNRepliesModal.stories.tsx b/ts/components/StoryViewsNRepliesModal.stories.tsx index 7d9c8e45ee..d58518e141 100644 --- a/ts/components/StoryViewsNRepliesModal.stories.tsx +++ b/ts/components/StoryViewsNRepliesModal.stories.tsx @@ -6,13 +6,13 @@ import React, { useState } from 'react'; import { v4 as generateUuid } from 'uuid'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './StoryViewsNRepliesModal.js'; -import * as durations from '../util/durations/index.js'; -import { SendStatus } from '../messages/MessageSendState.js'; -import { StoryViewsNRepliesModal } from './StoryViewsNRepliesModal.js'; -import { getDefaultConversation } from '../test-helpers/getDefaultConversation.js'; -import { StoryViewTargetType } from '../types/Stories.js'; -import { DEFAULT_PREFERRED_REACTION_EMOJI } from '../reactions/constants.js'; +import type { PropsType } from './StoryViewsNRepliesModal.dom.js'; +import * as durations from '../util/durations/index.std.js'; +import { SendStatus } from '../messages/MessageSendState.std.js'; +import { StoryViewsNRepliesModal } from './StoryViewsNRepliesModal.dom.js'; +import { getDefaultConversation } from '../test-helpers/getDefaultConversation.std.js'; +import { StoryViewTargetType } from '../types/Stories.std.js'; +import { DEFAULT_PREFERRED_REACTION_EMOJI } from '../reactions/constants.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/StoryViewsNRepliesModal.tsx b/ts/components/StoryViewsNRepliesModal.tsx index b92ccc1979..7b6704b4b1 100644 --- a/ts/components/StoryViewsNRepliesModal.tsx +++ b/ts/components/StoryViewsNRepliesModal.tsx @@ -10,34 +10,34 @@ import React, { } from 'react'; import classNames from 'classnames'; import lodash from 'lodash'; -import type { DraftBodyRanges } from '../types/BodyRange.js'; -import type { LocalizerType } from '../types/Util.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import type { InputApi } from './CompositionInput.js'; -import type { PreferredBadgeSelectorType } from '../state/selectors/badges.js'; -import type { ReplyType, StorySendStateType } from '../types/Stories.js'; -import { StoryViewTargetType } from '../types/Stories.js'; -import { Avatar, AvatarSize } from './Avatar.js'; -import { CompositionInput } from './CompositionInput.js'; -import { ContactName } from './conversation/ContactName.js'; -import { Emojify } from './conversation/Emojify.js'; -import { Message, TextDirection } from './conversation/Message.js'; -import { MessageTimestamp } from './conversation/MessageTimestamp.js'; -import { Modal } from './Modal.js'; -import { ReactionPicker } from './conversation/ReactionPicker.js'; -import { Tabs } from './Tabs.js'; -import { Theme } from '../util/theme.js'; -import { ThemeType } from '../types/Util.js'; -import { WidthBreakpoint } from './_util.js'; -import { getAvatarColor } from '../types/Colors.js'; -import { shouldNeverBeCalled } from '../util/shouldNeverBeCalled.js'; -import { ContextMenu } from './ContextMenu.js'; -import { ConfirmationDialog } from './ConfirmationDialog.js'; -import type { EmojiSkinTone } from './fun/data/emojis.js'; -import { FunEmojiPicker } from './fun/FunEmojiPicker.js'; -import { FunEmojiPickerButton } from './fun/FunButton.js'; -import type { FunEmojiSelection } from './fun/panels/FunPanelEmojis.js'; -import { useConfirmDiscard } from '../hooks/useConfirmDiscard.js'; +import type { DraftBodyRanges } from '../types/BodyRange.std.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import type { InputApi } from './CompositionInput.dom.js'; +import type { PreferredBadgeSelectorType } from '../state/selectors/badges.preload.js'; +import type { ReplyType, StorySendStateType } from '../types/Stories.std.js'; +import { StoryViewTargetType } from '../types/Stories.std.js'; +import { Avatar, AvatarSize } from './Avatar.dom.js'; +import { CompositionInput } from './CompositionInput.dom.js'; +import { ContactName } from './conversation/ContactName.dom.js'; +import { Emojify } from './conversation/Emojify.dom.js'; +import { Message, TextDirection } from './conversation/Message.dom.js'; +import { MessageTimestamp } from './conversation/MessageTimestamp.dom.js'; +import { Modal } from './Modal.dom.js'; +import { ReactionPicker } from './conversation/ReactionPicker.dom.js'; +import { Tabs } from './Tabs.dom.js'; +import { Theme } from '../util/theme.std.js'; +import { ThemeType } from '../types/Util.std.js'; +import { WidthBreakpoint } from './_util.std.js'; +import { getAvatarColor } from '../types/Colors.std.js'; +import { shouldNeverBeCalled } from '../util/shouldNeverBeCalled.std.js'; +import { ContextMenu } from './ContextMenu.dom.js'; +import { ConfirmationDialog } from './ConfirmationDialog.dom.js'; +import type { EmojiSkinTone } from './fun/data/emojis.std.js'; +import { FunEmojiPicker } from './fun/FunEmojiPicker.dom.js'; +import { FunEmojiPickerButton } from './fun/FunButton.dom.js'; +import type { FunEmojiSelection } from './fun/panels/FunPanelEmojis.dom.js'; +import { useConfirmDiscard } from '../hooks/useConfirmDiscard.dom.js'; const { noop, orderBy } = lodash; diff --git a/ts/components/Tabs.tsx b/ts/components/Tabs.tsx index 6631b8ec2d..5e1aa95746 100644 --- a/ts/components/Tabs.tsx +++ b/ts/components/Tabs.tsx @@ -4,8 +4,8 @@ import type { ReactNode } from 'react'; import React from 'react'; -import type { TabsOptionsType } from '../hooks/useTabs.js'; -import { useTabs } from '../hooks/useTabs.js'; +import type { TabsOptionsType } from '../hooks/useTabs.dom.js'; +import { useTabs } from '../hooks/useTabs.dom.js'; type PropsType = { children: (renderProps: { selectedTab: string }) => ReactNode; diff --git a/ts/components/TapToViewNotAvailableModal.stories.tsx b/ts/components/TapToViewNotAvailableModal.stories.tsx index 50719d0e7e..5c0d9cdd62 100644 --- a/ts/components/TapToViewNotAvailableModal.stories.tsx +++ b/ts/components/TapToViewNotAvailableModal.stories.tsx @@ -3,12 +3,12 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './TapToViewNotAvailableModal.js'; +import type { PropsType } from './TapToViewNotAvailableModal.dom.js'; import { TapToViewNotAvailableModal, TapToViewNotAvailableType, -} from './TapToViewNotAvailableModal.js'; -import type { ComponentMeta } from '../storybook/types.js'; +} from './TapToViewNotAvailableModal.dom.js'; +import type { ComponentMeta } from '../storybook/types.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/TapToViewNotAvailableModal.tsx b/ts/components/TapToViewNotAvailableModal.tsx index baa8a6606a..65452cfa4b 100644 --- a/ts/components/TapToViewNotAvailableModal.tsx +++ b/ts/components/TapToViewNotAvailableModal.tsx @@ -3,9 +3,9 @@ import * as React from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import { Modal } from './Modal.js'; -import { Button, ButtonVariant } from './Button.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { Modal } from './Modal.dom.js'; +import { Button, ButtonVariant } from './Button.dom.js'; export type DataPropsType = { parameters: { diff --git a/ts/components/TextAttachment.stories.tsx b/ts/components/TextAttachment.stories.tsx index 603521c682..5edf24a8e4 100644 --- a/ts/components/TextAttachment.stories.tsx +++ b/ts/components/TextAttachment.stories.tsx @@ -4,8 +4,8 @@ import React from 'react'; import type { Meta } from '@storybook/react'; -import { TextAttachment } from './TextAttachment.js'; -import type { PropsType } from './TextAttachment.js'; +import { TextAttachment } from './TextAttachment.dom.js'; +import type { PropsType } from './TextAttachment.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/TextAttachment.tsx b/ts/components/TextAttachment.tsx index 0975b56f46..0ff477eda5 100644 --- a/ts/components/TextAttachment.tsx +++ b/ts/components/TextAttachment.tsx @@ -4,23 +4,26 @@ import React, { forwardRef, useEffect, useRef, useState } from 'react'; import classNames from 'classnames'; -import type { LocalizerType, RenderTextCallbackType } from '../types/Util.js'; -import type { TextAttachmentType } from '../types/Attachment.js'; -import { AddNewLines } from './conversation/AddNewLines.js'; -import { Emojify } from './conversation/Emojify.js'; -import { StoryLinkPreview } from './StoryLinkPreview.js'; -import { TextAttachmentStyleType } from '../types/Attachment.js'; -import { count } from '../util/grapheme.js'; -import { isValidLink, getSafeDomain } from '../types/LinkPreview.js'; -import { getFontNameByTextScript } from '../util/getFontNameByTextScript.js'; +import type { + LocalizerType, + RenderTextCallbackType, +} from '../types/Util.std.js'; +import type { TextAttachmentType } from '../types/Attachment.std.js'; +import { AddNewLines } from './conversation/AddNewLines.dom.js'; +import { Emojify } from './conversation/Emojify.dom.js'; +import { StoryLinkPreview } from './StoryLinkPreview.dom.js'; +import { TextAttachmentStyleType } from '../types/Attachment.std.js'; +import { count } from '../util/grapheme.std.js'; +import { isValidLink, getSafeDomain } from '../types/LinkPreview.std.js'; +import { getFontNameByTextScript } from '../util/getFontNameByTextScript.std.js'; import { COLOR_WHITE_INT, getHexFromNumber, getBackgroundColor, -} from '../util/getStoryBackground.js'; -import { SECOND } from '../util/durations/index.js'; -import { useRefMerger } from '../hooks/useRefMerger.js'; -import { useSizeObserver } from '../hooks/useSizeObserver.js'; +} from '../util/getStoryBackground.std.js'; +import { SECOND } from '../util/durations/index.std.js'; +import { useRefMerger } from '../hooks/useRefMerger.std.js'; +import { useSizeObserver } from '../hooks/useSizeObserver.dom.js'; const renderNewLines: RenderTextCallbackType = ({ text: textWithNewLines, diff --git a/ts/components/TextStoryCreator.tsx b/ts/components/TextStoryCreator.tsx index 5c71b495a7..5406aaf273 100644 --- a/ts/components/TextStoryCreator.tsx +++ b/ts/components/TextStoryCreator.tsx @@ -5,32 +5,32 @@ import classNames from 'classnames'; import lodash from 'lodash'; import { usePopper } from 'react-popper'; import { FocusScope } from 'react-aria'; -import type { LinkPreviewForUIType } from '../types/message/LinkPreviews.js'; -import { ThemeType, type LocalizerType } from '../types/Util.js'; -import type { TextAttachmentType } from '../types/Attachment.js'; -import { Button, ButtonVariant } from './Button.js'; -import { ContextMenu } from './ContextMenu.js'; -import { LinkPreviewSourceType, findLinks } from '../types/LinkPreview.js'; -import type { MaybeGrabLinkPreviewOptionsType } from '../types/LinkPreview.js'; -import { Input } from './Input.js'; -import { Slider } from './Slider.js'; -import { StoryLinkPreview } from './StoryLinkPreview.js'; -import { TextAttachment } from './TextAttachment.js'; -import { Theme, themeClassName } from '../util/theme.js'; -import { getRGBA, getRGBANumber } from '../mediaEditor/util/color.js'; +import type { LinkPreviewForUIType } from '../types/message/LinkPreviews.std.js'; +import { ThemeType, type LocalizerType } from '../types/Util.std.js'; +import type { TextAttachmentType } from '../types/Attachment.std.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import { ContextMenu } from './ContextMenu.dom.js'; +import { LinkPreviewSourceType, findLinks } from '../types/LinkPreview.std.js'; +import type { MaybeGrabLinkPreviewOptionsType } from '../types/LinkPreview.std.js'; +import { Input } from './Input.dom.js'; +import { Slider } from './Slider.dom.js'; +import { StoryLinkPreview } from './StoryLinkPreview.dom.js'; +import { TextAttachment } from './TextAttachment.dom.js'; +import { Theme, themeClassName } from '../util/theme.std.js'; +import { getRGBA, getRGBANumber } from '../mediaEditor/util/color.std.js'; import { COLOR_BLACK_INT, COLOR_WHITE_INT, getBackgroundColor, -} from '../util/getStoryBackground.js'; -import { objectMap } from '../util/objectMap.js'; -import { handleOutsideClick } from '../util/handleOutsideClick.js'; -import { Spinner } from './Spinner.js'; -import { FunEmojiPicker } from './fun/FunEmojiPicker.js'; -import type { FunEmojiSelection } from './fun/panels/FunPanelEmojis.js'; -import { getEmojiVariantByKey } from './fun/data/emojis.js'; -import { FunEmojiPickerButton } from './fun/FunButton.js'; -import { useConfirmDiscard } from '../hooks/useConfirmDiscard.js'; +} from '../util/getStoryBackground.std.js'; +import { objectMap } from '../util/objectMap.std.js'; +import { handleOutsideClick } from '../util/handleOutsideClick.dom.js'; +import { Spinner } from './Spinner.dom.js'; +import { FunEmojiPicker } from './fun/FunEmojiPicker.dom.js'; +import type { FunEmojiSelection } from './fun/panels/FunPanelEmojis.dom.js'; +import { getEmojiVariantByKey } from './fun/data/emojis.std.js'; +import { FunEmojiPickerButton } from './fun/FunButton.dom.js'; +import { useConfirmDiscard } from '../hooks/useConfirmDiscard.dom.js'; const { noop } = lodash; diff --git a/ts/components/Time.tsx b/ts/components/Time.tsx index bad41c797a..db5cf1ec29 100644 --- a/ts/components/Time.tsx +++ b/ts/components/Time.tsx @@ -6,7 +6,7 @@ import type { ReactElement, TimeHTMLAttributes } from 'react'; import moment from 'moment'; import React from 'react'; -import { toBoundedDate } from '../util/timestamp.js'; +import { toBoundedDate } from '../util/timestamp.std.js'; export function Time({ children, diff --git a/ts/components/Toast.stories.tsx b/ts/components/Toast.stories.tsx index b82c235735..19e08437f6 100644 --- a/ts/components/Toast.stories.tsx +++ b/ts/components/Toast.stories.tsx @@ -3,9 +3,9 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './Toast.js'; -import { Toast } from './Toast.js'; -import { type ComponentMeta, argPresets } from '../storybook/types.js'; +import type { PropsType } from './Toast.dom.js'; +import { Toast } from './Toast.dom.js'; +import { type ComponentMeta, argPresets } from '../storybook/types.std.js'; export default { title: 'Components/Toast', diff --git a/ts/components/Toast.tsx b/ts/components/Toast.tsx index b5da8d06b6..931dca43c4 100644 --- a/ts/components/Toast.tsx +++ b/ts/components/Toast.tsx @@ -4,8 +4,8 @@ import type { KeyboardEvent, MouseEvent, ReactNode } from 'react'; import React, { memo, useEffect } from 'react'; import classNames from 'classnames'; -import { useRestoreFocus } from '../hooks/useRestoreFocus.js'; -import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.js'; +import { useRestoreFocus } from '../hooks/useRestoreFocus.dom.js'; +import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.std.js'; export type PropsType = { autoDismissDisabled?: boolean; diff --git a/ts/components/ToastManager.stories.tsx b/ts/components/ToastManager.stories.tsx index 761b3b3cca..98c179f9a8 100644 --- a/ts/components/ToastManager.stories.tsx +++ b/ts/components/ToastManager.stories.tsx @@ -5,13 +5,13 @@ import type { Meta, StoryFn } from '@storybook/react'; import React from 'react'; import { action } from '@storybook/addon-actions'; -import { ToastManager } from './ToastManager.js'; -import type { AnyToast } from '../types/Toast.js'; -import { ToastType } from '../types/Toast.js'; -import type { AnyActionableMegaphone } from '../types/Megaphone.js'; -import { MegaphoneType } from '../types/Megaphone.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import type { PropsType } from './ToastManager.js'; +import { ToastManager } from './ToastManager.dom.js'; +import type { AnyToast } from '../types/Toast.dom.js'; +import { ToastType } from '../types/Toast.dom.js'; +import type { AnyActionableMegaphone } from '../types/Megaphone.std.js'; +import { MegaphoneType } from '../types/Megaphone.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import type { PropsType } from './ToastManager.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/ToastManager.tsx b/ts/components/ToastManager.tsx index be7bc70f7f..bb98fcb89d 100644 --- a/ts/components/ToastManager.tsx +++ b/ts/components/ToastManager.tsx @@ -5,24 +5,24 @@ import classNames from 'classnames'; import React from 'react'; import { createPortal } from 'react-dom'; -import { SECOND } from '../util/durations/index.js'; -import { Toast } from './Toast.js'; -import { WidthBreakpoint } from './_util.js'; -import { UsernameMegaphone } from './UsernameMegaphone.js'; -import { assertDev } from '../util/assert.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { ToastType } from '../types/Toast.js'; -import { MegaphoneType } from '../types/Megaphone.js'; -import { NavTab, SettingsPage } from '../types/Nav.js'; -import { AxoSymbol } from '../axo/AxoSymbol.js'; -import { tw } from '../axo/tw.js'; +import { SECOND } from '../util/durations/index.std.js'; +import { Toast } from './Toast.dom.js'; +import { WidthBreakpoint } from './_util.std.js'; +import { UsernameMegaphone } from './UsernameMegaphone.dom.js'; +import { assertDev } from '../util/assert.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { ToastType } from '../types/Toast.dom.js'; +import { MegaphoneType } from '../types/Megaphone.std.js'; +import { NavTab, SettingsPage } from '../types/Nav.std.js'; +import { AxoSymbol } from '../axo/AxoSymbol.dom.js'; +import { tw } from '../axo/tw.dom.js'; -import type { LocalizerType } from '../types/Util.js'; -import type { AnyToast } from '../types/Toast.js'; -import type { AnyActionableMegaphone } from '../types/Megaphone.js'; -import type { Location } from '../types/Nav.js'; -import { I18n } from './I18n.js'; -import { UserText } from './UserText.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import type { AnyToast } from '../types/Toast.dom.js'; +import type { AnyActionableMegaphone } from '../types/Megaphone.std.js'; +import type { Location } from '../types/Nav.std.js'; +import { I18n } from './I18n.dom.js'; +import { UserText } from './UserText.dom.js'; export type PropsType = { changeLocation: (newLocation: Location) => unknown; diff --git a/ts/components/Tooltip.stories.tsx b/ts/components/Tooltip.stories.tsx index 9899b40e80..f4674e00e8 100644 --- a/ts/components/Tooltip.stories.tsx +++ b/ts/components/Tooltip.stories.tsx @@ -3,9 +3,9 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './Tooltip.js'; -import { Tooltip, TooltipPlacement } from './Tooltip.js'; -import { Theme } from '../util/theme.js'; +import type { PropsType } from './Tooltip.dom.js'; +import { Tooltip, TooltipPlacement } from './Tooltip.dom.js'; +import { Theme } from '../util/theme.std.js'; export default { title: 'Components/Tooltip', diff --git a/ts/components/Tooltip.tsx b/ts/components/Tooltip.tsx index 50b6453873..3acce276ed 100644 --- a/ts/components/Tooltip.tsx +++ b/ts/components/Tooltip.tsx @@ -7,11 +7,11 @@ import lodash from 'lodash'; import { Manager, Reference, Popper } from 'react-popper'; import type { StrictModifiers } from '@popperjs/core'; import { createPortal } from 'react-dom'; -import type { Theme } from '../util/theme.js'; -import { themeClassName } from '../util/theme.js'; -import { refMerger } from '../util/refMerger.js'; -import { offsetDistanceModifier } from '../util/popperUtil.js'; -import { getInteractionMode } from '../services/InteractionMode.js'; +import type { Theme } from '../util/theme.std.js'; +import { themeClassName } from '../util/theme.std.js'; +import { refMerger } from '../util/refMerger.std.js'; +import { offsetDistanceModifier } from '../util/popperUtil.std.js'; +import { getInteractionMode } from '../services/InteractionMode.dom.js'; const { noop } = lodash; diff --git a/ts/components/UnsupportedOSDialog.stories.tsx b/ts/components/UnsupportedOSDialog.stories.tsx index 6e513dc835..f58759519c 100644 --- a/ts/components/UnsupportedOSDialog.stories.tsx +++ b/ts/components/UnsupportedOSDialog.stories.tsx @@ -3,11 +3,11 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import { UnsupportedOSDialog } from './UnsupportedOSDialog.js'; -import type { PropsType } from './UnsupportedOSDialog.js'; -import { DAY } from '../util/durations/index.js'; -import { WidthBreakpoint } from './_util.js'; -import { FakeLeftPaneContainer } from '../test-helpers/FakeLeftPaneContainer.js'; +import { UnsupportedOSDialog } from './UnsupportedOSDialog.dom.js'; +import type { PropsType } from './UnsupportedOSDialog.dom.js'; +import { DAY } from '../util/durations/index.std.js'; +import { WidthBreakpoint } from './_util.std.js'; +import { FakeLeftPaneContainer } from '../test-helpers/FakeLeftPaneContainer.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/UnsupportedOSDialog.tsx b/ts/components/UnsupportedOSDialog.tsx index 77e9ede513..95d9b256b8 100644 --- a/ts/components/UnsupportedOSDialog.tsx +++ b/ts/components/UnsupportedOSDialog.tsx @@ -4,13 +4,13 @@ import React from 'react'; import moment from 'moment'; -import type { LocalizerType } from '../types/Util.js'; -import { UNSUPPORTED_OS_URL } from '../types/support.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import type { WidthBreakpoint } from './_util.js'; -import { I18n } from './I18n.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { UNSUPPORTED_OS_URL } from '../types/support.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import type { WidthBreakpoint } from './_util.std.js'; +import { I18n } from './I18n.dom.js'; -import { LeftPaneDialog } from './LeftPaneDialog.js'; +import { LeftPaneDialog } from './LeftPaneDialog.dom.js'; export type PropsType = { containerWidthBreakpoint: WidthBreakpoint; diff --git a/ts/components/UserText.tsx b/ts/components/UserText.tsx index 9ce344f568..f2ac30dfde 100644 --- a/ts/components/UserText.tsx +++ b/ts/components/UserText.tsx @@ -1,8 +1,8 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import React, { useMemo } from 'react'; -import { Emojify } from './conversation/Emojify.js'; -import { bidiIsolate } from '../util/unicodeBidi.js'; +import { Emojify } from './conversation/Emojify.dom.js'; +import { bidiIsolate } from '../util/unicodeBidi.std.js'; export type UserTextProps = Readonly<{ text: string; diff --git a/ts/components/UsernameEditor.stories.tsx b/ts/components/UsernameEditor.stories.tsx index 16a4808cf1..d364fe853f 100644 --- a/ts/components/UsernameEditor.stories.tsx +++ b/ts/components/UsernameEditor.stories.tsx @@ -5,14 +5,14 @@ import React from 'react'; import type { Meta, StoryFn } from '@storybook/react'; import { action } from '@storybook/addon-actions'; -import type { UsernameReservationType } from '../types/Username.js'; +import type { UsernameReservationType } from '../types/Username.std.js'; -import type { PropsType } from './UsernameEditor.js'; -import { UsernameEditor } from './UsernameEditor.js'; +import type { PropsType } from './UsernameEditor.dom.js'; +import { UsernameEditor } from './UsernameEditor.dom.js'; import { UsernameReservationState as State, UsernameReservationError, -} from '../state/ducks/usernameEnums.js'; +} from '../state/ducks/usernameEnums.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/UsernameEditor.tsx b/ts/components/UsernameEditor.tsx index eab530bb38..634f05a805 100644 --- a/ts/components/UsernameEditor.tsx +++ b/ts/components/UsernameEditor.tsx @@ -11,29 +11,29 @@ import React, { import classNames from 'classnames'; import lodash from 'lodash'; -import type { LocalizerType } from '../types/Util.js'; -import type { UsernameReservationType } from '../types/Username.js'; -import { ToastType } from '../types/Toast.js'; -import { missingCaseError } from '../util/missingCaseError.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import type { UsernameReservationType } from '../types/Username.std.js'; +import { ToastType } from '../types/Toast.dom.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; import { getNickname, getDiscriminator, isCaseChange, -} from '../types/Username.js'; +} from '../types/Username.std.js'; import { UsernameReservationState, UsernameReservationError, -} from '../state/ducks/usernameEnums.js'; -import type { ReserveUsernameOptionsType } from '../state/ducks/username.js'; -import type { ShowToastAction } from '../state/ducks/toast.js'; +} from '../state/ducks/usernameEnums.std.js'; +import type { ReserveUsernameOptionsType } from '../state/ducks/username.preload.js'; +import type { ShowToastAction } from '../state/ducks/toast.preload.js'; -import { AutoSizeInput } from './AutoSizeInput.js'; -import { ConfirmationDialog } from './ConfirmationDialog.js'; -import { Input } from './Input.js'; -import { Spinner } from './Spinner.js'; -import { Modal } from './Modal.js'; -import { Button, ButtonVariant } from './Button.js'; -import { useConfirmDiscard } from '../hooks/useConfirmDiscard.js'; +import { AutoSizeInput } from './AutoSizeInput.dom.js'; +import { ConfirmationDialog } from './ConfirmationDialog.dom.js'; +import { Input } from './Input.dom.js'; +import { Spinner } from './Spinner.dom.js'; +import { Modal } from './Modal.dom.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import { useConfirmDiscard } from '../hooks/useConfirmDiscard.dom.js'; const { noop } = lodash; diff --git a/ts/components/UsernameLinkEditor.stories.tsx b/ts/components/UsernameLinkEditor.stories.tsx index 5b7e9fdc17..ea1d1c696b 100644 --- a/ts/components/UsernameLinkEditor.stories.tsx +++ b/ts/components/UsernameLinkEditor.stories.tsx @@ -5,16 +5,16 @@ import React, { useCallback, useState } from 'react'; import type { Meta, StoryFn } from '@storybook/react'; import { action } from '@storybook/addon-actions'; -import { UsernameLinkState } from '../state/ducks/usernameEnums.js'; -import { SignalService as Proto } from '../protobuf/index.js'; +import { UsernameLinkState } from '../state/ducks/usernameEnums.std.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; -import type { PropsType } from './UsernameLinkEditor.js'; +import type { PropsType } from './UsernameLinkEditor.dom.js'; import { UsernameLinkEditor, PRINT_WIDTH, PRINT_HEIGHT, -} from './UsernameLinkEditor.js'; -import { Modal } from './Modal.js'; +} from './UsernameLinkEditor.dom.js'; +import { Modal } from './Modal.dom.js'; const ColorEnum = Proto.AccountRecord.UsernameLink.Color; diff --git a/ts/components/UsernameLinkEditor.tsx b/ts/components/UsernameLinkEditor.tsx index f15a6afa30..43e573efc8 100644 --- a/ts/components/UsernameLinkEditor.tsx +++ b/ts/components/UsernameLinkEditor.tsx @@ -7,22 +7,22 @@ import classnames from 'classnames'; import { changeDpiBlob } from 'changedpi'; import lodash from 'lodash'; -import { SignalService as Proto } from '../protobuf/index.js'; -import type { SaveAttachmentActionCreatorType } from '../state/ducks/conversations.js'; -import { UsernameLinkState } from '../state/ducks/usernameEnums.js'; -import { ToastType } from '../types/Toast.js'; -import type { ShowToastAction } from '../state/ducks/toast.js'; -import type { LocalizerType } from '../types/Util.js'; -import { IMAGE_PNG } from '../types/MIME.js'; -import { strictAssert } from '../util/assert.js'; -import { drop } from '../util/drop.js'; -import { splitText } from '../util/splitText.js'; -import { loadImage } from '../util/loadImage.js'; -import { Button, ButtonVariant } from './Button.js'; -import { ConfirmationDialog } from './ConfirmationDialog.js'; -import { Spinner } from './Spinner.js'; -import { BrandedQRCode } from './BrandedQRCode.js'; -import { useConfirmDiscard } from '../hooks/useConfirmDiscard.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; +import type { SaveAttachmentActionCreatorType } from '../state/ducks/conversations.preload.js'; +import { UsernameLinkState } from '../state/ducks/usernameEnums.std.js'; +import { ToastType } from '../types/Toast.dom.js'; +import type { ShowToastAction } from '../state/ducks/toast.preload.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { IMAGE_PNG } from '../types/MIME.std.js'; +import { strictAssert } from '../util/assert.std.js'; +import { drop } from '../util/drop.std.js'; +import { splitText } from '../util/splitText.std.js'; +import { loadImage } from '../util/loadImage.std.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import { ConfirmationDialog } from './ConfirmationDialog.dom.js'; +import { Spinner } from './Spinner.dom.js'; +import { BrandedQRCode } from './BrandedQRCode.dom.js'; +import { useConfirmDiscard } from '../hooks/useConfirmDiscard.dom.js'; const { noop } = lodash; diff --git a/ts/components/UsernameMegaphone.stories.tsx b/ts/components/UsernameMegaphone.stories.tsx index 3832490003..a3ac29bcf4 100644 --- a/ts/components/UsernameMegaphone.stories.tsx +++ b/ts/components/UsernameMegaphone.stories.tsx @@ -3,9 +3,9 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './UsernameMegaphone.js'; -import { UsernameMegaphone } from './UsernameMegaphone.js'; -import { type ComponentMeta } from '../storybook/types.js'; +import type { PropsType } from './UsernameMegaphone.dom.js'; +import { UsernameMegaphone } from './UsernameMegaphone.dom.js'; +import { type ComponentMeta } from '../storybook/types.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/UsernameMegaphone.tsx b/ts/components/UsernameMegaphone.tsx index 40e4b5988b..6a7e0e8410 100644 --- a/ts/components/UsernameMegaphone.tsx +++ b/ts/components/UsernameMegaphone.tsx @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import type { UsernameOnboardingActionableMegaphoneType } from '../types/Megaphone.js'; -import { Button, ButtonSize, ButtonVariant } from './Button.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import type { UsernameOnboardingActionableMegaphoneType } from '../types/Megaphone.std.js'; +import { Button, ButtonSize, ButtonVariant } from './Button.dom.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/UsernameOnboardingModal.stories.tsx b/ts/components/UsernameOnboardingModal.stories.tsx index b3fa92cbc3..2a3e4c4dd0 100644 --- a/ts/components/UsernameOnboardingModal.stories.tsx +++ b/ts/components/UsernameOnboardingModal.stories.tsx @@ -5,8 +5,8 @@ import React from 'react'; import type { Meta, StoryFn } from '@storybook/react'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './UsernameOnboardingModal.js'; -import { UsernameOnboardingModal } from './UsernameOnboardingModal.js'; +import type { PropsType } from './UsernameOnboardingModal.dom.js'; +import { UsernameOnboardingModal } from './UsernameOnboardingModal.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/UsernameOnboardingModal.tsx b/ts/components/UsernameOnboardingModal.tsx index 2f88b9b202..03209737dd 100644 --- a/ts/components/UsernameOnboardingModal.tsx +++ b/ts/components/UsernameOnboardingModal.tsx @@ -3,9 +3,9 @@ import React from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import { Button, ButtonVariant } from './Button.js'; -import { Modal } from './Modal.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { Button, ButtonVariant } from './Button.dom.js'; +import { Modal } from './Modal.dom.js'; export type PropsType = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/VoiceNotesPlaybackContext.tsx b/ts/components/VoiceNotesPlaybackContext.tsx index 23c596f95e..7bce424a5c 100644 --- a/ts/components/VoiceNotesPlaybackContext.tsx +++ b/ts/components/VoiceNotesPlaybackContext.tsx @@ -5,8 +5,8 @@ import * as React from 'react'; import PQueue from 'p-queue'; import { LRUCache } from 'lru-cache'; -import type { WaveformCache } from '../types/Audio.js'; -import { createLogger } from '../logging/log.js'; +import type { WaveformCache } from '../types/Audio.dom.js'; +import { createLogger } from '../logging/log.std.js'; const log = createLogger('VoiceNotesPlaybackContext'); diff --git a/ts/components/WarningIdlePrimaryDeviceDialog.tsx b/ts/components/WarningIdlePrimaryDeviceDialog.tsx index 019bc118a9..9656f56c16 100644 --- a/ts/components/WarningIdlePrimaryDeviceDialog.tsx +++ b/ts/components/WarningIdlePrimaryDeviceDialog.tsx @@ -7,10 +7,10 @@ import { LeftPaneDialog, LeftPaneDialogIcon, LeftPaneDialogIconBackground, -} from './LeftPaneDialog.js'; -import { WidthBreakpoint } from './_util.js'; -import type { LocalizerType } from '../types/I18N.js'; -import { openLinkInWebBrowser } from '../util/openLinkInWebBrowser.js'; +} from './LeftPaneDialog.dom.js'; +import { WidthBreakpoint } from './_util.std.js'; +import type { LocalizerType } from '../types/I18N.std.js'; +import { openLinkInWebBrowser } from '../util/openLinkInWebBrowser.dom.js'; export type Props = { containerWidthBreakpoint: WidthBreakpoint; diff --git a/ts/components/WhatsNewLink.tsx b/ts/components/WhatsNewLink.tsx index a7b546e618..6d5a80afd4 100644 --- a/ts/components/WhatsNewLink.tsx +++ b/ts/components/WhatsNewLink.tsx @@ -3,9 +3,9 @@ import React from 'react'; -import { I18n } from './I18n.js'; +import { I18n } from './I18n.dom.js'; -import type { LocalizerType } from '../types/Util.js'; +import type { LocalizerType } from '../types/Util.std.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/WhatsNewModal.stories.tsx b/ts/components/WhatsNewModal.stories.tsx index 3576bc0b67..57cfbf9882 100644 --- a/ts/components/WhatsNewModal.stories.tsx +++ b/ts/components/WhatsNewModal.stories.tsx @@ -4,8 +4,8 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './WhatsNewModal.js'; -import { WhatsNewModal } from './WhatsNewModal.js'; +import type { PropsType } from './WhatsNewModal.dom.js'; +import { WhatsNewModal } from './WhatsNewModal.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/WhatsNewModal.tsx b/ts/components/WhatsNewModal.tsx index da8ba81337..ca18c8c596 100644 --- a/ts/components/WhatsNewModal.tsx +++ b/ts/components/WhatsNewModal.tsx @@ -5,10 +5,10 @@ import type { ReactNode } from 'react'; import React from 'react'; import moment from 'moment'; -import { Modal } from './Modal.js'; -import { I18n } from './I18n.js'; -import type { LocalizerType } from '../types/Util.js'; -import { tw } from '../axo/tw.js'; +import { Modal } from './Modal.dom.js'; +import { I18n } from './I18n.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { tw } from '../axo/tw.dom.js'; export type PropsType = { hideWhatsNewModal: () => unknown; diff --git a/ts/components/conversation/About.tsx b/ts/components/conversation/About.tsx index 09942796a0..bf48ee3aab 100644 --- a/ts/components/conversation/About.tsx +++ b/ts/components/conversation/About.tsx @@ -3,7 +3,7 @@ import React from 'react'; -import { Emojify } from './Emojify.js'; +import { Emojify } from './Emojify.dom.js'; export type PropsType = { className?: string; diff --git a/ts/components/conversation/AboutContactModal.stories.tsx b/ts/components/conversation/AboutContactModal.stories.tsx index 75759f3f36..64235a61eb 100644 --- a/ts/components/conversation/AboutContactModal.stories.tsx +++ b/ts/components/conversation/AboutContactModal.stories.tsx @@ -3,10 +3,10 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './AboutContactModal.js'; -import { AboutContactModal } from './AboutContactModal.js'; -import { type ComponentMeta } from '../../storybook/types.js'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; +import type { PropsType } from './AboutContactModal.dom.js'; +import { AboutContactModal } from './AboutContactModal.dom.js'; +import { type ComponentMeta } from '../../storybook/types.std.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/AboutContactModal.tsx b/ts/components/conversation/AboutContactModal.tsx index 11a0daab6d..ebefbd3128 100644 --- a/ts/components/conversation/AboutContactModal.tsx +++ b/ts/components/conversation/AboutContactModal.tsx @@ -2,17 +2,17 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { type ReactNode, useCallback, useEffect, useMemo } from 'react'; -import type { ConversationType } from '../../state/ducks/conversations.js'; -import type { LocalizerType } from '../../types/Util.js'; -import { isInSystemContacts } from '../../util/isInSystemContacts.js'; -import { Avatar, AvatarBlur, AvatarSize } from '../Avatar.js'; -import { Modal } from '../Modal.js'; -import { UserText } from '../UserText.js'; -import { SharedGroupNames } from '../SharedGroupNames.js'; -import { About } from './About.js'; -import { I18n } from '../I18n.js'; -import { canHaveNicknameAndNote } from '../../util/nicknames.js'; -import { Tooltip, TooltipPlacement } from '../Tooltip.js'; +import type { ConversationType } from '../../state/ducks/conversations.preload.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import { isInSystemContacts } from '../../util/isInSystemContacts.std.js'; +import { Avatar, AvatarBlur, AvatarSize } from '../Avatar.dom.js'; +import { Modal } from '../Modal.dom.js'; +import { UserText } from '../UserText.dom.js'; +import { SharedGroupNames } from '../SharedGroupNames.dom.js'; +import { About } from './About.dom.js'; +import { I18n } from '../I18n.dom.js'; +import { canHaveNicknameAndNote } from '../../util/nicknames.dom.js'; +import { Tooltip, TooltipPlacement } from '../Tooltip.dom.js'; function muted(parts: Array) { return ( diff --git a/ts/components/conversation/AddNewLines.stories.tsx b/ts/components/conversation/AddNewLines.stories.tsx index f4600f6ad2..119cae7761 100644 --- a/ts/components/conversation/AddNewLines.stories.tsx +++ b/ts/components/conversation/AddNewLines.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './AddNewLines.js'; -import { AddNewLines } from './AddNewLines.js'; +import type { Props } from './AddNewLines.dom.js'; +import { AddNewLines } from './AddNewLines.dom.js'; export default { title: 'Components/Conversation/AddNewLines', diff --git a/ts/components/conversation/AddNewLines.tsx b/ts/components/conversation/AddNewLines.tsx index d3458dd7c6..4f247acb7b 100644 --- a/ts/components/conversation/AddNewLines.tsx +++ b/ts/components/conversation/AddNewLines.tsx @@ -3,7 +3,7 @@ import React from 'react'; -import type { RenderTextCallbackType } from '../../types/Util.js'; +import type { RenderTextCallbackType } from '../../types/Util.std.js'; export type Props = { text: string; diff --git a/ts/components/conversation/AtMention.tsx b/ts/components/conversation/AtMention.tsx index 0d5377bdec..b4c5a2aa0e 100644 --- a/ts/components/conversation/AtMention.tsx +++ b/ts/components/conversation/AtMention.tsx @@ -4,7 +4,7 @@ import classNames from 'classnames'; import type { KeyboardEventHandler } from 'react'; import React from 'react'; -import { Emojify } from './Emojify.js'; +import { Emojify } from './Emojify.dom.js'; export function AtMention({ direction, diff --git a/ts/components/conversation/AtMentionify.stories.tsx b/ts/components/conversation/AtMentionify.stories.tsx index 25b4cc28cf..d292706c3f 100644 --- a/ts/components/conversation/AtMentionify.stories.tsx +++ b/ts/components/conversation/AtMentionify.stories.tsx @@ -4,9 +4,9 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { generateAci } from '../../types/ServiceId.js'; -import type { Props } from './AtMentionify.js'; -import { AtMentionify } from './AtMentionify.js'; +import { generateAci } from '../../types/ServiceId.std.js'; +import type { Props } from './AtMentionify.dom.js'; +import { AtMentionify } from './AtMentionify.dom.js'; const SERVICE_ID_1 = generateAci(); const SERVICE_ID_2 = generateAci(); diff --git a/ts/components/conversation/AtMentionify.tsx b/ts/components/conversation/AtMentionify.tsx index 5dec7d8628..42d6cfad2a 100644 --- a/ts/components/conversation/AtMentionify.tsx +++ b/ts/components/conversation/AtMentionify.tsx @@ -6,8 +6,8 @@ import lodash from 'lodash'; import type { HydratedBodyRangeMention, BodyRange, -} from '../../types/BodyRange.js'; -import { AtMention } from './AtMention.js'; +} from '../../types/BodyRange.std.js'; +import { AtMention } from './AtMention.dom.js'; const { sortBy } = lodash; diff --git a/ts/components/conversation/AttachmentDetailPill.stories.tsx b/ts/components/conversation/AttachmentDetailPill.stories.tsx index 8c7b18d95d..ac25d402dc 100644 --- a/ts/components/conversation/AttachmentDetailPill.stories.tsx +++ b/ts/components/conversation/AttachmentDetailPill.stories.tsx @@ -6,9 +6,9 @@ import { action } from '@storybook/addon-actions'; import { type PropsType, AttachmentDetailPill, -} from './AttachmentDetailPill.js'; -import { type ComponentMeta } from '../../storybook/types.js'; -import { fakeAttachment } from '../../test-helpers/fakeAttachment.js'; +} from './AttachmentDetailPill.dom.js'; +import { type ComponentMeta } from '../../storybook/types.std.js'; +import { fakeAttachment } from '../../test-helpers/fakeAttachment.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/AttachmentDetailPill.tsx b/ts/components/conversation/AttachmentDetailPill.tsx index 065f92e84a..44ec04b507 100644 --- a/ts/components/conversation/AttachmentDetailPill.tsx +++ b/ts/components/conversation/AttachmentDetailPill.tsx @@ -4,12 +4,12 @@ import React from 'react'; import classNames from 'classnames'; -import { formatFileSize } from '../../util/formatFileSize.js'; -import { SpinnerV2 } from '../SpinnerV2.js'; +import { formatFileSize } from '../../util/formatFileSize.std.js'; +import { SpinnerV2 } from '../SpinnerV2.dom.js'; -import type { AttachmentForUIType } from '../../types/Attachment.js'; -import type { LocalizerType } from '../../types/I18N.js'; -import { isKeyboardActivation } from '../../hooks/useKeyboardShortcuts.js'; +import type { AttachmentForUIType } from '../../types/Attachment.std.js'; +import type { LocalizerType } from '../../types/I18N.std.js'; +import { isKeyboardActivation } from '../../hooks/useKeyboardShortcuts.dom.js'; export type PropsType = { attachments: ReadonlyArray; diff --git a/ts/components/conversation/AttachmentList.stories.tsx b/ts/components/conversation/AttachmentList.stories.tsx index 5361f1e28f..f0ed27b2ab 100644 --- a/ts/components/conversation/AttachmentList.stories.tsx +++ b/ts/components/conversation/AttachmentList.stories.tsx @@ -7,17 +7,17 @@ import type { Meta } from '@storybook/react'; import type { AttachmentDraftType, AttachmentForUIType, -} from '../../types/Attachment.js'; -import type { Props } from './AttachmentList.js'; -import { AttachmentList } from './AttachmentList.js'; +} from '../../types/Attachment.std.js'; +import type { Props } from './AttachmentList.dom.js'; +import { AttachmentList } from './AttachmentList.dom.js'; import { AUDIO_MP3, IMAGE_GIF, IMAGE_JPEG, VIDEO_MP4, stringToMIMEType, -} from '../../types/MIME.js'; -import { fakeDraftAttachment } from '../../test-helpers/fakeAttachment.js'; +} from '../../types/MIME.std.js'; +import { fakeDraftAttachment } from '../../test-helpers/fakeAttachment.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/AttachmentList.tsx b/ts/components/conversation/AttachmentList.tsx index 8fd57d2dcf..31483e05d6 100644 --- a/ts/components/conversation/AttachmentList.tsx +++ b/ts/components/conversation/AttachmentList.tsx @@ -3,20 +3,20 @@ import React, { useMemo } from 'react'; -import { CurveType, Image } from './Image.js'; -import { StagedGenericAttachment } from './StagedGenericAttachment.js'; -import { StagedPlaceholderAttachment } from './StagedPlaceholderAttachment.js'; -import type { LocalizerType } from '../../types/Util.js'; +import { CurveType, Image } from './Image.dom.js'; +import { StagedGenericAttachment } from './StagedGenericAttachment.dom.js'; +import { StagedPlaceholderAttachment } from './StagedPlaceholderAttachment.dom.js'; +import type { LocalizerType } from '../../types/Util.std.js'; import type { AttachmentForUIType, AttachmentDraftType, -} from '../../types/Attachment.js'; +} from '../../types/Attachment.std.js'; import { areAllAttachmentsVisual, canDisplayImage, isImageAttachment, isVideoAttachment, -} from '../../util/Attachment.js'; +} from '../../util/Attachment.std.js'; export type Props = Readonly<{ diff --git a/ts/components/conversation/AttachmentStatusIcon.stories.tsx b/ts/components/conversation/AttachmentStatusIcon.stories.tsx index 5a02e7d98d..adbd67714d 100644 --- a/ts/components/conversation/AttachmentStatusIcon.stories.tsx +++ b/ts/components/conversation/AttachmentStatusIcon.stories.tsx @@ -3,9 +3,9 @@ import React, { useCallback, useRef, useState } from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './AttachmentStatusIcon.js'; -import { AttachmentStatusIcon } from './AttachmentStatusIcon.js'; -import { fakeAttachment } from '../../test-helpers/fakeAttachment.js'; +import type { PropsType } from './AttachmentStatusIcon.dom.js'; +import { AttachmentStatusIcon } from './AttachmentStatusIcon.dom.js'; +import { fakeAttachment } from '../../test-helpers/fakeAttachment.std.js'; export default { title: 'Components/Conversation/AttachmentStatusIcon', diff --git a/ts/components/conversation/AttachmentStatusIcon.tsx b/ts/components/conversation/AttachmentStatusIcon.tsx index 33f354a68b..86449d9e5d 100644 --- a/ts/components/conversation/AttachmentStatusIcon.tsx +++ b/ts/components/conversation/AttachmentStatusIcon.tsx @@ -4,11 +4,11 @@ import React, { type ReactNode } from 'react'; import classNames from 'classnames'; -import { SpinnerV2 } from '../SpinnerV2.js'; +import { SpinnerV2 } from '../SpinnerV2.dom.js'; -import type { AttachmentForUIType } from '../../types/Attachment.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; -import { useAttachmentStatus } from '../../hooks/useAttachmentStatus.js'; +import type { AttachmentForUIType } from '../../types/Attachment.std.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; +import { useAttachmentStatus } from '../../hooks/useAttachmentStatus.std.js'; export type PropsType = { attachment: AttachmentForUIType; diff --git a/ts/components/conversation/AudioCapture.tsx b/ts/components/conversation/AudioCapture.tsx index 62d58f78b9..0fb2bc8d78 100644 --- a/ts/components/conversation/AudioCapture.tsx +++ b/ts/components/conversation/AudioCapture.tsx @@ -3,14 +3,14 @@ import React, { useCallback } from 'react'; -import type { ShowToastAction } from '../../state/ducks/toast.js'; -import type { AttachmentDraftType } from '../../types/Attachment.js'; -import type { LocalizerType } from '../../types/Util.js'; -import { ToastType } from '../../types/Toast.js'; +import type { ShowToastAction } from '../../state/ducks/toast.preload.js'; +import type { AttachmentDraftType } from '../../types/Attachment.std.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import { ToastType } from '../../types/Toast.dom.js'; import { useStartRecordingShortcut, useKeyboardShortcuts, -} from '../../hooks/useKeyboardShortcuts.js'; +} from '../../hooks/useKeyboardShortcuts.dom.js'; export type PropsType = { conversationId: string; diff --git a/ts/components/conversation/CallingNotification.stories.tsx b/ts/components/conversation/CallingNotification.stories.tsx index 9d366e4201..e882120b77 100644 --- a/ts/components/conversation/CallingNotification.stories.tsx +++ b/ts/components/conversation/CallingNotification.stories.tsx @@ -10,15 +10,18 @@ import { CallDirection, GroupCallStatus, DirectCallStatus, -} from '../../types/CallDisposition.js'; -import { generateAci } from '../../types/ServiceId.js'; -import { CallingNotification, type PropsType } from './CallingNotification.js'; +} from '../../types/CallDisposition.std.js'; +import { generateAci } from '../../types/ServiceId.std.js'; +import { + CallingNotification, + type PropsType, +} from './CallingNotification.dom.js'; import { getDefaultConversation, getDefaultGroup, -} from '../../test-helpers/getDefaultConversation.js'; -import type { CallStatus } from '../../types/CallDisposition.js'; -import type { ConversationType } from '../../state/ducks/conversations.js'; +} from '../../test-helpers/getDefaultConversation.std.js'; +import type { CallStatus } from '../../types/CallDisposition.std.js'; +import type { ConversationType } from '../../state/ducks/conversations.preload.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/CallingNotification.tsx b/ts/components/conversation/CallingNotification.tsx index a44f0dae97..2fc10944ff 100644 --- a/ts/components/conversation/CallingNotification.tsx +++ b/ts/components/conversation/CallingNotification.tsx @@ -6,39 +6,39 @@ import React from 'react'; import lodash from 'lodash'; import { ContextMenuTrigger } from 'react-contextmenu'; -import { SystemMessage, SystemMessageKind } from './SystemMessage.js'; -import { Button, ButtonSize, ButtonVariant } from '../Button.js'; -import { MessageTimestamp } from './MessageTimestamp.js'; -import type { LocalizerType } from '../../types/Util.js'; +import { SystemMessage, SystemMessageKind } from './SystemMessage.dom.js'; +import { Button, ButtonSize, ButtonVariant } from '../Button.dom.js'; +import { MessageTimestamp } from './MessageTimestamp.dom.js'; +import type { LocalizerType } from '../../types/Util.std.js'; import { CallMode, CallDirection, CallType, DirectCallStatus, GroupCallStatus, -} from '../../types/CallDisposition.js'; -import type { CallingNotificationType } from '../../util/callingNotification.js'; +} from '../../types/CallDisposition.std.js'; +import type { CallingNotificationType } from '../../util/callingNotification.std.js'; import { getCallingIcon, getCallingNotificationText, -} from '../../util/callingNotification.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; -import { Tooltip, TooltipPlacement } from '../Tooltip.js'; -import { createLogger } from '../../logging/log.js'; +} from '../../util/callingNotification.std.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; +import { Tooltip, TooltipPlacement } from '../Tooltip.dom.js'; +import { createLogger } from '../../logging/log.std.js'; import { type ContextMenuTriggerType, MessageContextMenu, useHandleMessageContextMenu, -} from './MessageContextMenu.js'; -import type { DeleteMessagesPropsType } from '../../state/ducks/globalModals.js'; +} from './MessageContextMenu.dom.js'; +import type { DeleteMessagesPropsType } from '../../state/ducks/globalModals.preload.js'; import { useKeyboardShortcutsConditionally, useOpenContextMenu, -} from '../../hooks/useKeyboardShortcuts.js'; -import { MINUTE } from '../../util/durations/index.js'; -import { isMoreRecentThan } from '../../util/timestamp.js'; -import { InAnotherCallTooltip } from './InAnotherCallTooltip.js'; -import type { InteractionModeType } from '../../state/ducks/conversations.js'; +} from '../../hooks/useKeyboardShortcuts.dom.js'; +import { MINUTE } from '../../util/durations/index.std.js'; +import { isMoreRecentThan } from '../../util/timestamp.std.js'; +import { InAnotherCallTooltip } from './InAnotherCallTooltip.dom.js'; +import type { InteractionModeType } from '../../state/ducks/conversations.preload.js'; const { noop } = lodash; diff --git a/ts/components/conversation/ChangeNumberNotification.stories.tsx b/ts/components/conversation/ChangeNumberNotification.stories.tsx index 8313bf0040..5ca67fadd9 100644 --- a/ts/components/conversation/ChangeNumberNotification.stories.tsx +++ b/ts/components/conversation/ChangeNumberNotification.stories.tsx @@ -3,9 +3,9 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; -import type { Props } from './ChangeNumberNotification.js'; -import { ChangeNumberNotification } from './ChangeNumberNotification.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.std.js'; +import type { Props } from './ChangeNumberNotification.dom.js'; +import { ChangeNumberNotification } from './ChangeNumberNotification.dom.js'; export default { title: 'Components/Conversation/ChangeNumberNotification', diff --git a/ts/components/conversation/ChangeNumberNotification.tsx b/ts/components/conversation/ChangeNumberNotification.tsx index a845e2cd19..16e883e3ab 100644 --- a/ts/components/conversation/ChangeNumberNotification.tsx +++ b/ts/components/conversation/ChangeNumberNotification.tsx @@ -3,13 +3,13 @@ import React from 'react'; -import type { ConversationType } from '../../state/ducks/conversations.js'; -import type { LocalizerType } from '../../types/Util.js'; -import { I18n } from '../I18n.js'; +import type { ConversationType } from '../../state/ducks/conversations.preload.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import { I18n } from '../I18n.dom.js'; -import { SystemMessage } from './SystemMessage.js'; -import { MessageTimestamp } from './MessageTimestamp.js'; -import { UserText } from '../UserText.js'; +import { SystemMessage } from './SystemMessage.dom.js'; +import { MessageTimestamp } from './MessageTimestamp.dom.js'; +import { UserText } from '../UserText.dom.js'; export type PropsData = { sender: ConversationType; diff --git a/ts/components/conversation/ChatSessionRefreshedDialog.stories.tsx b/ts/components/conversation/ChatSessionRefreshedDialog.stories.tsx index 86e4b75287..68e6dfad49 100644 --- a/ts/components/conversation/ChatSessionRefreshedDialog.stories.tsx +++ b/ts/components/conversation/ChatSessionRefreshedDialog.stories.tsx @@ -4,8 +4,8 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './ChatSessionRefreshedDialog.js'; -import { ChatSessionRefreshedDialog } from './ChatSessionRefreshedDialog.js'; +import type { PropsType } from './ChatSessionRefreshedDialog.dom.js'; +import { ChatSessionRefreshedDialog } from './ChatSessionRefreshedDialog.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/ChatSessionRefreshedDialog.tsx b/ts/components/conversation/ChatSessionRefreshedDialog.tsx index e3bf51e2cc..2dc98317c0 100644 --- a/ts/components/conversation/ChatSessionRefreshedDialog.tsx +++ b/ts/components/conversation/ChatSessionRefreshedDialog.tsx @@ -3,12 +3,12 @@ import * as React from 'react'; -import { Modal } from '../Modal.js'; +import { Modal } from '../Modal.dom.js'; -import { useRestoreFocus } from '../../hooks/useRestoreFocus.js'; +import { useRestoreFocus } from '../../hooks/useRestoreFocus.dom.js'; -import type { LocalizerType } from '../../types/Util.js'; -import { Button, ButtonSize, ButtonVariant } from '../Button.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import { Button, ButtonSize, ButtonVariant } from '../Button.dom.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/conversation/ChatSessionRefreshedNotification.stories.tsx b/ts/components/conversation/ChatSessionRefreshedNotification.stories.tsx index 654a395fd9..701fd61607 100644 --- a/ts/components/conversation/ChatSessionRefreshedNotification.stories.tsx +++ b/ts/components/conversation/ChatSessionRefreshedNotification.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './ChatSessionRefreshedNotification.js'; -import { ChatSessionRefreshedNotification } from './ChatSessionRefreshedNotification.js'; +import type { PropsType } from './ChatSessionRefreshedNotification.dom.js'; +import { ChatSessionRefreshedNotification } from './ChatSessionRefreshedNotification.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/ChatSessionRefreshedNotification.tsx b/ts/components/conversation/ChatSessionRefreshedNotification.tsx index 41cbd4f561..8f88bed000 100644 --- a/ts/components/conversation/ChatSessionRefreshedNotification.tsx +++ b/ts/components/conversation/ChatSessionRefreshedNotification.tsx @@ -4,12 +4,12 @@ import type { ReactElement } from 'react'; import React, { useCallback, useState } from 'react'; -import type { LocalizerType } from '../../types/Util.js'; +import type { LocalizerType } from '../../types/Util.std.js'; -import { Button, ButtonSize, ButtonVariant } from '../Button.js'; -import { SystemMessage } from './SystemMessage.js'; -import { ChatSessionRefreshedDialog } from './ChatSessionRefreshedDialog.js'; -import { openLinkInWebBrowser } from '../../util/openLinkInWebBrowser.js'; +import { Button, ButtonSize, ButtonVariant } from '../Button.dom.js'; +import { SystemMessage } from './SystemMessage.dom.js'; +import { ChatSessionRefreshedDialog } from './ChatSessionRefreshedDialog.dom.js'; +import { openLinkInWebBrowser } from '../../util/openLinkInWebBrowser.dom.js'; type PropsHousekeepingType = { i18n: LocalizerType; diff --git a/ts/components/conversation/ContactDetail.stories.tsx b/ts/components/conversation/ContactDetail.stories.tsx index cd67e63da5..66ab8e6c24 100644 --- a/ts/components/conversation/ContactDetail.stories.tsx +++ b/ts/components/conversation/ContactDetail.stories.tsx @@ -4,11 +4,14 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './ContactDetail.js'; -import { ContactDetail } from './ContactDetail.js'; -import { AddressType, ContactFormType } from '../../types/EmbeddedContact.js'; -import { IMAGE_GIF } from '../../types/MIME.js'; -import { fakeAttachment } from '../../test-helpers/fakeAttachment.js'; +import type { Props } from './ContactDetail.dom.js'; +import { ContactDetail } from './ContactDetail.dom.js'; +import { + AddressType, + ContactFormType, +} from '../../types/EmbeddedContact.std.js'; +import { IMAGE_GIF } from '../../types/MIME.std.js'; +import { fakeAttachment } from '../../test-helpers/fakeAttachment.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/ContactDetail.tsx b/ts/components/conversation/ContactDetail.tsx index 2d6d2d10b8..51f9c70a3a 100644 --- a/ts/components/conversation/ContactDetail.tsx +++ b/ts/components/conversation/ContactDetail.tsx @@ -6,21 +6,24 @@ import classNames from 'classnames'; import type { ReadonlyDeep } from 'type-fest'; -import { AddressType, ContactFormType } from '../../types/EmbeddedContact.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; +import { + AddressType, + ContactFormType, +} from '../../types/EmbeddedContact.std.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; import { renderAvatar, renderContactShorthand, renderName, -} from './contactUtil.js'; +} from './contactUtil.dom.js'; import type { EmbeddedContactForUIType, Email, Phone, PostalAddress, -} from '../../types/EmbeddedContact.js'; -import type { LocalizerType } from '../../types/Util.js'; +} from '../../types/EmbeddedContact.std.js'; +import type { LocalizerType } from '../../types/Util.std.js'; export type Props = { cancelAttachmentDownload: (options: { messageId: string }) => void; diff --git a/ts/components/conversation/ContactModal.stories.tsx b/ts/components/conversation/ContactModal.stories.tsx index ba99a675bb..0f17b0e0f3 100644 --- a/ts/components/conversation/ContactModal.stories.tsx +++ b/ts/components/conversation/ContactModal.stories.tsx @@ -5,13 +5,13 @@ import type { Meta, StoryFn } from '@storybook/react'; import * as React from 'react'; import casual from 'casual'; import { action } from '@storybook/addon-actions'; -import type { ConversationType } from '../../state/ducks/conversations.js'; -import type { PropsType } from './ContactModal.js'; -import { ContactModal } from './ContactModal.js'; -import { HasStories } from '../../types/Stories.js'; -import { ThemeType } from '../../types/Util.js'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; -import { getFakeBadges } from '../../test-helpers/getFakeBadge.js'; +import type { ConversationType } from '../../state/ducks/conversations.preload.js'; +import type { PropsType } from './ContactModal.dom.js'; +import { ContactModal } from './ContactModal.dom.js'; +import { HasStories } from '../../types/Stories.std.js'; +import { ThemeType } from '../../types/Util.std.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.std.js'; +import { getFakeBadges } from '../../test-helpers/getFakeBadge.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/ContactModal.tsx b/ts/components/conversation/ContactModal.tsx index 9fba657d79..eca7afbf76 100644 --- a/ts/components/conversation/ContactModal.tsx +++ b/ts/components/conversation/ContactModal.tsx @@ -7,30 +7,30 @@ import type { ReactNode } from 'react'; import type { ConversationType, ShowConversationType, -} from '../../state/ducks/conversations.js'; -import type { BadgeType } from '../../badges/types.js'; -import type { HasStories } from '../../types/Stories.js'; -import type { LocalizerType, ThemeType } from '../../types/Util.js'; -import type { ViewUserStoriesActionCreatorType } from '../../state/ducks/stories.js'; -import { StoryViewModeType } from '../../types/Stories.js'; -import { createLogger } from '../../logging/log.js'; -import { Avatar, AvatarBlur, AvatarSize } from '../Avatar.js'; -import { AvatarLightbox } from '../AvatarLightbox.js'; -import { BadgeDialog } from '../BadgeDialog.js'; -import { ConfirmationDialog } from '../ConfirmationDialog.js'; -import { Modal } from '../Modal.js'; -import { RemoveGroupMemberConfirmationDialog } from './RemoveGroupMemberConfirmationDialog.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; -import { UserText } from '../UserText.js'; -import { Button, ButtonIconType, ButtonVariant } from '../Button.js'; -import { isInSystemContacts } from '../../util/isInSystemContacts.js'; -import { InContactsIcon } from '../InContactsIcon.js'; -import { canHaveNicknameAndNote } from '../../util/nicknames.js'; -import { getThemeByThemeType } from '../../util/theme.js'; +} from '../../state/ducks/conversations.preload.js'; +import type { BadgeType } from '../../badges/types.std.js'; +import type { HasStories } from '../../types/Stories.std.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.std.js'; +import type { ViewUserStoriesActionCreatorType } from '../../state/ducks/stories.preload.js'; +import { StoryViewModeType } from '../../types/Stories.std.js'; +import { createLogger } from '../../logging/log.std.js'; +import { Avatar, AvatarBlur, AvatarSize } from '../Avatar.dom.js'; +import { AvatarLightbox } from '../AvatarLightbox.dom.js'; +import { BadgeDialog } from '../BadgeDialog.dom.js'; +import { ConfirmationDialog } from '../ConfirmationDialog.dom.js'; +import { Modal } from '../Modal.dom.js'; +import { RemoveGroupMemberConfirmationDialog } from './RemoveGroupMemberConfirmationDialog.dom.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; +import { UserText } from '../UserText.dom.js'; +import { Button, ButtonIconType, ButtonVariant } from '../Button.dom.js'; +import { isInSystemContacts } from '../../util/isInSystemContacts.std.js'; +import { InContactsIcon } from '../InContactsIcon.dom.js'; +import { canHaveNicknameAndNote } from '../../util/nicknames.dom.js'; +import { getThemeByThemeType } from '../../util/theme.std.js'; import { InAnotherCallTooltip, getTooltipContent, -} from './InAnotherCallTooltip.js'; +} from './InAnotherCallTooltip.dom.js'; const log = createLogger('ContactModal'); diff --git a/ts/components/conversation/ContactName.stories.tsx b/ts/components/conversation/ContactName.stories.tsx index 64c425ad97..b32d004dcb 100644 --- a/ts/components/conversation/ContactName.stories.tsx +++ b/ts/components/conversation/ContactName.stories.tsx @@ -3,9 +3,9 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './ContactName.js'; -import { ContactName } from './ContactName.js'; -import { ContactNameColors } from '../../types/Colors.js'; +import type { PropsType } from './ContactName.dom.js'; +import { ContactName } from './ContactName.dom.js'; +import { ContactNameColors } from '../../types/Colors.std.js'; export default { title: 'Components/Conversation/ContactName', diff --git a/ts/components/conversation/ContactName.tsx b/ts/components/conversation/ContactName.tsx index 31fb70d3f2..77633f0d3b 100644 --- a/ts/components/conversation/ContactName.tsx +++ b/ts/components/conversation/ContactName.tsx @@ -4,11 +4,11 @@ import React, { useMemo } from 'react'; import classNames from 'classnames'; -import { Emojify } from './Emojify.js'; -import type { ContactNameColorType } from '../../types/Colors.js'; -import { getClassNamesFor } from '../../util/getClassNamesFor.js'; -import type { ConversationType } from '../../state/ducks/conversations.js'; -import { isSignalConversation as getIsSignalConversation } from '../../util/isSignalConversation.js'; +import { Emojify } from './Emojify.dom.js'; +import type { ContactNameColorType } from '../../types/Colors.std.js'; +import { getClassNamesFor } from '../../util/getClassNamesFor.std.js'; +import type { ConversationType } from '../../state/ducks/conversations.preload.js'; +import { isSignalConversation as getIsSignalConversation } from '../../util/isSignalConversation.dom.js'; export type ContactNameData = { contactNameColor?: ContactNameColorType; diff --git a/ts/components/conversation/ContactSpoofingReviewDialog.stories.tsx b/ts/components/conversation/ContactSpoofingReviewDialog.stories.tsx index 7b1192ccc1..32aa4f3d7b 100644 --- a/ts/components/conversation/ContactSpoofingReviewDialog.stories.tsx +++ b/ts/components/conversation/ContactSpoofingReviewDialog.stories.tsx @@ -5,11 +5,11 @@ import React from 'react'; import lodash from 'lodash'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; -import type { PropsType } from './ContactSpoofingReviewDialog.js'; -import { ContactSpoofingReviewDialog } from './ContactSpoofingReviewDialog.js'; -import { ContactSpoofingType } from '../../util/contactSpoofing.js'; -import { ThemeType } from '../../types/Util.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.std.js'; +import type { PropsType } from './ContactSpoofingReviewDialog.dom.js'; +import { ContactSpoofingReviewDialog } from './ContactSpoofingReviewDialog.dom.js'; +import { ContactSpoofingType } from '../../util/contactSpoofing.std.js'; +import { ThemeType } from '../../types/Util.std.js'; const { times } = lodash; diff --git a/ts/components/conversation/ContactSpoofingReviewDialog.tsx b/ts/components/conversation/ContactSpoofingReviewDialog.tsx index 785ead1a9a..6e3907d4ba 100644 --- a/ts/components/conversation/ContactSpoofingReviewDialog.tsx +++ b/ts/components/conversation/ContactSpoofingReviewDialog.tsx @@ -4,22 +4,22 @@ import type { ReactChild, ReactNode } from 'react'; import React, { useState } from 'react'; -import type { LocalizerType, ThemeType } from '../../types/Util.js'; -import type { ConversationType } from '../../state/ducks/conversations.js'; -import type { PreferredBadgeSelectorType } from '../../state/selectors/badges.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.std.js'; +import type { ConversationType } from '../../state/ducks/conversations.preload.js'; +import type { PreferredBadgeSelectorType } from '../../state/selectors/badges.preload.js'; import { MessageRequestActionsConfirmation, MessageRequestState, -} from './MessageRequestActionsConfirmation.js'; -import { ContactSpoofingType } from '../../util/contactSpoofing.js'; +} from './MessageRequestActionsConfirmation.dom.js'; +import { ContactSpoofingType } from '../../util/contactSpoofing.std.js'; -import { Modal } from '../Modal.js'; -import { RemoveGroupMemberConfirmationDialog } from './RemoveGroupMemberConfirmationDialog.js'; -import { ContactSpoofingReviewDialogPerson } from './ContactSpoofingReviewDialogPerson.js'; -import { Button, ButtonVariant } from '../Button.js'; -import { assertDev } from '../../util/assert.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; -import { isInSystemContacts } from '../../util/isInSystemContacts.js'; +import { Modal } from '../Modal.dom.js'; +import { RemoveGroupMemberConfirmationDialog } from './RemoveGroupMemberConfirmationDialog.dom.js'; +import { ContactSpoofingReviewDialogPerson } from './ContactSpoofingReviewDialogPerson.dom.js'; +import { Button, ButtonVariant } from '../Button.dom.js'; +import { assertDev } from '../../util/assert.std.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; +import { isInSystemContacts } from '../../util/isInSystemContacts.std.js'; export type ReviewPropsType = Readonly< | { diff --git a/ts/components/conversation/ContactSpoofingReviewDialogPerson.stories.tsx b/ts/components/conversation/ContactSpoofingReviewDialogPerson.stories.tsx index 24e7c9de4e..db46a8a027 100644 --- a/ts/components/conversation/ContactSpoofingReviewDialogPerson.stories.tsx +++ b/ts/components/conversation/ContactSpoofingReviewDialogPerson.stories.tsx @@ -5,11 +5,11 @@ import React from 'react'; import type { Meta, StoryFn } from '@storybook/react'; import { action } from '@storybook/addon-actions'; -import { ThemeType } from '../../types/Util.js'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; +import { ThemeType } from '../../types/Util.std.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.std.js'; -import type { PropsType } from './ContactSpoofingReviewDialogPerson.js'; -import { ContactSpoofingReviewDialogPerson } from './ContactSpoofingReviewDialogPerson.js'; +import type { PropsType } from './ContactSpoofingReviewDialogPerson.dom.js'; +import { ContactSpoofingReviewDialogPerson } from './ContactSpoofingReviewDialogPerson.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/ContactSpoofingReviewDialogPerson.tsx b/ts/components/conversation/ContactSpoofingReviewDialogPerson.tsx index ad4b64fc44..4ada2c468a 100644 --- a/ts/components/conversation/ContactSpoofingReviewDialogPerson.tsx +++ b/ts/components/conversation/ContactSpoofingReviewDialogPerson.tsx @@ -4,16 +4,16 @@ import type { ReactNode } from 'react'; import React, { useEffect } from 'react'; -import type { ConversationType } from '../../state/ducks/conversations.js'; -import type { LocalizerType, ThemeType } from '../../types/Util.js'; -import type { PreferredBadgeSelectorType } from '../../state/selectors/badges.js'; -import { assertDev } from '../../util/assert.js'; +import type { ConversationType } from '../../state/ducks/conversations.preload.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.std.js'; +import type { PreferredBadgeSelectorType } from '../../state/selectors/badges.preload.js'; +import { assertDev } from '../../util/assert.std.js'; -import { Avatar, AvatarSize } from '../Avatar.js'; -import { ContactName } from './ContactName.js'; -import { SharedGroupNames } from '../SharedGroupNames.js'; -import { UserText } from '../UserText.js'; -import { I18n } from '../I18n.js'; +import { Avatar, AvatarSize } from '../Avatar.dom.js'; +import { ContactName } from './ContactName.dom.js'; +import { SharedGroupNames } from '../SharedGroupNames.dom.js'; +import { UserText } from '../UserText.dom.js'; +import { I18n } from '../I18n.dom.js'; export type PropsType = Readonly<{ children?: ReactNode; diff --git a/ts/components/conversation/ConversationHeader.stories.tsx b/ts/components/conversation/ConversationHeader.stories.tsx index 88d9628919..6ee499bfc3 100644 --- a/ts/components/conversation/ConversationHeader.stories.tsx +++ b/ts/components/conversation/ConversationHeader.stories.tsx @@ -8,17 +8,17 @@ import type { Meta } from '@storybook/react'; import { getDefaultConversation, getDefaultGroup, -} from '../../test-helpers/getDefaultConversation.js'; -import { getRandomColor } from '../../test-helpers/getRandomColor.js'; -import { DurationInSeconds } from '../../util/durations/index.js'; +} from '../../test-helpers/getDefaultConversation.std.js'; +import { getRandomColor } from '../../test-helpers/getRandomColor.std.js'; +import { DurationInSeconds } from '../../util/durations/index.std.js'; import { StorybookThemeContext } from '../../../.storybook/StorybookThemeContext.js'; -import type { PropsType } from './ConversationHeader.js'; +import type { PropsType } from './ConversationHeader.dom.js'; import { ConversationHeader, OutgoingCallButtonStyle, -} from './ConversationHeader.js'; -import { gifUrl } from '../../storybook/Fixtures.js'; -import { ThemeType } from '../../types/Util.js'; +} from './ConversationHeader.dom.js'; +import { gifUrl } from '../../storybook/Fixtures.std.js'; +import { ThemeType } from '../../types/Util.std.js'; export default { title: 'Components/Conversation/ConversationHeader', diff --git a/ts/components/conversation/ConversationHeader.tsx b/ts/components/conversation/ConversationHeader.tsx index c140f84eae..a7283afc91 100644 --- a/ts/components/conversation/ConversationHeader.tsx +++ b/ts/components/conversation/ConversationHeader.tsx @@ -11,35 +11,35 @@ import { SubMenu, } from 'react-contextmenu'; import { createPortal } from 'react-dom'; -import type { BadgeType } from '../../badges/types.js'; +import type { BadgeType } from '../../badges/types.std.js'; import { useKeyboardShortcuts, useStartCallShortcuts, -} from '../../hooks/useKeyboardShortcuts.js'; -import { SizeObserver } from '../../hooks/useSizeObserver.js'; -import type { ConversationTypeType } from '../../state/ducks/conversations.js'; -import type { HasStories } from '../../types/Stories.js'; -import type { LocalizerType, ThemeType } from '../../types/Util.js'; -import { DurationInSeconds } from '../../util/durations/index.js'; -import * as expirationTimer from '../../util/expirationTimer.js'; -import { getMuteOptions } from '../../util/getMuteOptions.js'; -import { isConversationMuted } from '../../util/isConversationMuted.js'; -import { isInSystemContacts } from '../../util/isInSystemContacts.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; -import { Alert } from '../Alert.js'; -import { Avatar, AvatarSize } from '../Avatar.js'; -import { ConfirmationDialog } from '../ConfirmationDialog.js'; -import { DisappearingTimeDialog } from '../DisappearingTimeDialog.js'; -import { InContactsIcon } from '../InContactsIcon.js'; -import { UserText } from '../UserText.js'; -import type { ContactNameData } from './ContactName.js'; +} from '../../hooks/useKeyboardShortcuts.dom.js'; +import { SizeObserver } from '../../hooks/useSizeObserver.dom.js'; +import type { ConversationTypeType } from '../../state/ducks/conversations.preload.js'; +import type { HasStories } from '../../types/Stories.std.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.std.js'; +import { DurationInSeconds } from '../../util/durations/index.std.js'; +import * as expirationTimer from '../../util/expirationTimer.std.js'; +import { getMuteOptions } from '../../util/getMuteOptions.std.js'; +import { isConversationMuted } from '../../util/isConversationMuted.std.js'; +import { isInSystemContacts } from '../../util/isInSystemContacts.std.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; +import { Alert } from '../Alert.dom.js'; +import { Avatar, AvatarSize } from '../Avatar.dom.js'; +import { ConfirmationDialog } from '../ConfirmationDialog.dom.js'; +import { DisappearingTimeDialog } from '../DisappearingTimeDialog.dom.js'; +import { InContactsIcon } from '../InContactsIcon.dom.js'; +import { UserText } from '../UserText.dom.js'; +import type { ContactNameData } from './ContactName.dom.js'; import { MessageRequestActionsConfirmation, MessageRequestState, -} from './MessageRequestActionsConfirmation.js'; -import type { MinimalConversation } from '../../hooks/useMinimalConversation.js'; -import { InAnotherCallTooltip } from './InAnotherCallTooltip.js'; -import { DeleteMessagesConfirmationDialog } from '../DeleteMessagesConfirmationDialog.js'; +} from './MessageRequestActionsConfirmation.dom.js'; +import type { MinimalConversation } from '../../hooks/useMinimalConversation.std.js'; +import { InAnotherCallTooltip } from './InAnotherCallTooltip.dom.js'; +import { DeleteMessagesConfirmationDialog } from '../DeleteMessagesConfirmationDialog.dom.js'; function HeaderInfoTitle({ name, diff --git a/ts/components/conversation/ConversationHero.stories.tsx b/ts/components/conversation/ConversationHero.stories.tsx index c20f4ab992..ad02ce421e 100644 --- a/ts/components/conversation/ConversationHero.stories.tsx +++ b/ts/components/conversation/ConversationHero.stories.tsx @@ -5,13 +5,13 @@ import type { Meta, StoryFn } from '@storybook/react'; import React, { useContext } from 'react'; import casual from 'casual'; import { action } from '@storybook/addon-actions'; -import type { Props } from './ConversationHero.js'; -import { ConversationHero } from './ConversationHero.js'; -import { HasStories } from '../../types/Stories.js'; +import type { Props } from './ConversationHero.dom.js'; +import { ConversationHero } from './ConversationHero.dom.js'; +import { HasStories } from '../../types/Stories.std.js'; import { StorybookThemeContext } from '../../../.storybook/StorybookThemeContext.js'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; -import { ThemeType } from '../../types/Util.js'; -import type { GroupV2Membership } from './conversation-details/ConversationDetailsMembershipList.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.std.js'; +import { ThemeType } from '../../types/Util.std.js'; +import type { GroupV2Membership } from './conversation-details/ConversationDetailsMembershipList.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/ConversationHero.tsx b/ts/components/conversation/ConversationHero.tsx index 3500e4091d..b70d31b709 100644 --- a/ts/components/conversation/ConversationHero.tsx +++ b/ts/components/conversation/ConversationHero.tsx @@ -3,21 +3,21 @@ import React, { type ReactNode, useEffect, useState } from 'react'; import classNames from 'classnames'; -import type { Props as AvatarProps } from '../Avatar.js'; -import { Avatar, AvatarSize, AvatarBlur } from '../Avatar.js'; -import { ContactName } from './ContactName.js'; -import { About } from './About.js'; -import { GroupDescription } from './GroupDescription.js'; -import { SharedGroupNames } from '../SharedGroupNames.js'; -import { GroupMembersNames } from '../GroupMembersNames.js'; -import type { LocalizerType, ThemeType } from '../../types/Util.js'; -import type { HasStories } from '../../types/Stories.js'; -import type { ViewUserStoriesActionCreatorType } from '../../state/ducks/stories.js'; -import type { GroupV2Membership } from './conversation-details/ConversationDetailsMembershipList.js'; -import { StoryViewModeType } from '../../types/Stories.js'; -import { Button, ButtonVariant } from '../Button.js'; -import { SafetyTipsModal } from '../SafetyTipsModal.js'; -import { I18n } from '../I18n.js'; +import type { Props as AvatarProps } from '../Avatar.dom.js'; +import { Avatar, AvatarSize, AvatarBlur } from '../Avatar.dom.js'; +import { ContactName } from './ContactName.dom.js'; +import { About } from './About.dom.js'; +import { GroupDescription } from './GroupDescription.dom.js'; +import { SharedGroupNames } from '../SharedGroupNames.dom.js'; +import { GroupMembersNames } from '../GroupMembersNames.dom.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.std.js'; +import type { HasStories } from '../../types/Stories.std.js'; +import type { ViewUserStoriesActionCreatorType } from '../../state/ducks/stories.preload.js'; +import type { GroupV2Membership } from './conversation-details/ConversationDetailsMembershipList.dom.js'; +import { StoryViewModeType } from '../../types/Stories.std.js'; +import { Button, ButtonVariant } from '../Button.dom.js'; +import { SafetyTipsModal } from '../SafetyTipsModal.dom.js'; +import { I18n } from '../I18n.dom.js'; export type Props = { about?: string; diff --git a/ts/components/conversation/ConversationMergeNotification.stories.tsx b/ts/components/conversation/ConversationMergeNotification.stories.tsx index 6d21e719be..f1cd29e796 100644 --- a/ts/components/conversation/ConversationMergeNotification.stories.tsx +++ b/ts/components/conversation/ConversationMergeNotification.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './ConversationMergeNotification.js'; -import { ConversationMergeNotification } from './ConversationMergeNotification.js'; +import type { PropsType } from './ConversationMergeNotification.dom.js'; +import { ConversationMergeNotification } from './ConversationMergeNotification.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/ConversationMergeNotification.tsx b/ts/components/conversation/ConversationMergeNotification.tsx index 1bcc7cebc0..437f3e8a37 100644 --- a/ts/components/conversation/ConversationMergeNotification.tsx +++ b/ts/components/conversation/ConversationMergeNotification.tsx @@ -3,13 +3,13 @@ import React from 'react'; -import type { LocalizerType } from '../../types/Util.js'; -import { getStringForConversationMerge } from '../../util/getStringForConversationMerge.js'; -import { Button, ButtonSize, ButtonVariant } from '../Button.js'; -import { SystemMessage } from './SystemMessage.js'; -import { Emojify } from './Emojify.js'; -import { Modal } from '../Modal.js'; -import { I18n } from '../I18n.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import { getStringForConversationMerge } from '../../util/getStringForConversationMerge.std.js'; +import { Button, ButtonSize, ButtonVariant } from '../Button.dom.js'; +import { SystemMessage } from './SystemMessage.dom.js'; +import { Emojify } from './Emojify.dom.js'; +import { Modal } from '../Modal.dom.js'; +import { I18n } from '../I18n.dom.js'; export type PropsDataType = { conversationTitle: string; diff --git a/ts/components/conversation/ConversationView.tsx b/ts/components/conversation/ConversationView.tsx index 4570090565..bac58bb4c2 100644 --- a/ts/components/conversation/ConversationView.tsx +++ b/ts/components/conversation/ConversationView.tsx @@ -3,9 +3,9 @@ import React from 'react'; import classNames from 'classnames'; -import { useEscapeHandling } from '../../hooks/useEscapeHandling.js'; -import { getSuggestedFilename } from '../../util/Attachment.js'; -import { IMAGE_PNG, type MIMEType } from '../../types/MIME.js'; +import { useEscapeHandling } from '../../hooks/useEscapeHandling.dom.js'; +import { getSuggestedFilename } from '../../util/Attachment.std.js'; +import { IMAGE_PNG, type MIMEType } from '../../types/MIME.std.js'; export type PropsType = { conversationId: string; diff --git a/ts/components/conversation/DeliveryIssueDialog.stories.tsx b/ts/components/conversation/DeliveryIssueDialog.stories.tsx index a9f0fa65aa..46a8caa0a3 100644 --- a/ts/components/conversation/DeliveryIssueDialog.stories.tsx +++ b/ts/components/conversation/DeliveryIssueDialog.stories.tsx @@ -4,9 +4,9 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './DeliveryIssueDialog.js'; -import { DeliveryIssueDialog } from './DeliveryIssueDialog.js'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; +import type { PropsType } from './DeliveryIssueDialog.dom.js'; +import { DeliveryIssueDialog } from './DeliveryIssueDialog.dom.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.std.js'; const { i18n } = window.SignalContext; const sender = getDefaultConversation(); diff --git a/ts/components/conversation/DeliveryIssueDialog.tsx b/ts/components/conversation/DeliveryIssueDialog.tsx index 6bbad43e8f..17fc41f0bf 100644 --- a/ts/components/conversation/DeliveryIssueDialog.tsx +++ b/ts/components/conversation/DeliveryIssueDialog.tsx @@ -3,16 +3,16 @@ import * as React from 'react'; -import { Button, ButtonSize, ButtonVariant } from '../Button.js'; -import type { ConversationType } from '../../state/ducks/conversations.js'; -import { Modal } from '../Modal.js'; -import { I18n } from '../I18n.js'; -import { Emojify } from './Emojify.js'; +import { Button, ButtonSize, ButtonVariant } from '../Button.dom.js'; +import type { ConversationType } from '../../state/ducks/conversations.preload.js'; +import { Modal } from '../Modal.dom.js'; +import { I18n } from '../I18n.dom.js'; +import { Emojify } from './Emojify.dom.js'; -import { useRestoreFocus } from '../../hooks/useRestoreFocus.js'; +import { useRestoreFocus } from '../../hooks/useRestoreFocus.dom.js'; -import type { LocalizerType } from '../../types/Util.js'; -import { openLinkInWebBrowser } from '../../util/openLinkInWebBrowser.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import { openLinkInWebBrowser } from '../../util/openLinkInWebBrowser.dom.js'; export type PropsType = { i18n: LocalizerType; diff --git a/ts/components/conversation/DeliveryIssueNotification.stories.tsx b/ts/components/conversation/DeliveryIssueNotification.stories.tsx index aface52e95..1bad6e4bd9 100644 --- a/ts/components/conversation/DeliveryIssueNotification.stories.tsx +++ b/ts/components/conversation/DeliveryIssueNotification.stories.tsx @@ -3,9 +3,9 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './DeliveryIssueNotification.js'; -import { DeliveryIssueNotification } from './DeliveryIssueNotification.js'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; +import type { PropsType } from './DeliveryIssueNotification.dom.js'; +import { DeliveryIssueNotification } from './DeliveryIssueNotification.dom.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.std.js'; export default { title: 'Components/Conversation/DeliveryIssueNotification', diff --git a/ts/components/conversation/DeliveryIssueNotification.tsx b/ts/components/conversation/DeliveryIssueNotification.tsx index 8062e0d2a2..f351808c8b 100644 --- a/ts/components/conversation/DeliveryIssueNotification.tsx +++ b/ts/components/conversation/DeliveryIssueNotification.tsx @@ -4,14 +4,14 @@ import type { ReactElement } from 'react'; import React, { useCallback, useState } from 'react'; -import { Button, ButtonSize, ButtonVariant } from '../Button.js'; -import { SystemMessage } from './SystemMessage.js'; -import type { ConversationType } from '../../state/ducks/conversations.js'; -import type { LocalizerType } from '../../types/Util.js'; -import { I18n } from '../I18n.js'; +import { Button, ButtonSize, ButtonVariant } from '../Button.dom.js'; +import { SystemMessage } from './SystemMessage.dom.js'; +import type { ConversationType } from '../../state/ducks/conversations.preload.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import { I18n } from '../I18n.dom.js'; -import { DeliveryIssueDialog } from './DeliveryIssueDialog.js'; -import { UserText } from '../UserText.js'; +import { DeliveryIssueDialog } from './DeliveryIssueDialog.dom.js'; +import { UserText } from '../UserText.dom.js'; export type PropsDataType = { sender?: ConversationType; diff --git a/ts/components/conversation/DonationsOfflineTooltip.tsx b/ts/components/conversation/DonationsOfflineTooltip.tsx index a3aa91ab6f..8f328cc665 100644 --- a/ts/components/conversation/DonationsOfflineTooltip.tsx +++ b/ts/components/conversation/DonationsOfflineTooltip.tsx @@ -3,10 +3,10 @@ import React from 'react'; -import { offsetDistanceModifier } from '../../util/popperUtil.js'; -import { Tooltip, TooltipPlacement } from '../Tooltip.js'; +import { offsetDistanceModifier } from '../../util/popperUtil.std.js'; +import { Tooltip, TooltipPlacement } from '../Tooltip.dom.js'; -import type { LocalizerType } from '../../types/I18N.js'; +import type { LocalizerType } from '../../types/I18N.std.js'; type Props = { i18n: LocalizerType; diff --git a/ts/components/conversation/EmbeddedContact.tsx b/ts/components/conversation/EmbeddedContact.tsx index 69d3f7c210..836f79dbc7 100644 --- a/ts/components/conversation/EmbeddedContact.tsx +++ b/ts/components/conversation/EmbeddedContact.tsx @@ -5,14 +5,14 @@ import React from 'react'; import classNames from 'classnames'; import type { ReadonlyDeep } from 'type-fest'; -import type { EmbeddedContactForUIType } from '../../types/EmbeddedContact.js'; +import type { EmbeddedContactForUIType } from '../../types/EmbeddedContact.std.js'; -import type { LocalizerType } from '../../types/Util.js'; +import type { LocalizerType } from '../../types/Util.std.js'; import { renderAvatar, renderContactShorthand, renderName, -} from './contactUtil.js'; +} from './contactUtil.dom.js'; export type Props = { contact: ReadonlyDeep; diff --git a/ts/components/conversation/Emojify.stories.tsx b/ts/components/conversation/Emojify.stories.tsx index 7a4d28d0ae..1e1f7470c5 100644 --- a/ts/components/conversation/Emojify.stories.tsx +++ b/ts/components/conversation/Emojify.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './Emojify.js'; -import { Emojify } from './Emojify.js'; +import type { Props } from './Emojify.dom.js'; +import { Emojify } from './Emojify.dom.js'; export default { title: 'Components/Conversation/Emojify', diff --git a/ts/components/conversation/Emojify.tsx b/ts/components/conversation/Emojify.tsx index 25a3097275..e0bfdafa6f 100644 --- a/ts/components/conversation/Emojify.tsx +++ b/ts/components/conversation/Emojify.tsx @@ -1,18 +1,18 @@ // Copyright 2018 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import type { RenderTextCallbackType } from '../../types/Util.js'; -import { splitByEmoji } from '../../util/emoji.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; -import { FunInlineEmoji } from '../fun/FunEmoji.js'; +import type { RenderTextCallbackType } from '../../types/Util.std.js'; +import { splitByEmoji } from '../../util/emoji.std.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; +import { FunInlineEmoji } from '../fun/FunEmoji.dom.js'; import { getEmojiVariantByKey, getEmojiVariantKeyByValue, isEmojiVariantValue, isEmojiVariantValueNonQualified, -} from '../fun/data/emojis.js'; -import { createLogger } from '../../logging/log.js'; -import { useFunEmojiLocalizer } from '../fun/useFunEmojiLocalizer.js'; +} from '../fun/data/emojis.std.js'; +import { createLogger } from '../../logging/log.std.js'; +import { useFunEmojiLocalizer } from '../fun/useFunEmojiLocalizer.dom.js'; const log = createLogger('Emojify'); diff --git a/ts/components/conversation/ErrorBoundary.stories.tsx b/ts/components/conversation/ErrorBoundary.stories.tsx index 2f466bb0b5..3587a5f34c 100644 --- a/ts/components/conversation/ErrorBoundary.stories.tsx +++ b/ts/components/conversation/ErrorBoundary.stories.tsx @@ -4,8 +4,8 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './ErrorBoundary.js'; -import { ErrorBoundary } from './ErrorBoundary.js'; +import type { Props } from './ErrorBoundary.dom.js'; +import { ErrorBoundary } from './ErrorBoundary.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/ErrorBoundary.tsx b/ts/components/conversation/ErrorBoundary.tsx index 016602be0d..be8f284c2d 100644 --- a/ts/components/conversation/ErrorBoundary.tsx +++ b/ts/components/conversation/ErrorBoundary.tsx @@ -4,9 +4,9 @@ import type { ReactNode } from 'react'; import React from 'react'; -import type { LocalizerType } from '../../types/Util.js'; -import * as Errors from '../../types/errors.js'; -import { createLogger } from '../../logging/log.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import * as Errors from '../../types/errors.std.js'; +import { createLogger } from '../../logging/log.std.js'; const log = createLogger('ErrorBoundary'); diff --git a/ts/components/conversation/ExpireTimer.stories.tsx b/ts/components/conversation/ExpireTimer.stories.tsx index 7bdb16231a..2fd606226f 100644 --- a/ts/components/conversation/ExpireTimer.stories.tsx +++ b/ts/components/conversation/ExpireTimer.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './ExpireTimer.js'; -import { ExpireTimer } from './ExpireTimer.js'; +import type { Props } from './ExpireTimer.dom.js'; +import { ExpireTimer } from './ExpireTimer.dom.js'; export default { title: 'Components/Conversation/ExpireTimer', diff --git a/ts/components/conversation/ExpireTimer.tsx b/ts/components/conversation/ExpireTimer.tsx index f0971e4781..2f327b8ddd 100644 --- a/ts/components/conversation/ExpireTimer.tsx +++ b/ts/components/conversation/ExpireTimer.tsx @@ -4,7 +4,7 @@ import React, { useEffect, useReducer } from 'react'; import classNames from 'classnames'; -import { getIncrement, getTimerBucket } from '../../util/timer.js'; +import { getIncrement, getTimerBucket } from '../../util/timer.std.js'; export type Props = { direction?: 'incoming' | 'outgoing'; diff --git a/ts/components/conversation/GIF.tsx b/ts/components/conversation/GIF.tsx index 5a177d2595..ceabae9073 100644 --- a/ts/components/conversation/GIF.tsx +++ b/ts/components/conversation/GIF.tsx @@ -5,22 +5,22 @@ import React, { useCallback, useEffect, useRef, useState } from 'react'; import classNames from 'classnames'; import { Blurhash } from 'react-blurhash'; -import type { LocalizerType, ThemeType } from '../../types/Util.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.std.js'; -import type { AttachmentForUIType } from '../../types/Attachment.js'; +import type { AttachmentForUIType } from '../../types/Attachment.std.js'; import { hasNotResolved, getImageDimensionsForTimeline, defaultBlurHash, isDownloadable, -} from '../../util/Attachment.js'; -import * as Errors from '../../types/errors.js'; -import { createLogger } from '../../logging/log.js'; -import { useReducedMotion } from '../../hooks/useReducedMotion.js'; -import { AttachmentDetailPill } from './AttachmentDetailPill.js'; -import { getSpinner } from './Image.js'; -import { useUndownloadableMediaHandler } from '../../hooks/useUndownloadableMediaHandler.js'; -import { isAbortError } from '../../util/isAbortError.js'; +} from '../../util/Attachment.std.js'; +import * as Errors from '../../types/errors.std.js'; +import { createLogger } from '../../logging/log.std.js'; +import { useReducedMotion } from '../../hooks/useReducedMotion.dom.js'; +import { AttachmentDetailPill } from './AttachmentDetailPill.dom.js'; +import { getSpinner } from './Image.dom.js'; +import { useUndownloadableMediaHandler } from '../../hooks/useUndownloadableMediaHandler.dom.js'; +import { isAbortError } from '../../util/isAbortError.std.js'; const log = createLogger('GIF'); diff --git a/ts/components/conversation/GroupDescription.stories.tsx b/ts/components/conversation/GroupDescription.stories.tsx index 550bcc762c..51ac28575b 100644 --- a/ts/components/conversation/GroupDescription.stories.tsx +++ b/ts/components/conversation/GroupDescription.stories.tsx @@ -3,8 +3,8 @@ import React from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './GroupDescription.js'; -import { GroupDescription } from './GroupDescription.js'; +import type { PropsType } from './GroupDescription.dom.js'; +import { GroupDescription } from './GroupDescription.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/GroupDescription.tsx b/ts/components/conversation/GroupDescription.tsx index 90f6e96b79..ecdc106f4c 100644 --- a/ts/components/conversation/GroupDescription.tsx +++ b/ts/components/conversation/GroupDescription.tsx @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useEffect, useRef, useState } from 'react'; -import { Modal } from '../Modal.js'; -import type { LocalizerType } from '../../types/Util.js'; -import { GroupDescriptionText } from '../GroupDescriptionText.js'; +import { Modal } from '../Modal.dom.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import { GroupDescriptionText } from '../GroupDescriptionText.dom.js'; // Emojification can cause the scroll height to be *slightly* larger than the client // height, so we add a little wiggle room. diff --git a/ts/components/conversation/GroupNotification.stories.tsx b/ts/components/conversation/GroupNotification.stories.tsx index c85c66faff..5831ddd08a 100644 --- a/ts/components/conversation/GroupNotification.stories.tsx +++ b/ts/components/conversation/GroupNotification.stories.tsx @@ -3,9 +3,9 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './GroupNotification.js'; -import { GroupNotification } from './GroupNotification.js'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; +import type { Props } from './GroupNotification.dom.js'; +import { GroupNotification } from './GroupNotification.dom.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.std.js'; export default { title: 'Components/Conversation', diff --git a/ts/components/conversation/GroupNotification.tsx b/ts/components/conversation/GroupNotification.tsx index 01dfc3c5b8..c52e5942bf 100644 --- a/ts/components/conversation/GroupNotification.tsx +++ b/ts/components/conversation/GroupNotification.tsx @@ -5,13 +5,13 @@ import type { ReactNode } from 'react'; import React from 'react'; import lodash from 'lodash'; -import { ContactName } from './ContactName.js'; -import { SystemMessage } from './SystemMessage.js'; -import { I18n } from '../I18n.js'; -import type { LocalizerType } from '../../types/Util.js'; +import { ContactName } from './ContactName.dom.js'; +import { SystemMessage } from './SystemMessage.dom.js'; +import { I18n } from '../I18n.dom.js'; +import type { LocalizerType } from '../../types/Util.std.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; -import type { ConversationType } from '../../state/ducks/conversations.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; +import type { ConversationType } from '../../state/ducks/conversations.preload.js'; const { compact, flatten } = lodash; diff --git a/ts/components/conversation/GroupV1DisabledActions.stories.tsx b/ts/components/conversation/GroupV1DisabledActions.stories.tsx index 9e4cae3b90..913c219254 100644 --- a/ts/components/conversation/GroupV1DisabledActions.stories.tsx +++ b/ts/components/conversation/GroupV1DisabledActions.stories.tsx @@ -4,8 +4,8 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType as GroupV1DisabledActionsPropsType } from './GroupV1DisabledActions.js'; -import { GroupV1DisabledActions } from './GroupV1DisabledActions.js'; +import type { PropsType as GroupV1DisabledActionsPropsType } from './GroupV1DisabledActions.dom.js'; +import { GroupV1DisabledActions } from './GroupV1DisabledActions.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/GroupV1DisabledActions.tsx b/ts/components/conversation/GroupV1DisabledActions.tsx index c95b856f56..fc6d456e8e 100644 --- a/ts/components/conversation/GroupV1DisabledActions.tsx +++ b/ts/components/conversation/GroupV1DisabledActions.tsx @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import * as React from 'react'; -import { I18n } from '../I18n.js'; -import type { LocalizerType } from '../../types/Util.js'; +import { I18n } from '../I18n.dom.js'; +import type { LocalizerType } from '../../types/Util.std.js'; export type PropsType = { conversationId: string; diff --git a/ts/components/conversation/GroupV1Migration.stories.tsx b/ts/components/conversation/GroupV1Migration.stories.tsx index 4961f6e9ff..0b48797586 100644 --- a/ts/components/conversation/GroupV1Migration.stories.tsx +++ b/ts/components/conversation/GroupV1Migration.stories.tsx @@ -3,10 +3,10 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; -import type { PropsType } from './GroupV1Migration.js'; -import { GroupV1Migration } from './GroupV1Migration.js'; -import { ThemeType } from '../../types/Util.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.std.js'; +import type { PropsType } from './GroupV1Migration.dom.js'; +import { GroupV1Migration } from './GroupV1Migration.dom.js'; +import { ThemeType } from '../../types/Util.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/GroupV1Migration.tsx b/ts/components/conversation/GroupV1Migration.tsx index a21caf9a04..6b2d47760c 100644 --- a/ts/components/conversation/GroupV1Migration.tsx +++ b/ts/components/conversation/GroupV1Migration.tsx @@ -3,15 +3,15 @@ import * as React from 'react'; -import { Button, ButtonSize, ButtonVariant } from '../Button.js'; -import { SystemMessage } from './SystemMessage.js'; -import type { LocalizerType, ThemeType } from '../../types/Util.js'; -import type { ConversationType } from '../../state/ducks/conversations.js'; -import type { PreferredBadgeSelectorType } from '../../state/selectors/badges.js'; -import { I18n } from '../I18n.js'; -import { ContactName } from './ContactName.js'; -import { GroupV1MigrationDialog } from '../GroupV1MigrationDialog.js'; -import { createLogger } from '../../logging/log.js'; +import { Button, ButtonSize, ButtonVariant } from '../Button.dom.js'; +import { SystemMessage } from './SystemMessage.dom.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.std.js'; +import type { ConversationType } from '../../state/ducks/conversations.preload.js'; +import type { PreferredBadgeSelectorType } from '../../state/selectors/badges.preload.js'; +import { I18n } from '../I18n.dom.js'; +import { ContactName } from './ContactName.dom.js'; +import { GroupV1MigrationDialog } from '../GroupV1MigrationDialog.dom.js'; +import { createLogger } from '../../logging/log.std.js'; const log = createLogger('GroupV1Migration'); diff --git a/ts/components/conversation/GroupV2Change.stories.tsx b/ts/components/conversation/GroupV2Change.stories.tsx index 50d50958d1..862cb0caaa 100644 --- a/ts/components/conversation/GroupV2Change.stories.tsx +++ b/ts/components/conversation/GroupV2Change.stories.tsx @@ -4,13 +4,13 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { generateAci, generatePni } from '../../types/ServiceId.js'; -import type { ServiceIdString, AciString } from '../../types/ServiceId.js'; -import type { GroupV2ChangeType } from '../../types/groups.ts'; -import { SignalService as Proto } from '../../protobuf/index.js'; -import type { SmartContactRendererType } from '../../groupChange.js'; -import type { PropsType } from './GroupV2Change.js'; -import { GroupV2Change } from './GroupV2Change.js'; +import { generateAci, generatePni } from '../../types/ServiceId.std.js'; +import type { ServiceIdString, AciString } from '../../types/ServiceId.std.js'; +import type { GroupV2ChangeType } from '../../types/groups.std.js'; +import { SignalService as Proto } from '../../protobuf/index.std.js'; +import type { SmartContactRendererType } from '../../groupChange.std.js'; +import type { PropsType } from './GroupV2Change.dom.js'; +import { GroupV2Change } from './GroupV2Change.dom.js'; // Note: this should be kept up to date with backup_groupv2_notifications_test.ts, to // maintain the comprehensive set of GroupV2 notifications we need to handle diff --git a/ts/components/conversation/GroupV2Change.tsx b/ts/components/conversation/GroupV2Change.tsx index 6e00ac8de9..4f96d035db 100644 --- a/ts/components/conversation/GroupV2Change.tsx +++ b/ts/components/conversation/GroupV2Change.tsx @@ -6,30 +6,30 @@ import React, { useState } from 'react'; import lodash from 'lodash'; import type { ReadonlyDeep } from 'type-fest'; -import { createLogger } from '../../logging/log.js'; -import { I18n } from '../I18n.js'; +import { createLogger } from '../../logging/log.std.js'; +import { I18n } from '../I18n.dom.js'; import type { LocalizerType, ICUJSXMessageParamsByKeyType, -} from '../../types/Util.js'; +} from '../../types/Util.std.js'; import type { AciString, PniString, ServiceIdString, -} from '../../types/ServiceId.js'; -import { GroupDescriptionText } from '../GroupDescriptionText.js'; -import { Button, ButtonSize, ButtonVariant } from '../Button.js'; -import { SystemMessage } from './SystemMessage.js'; +} from '../../types/ServiceId.std.js'; +import { GroupDescriptionText } from '../GroupDescriptionText.dom.js'; +import { Button, ButtonSize, ButtonVariant } from '../Button.dom.js'; +import { SystemMessage } from './SystemMessage.dom.js'; import type { GroupV2ChangeType, GroupV2ChangeDetailType, -} from '../../types/groups.ts'; +} from '../../types/groups.std.js'; -import type { SmartContactRendererType } from '../../groupChange.js'; -import { renderChange } from '../../groupChange.js'; -import { Modal } from '../Modal.js'; -import { ConfirmationDialog } from '../ConfirmationDialog.js'; +import type { SmartContactRendererType } from '../../groupChange.std.js'; +import { renderChange } from '../../groupChange.std.js'; +import { Modal } from '../Modal.dom.js'; +import { ConfirmationDialog } from '../ConfirmationDialog.dom.js'; const { get } = lodash; diff --git a/ts/components/conversation/GroupV2PendingApprovalActions.stories.tsx b/ts/components/conversation/GroupV2PendingApprovalActions.stories.tsx index 3a116f8721..a57893ca11 100644 --- a/ts/components/conversation/GroupV2PendingApprovalActions.stories.tsx +++ b/ts/components/conversation/GroupV2PendingApprovalActions.stories.tsx @@ -4,8 +4,8 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType as GroupV2PendingApprovalActionsPropsType } from './GroupV2PendingApprovalActions.js'; -import { GroupV2PendingApprovalActions } from './GroupV2PendingApprovalActions.js'; +import type { PropsType as GroupV2PendingApprovalActionsPropsType } from './GroupV2PendingApprovalActions.dom.js'; +import { GroupV2PendingApprovalActions } from './GroupV2PendingApprovalActions.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/GroupV2PendingApprovalActions.tsx b/ts/components/conversation/GroupV2PendingApprovalActions.tsx index 15e286ae38..ca99e5a5f2 100644 --- a/ts/components/conversation/GroupV2PendingApprovalActions.tsx +++ b/ts/components/conversation/GroupV2PendingApprovalActions.tsx @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import * as React from 'react'; -import type { LocalizerType } from '../../types/Util.js'; -import { ConfirmationDialog } from '../ConfirmationDialog.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import { ConfirmationDialog } from '../ConfirmationDialog.dom.js'; export type PropsType = { conversationId: string; diff --git a/ts/components/conversation/Image.stories.tsx b/ts/components/conversation/Image.stories.tsx index 6ed6d78ed8..bf1b876be3 100644 --- a/ts/components/conversation/Image.stories.tsx +++ b/ts/components/conversation/Image.stories.tsx @@ -4,14 +4,14 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { pngUrl } from '../../storybook/Fixtures.js'; -import type { Props } from './Image.js'; -import { CurveType, Image } from './Image.js'; -import { IMAGE_PNG } from '../../types/MIME.js'; -import type { ThemeType } from '../../types/Util.js'; +import { pngUrl } from '../../storybook/Fixtures.std.js'; +import type { Props } from './Image.dom.js'; +import { CurveType, Image } from './Image.dom.js'; +import { IMAGE_PNG } from '../../types/MIME.std.js'; +import type { ThemeType } from '../../types/Util.std.js'; import { StorybookThemeContext } from '../../../.storybook/StorybookThemeContext.js'; -import { fakeAttachment } from '../../test-helpers/fakeAttachment.js'; +import { fakeAttachment } from '../../test-helpers/fakeAttachment.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/Image.tsx b/ts/components/conversation/Image.tsx index d7bf9fbebd..a15c592b0f 100644 --- a/ts/components/conversation/Image.tsx +++ b/ts/components/conversation/Image.tsx @@ -5,16 +5,16 @@ import type { CSSProperties } from 'react'; import React, { useCallback } from 'react'; import classNames from 'classnames'; -import { ImageOrBlurhash } from '../ImageOrBlurhash.js'; -import type { LocalizerType, ThemeType } from '../../types/Util.js'; -import type { AttachmentForUIType } from '../../types/Attachment.js'; +import { ImageOrBlurhash } from '../ImageOrBlurhash.dom.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.std.js'; +import type { AttachmentForUIType } from '../../types/Attachment.std.js'; import { defaultBlurHash, isIncremental, isReadyToView, -} from '../../util/Attachment.js'; -import { SpinnerV2 } from '../SpinnerV2.js'; -import { useUndownloadableMediaHandler } from '../../hooks/useUndownloadableMediaHandler.js'; +} from '../../util/Attachment.std.js'; +import { SpinnerV2 } from '../SpinnerV2.dom.js'; +import { useUndownloadableMediaHandler } from '../../hooks/useUndownloadableMediaHandler.dom.js'; export enum CurveType { None = 0, diff --git a/ts/components/conversation/ImageGrid.stories.tsx b/ts/components/conversation/ImageGrid.stories.tsx index 37a772f83d..e0d6f7a4f9 100644 --- a/ts/components/conversation/ImageGrid.stories.tsx +++ b/ts/components/conversation/ImageGrid.stories.tsx @@ -4,8 +4,8 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './ImageGrid.js'; -import { ImageGrid } from './ImageGrid.js'; +import type { Props } from './ImageGrid.dom.js'; +import { ImageGrid } from './ImageGrid.dom.js'; import { AUDIO_MP3, IMAGE_JPEG, @@ -13,11 +13,11 @@ import { IMAGE_WEBP, VIDEO_MP4, stringToMIMEType, -} from '../../types/MIME.js'; -import { pngUrl, squareStickerUrl } from '../../storybook/Fixtures.js'; -import { fakeAttachment } from '../../test-helpers/fakeAttachment.js'; -import { strictAssert } from '../../util/assert.js'; -import { isDownloadable } from '../../util/Attachment.js'; +} from '../../types/MIME.std.js'; +import { pngUrl, squareStickerUrl } from '../../storybook/Fixtures.std.js'; +import { fakeAttachment } from '../../test-helpers/fakeAttachment.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { isDownloadable } from '../../util/Attachment.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/ImageGrid.tsx b/ts/components/conversation/ImageGrid.tsx index a5090f0438..f1a6356eb2 100644 --- a/ts/components/conversation/ImageGrid.tsx +++ b/ts/components/conversation/ImageGrid.tsx @@ -7,7 +7,7 @@ import classNames from 'classnames'; import type { AttachmentForUIType, AttachmentType, -} from '../../types/Attachment.js'; +} from '../../types/Attachment.std.js'; import { areAllAttachmentsVisual, getAlt, @@ -17,12 +17,12 @@ import { isDownloadable, isIncremental, isVideoAttachment, -} from '../../util/Attachment.js'; +} from '../../util/Attachment.std.js'; -import { Image, CurveType } from './Image.js'; +import { Image, CurveType } from './Image.dom.js'; -import type { LocalizerType, ThemeType } from '../../types/Util.js'; -import { AttachmentDetailPill } from './AttachmentDetailPill.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.std.js'; +import { AttachmentDetailPill } from './AttachmentDetailPill.dom.js'; export type DirectionType = 'incoming' | 'outgoing'; diff --git a/ts/components/conversation/InAnotherCallTooltip.tsx b/ts/components/conversation/InAnotherCallTooltip.tsx index 5df138d9ca..3b372ef61c 100644 --- a/ts/components/conversation/InAnotherCallTooltip.tsx +++ b/ts/components/conversation/InAnotherCallTooltip.tsx @@ -3,10 +3,10 @@ import React from 'react'; -import { offsetDistanceModifier } from '../../util/popperUtil.js'; -import { Tooltip, TooltipPlacement } from '../Tooltip.js'; +import { offsetDistanceModifier } from '../../util/popperUtil.std.js'; +import { Tooltip, TooltipPlacement } from '../Tooltip.dom.js'; -import type { LocalizerType } from '../../types/I18N.js'; +import type { LocalizerType } from '../../types/I18N.std.js'; type Props = { i18n: LocalizerType; diff --git a/ts/components/conversation/InlineNotificationWrapper.tsx b/ts/components/conversation/InlineNotificationWrapper.tsx index 977b6773e9..c53d43e630 100644 --- a/ts/components/conversation/InlineNotificationWrapper.tsx +++ b/ts/components/conversation/InlineNotificationWrapper.tsx @@ -3,7 +3,7 @@ import type { ReactNode } from 'react'; import React, { useCallback, useEffect, useRef } from 'react'; -import { getInteractionMode } from '../../services/InteractionMode.js'; +import { getInteractionMode } from '../../services/InteractionMode.dom.js'; type PropsType = { id: string; diff --git a/ts/components/conversation/JoinedSignalNotification.stories.tsx b/ts/components/conversation/JoinedSignalNotification.stories.tsx index c6fcb54afe..5cf5adbf5a 100644 --- a/ts/components/conversation/JoinedSignalNotification.stories.tsx +++ b/ts/components/conversation/JoinedSignalNotification.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './JoinedSignalNotification.js'; -import { JoinedSignalNotification } from './JoinedSignalNotification.js'; +import type { Props } from './JoinedSignalNotification.dom.js'; +import { JoinedSignalNotification } from './JoinedSignalNotification.dom.js'; export default { title: 'Components/Conversation/JoinedSignalNotification', diff --git a/ts/components/conversation/JoinedSignalNotification.tsx b/ts/components/conversation/JoinedSignalNotification.tsx index 42a354041b..ce7bd2180f 100644 --- a/ts/components/conversation/JoinedSignalNotification.tsx +++ b/ts/components/conversation/JoinedSignalNotification.tsx @@ -3,11 +3,11 @@ import React from 'react'; -import type { LocalizerType } from '../../types/Util.js'; -import { I18n } from '../I18n.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import { I18n } from '../I18n.dom.js'; -import { SystemMessage } from './SystemMessage.js'; -import { MessageTimestamp } from './MessageTimestamp.js'; +import { SystemMessage } from './SystemMessage.dom.js'; +import { MessageTimestamp } from './MessageTimestamp.dom.js'; export type PropsData = { timestamp: number; diff --git a/ts/components/conversation/LastSeenIndicator.stories.tsx b/ts/components/conversation/LastSeenIndicator.stories.tsx index 77fb39691b..066ade4d1b 100644 --- a/ts/components/conversation/LastSeenIndicator.stories.tsx +++ b/ts/components/conversation/LastSeenIndicator.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './LastSeenIndicator.js'; -import { LastSeenIndicator } from './LastSeenIndicator.js'; +import type { Props } from './LastSeenIndicator.dom.js'; +import { LastSeenIndicator } from './LastSeenIndicator.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/LastSeenIndicator.tsx b/ts/components/conversation/LastSeenIndicator.tsx index e21b302c71..9d5a912b31 100644 --- a/ts/components/conversation/LastSeenIndicator.tsx +++ b/ts/components/conversation/LastSeenIndicator.tsx @@ -3,7 +3,7 @@ import React, { forwardRef } from 'react'; -import type { LocalizerType } from '../../types/Util.js'; +import type { LocalizerType } from '../../types/Util.std.js'; export type Props = { count: number; diff --git a/ts/components/conversation/LinkPreviewDate.tsx b/ts/components/conversation/LinkPreviewDate.tsx index 5f04a44846..28d6a91284 100644 --- a/ts/components/conversation/LinkPreviewDate.tsx +++ b/ts/components/conversation/LinkPreviewDate.tsx @@ -4,7 +4,7 @@ import * as React from 'react'; import type { Moment } from 'moment'; import moment from 'moment'; -import { isLinkPreviewDateValid } from '../../linkPreviews/isLinkPreviewDateValid.js'; +import { isLinkPreviewDateValid } from '../../linkPreviews/isLinkPreviewDateValid.std.js'; type Props = { date?: null | number; diff --git a/ts/components/conversation/Linkify.stories.tsx b/ts/components/conversation/Linkify.stories.tsx index 40669cfb54..be015d8c1d 100644 --- a/ts/components/conversation/Linkify.stories.tsx +++ b/ts/components/conversation/Linkify.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './Linkify.js'; -import { Linkify } from './Linkify.js'; +import type { Props } from './Linkify.dom.js'; +import { Linkify } from './Linkify.dom.js'; export default { title: 'Components/Conversation/Linkify', diff --git a/ts/components/conversation/Linkify.tsx b/ts/components/conversation/Linkify.tsx index d46f49b298..3d254c3771 100644 --- a/ts/components/conversation/Linkify.tsx +++ b/ts/components/conversation/Linkify.tsx @@ -5,10 +5,13 @@ import React from 'react'; import LinkifyIt from 'linkify-it'; -import type { RenderTextCallbackType } from '../../types/Util.js'; -import { isLinkSneaky, shouldLinkifyMessage } from '../../types/LinkPreview.js'; -import { splitByEmoji } from '../../util/emoji.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; +import type { RenderTextCallbackType } from '../../types/Util.std.js'; +import { + isLinkSneaky, + shouldLinkifyMessage, +} from '../../types/LinkPreview.std.js'; +import { splitByEmoji } from '../../util/emoji.std.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; export const linkify = new LinkifyIt() // This is all TLDs in place in 2010, according to [IANA's root zone database][0] diff --git a/ts/components/conversation/MandatoryProfileSharingActions.stories.tsx b/ts/components/conversation/MandatoryProfileSharingActions.stories.tsx index e7e5f43bdc..1a171583bc 100644 --- a/ts/components/conversation/MandatoryProfileSharingActions.stories.tsx +++ b/ts/components/conversation/MandatoryProfileSharingActions.stories.tsx @@ -4,12 +4,12 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './MandatoryProfileSharingActions.js'; -import { MandatoryProfileSharingActions } from './MandatoryProfileSharingActions.js'; +import type { Props } from './MandatoryProfileSharingActions.dom.js'; +import { MandatoryProfileSharingActions } from './MandatoryProfileSharingActions.dom.js'; import { getDefaultConversation, getDefaultGroup, -} from '../../test-helpers/getDefaultConversation.js'; +} from '../../test-helpers/getDefaultConversation.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/MandatoryProfileSharingActions.tsx b/ts/components/conversation/MandatoryProfileSharingActions.tsx index ac3f402dbd..d2700668bb 100644 --- a/ts/components/conversation/MandatoryProfileSharingActions.tsx +++ b/ts/components/conversation/MandatoryProfileSharingActions.tsx @@ -2,15 +2,15 @@ // SPDX-License-Identifier: AGPL-3.0-only import * as React from 'react'; -import { ContactName } from './ContactName.js'; -import { Button, ButtonVariant } from '../Button.js'; -import type { MessageRequestActionsConfirmationProps } from './MessageRequestActionsConfirmation.js'; +import { ContactName } from './ContactName.dom.js'; +import { Button, ButtonVariant } from '../Button.dom.js'; +import type { MessageRequestActionsConfirmationProps } from './MessageRequestActionsConfirmation.dom.js'; import { MessageRequestActionsConfirmation, MessageRequestState, -} from './MessageRequestActionsConfirmation.js'; -import { I18n } from '../I18n.js'; -import type { LocalizerType } from '../../types/Util.js'; +} from './MessageRequestActionsConfirmation.dom.js'; +import { I18n } from '../I18n.dom.js'; +import type { LocalizerType } from '../../types/Util.std.js'; export type Props = { i18n: LocalizerType; diff --git a/ts/components/conversation/Message.tsx b/ts/components/conversation/Message.tsx index 1df79d858e..43421eb32a 100644 --- a/ts/components/conversation/Message.tsx +++ b/ts/components/conversation/Message.tsx @@ -25,39 +25,39 @@ import type { SaveAttachmentActionCreatorType, SaveAttachmentsActionCreatorType, ShowConversationType, -} from '../../state/ducks/conversations.js'; -import type { ViewStoryActionCreatorType } from '../../state/ducks/stories.js'; -import { ReadStatus } from '../../messages/MessageReadStatus.js'; -import { Avatar, AvatarSize } from '../Avatar.js'; -import { AvatarSpacer } from '../AvatarSpacer.js'; -import { MessageBodyReadMore } from './MessageBodyReadMore.js'; -import { MessageMetadata } from './MessageMetadata.js'; -import { MessageTextMetadataSpacer } from './MessageTextMetadataSpacer.js'; -import { ImageGrid } from './ImageGrid.js'; -import { GIF } from './GIF.js'; -import { CurveType, Image } from './Image.js'; -import { ContactName } from './ContactName.js'; -import type { QuotedAttachmentForUIType } from './Quote.js'; -import { Quote } from './Quote.js'; -import { EmbeddedContact } from './EmbeddedContact.js'; +} from '../../state/ducks/conversations.preload.js'; +import type { ViewStoryActionCreatorType } from '../../state/ducks/stories.preload.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.std.js'; +import { Avatar, AvatarSize } from '../Avatar.dom.js'; +import { AvatarSpacer } from '../AvatarSpacer.dom.js'; +import { MessageBodyReadMore } from './MessageBodyReadMore.dom.js'; +import { MessageMetadata } from './MessageMetadata.dom.js'; +import { MessageTextMetadataSpacer } from './MessageTextMetadataSpacer.dom.js'; +import { ImageGrid } from './ImageGrid.dom.js'; +import { GIF } from './GIF.dom.js'; +import { CurveType, Image } from './Image.dom.js'; +import { ContactName } from './ContactName.dom.js'; +import type { QuotedAttachmentForUIType } from './Quote.dom.js'; +import { Quote } from './Quote.dom.js'; +import { EmbeddedContact } from './EmbeddedContact.dom.js'; import type { OwnProps as ReactionViewerProps, Reaction, -} from './ReactionViewer.js'; -import { ReactionViewer } from './ReactionViewer.js'; -import { LinkPreviewDate } from './LinkPreviewDate.js'; -import type { LinkPreviewForUIType } from '../../types/message/LinkPreviews.js'; -import type { MessageStatusType } from '../../types/message/MessageStatus.js'; -import { shouldUseFullSizeLinkPreviewImage } from '../../linkPreviews/shouldUseFullSizeLinkPreviewImage.js'; -import type { WidthBreakpoint } from '../_util.js'; -import { OutgoingGiftBadgeModal } from '../OutgoingGiftBadgeModal.js'; -import { createLogger } from '../../logging/log.js'; -import { StoryViewModeType } from '../../types/Stories.js'; -import { GiftBadgeStates } from '../../types/GiftBadgeStates.js'; +} from './ReactionViewer.dom.js'; +import { ReactionViewer } from './ReactionViewer.dom.js'; +import { LinkPreviewDate } from './LinkPreviewDate.dom.js'; +import type { LinkPreviewForUIType } from '../../types/message/LinkPreviews.std.js'; +import type { MessageStatusType } from '../../types/message/MessageStatus.std.js'; +import { shouldUseFullSizeLinkPreviewImage } from '../../linkPreviews/shouldUseFullSizeLinkPreviewImage.std.js'; +import type { WidthBreakpoint } from '../_util.std.js'; +import { OutgoingGiftBadgeModal } from '../OutgoingGiftBadgeModal.dom.js'; +import { createLogger } from '../../logging/log.std.js'; +import { StoryViewModeType } from '../../types/Stories.std.js'; +import { GiftBadgeStates } from '../../types/GiftBadgeStates.std.js'; import type { AttachmentForUIType, AttachmentType, -} from '../../types/Attachment.js'; +} from '../../types/Attachment.std.js'; import { canDisplayImage, getGridDimensions, @@ -72,48 +72,48 @@ import { isImageAttachment, isPlayed, isVideo, -} from '../../util/Attachment.js'; -import type { EmbeddedContactForUIType } from '../../types/EmbeddedContact.js'; +} from '../../util/Attachment.std.js'; +import type { EmbeddedContactForUIType } from '../../types/EmbeddedContact.std.js'; -import { getIncrement } from '../../util/timer.js'; -import { clearTimeoutIfNecessary } from '../../util/clearTimeoutIfNecessary.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; -import type { HydratedBodyRangesType } from '../../types/BodyRange.js'; -import type { LocalizerType, ThemeType } from '../../types/Util.js'; +import { getIncrement } from '../../util/timer.std.js'; +import { clearTimeoutIfNecessary } from '../../util/clearTimeoutIfNecessary.std.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; +import type { HydratedBodyRangesType } from '../../types/BodyRange.std.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.std.js'; -import type { PreferredBadgeSelectorType } from '../../state/selectors/badges.js'; +import type { PreferredBadgeSelectorType } from '../../state/selectors/badges.preload.js'; import type { ContactNameColorType, ConversationColorType, CustomColorType, -} from '../../types/Colors.js'; -import { createRefMerger } from '../../util/refMerger.js'; -import { getCustomColorStyle } from '../../util/getCustomColorStyle.js'; -import type { ServiceIdString } from '../../types/ServiceId.js'; -import { DAY, HOUR, MINUTE, SECOND } from '../../util/durations/index.js'; -import { BadgeImageTheme } from '../../badges/BadgeImageTheme.js'; -import { getBadgeImageFileLocalPath } from '../../badges/getBadgeImageFileLocalPath.js'; -import { handleOutsideClick } from '../../util/handleOutsideClick.js'; -import { isPaymentNotificationEvent } from '../../types/Payment.js'; -import type { AnyPaymentEvent } from '../../types/Payment.js'; -import { getPaymentEventDescription } from '../../messages/payments.js'; -import { PanelType } from '../../types/Panels.js'; -import { isPollReceiveEnabled } from '../../types/Polls.js'; -import type { PollWithResolvedVotersType } from '../../state/selectors/message.js'; -import { PollMessageContents } from './poll-message/PollMessageContents.js'; -import { openLinkInWebBrowser } from '../../util/openLinkInWebBrowser.js'; -import { RenderLocation } from './MessageTextRenderer.js'; -import { UserText } from '../UserText.js'; -import { getColorForCallLink } from '../../util/getColorForCallLink.js'; -import { getKeyFromCallLink } from '../../util/callLinks.js'; -import { InAnotherCallTooltip } from './InAnotherCallTooltip.js'; -import { formatFileSize } from '../../util/formatFileSize.js'; -import { assertDev, strictAssert } from '../../util/assert.js'; -import { AttachmentStatusIcon } from './AttachmentStatusIcon.js'; -import { TapToViewNotAvailableType } from '../TapToViewNotAvailableModal.js'; -import type { DataPropsType as TapToViewNotAvailablePropsType } from '../TapToViewNotAvailableModal.js'; -import { FileThumbnail } from '../FileThumbnail.js'; -import { FunStaticEmoji } from '../fun/FunEmoji.js'; +} from '../../types/Colors.std.js'; +import { createRefMerger } from '../../util/refMerger.std.js'; +import { getCustomColorStyle } from '../../util/getCustomColorStyle.dom.js'; +import type { ServiceIdString } from '../../types/ServiceId.std.js'; +import { DAY, HOUR, MINUTE, SECOND } from '../../util/durations/index.std.js'; +import { BadgeImageTheme } from '../../badges/BadgeImageTheme.std.js'; +import { getBadgeImageFileLocalPath } from '../../badges/getBadgeImageFileLocalPath.std.js'; +import { handleOutsideClick } from '../../util/handleOutsideClick.dom.js'; +import { isPaymentNotificationEvent } from '../../types/Payment.std.js'; +import type { AnyPaymentEvent } from '../../types/Payment.std.js'; +import { getPaymentEventDescription } from '../../messages/payments.std.js'; +import { PanelType } from '../../types/Panels.std.js'; +import { isPollReceiveEnabled } from '../../types/Polls.dom.js'; +import type { PollWithResolvedVotersType } from '../../state/selectors/message.preload.js'; +import { PollMessageContents } from './poll-message/PollMessageContents.dom.js'; +import { openLinkInWebBrowser } from '../../util/openLinkInWebBrowser.dom.js'; +import { RenderLocation } from './MessageTextRenderer.dom.js'; +import { UserText } from '../UserText.dom.js'; +import { getColorForCallLink } from '../../util/getColorForCallLink.std.js'; +import { getKeyFromCallLink } from '../../util/callLinks.std.js'; +import { InAnotherCallTooltip } from './InAnotherCallTooltip.dom.js'; +import { formatFileSize } from '../../util/formatFileSize.std.js'; +import { assertDev, strictAssert } from '../../util/assert.std.js'; +import { AttachmentStatusIcon } from './AttachmentStatusIcon.dom.js'; +import { TapToViewNotAvailableType } from '../TapToViewNotAvailableModal.dom.js'; +import type { DataPropsType as TapToViewNotAvailablePropsType } from '../TapToViewNotAvailableModal.dom.js'; +import { FileThumbnail } from '../FileThumbnail.dom.js'; +import { FunStaticEmoji } from '../fun/FunEmoji.dom.js'; import { type EmojifyData, getEmojifyData, @@ -122,8 +122,8 @@ import { getEmojiVariantByKey, getEmojiVariantKeyByValue, isEmojiVariantValue, -} from '../fun/data/emojis.js'; -import { useGroupedAndOrderedReactions } from '../../util/groupAndOrderReactions.js'; +} from '../fun/data/emojis.std.js'; +import { useGroupedAndOrderedReactions } from '../../util/groupAndOrderReactions.dom.js'; const { drop, take, unescape } = lodash; diff --git a/ts/components/conversation/MessageAudio.tsx b/ts/components/conversation/MessageAudio.tsx index 20ab524403..3e9283d668 100644 --- a/ts/components/conversation/MessageAudio.tsx +++ b/ts/components/conversation/MessageAudio.tsx @@ -7,24 +7,24 @@ import classNames from 'classnames'; import lodash from 'lodash'; import { animated, useSpring } from '@react-spring/web'; -import type { LocalizerType } from '../../types/Util.js'; -import type { AttachmentForUIType } from '../../types/Attachment.js'; -import type { MessageStatusType } from '../../types/message/MessageStatus.js'; -import type { PushPanelForConversationActionType } from '../../state/ducks/conversations.js'; -import { isDownloaded } from '../../util/Attachment.js'; -import type { DirectionType } from './Message.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import type { AttachmentForUIType } from '../../types/Attachment.std.js'; +import type { MessageStatusType } from '../../types/message/MessageStatus.std.js'; +import type { PushPanelForConversationActionType } from '../../state/ducks/conversations.preload.js'; +import { isDownloaded } from '../../util/Attachment.std.js'; +import type { DirectionType } from './Message.dom.js'; -import type { ComputePeaksResult } from '../VoiceNotesPlaybackContext.js'; -import { MessageMetadata } from './MessageMetadata.js'; -import { createLogger } from '../../logging/log.js'; -import type { ActiveAudioPlayerStateType } from '../../state/ducks/audioPlayer.js'; -import { PlaybackRateButton } from '../PlaybackRateButton.js'; -import { PlaybackButton } from '../PlaybackButton.js'; -import { WaveformScrubber } from './WaveformScrubber.js'; -import { useComputePeaks } from '../../hooks/useComputePeaks.js'; -import { durationToPlaybackText } from '../../util/durationToPlaybackText.js'; -import { shouldNeverBeCalled } from '../../util/shouldNeverBeCalled.js'; -import { formatFileSize } from '../../util/formatFileSize.js'; +import type { ComputePeaksResult } from '../VoiceNotesPlaybackContext.dom.js'; +import { MessageMetadata } from './MessageMetadata.dom.js'; +import { createLogger } from '../../logging/log.std.js'; +import type { ActiveAudioPlayerStateType } from '../../state/ducks/audioPlayer.preload.js'; +import { PlaybackRateButton } from '../PlaybackRateButton.dom.js'; +import { PlaybackButton } from '../PlaybackButton.dom.js'; +import { WaveformScrubber } from './WaveformScrubber.dom.js'; +import { useComputePeaks } from '../../hooks/useComputePeaks.dom.js'; +import { durationToPlaybackText } from '../../util/durationToPlaybackText.std.js'; +import { shouldNeverBeCalled } from '../../util/shouldNeverBeCalled.std.js'; +import { formatFileSize } from '../../util/formatFileSize.std.js'; const { noop } = lodash; diff --git a/ts/components/conversation/MessageBody.stories.tsx b/ts/components/conversation/MessageBody.stories.tsx index 8bc0e3b433..9621944692 100644 --- a/ts/components/conversation/MessageBody.stories.tsx +++ b/ts/components/conversation/MessageBody.stories.tsx @@ -4,11 +4,11 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './MessageBody.js'; -import { MessageBody } from './MessageBody.js'; -import { BodyRange } from '../../types/BodyRange.js'; -import { generateAci } from '../../types/ServiceId.js'; -import { RenderLocation } from './MessageTextRenderer.js'; +import type { Props } from './MessageBody.dom.js'; +import { MessageBody } from './MessageBody.dom.js'; +import { BodyRange } from '../../types/BodyRange.std.js'; +import { generateAci } from '../../types/ServiceId.std.js'; +import { RenderLocation } from './MessageTextRenderer.dom.js'; const SERVICE_ID_1 = generateAci(); const SERVICE_ID_2 = generateAci(); diff --git a/ts/components/conversation/MessageBody.tsx b/ts/components/conversation/MessageBody.tsx index ff1db00e07..9f45525ff0 100644 --- a/ts/components/conversation/MessageBody.tsx +++ b/ts/components/conversation/MessageBody.tsx @@ -3,17 +3,17 @@ import type { KeyboardEvent } from 'react'; import React from 'react'; -import type { AttachmentType } from '../../types/Attachment.js'; -import { canBeDownloaded, isDownloaded } from '../../util/Attachment.js'; -import type { ShowConversationType } from '../../state/ducks/conversations.js'; -import type { HydratedBodyRangesType } from '../../types/BodyRange.js'; -import type { LocalizerType } from '../../types/Util.js'; -import { MessageTextRenderer } from './MessageTextRenderer.js'; -import type { RenderLocation } from './MessageTextRenderer.js'; -import { UserText } from '../UserText.js'; -import { shouldLinkifyMessage } from '../../types/LinkPreview.js'; -import { FunJumboEmojiSize } from '../fun/FunEmoji.js'; -import { getEmojifyData } from '../fun/data/emojis.js'; +import type { AttachmentType } from '../../types/Attachment.std.js'; +import { canBeDownloaded, isDownloaded } from '../../util/Attachment.std.js'; +import type { ShowConversationType } from '../../state/ducks/conversations.preload.js'; +import type { HydratedBodyRangesType } from '../../types/BodyRange.std.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import { MessageTextRenderer } from './MessageTextRenderer.dom.js'; +import type { RenderLocation } from './MessageTextRenderer.dom.js'; +import { UserText } from '../UserText.dom.js'; +import { shouldLinkifyMessage } from '../../types/LinkPreview.std.js'; +import { FunJumboEmojiSize } from '../fun/FunEmoji.dom.js'; +import { getEmojifyData } from '../fun/data/emojis.std.js'; function getSizeClass(str: string): FunJumboEmojiSize | null { const emojifyData = getEmojifyData(str); diff --git a/ts/components/conversation/MessageBodyReadMore.stories.tsx b/ts/components/conversation/MessageBodyReadMore.stories.tsx index 7ddbd4e553..f58cbb8351 100644 --- a/ts/components/conversation/MessageBodyReadMore.stories.tsx +++ b/ts/components/conversation/MessageBodyReadMore.stories.tsx @@ -4,12 +4,12 @@ import React, { useState } from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './MessageBodyReadMore.js'; -import { MessageBodyReadMore } from './MessageBodyReadMore.js'; -import type { HydratedBodyRangesType } from '../../types/BodyRange.js'; -import { BodyRange } from '../../types/BodyRange.js'; -import { generateAci } from '../../types/ServiceId.js'; -import { RenderLocation } from './MessageTextRenderer.js'; +import type { Props } from './MessageBodyReadMore.dom.js'; +import { MessageBodyReadMore } from './MessageBodyReadMore.dom.js'; +import type { HydratedBodyRangesType } from '../../types/BodyRange.std.js'; +import { BodyRange } from '../../types/BodyRange.std.js'; +import { generateAci } from '../../types/ServiceId.std.js'; +import { RenderLocation } from './MessageTextRenderer.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/MessageBodyReadMore.tsx b/ts/components/conversation/MessageBodyReadMore.tsx index f386cf6884..980674e0a6 100644 --- a/ts/components/conversation/MessageBodyReadMore.tsx +++ b/ts/components/conversation/MessageBodyReadMore.tsx @@ -3,10 +3,10 @@ import React from 'react'; -import type { Props as MessageBodyPropsType } from './MessageBody.js'; -import { MessageBody } from './MessageBody.js'; -import { graphemeAndLinkAwareSlice } from '../../util/graphemeAndLinkAwareSlice.js'; -import { shouldLinkifyMessage } from '../../types/LinkPreview.js'; +import type { Props as MessageBodyPropsType } from './MessageBody.dom.js'; +import { MessageBody } from './MessageBody.dom.js'; +import { graphemeAndLinkAwareSlice } from '../../util/graphemeAndLinkAwareSlice.std.js'; +import { shouldLinkifyMessage } from '../../types/LinkPreview.std.js'; export type Props = Pick< MessageBodyPropsType, diff --git a/ts/components/conversation/MessageContextMenu.tsx b/ts/components/conversation/MessageContextMenu.tsx index 9f1966b628..66b78c6858 100644 --- a/ts/components/conversation/MessageContextMenu.tsx +++ b/ts/components/conversation/MessageContextMenu.tsx @@ -4,8 +4,8 @@ import React, { type RefObject } from 'react'; import { ContextMenu, MenuItem } from 'react-contextmenu'; import ReactDOM from 'react-dom'; -import type { LocalizerType } from '../../types/I18N.js'; -import type { InteractionModeType } from '../../state/ducks/conversations.js'; +import type { LocalizerType } from '../../types/I18N.std.js'; +import type { InteractionModeType } from '../../state/ducks/conversations.preload.js'; export type ContextMenuTriggerType = { handleContextClick: ( diff --git a/ts/components/conversation/MessageDetail.stories.tsx b/ts/components/conversation/MessageDetail.stories.tsx index 2c6d20cce4..b710d3207c 100644 --- a/ts/components/conversation/MessageDetail.stories.tsx +++ b/ts/components/conversation/MessageDetail.stories.tsx @@ -4,15 +4,15 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsData as MessageDataPropsType } from './Message.js'; -import { TextDirection } from './Message.js'; -import type { Props } from './MessageDetail.js'; -import { MessageDetail } from './MessageDetail.js'; -import { SendStatus } from '../../messages/MessageSendState.js'; -import { ReadStatus } from '../../messages/MessageReadStatus.js'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; -import { getFakeBadge } from '../../test-helpers/getFakeBadge.js'; -import { ThemeType } from '../../types/Util.js'; +import type { PropsData as MessageDataPropsType } from './Message.dom.js'; +import { TextDirection } from './Message.dom.js'; +import type { Props } from './MessageDetail.dom.js'; +import { MessageDetail } from './MessageDetail.dom.js'; +import { SendStatus } from '../../messages/MessageSendState.std.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.std.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.std.js'; +import { getFakeBadge } from '../../test-helpers/getFakeBadge.std.js'; +import { ThemeType } from '../../types/Util.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/MessageDetail.tsx b/ts/components/conversation/MessageDetail.tsx index 600c8f85d9..d302dddca1 100644 --- a/ts/components/conversation/MessageDetail.tsx +++ b/ts/components/conversation/MessageDetail.tsx @@ -6,36 +6,36 @@ import React, { useRef } from 'react'; import classNames from 'classnames'; import lodash from 'lodash'; -import { Avatar, AvatarSize } from '../Avatar.js'; -import { ContactName } from './ContactName.js'; -import { ContextMenu } from '../ContextMenu.js'; -import { Time } from '../Time.js'; +import { Avatar, AvatarSize } from '../Avatar.dom.js'; +import { ContactName } from './ContactName.dom.js'; +import { ContextMenu } from '../ContextMenu.dom.js'; +import { Time } from '../Time.dom.js'; import type { Props as MessagePropsType, PropsData as MessagePropsDataType, -} from './Message.js'; -import { Message } from './Message.js'; -import type { LocalizerType, ThemeType } from '../../types/Util.js'; -import type { ConversationType } from '../../state/ducks/conversations.js'; -import type { PreferredBadgeSelectorType } from '../../state/selectors/badges.js'; -import { groupBy } from '../../util/mapUtil.js'; -import type { ContactNameColorType } from '../../types/Colors.js'; +} from './Message.dom.js'; +import { Message } from './Message.dom.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.std.js'; +import type { ConversationType } from '../../state/ducks/conversations.preload.js'; +import type { PreferredBadgeSelectorType } from '../../state/selectors/badges.preload.js'; +import { groupBy } from '../../util/mapUtil.std.js'; +import type { ContactNameColorType } from '../../types/Colors.std.js'; import { SendStatus, type VisibleSendStatus, -} from '../../messages/MessageSendState.js'; -import { WidthBreakpoint } from '../_util.js'; -import { createLogger } from '../../logging/log.js'; -import { formatDateTimeLong } from '../../util/timestamp.js'; -import { DurationInSeconds } from '../../util/durations/index.js'; -import { format as formatRelativeTime } from '../../util/expirationTimer.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; -import { PanelRow } from './conversation-details/PanelRow.js'; -import { PanelSection } from './conversation-details/PanelSection.js'; +} from '../../messages/MessageSendState.std.js'; +import { WidthBreakpoint } from '../_util.std.js'; +import { createLogger } from '../../logging/log.std.js'; +import { formatDateTimeLong } from '../../util/formatTimestamp.dom.js'; +import { DurationInSeconds } from '../../util/durations/index.std.js'; +import { format as formatRelativeTime } from '../../util/expirationTimer.std.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; +import { PanelRow } from './conversation-details/PanelRow.dom.js'; +import { PanelSection } from './conversation-details/PanelSection.dom.js'; import { ConversationDetailsIcon, IconType, -} from './conversation-details/ConversationDetailsIcon.js'; +} from './conversation-details/ConversationDetailsIcon.dom.js'; const { noop } = lodash; diff --git a/ts/components/conversation/MessageMetadata.tsx b/ts/components/conversation/MessageMetadata.tsx index 79ac97f295..2dba22bf94 100644 --- a/ts/components/conversation/MessageMetadata.tsx +++ b/ts/components/conversation/MessageMetadata.tsx @@ -5,19 +5,19 @@ import type { ReactChild } from 'react'; import React, { forwardRef, useCallback, useState } from 'react'; import classNames from 'classnames'; -import type { LocalizerType } from '../../types/Util.js'; -import type { MessageStatusType } from '../../types/message/MessageStatus.js'; -import type { DirectionType } from './Message.js'; -import type { PushPanelForConversationActionType } from '../../state/ducks/conversations.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; -import { ExpireTimer } from './ExpireTimer.js'; -import { MessageTimestamp } from './MessageTimestamp.js'; -import { PanelType } from '../../types/Panels.js'; -import { Spinner } from '../Spinner.js'; -import { ConfirmationDialog } from '../ConfirmationDialog.js'; -import { refMerger } from '../../util/refMerger.js'; -import type { Size } from '../../hooks/useSizeObserver.js'; -import { SizeObserver } from '../../hooks/useSizeObserver.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import type { MessageStatusType } from '../../types/message/MessageStatus.std.js'; +import type { DirectionType } from './Message.dom.js'; +import type { PushPanelForConversationActionType } from '../../state/ducks/conversations.preload.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; +import { ExpireTimer } from './ExpireTimer.dom.js'; +import { MessageTimestamp } from './MessageTimestamp.dom.js'; +import { PanelType } from '../../types/Panels.std.js'; +import { Spinner } from '../Spinner.dom.js'; +import { ConfirmationDialog } from '../ConfirmationDialog.dom.js'; +import { refMerger } from '../../util/refMerger.std.js'; +import type { Size } from '../../hooks/useSizeObserver.dom.js'; +import { SizeObserver } from '../../hooks/useSizeObserver.dom.js'; type PropsType = { deletedForEveryone?: boolean; diff --git a/ts/components/conversation/MessageRequestActions.stories.tsx b/ts/components/conversation/MessageRequestActions.stories.tsx index 76185cce83..719d3c170b 100644 --- a/ts/components/conversation/MessageRequestActions.stories.tsx +++ b/ts/components/conversation/MessageRequestActions.stories.tsx @@ -4,11 +4,11 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { MessageRequestActions } from './MessageRequestActions.js'; +import { MessageRequestActions } from './MessageRequestActions.dom.js'; import { getDefaultConversation, getDefaultGroup, -} from '../../test-helpers/getDefaultConversation.js'; +} from '../../test-helpers/getDefaultConversation.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/MessageRequestActions.tsx b/ts/components/conversation/MessageRequestActions.tsx index 61a18fd140..68a62a55e2 100644 --- a/ts/components/conversation/MessageRequestActions.tsx +++ b/ts/components/conversation/MessageRequestActions.tsx @@ -2,16 +2,16 @@ // SPDX-License-Identifier: AGPL-3.0-only import * as React from 'react'; -import { ContactName } from './ContactName.js'; -import { Button, ButtonVariant } from '../Button.js'; -import type { MessageRequestActionsConfirmationProps } from './MessageRequestActionsConfirmation.js'; +import { ContactName } from './ContactName.dom.js'; +import { Button, ButtonVariant } from '../Button.dom.js'; +import type { MessageRequestActionsConfirmationProps } from './MessageRequestActionsConfirmation.dom.js'; import { MessageRequestActionsConfirmation, MessageRequestState, -} from './MessageRequestActionsConfirmation.js'; -import { I18n } from '../I18n.js'; -import type { LocalizerType } from '../../types/Util.js'; -import { strictAssert } from '../../util/assert.js'; +} from './MessageRequestActionsConfirmation.dom.js'; +import { I18n } from '../I18n.dom.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import { strictAssert } from '../../util/assert.std.js'; export type Props = { i18n: LocalizerType; diff --git a/ts/components/conversation/MessageRequestActionsConfirmation.tsx b/ts/components/conversation/MessageRequestActionsConfirmation.tsx index 53e33d7c07..db95b695ed 100644 --- a/ts/components/conversation/MessageRequestActionsConfirmation.tsx +++ b/ts/components/conversation/MessageRequestActionsConfirmation.tsx @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import * as React from 'react'; -import type { ContactNameData } from './ContactName.js'; -import { ContactName } from './ContactName.js'; -import { ConfirmationDialog } from '../ConfirmationDialog.js'; -import { I18n } from '../I18n.js'; -import type { LocalizerType } from '../../types/Util.js'; +import type { ContactNameData } from './ContactName.dom.js'; +import { ContactName } from './ContactName.dom.js'; +import { ConfirmationDialog } from '../ConfirmationDialog.dom.js'; +import { I18n } from '../I18n.dom.js'; +import type { LocalizerType } from '../../types/Util.std.js'; export enum MessageRequestState { blocking, diff --git a/ts/components/conversation/MessageRequestResponseNotification.tsx b/ts/components/conversation/MessageRequestResponseNotification.tsx index 2c89ae6384..02dde9c9c6 100644 --- a/ts/components/conversation/MessageRequestResponseNotification.tsx +++ b/ts/components/conversation/MessageRequestResponseNotification.tsx @@ -1,12 +1,12 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import React, { useState } from 'react'; -import type { LocalizerType } from '../../types/I18N.js'; -import { SystemMessage } from './SystemMessage.js'; -import { Button, ButtonSize, ButtonVariant } from '../Button.js'; -import { MessageRequestState } from './MessageRequestActionsConfirmation.js'; -import { SafetyTipsModal } from '../SafetyTipsModal.js'; -import { MessageRequestResponseEvent } from '../../types/MessageRequestResponseEvent.js'; +import type { LocalizerType } from '../../types/I18N.std.js'; +import { SystemMessage } from './SystemMessage.dom.js'; +import { Button, ButtonSize, ButtonVariant } from '../Button.dom.js'; +import { MessageRequestState } from './MessageRequestActionsConfirmation.dom.js'; +import { SafetyTipsModal } from '../SafetyTipsModal.dom.js'; +import { MessageRequestResponseEvent } from '../../types/MessageRequestResponseEvent.std.js'; export type MessageRequestResponseNotificationData = { messageRequestResponseEvent: MessageRequestResponseEvent; diff --git a/ts/components/conversation/MessageTextRenderer.tsx b/ts/components/conversation/MessageTextRenderer.tsx index b922126e88..4ae4e1ae41 100644 --- a/ts/components/conversation/MessageTextRenderer.tsx +++ b/ts/components/conversation/MessageTextRenderer.tsx @@ -7,25 +7,25 @@ import classNames from 'classnames'; import emojiRegex from 'emoji-regex'; import lodash from 'lodash'; -import { linkify, SUPPORTED_PROTOCOLS } from './Linkify.js'; +import { linkify, SUPPORTED_PROTOCOLS } from './Linkify.dom.js'; import type { BodyRangesForDisplayType, DisplayNode, HydratedBodyRangeMention, RangeNode, -} from '../../types/BodyRange.js'; +} from '../../types/BodyRange.std.js'; import { BodyRange, insertRange, collapseRangeTree, groupContiguousSpoilers, -} from '../../types/BodyRange.js'; -import { AtMention } from './AtMention.js'; -import { isLinkSneaky } from '../../types/LinkPreview.js'; -import { Emojify } from './Emojify.js'; -import { AddNewLines } from './AddNewLines.js'; -import type { LocalizerType } from '../../types/Util.js'; -import type { FunJumboEmojiSize } from '../fun/FunEmoji.js'; +} from '../../types/BodyRange.std.js'; +import { AtMention } from './AtMention.dom.js'; +import { isLinkSneaky } from '../../types/LinkPreview.std.js'; +import { Emojify } from './Emojify.dom.js'; +import { AddNewLines } from './AddNewLines.dom.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import type { FunJumboEmojiSize } from '../fun/FunEmoji.dom.js'; const { sortBy } = lodash; diff --git a/ts/components/conversation/MessageTimestamp.stories.tsx b/ts/components/conversation/MessageTimestamp.stories.tsx index 3fc0c5ebf3..66cef3cae4 100644 --- a/ts/components/conversation/MessageTimestamp.stories.tsx +++ b/ts/components/conversation/MessageTimestamp.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './MessageTimestamp.js'; -import { MessageTimestamp } from './MessageTimestamp.js'; +import type { Props } from './MessageTimestamp.dom.js'; +import { MessageTimestamp } from './MessageTimestamp.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/MessageTimestamp.tsx b/ts/components/conversation/MessageTimestamp.tsx index 279f126ea7..1d8ef287d5 100644 --- a/ts/components/conversation/MessageTimestamp.tsx +++ b/ts/components/conversation/MessageTimestamp.tsx @@ -5,11 +5,11 @@ import type { ReactElement } from 'react'; import React from 'react'; import classNames from 'classnames'; -import { formatTime } from '../../util/timestamp.js'; +import { formatTime } from '../../util/formatTimestamp.dom.js'; -import type { LocalizerType } from '../../types/Util.js'; -import { Time } from '../Time.js'; -import { useNowThatUpdatesEveryMinute } from '../../hooks/useNowThatUpdatesEveryMinute.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import { Time } from '../Time.dom.js'; +import { useNowThatUpdatesEveryMinute } from '../../hooks/useNowThatUpdatesEveryMinute.std.js'; export type Props = { direction?: 'incoming' | 'outgoing'; diff --git a/ts/components/conversation/PaymentEventNotification.tsx b/ts/components/conversation/PaymentEventNotification.tsx index b248430f71..65888570ee 100644 --- a/ts/components/conversation/PaymentEventNotification.tsx +++ b/ts/components/conversation/PaymentEventNotification.tsx @@ -3,12 +3,12 @@ import React from 'react'; -import type { LocalizerType } from '../../types/Util.js'; -import type { ConversationType } from '../../state/ducks/conversations.js'; -import { SystemMessage } from './SystemMessage.js'; -import { Emojify } from './Emojify.js'; -import type { AnyPaymentEvent } from '../../types/Payment.js'; -import { getPaymentEventDescription } from '../../messages/payments.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import type { ConversationType } from '../../state/ducks/conversations.preload.js'; +import { SystemMessage } from './SystemMessage.dom.js'; +import { Emojify } from './Emojify.dom.js'; +import type { AnyPaymentEvent } from '../../types/Payment.std.js'; +import { getPaymentEventDescription } from '../../messages/payments.std.js'; export type PropsType = { event: AnyPaymentEvent; diff --git a/ts/components/conversation/PhoneNumberDiscoveryNotification.stories.tsx b/ts/components/conversation/PhoneNumberDiscoveryNotification.stories.tsx index ca44bb60c6..70f74820b9 100644 --- a/ts/components/conversation/PhoneNumberDiscoveryNotification.stories.tsx +++ b/ts/components/conversation/PhoneNumberDiscoveryNotification.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './PhoneNumberDiscoveryNotification.js'; -import { PhoneNumberDiscoveryNotification } from './PhoneNumberDiscoveryNotification.js'; +import type { PropsType } from './PhoneNumberDiscoveryNotification.dom.js'; +import { PhoneNumberDiscoveryNotification } from './PhoneNumberDiscoveryNotification.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/PhoneNumberDiscoveryNotification.tsx b/ts/components/conversation/PhoneNumberDiscoveryNotification.tsx index 12a4605b8e..42a3e9bb1c 100644 --- a/ts/components/conversation/PhoneNumberDiscoveryNotification.tsx +++ b/ts/components/conversation/PhoneNumberDiscoveryNotification.tsx @@ -3,10 +3,10 @@ import React from 'react'; -import type { LocalizerType } from '../../types/Util.js'; -import { SystemMessage } from './SystemMessage.js'; -import { Emojify } from './Emojify.js'; -import { getStringForPhoneNumberDiscovery } from '../../util/getStringForPhoneNumberDiscovery.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import { SystemMessage } from './SystemMessage.dom.js'; +import { Emojify } from './Emojify.dom.js'; +import { getStringForPhoneNumberDiscovery } from '../../util/getStringForPhoneNumberDiscovery.std.js'; export type PropsDataType = { conversationTitle: string; diff --git a/ts/components/conversation/ProfileChangeNotification.stories.tsx b/ts/components/conversation/ProfileChangeNotification.stories.tsx index 6fa4cf51eb..c0d3f512d3 100644 --- a/ts/components/conversation/ProfileChangeNotification.stories.tsx +++ b/ts/components/conversation/ProfileChangeNotification.stories.tsx @@ -4,9 +4,9 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; import { action } from '@storybook/addon-actions'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; -import type { PropsType } from './ProfileChangeNotification.js'; -import { ProfileChangeNotification } from './ProfileChangeNotification.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.std.js'; +import type { PropsType } from './ProfileChangeNotification.dom.js'; +import { ProfileChangeNotification } from './ProfileChangeNotification.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/ProfileChangeNotification.tsx b/ts/components/conversation/ProfileChangeNotification.tsx index 0a9523e3bf..cfb0c857ae 100644 --- a/ts/components/conversation/ProfileChangeNotification.tsx +++ b/ts/components/conversation/ProfileChangeNotification.tsx @@ -3,13 +3,13 @@ import React, { useCallback } from 'react'; -import type { LocalizerType } from '../../types/Util.js'; -import type { ConversationType } from '../../state/ducks/conversations.js'; -import { SystemMessage } from './SystemMessage.js'; -import { Emojify } from './Emojify.js'; -import type { ProfileNameChangeType } from '../../util/getStringForProfileChange.js'; -import { getStringForProfileChange } from '../../util/getStringForProfileChange.js'; -import { Button, ButtonSize, ButtonVariant } from '../Button.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import type { ConversationType } from '../../state/ducks/conversations.preload.js'; +import { SystemMessage } from './SystemMessage.dom.js'; +import { Emojify } from './Emojify.dom.js'; +import type { ProfileNameChangeType } from '../../util/getStringForProfileChange.std.js'; +import { getStringForProfileChange } from '../../util/getStringForProfileChange.std.js'; +import { Button, ButtonSize, ButtonVariant } from '../Button.dom.js'; export type PropsType = { change: ProfileNameChangeType; diff --git a/ts/components/conversation/ProfileNameWarningModal.stories.tsx b/ts/components/conversation/ProfileNameWarningModal.stories.tsx index 53be553043..50ee15307f 100644 --- a/ts/components/conversation/ProfileNameWarningModal.stories.tsx +++ b/ts/components/conversation/ProfileNameWarningModal.stories.tsx @@ -3,9 +3,9 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; -import type { PropsType } from './ProfileNameWarningModal.js'; -import { ProfileNameWarningModal } from './ProfileNameWarningModal.js'; -import { type ComponentMeta } from '../../storybook/types.js'; +import type { PropsType } from './ProfileNameWarningModal.dom.js'; +import { ProfileNameWarningModal } from './ProfileNameWarningModal.dom.js'; +import { type ComponentMeta } from '../../storybook/types.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/ProfileNameWarningModal.tsx b/ts/components/conversation/ProfileNameWarningModal.tsx index 4222220eae..7bb4712778 100644 --- a/ts/components/conversation/ProfileNameWarningModal.tsx +++ b/ts/components/conversation/ProfileNameWarningModal.tsx @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import { Modal } from '../Modal.js'; -import type { LocalizerType } from '../../types/Util.js'; +import { Modal } from '../Modal.dom.js'; +import type { LocalizerType } from '../../types/Util.std.js'; export type PropsType = Readonly<{ conversationType: 'group' | 'direct'; diff --git a/ts/components/conversation/Quote.stories.tsx b/ts/components/conversation/Quote.stories.tsx index 98e7c5d3e2..020da774f5 100644 --- a/ts/components/conversation/Quote.stories.tsx +++ b/ts/components/conversation/Quote.stories.tsx @@ -6,11 +6,11 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; -import { ConversationColors } from '../../types/Colors.js'; -import { pngUrl } from '../../storybook/Fixtures.js'; -import type { Props as TimelineMessagesProps } from './TimelineMessage.js'; -import { TimelineMessage } from './TimelineMessage.js'; -import { TextDirection } from './Message.js'; +import { ConversationColors } from '../../types/Colors.std.js'; +import { pngUrl } from '../../storybook/Fixtures.std.js'; +import type { Props as TimelineMessagesProps } from './TimelineMessage.dom.js'; +import { TimelineMessage } from './TimelineMessage.dom.js'; +import { TextDirection } from './Message.dom.js'; import { AUDIO_MP3, IMAGE_PNG, @@ -18,14 +18,14 @@ import { LONG_MESSAGE, VIDEO_MP4, stringToMIMEType, -} from '../../types/MIME.js'; -import type { Props } from './Quote.js'; -import { Quote } from './Quote.js'; -import { ReadStatus } from '../../messages/MessageReadStatus.js'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; -import { WidthBreakpoint } from '../_util.js'; -import { ThemeType } from '../../types/Util.js'; -import { PaymentEventKind } from '../../types/Payment.js'; +} from '../../types/MIME.std.js'; +import type { Props } from './Quote.dom.js'; +import { Quote } from './Quote.dom.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.std.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.std.js'; +import { WidthBreakpoint } from '../_util.std.js'; +import { ThemeType } from '../../types/Util.std.js'; +import { PaymentEventKind } from '../../types/Payment.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/Quote.tsx b/ts/components/conversation/Quote.tsx index 4af3f98e03..4f4eef8a56 100644 --- a/ts/components/conversation/Quote.tsx +++ b/ts/components/conversation/Quote.tsx @@ -6,28 +6,31 @@ import React, { useRef, useState, useEffect } from 'react'; import lodash from 'lodash'; import classNames from 'classnames'; -import * as MIME from '../../types/MIME.js'; -import * as GoogleChrome from '../../util/GoogleChrome.js'; +import * as MIME from '../../types/MIME.std.js'; +import * as GoogleChrome from '../../util/GoogleChrome.std.js'; -import { MessageBody } from './MessageBody.js'; -import type { AttachmentType, ThumbnailType } from '../../types/Attachment.js'; -import type { HydratedBodyRangesType } from '../../types/BodyRange.js'; -import type { LocalizerType } from '../../types/Util.js'; +import { MessageBody } from './MessageBody.dom.js'; +import type { + AttachmentType, + ThumbnailType, +} from '../../types/Attachment.std.js'; +import type { HydratedBodyRangesType } from '../../types/BodyRange.std.js'; +import type { LocalizerType } from '../../types/Util.std.js'; import type { ConversationColorType, CustomColorType, -} from '../../types/Colors.js'; -import { ContactName } from './ContactName.js'; -import { Emojify } from './Emojify.js'; -import { TextAttachment } from '../TextAttachment.js'; -import { getClassNamesFor } from '../../util/getClassNamesFor.js'; -import { getCustomColorStyle } from '../../util/getCustomColorStyle.js'; -import type { AnyPaymentEvent } from '../../types/Payment.js'; -import { PaymentEventKind } from '../../types/Payment.js'; -import { getPaymentEventNotificationText } from '../../messages/payments.js'; -import { shouldTryToCopyFromQuotedMessage } from '../../messages/helpers.js'; -import { RenderLocation } from './MessageTextRenderer.js'; -import type { QuotedAttachmentType } from '../../model-types.js'; +} from '../../types/Colors.std.js'; +import { ContactName } from './ContactName.dom.js'; +import { Emojify } from './Emojify.dom.js'; +import { TextAttachment } from '../TextAttachment.dom.js'; +import { getClassNamesFor } from '../../util/getClassNamesFor.std.js'; +import { getCustomColorStyle } from '../../util/getCustomColorStyle.dom.js'; +import type { AnyPaymentEvent } from '../../types/Payment.std.js'; +import { PaymentEventKind } from '../../types/Payment.std.js'; +import { getPaymentEventNotificationText } from '../../messages/payments.std.js'; +import { shouldTryToCopyFromQuotedMessage } from '../../messages/helpers.std.js'; +import { RenderLocation } from './MessageTextRenderer.dom.js'; +import type { QuotedAttachmentType } from '../../model-types.d.ts'; const { noop } = lodash; diff --git a/ts/components/conversation/ReactionPicker.stories.tsx b/ts/components/conversation/ReactionPicker.stories.tsx index 22aa997f14..0bc0c3b048 100644 --- a/ts/components/conversation/ReactionPicker.stories.tsx +++ b/ts/components/conversation/ReactionPicker.stories.tsx @@ -4,9 +4,9 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props as ReactionPickerProps } from './ReactionPicker.js'; -import { ReactionPicker } from './ReactionPicker.js'; -import { DEFAULT_PREFERRED_REACTION_EMOJI } from '../../reactions/constants.js'; +import type { Props as ReactionPickerProps } from './ReactionPicker.dom.js'; +import { ReactionPicker } from './ReactionPicker.dom.js'; +import { DEFAULT_PREFERRED_REACTION_EMOJI } from '../../reactions/constants.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/ReactionPicker.tsx b/ts/components/conversation/ReactionPicker.tsx index e57f0dfadd..838b5b7027 100644 --- a/ts/components/conversation/ReactionPicker.tsx +++ b/ts/components/conversation/ReactionPicker.tsx @@ -3,17 +3,17 @@ import React, { useCallback, useState, useEffect } from 'react'; import { Button } from 'react-aria-components'; -import { useDelayedRestoreFocus } from '../../hooks/useRestoreFocus.js'; -import type { LocalizerType, ThemeType } from '../../types/Util.js'; +import { useDelayedRestoreFocus } from '../../hooks/useRestoreFocus.dom.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.std.js'; import { ReactionPickerPicker, ReactionPickerPickerEmojiButton, ReactionPickerPickerStyle, -} from '../ReactionPickerPicker.js'; -import type { EmojiVariantKey } from '../fun/data/emojis.js'; -import { getEmojiVariantByKey } from '../fun/data/emojis.js'; -import { FunEmojiPicker } from '../fun/FunEmojiPicker.js'; -import type { FunEmojiSelection } from '../fun/panels/FunPanelEmojis.js'; +} from '../ReactionPickerPicker.dom.js'; +import type { EmojiVariantKey } from '../fun/data/emojis.std.js'; +import { getEmojiVariantByKey } from '../fun/data/emojis.std.js'; +import { FunEmojiPicker } from '../fun/FunEmojiPicker.dom.js'; +import type { FunEmojiSelection } from '../fun/panels/FunPanelEmojis.dom.js'; export type OwnProps = { i18n: LocalizerType; diff --git a/ts/components/conversation/ReactionViewer.stories.tsx b/ts/components/conversation/ReactionViewer.stories.tsx index 13e3adeca0..c3d71ca9c9 100644 --- a/ts/components/conversation/ReactionViewer.stories.tsx +++ b/ts/components/conversation/ReactionViewer.stories.tsx @@ -4,10 +4,10 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './ReactionViewer.js'; -import { ReactionViewer } from './ReactionViewer.js'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; -import { ThemeType } from '../../types/Util.js'; +import type { Props } from './ReactionViewer.dom.js'; +import { ReactionViewer } from './ReactionViewer.dom.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.std.js'; +import { ThemeType } from '../../types/Util.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/ReactionViewer.tsx b/ts/components/conversation/ReactionViewer.tsx index a6275ce6c3..02fd196538 100644 --- a/ts/components/conversation/ReactionViewer.tsx +++ b/ts/components/conversation/ReactionViewer.tsx @@ -4,25 +4,28 @@ import * as React from 'react'; import lodash from 'lodash'; import classNames from 'classnames'; -import { ContactName } from './ContactName.js'; -import type { Props as AvatarProps } from '../Avatar.js'; -import { Avatar } from '../Avatar.js'; -import { useRestoreFocus } from '../../hooks/useRestoreFocus.js'; -import type { ConversationType } from '../../state/ducks/conversations.js'; -import type { PreferredBadgeSelectorType } from '../../state/selectors/badges.js'; -import { useEscapeHandling } from '../../hooks/useEscapeHandling.js'; -import type { ThemeType } from '../../types/Util.js'; -import type { EmojiParentKey, EmojiVariantKey } from '../fun/data/emojis.js'; +import { ContactName } from './ContactName.dom.js'; +import type { Props as AvatarProps } from '../Avatar.dom.js'; +import { Avatar } from '../Avatar.dom.js'; +import { useRestoreFocus } from '../../hooks/useRestoreFocus.dom.js'; +import type { ConversationType } from '../../state/ducks/conversations.preload.js'; +import type { PreferredBadgeSelectorType } from '../../state/selectors/badges.preload.js'; +import { useEscapeHandling } from '../../hooks/useEscapeHandling.dom.js'; +import type { ThemeType } from '../../types/Util.std.js'; +import type { + EmojiParentKey, + EmojiVariantKey, +} from '../fun/data/emojis.std.js'; import { EMOJI_PARENT_KEY_CONSTANTS, getEmojiParentKeyByVariantKey, getEmojiVariantByKey, getEmojiVariantKeyByValue, isEmojiVariantValue, -} from '../fun/data/emojis.js'; -import { strictAssert } from '../../util/assert.js'; -import { FunStaticEmoji } from '../fun/FunEmoji.js'; -import { useFunEmojiLocalizer } from '../fun/useFunEmojiLocalizer.js'; +} from '../fun/data/emojis.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { FunStaticEmoji } from '../fun/FunEmoji.dom.js'; +import { useFunEmojiLocalizer } from '../fun/useFunEmojiLocalizer.dom.js'; const { mapValues, orderBy } = lodash; diff --git a/ts/components/conversation/RemoveGroupMemberConfirmationDialog.tsx b/ts/components/conversation/RemoveGroupMemberConfirmationDialog.tsx index a3d8ff4bcb..9fd9d1099d 100644 --- a/ts/components/conversation/RemoveGroupMemberConfirmationDialog.tsx +++ b/ts/components/conversation/RemoveGroupMemberConfirmationDialog.tsx @@ -3,13 +3,13 @@ import React from 'react'; -import type { ConversationType } from '../../state/ducks/conversations.js'; -import type { LocalizerType } from '../../types/Util.js'; -import { isAccessControlEnabled } from '../../groups/util.js'; +import type { ConversationType } from '../../state/ducks/conversations.preload.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import { isAccessControlEnabled } from '../../groups/util.std.js'; -import { ConfirmationDialog } from '../ConfirmationDialog.js'; -import { I18n } from '../I18n.js'; -import { ContactName } from './ContactName.js'; +import { ConfirmationDialog } from '../ConfirmationDialog.dom.js'; +import { I18n } from '../I18n.dom.js'; +import { ContactName } from './ContactName.dom.js'; type PropsType = { group: ConversationType; diff --git a/ts/components/conversation/ResetSessionNotification.stories.tsx b/ts/components/conversation/ResetSessionNotification.stories.tsx index 02f2472032..1e3ada90bd 100644 --- a/ts/components/conversation/ResetSessionNotification.stories.tsx +++ b/ts/components/conversation/ResetSessionNotification.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './ResetSessionNotification.js'; -import { ResetSessionNotification } from './ResetSessionNotification.js'; +import type { Props } from './ResetSessionNotification.dom.js'; +import { ResetSessionNotification } from './ResetSessionNotification.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/ResetSessionNotification.tsx b/ts/components/conversation/ResetSessionNotification.tsx index c3945382a0..65e2d3ad04 100644 --- a/ts/components/conversation/ResetSessionNotification.tsx +++ b/ts/components/conversation/ResetSessionNotification.tsx @@ -3,8 +3,8 @@ import React from 'react'; -import type { LocalizerType } from '../../types/Util.js'; -import { SystemMessage } from './SystemMessage.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import { SystemMessage } from './SystemMessage.dom.js'; export type Props = { i18n: LocalizerType; diff --git a/ts/components/conversation/SafetyNumberNotification.stories.tsx b/ts/components/conversation/SafetyNumberNotification.stories.tsx index 3fb8e754d6..c20b59ffcd 100644 --- a/ts/components/conversation/SafetyNumberNotification.stories.tsx +++ b/ts/components/conversation/SafetyNumberNotification.stories.tsx @@ -4,8 +4,8 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { ContactType, Props } from './SafetyNumberNotification.js'; -import { SafetyNumberNotification } from './SafetyNumberNotification.js'; +import type { ContactType, Props } from './SafetyNumberNotification.dom.js'; +import { SafetyNumberNotification } from './SafetyNumberNotification.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/SafetyNumberNotification.tsx b/ts/components/conversation/SafetyNumberNotification.tsx index 344bd1cc75..2001d85683 100644 --- a/ts/components/conversation/SafetyNumberNotification.tsx +++ b/ts/components/conversation/SafetyNumberNotification.tsx @@ -3,11 +3,11 @@ import React from 'react'; -import { Button, ButtonSize, ButtonVariant } from '../Button.js'; -import { SystemMessage } from './SystemMessage.js'; -import { ContactName } from './ContactName.js'; -import { I18n } from '../I18n.js'; -import type { LocalizerType } from '../../types/Util.js'; +import { Button, ButtonSize, ButtonVariant } from '../Button.dom.js'; +import { SystemMessage } from './SystemMessage.dom.js'; +import { ContactName } from './ContactName.dom.js'; +import { I18n } from '../I18n.dom.js'; +import type { LocalizerType } from '../../types/Util.std.js'; export type ContactType = { id: string; diff --git a/ts/components/conversation/ScrollDownButton.stories.tsx b/ts/components/conversation/ScrollDownButton.stories.tsx index 81c322e241..24322c3a99 100644 --- a/ts/components/conversation/ScrollDownButton.stories.tsx +++ b/ts/components/conversation/ScrollDownButton.stories.tsx @@ -5,11 +5,11 @@ import * as React from 'react'; import type { Meta, StoryFn } from '@storybook/react'; import { action } from '@storybook/addon-actions'; -import type { ScrollDownButtonPropsType } from './ScrollDownButton.js'; +import type { ScrollDownButtonPropsType } from './ScrollDownButton.dom.js'; import { ScrollDownButton, ScrollDownButtonVariant, -} from './ScrollDownButton.js'; +} from './ScrollDownButton.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/ScrollDownButton.tsx b/ts/components/conversation/ScrollDownButton.tsx index 0516405846..ab66457cae 100644 --- a/ts/components/conversation/ScrollDownButton.tsx +++ b/ts/components/conversation/ScrollDownButton.tsx @@ -4,8 +4,8 @@ import classNames from 'classnames'; import React from 'react'; -import type { LocalizerType } from '../../types/Util.js'; -import { getClassNamesFor } from '../../util/getClassNamesFor.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import { getClassNamesFor } from '../../util/getClassNamesFor.std.js'; export enum ScrollDownButtonVariant { UNREAD_MESSAGES = 'unread-messages', diff --git a/ts/components/conversation/SelectModeActions.tsx b/ts/components/conversation/SelectModeActions.tsx index 7f2b138951..751c212cfc 100644 --- a/ts/components/conversation/SelectModeActions.tsx +++ b/ts/components/conversation/SelectModeActions.tsx @@ -3,9 +3,9 @@ import classNames from 'classnames'; import React from 'react'; -import type { ShowToastAction } from '../../state/ducks/toast.js'; -import { ToastType } from '../../types/Toast.js'; -import type { LocalizerType } from '../../types/Util.js'; +import type { ShowToastAction } from '../../state/ducks/toast.preload.js'; +import { ToastType } from '../../types/Toast.dom.js'; +import type { LocalizerType } from '../../types/Util.std.js'; // Keep this in sync with iOS and Android const MAX_FORWARD_COUNT = 30; diff --git a/ts/components/conversation/SignalConversationMuteToggle.tsx b/ts/components/conversation/SignalConversationMuteToggle.tsx index d8f36e8b7b..0ae7c6afd9 100644 --- a/ts/components/conversation/SignalConversationMuteToggle.tsx +++ b/ts/components/conversation/SignalConversationMuteToggle.tsx @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import type { LocalizerType } from '../../types/I18N.js'; +import type { LocalizerType } from '../../types/I18N.std.js'; type Props = { isMuted: boolean; diff --git a/ts/components/conversation/StagedGenericAttachment.stories.tsx b/ts/components/conversation/StagedGenericAttachment.stories.tsx index bf9430616b..fdad4438d8 100644 --- a/ts/components/conversation/StagedGenericAttachment.stories.tsx +++ b/ts/components/conversation/StagedGenericAttachment.stories.tsx @@ -4,10 +4,10 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { AttachmentType } from '../../types/Attachment.js'; -import { stringToMIMEType } from '../../types/MIME.js'; -import type { Props } from './StagedGenericAttachment.js'; -import { StagedGenericAttachment } from './StagedGenericAttachment.js'; +import type { AttachmentType } from '../../types/Attachment.std.js'; +import { stringToMIMEType } from '../../types/MIME.std.js'; +import type { Props } from './StagedGenericAttachment.dom.js'; +import { StagedGenericAttachment } from './StagedGenericAttachment.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/StagedGenericAttachment.tsx b/ts/components/conversation/StagedGenericAttachment.tsx index c73ec0d9e2..e7d2857d22 100644 --- a/ts/components/conversation/StagedGenericAttachment.tsx +++ b/ts/components/conversation/StagedGenericAttachment.tsx @@ -3,9 +3,9 @@ import React from 'react'; -import type { AttachmentType } from '../../types/Attachment.js'; -import type { LocalizerType } from '../../types/Util.js'; -import { FileThumbnail } from '../FileThumbnail.js'; +import type { AttachmentType } from '../../types/Attachment.std.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import { FileThumbnail } from '../FileThumbnail.dom.js'; export type Props = { attachment: AttachmentType; diff --git a/ts/components/conversation/StagedLinkPreview.stories.tsx b/ts/components/conversation/StagedLinkPreview.stories.tsx index 749bf84f93..a1f9ee3ab5 100644 --- a/ts/components/conversation/StagedLinkPreview.stories.tsx +++ b/ts/components/conversation/StagedLinkPreview.stories.tsx @@ -5,10 +5,10 @@ import type { Meta, StoryFn } from '@storybook/react'; import * as React from 'react'; import { action } from '@storybook/addon-actions'; -import type { Props } from './StagedLinkPreview.js'; -import { StagedLinkPreview } from './StagedLinkPreview.js'; -import { fakeAttachment } from '../../test-helpers/fakeAttachment.js'; -import { IMAGE_JPEG } from '../../types/MIME.js'; +import type { Props } from './StagedLinkPreview.dom.js'; +import { StagedLinkPreview } from './StagedLinkPreview.dom.js'; +import { fakeAttachment } from '../../test-helpers/fakeAttachment.std.js'; +import { IMAGE_JPEG } from '../../types/MIME.std.js'; const LONG_TITLE = "This is a super-sweet site. And it's got some really amazing content in store for you if you just click that link. Can you click that link for me?"; diff --git a/ts/components/conversation/StagedLinkPreview.tsx b/ts/components/conversation/StagedLinkPreview.tsx index 6ab03ff9d7..f955636f48 100644 --- a/ts/components/conversation/StagedLinkPreview.tsx +++ b/ts/components/conversation/StagedLinkPreview.tsx @@ -5,17 +5,17 @@ import React from 'react'; import classNames from 'classnames'; import lodash from 'lodash'; -import { CurveType, Image } from './Image.js'; -import { LinkPreviewDate } from './LinkPreviewDate.js'; +import { CurveType, Image } from './Image.dom.js'; +import { LinkPreviewDate } from './LinkPreviewDate.dom.js'; -import type { LinkPreviewForUIType } from '../../types/message/LinkPreviews.js'; -import type { LocalizerType } from '../../types/Util.js'; -import { getClassNamesFor } from '../../util/getClassNamesFor.js'; -import { isImageAttachment } from '../../util/Attachment.js'; -import { isCallLink } from '../../types/LinkPreview.js'; -import { Avatar } from '../Avatar.js'; -import { getColorForCallLink } from '../../util/getColorForCallLink.js'; -import { getKeyFromCallLink } from '../../util/callLinks.js'; +import type { LinkPreviewForUIType } from '../../types/message/LinkPreviews.std.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import { getClassNamesFor } from '../../util/getClassNamesFor.std.js'; +import { isImageAttachment } from '../../util/Attachment.std.js'; +import { isCallLink } from '../../types/LinkPreview.std.js'; +import { Avatar } from '../Avatar.dom.js'; +import { getColorForCallLink } from '../../util/getColorForCallLink.std.js'; +import { getKeyFromCallLink } from '../../util/callLinks.std.js'; const { unescape } = lodash; diff --git a/ts/components/conversation/StagedPlaceholderAttachment.stories.tsx b/ts/components/conversation/StagedPlaceholderAttachment.stories.tsx index c4d55273fe..2e2e792ceb 100644 --- a/ts/components/conversation/StagedPlaceholderAttachment.stories.tsx +++ b/ts/components/conversation/StagedPlaceholderAttachment.stories.tsx @@ -4,8 +4,8 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './StagedPlaceholderAttachment.js'; -import { StagedPlaceholderAttachment } from './StagedPlaceholderAttachment.js'; +import type { Props } from './StagedPlaceholderAttachment.dom.js'; +import { StagedPlaceholderAttachment } from './StagedPlaceholderAttachment.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/StagedPlaceholderAttachment.tsx b/ts/components/conversation/StagedPlaceholderAttachment.tsx index bf8b023472..28f2694023 100644 --- a/ts/components/conversation/StagedPlaceholderAttachment.tsx +++ b/ts/components/conversation/StagedPlaceholderAttachment.tsx @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import type { LocalizerType } from '../../types/Util.js'; +import type { LocalizerType } from '../../types/Util.std.js'; export type Props = { onClick: () => void; diff --git a/ts/components/conversation/SystemMessage.stories.tsx b/ts/components/conversation/SystemMessage.stories.tsx index b38fd926fe..c76a9c2d43 100644 --- a/ts/components/conversation/SystemMessage.stories.tsx +++ b/ts/components/conversation/SystemMessage.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './SystemMessage.js'; -import { SystemMessage, SystemMessageKind } from './SystemMessage.js'; +import type { PropsType } from './SystemMessage.dom.js'; +import { SystemMessage, SystemMessageKind } from './SystemMessage.dom.js'; export default { title: 'Components/Conversation/SystemMessage', diff --git a/ts/components/conversation/Timeline.stories.tsx b/ts/components/conversation/Timeline.stories.tsx index 4417437e21..c4dfa3f2f5 100644 --- a/ts/components/conversation/Timeline.stories.tsx +++ b/ts/components/conversation/Timeline.stories.tsx @@ -6,23 +6,23 @@ import lodash from 'lodash'; import { v4 as uuid } from 'uuid'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { DurationInSeconds } from '../../util/durations/index.js'; -import type { PropsType } from './Timeline.js'; -import { Timeline } from './Timeline.js'; -import type { TimelineItemType } from './TimelineItem.js'; -import { TimelineItem } from './TimelineItem.js'; +import { DurationInSeconds } from '../../util/durations/index.std.js'; +import type { PropsType } from './Timeline.dom.js'; +import { Timeline } from './Timeline.dom.js'; +import type { TimelineItemType } from './TimelineItem.dom.js'; +import { TimelineItem } from './TimelineItem.dom.js'; import { StorybookThemeContext } from '../../../.storybook/StorybookThemeContext.js'; -import { ConversationHero } from './ConversationHero.js'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; -import { TypingBubble } from './TypingBubble.js'; -import { ContactSpoofingType } from '../../util/contactSpoofing.js'; -import { ReadStatus } from '../../messages/MessageReadStatus.js'; -import type { WidthBreakpoint } from '../_util.js'; -import { ThemeType } from '../../types/Util.js'; -import { TextDirection } from './Message.js'; -import { PaymentEventKind } from '../../types/Payment.js'; -import type { PropsData as TimelineMessageProps } from './TimelineMessage.js'; -import { CollidingAvatars } from '../CollidingAvatars.js'; +import { ConversationHero } from './ConversationHero.dom.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.std.js'; +import { TypingBubble } from './TypingBubble.dom.js'; +import { ContactSpoofingType } from '../../util/contactSpoofing.std.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.std.js'; +import type { WidthBreakpoint } from '../_util.std.js'; +import { ThemeType } from '../../types/Util.std.js'; +import { TextDirection } from './Message.dom.js'; +import { PaymentEventKind } from '../../types/Payment.std.js'; +import type { PropsData as TimelineMessageProps } from './TimelineMessage.dom.js'; +import { CollidingAvatars } from '../CollidingAvatars.dom.js'; const { times } = lodash; diff --git a/ts/components/conversation/Timeline.tsx b/ts/components/conversation/Timeline.tsx index ff0e0cf04a..c27b17296f 100644 --- a/ts/components/conversation/Timeline.tsx +++ b/ts/components/conversation/Timeline.tsx @@ -10,45 +10,45 @@ import type { ReadonlyDeep } from 'type-fest'; import { ScrollDownButton, ScrollDownButtonVariant, -} from './ScrollDownButton.js'; +} from './ScrollDownButton.dom.js'; -import type { LocalizerType, ThemeType } from '../../types/Util.js'; -import type { ConversationType } from '../../state/ducks/conversations.js'; -import type { PreferredBadgeSelectorType } from '../../state/selectors/badges.js'; -import { assertDev, strictAssert } from '../../util/assert.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; -import { clearTimeoutIfNecessary } from '../../util/clearTimeoutIfNecessary.js'; -import { WidthBreakpoint } from '../_util.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.std.js'; +import type { ConversationType } from '../../state/ducks/conversations.preload.js'; +import type { PreferredBadgeSelectorType } from '../../state/selectors/badges.preload.js'; +import { assertDev, strictAssert } from '../../util/assert.std.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; +import { clearTimeoutIfNecessary } from '../../util/clearTimeoutIfNecessary.std.js'; +import { WidthBreakpoint } from '../_util.std.js'; -import { ErrorBoundary } from './ErrorBoundary.js'; -import { I18n } from '../I18n.js'; -import { TimelineWarning } from './TimelineWarning.js'; -import { TimelineWarnings } from './TimelineWarnings.js'; -import { NewlyCreatedGroupInvitedContactsDialog } from '../NewlyCreatedGroupInvitedContactsDialog.js'; -import { ContactSpoofingType } from '../../util/contactSpoofing.js'; -import type { PropsType as SmartContactSpoofingReviewDialogPropsType } from '../../state/smart/ContactSpoofingReviewDialog.js'; -import type { GroupNameCollisionsWithIdsByTitle } from '../../util/groupMemberNameCollisions.js'; -import { hasUnacknowledgedCollisions } from '../../util/groupMemberNameCollisions.js'; -import { TimelineFloatingHeader } from './TimelineFloatingHeader.js'; +import { ErrorBoundary } from './ErrorBoundary.dom.js'; +import { I18n } from '../I18n.dom.js'; +import { TimelineWarning } from './TimelineWarning.dom.js'; +import { TimelineWarnings } from './TimelineWarnings.dom.js'; +import { NewlyCreatedGroupInvitedContactsDialog } from '../NewlyCreatedGroupInvitedContactsDialog.dom.js'; +import { ContactSpoofingType } from '../../util/contactSpoofing.std.js'; +import type { PropsType as SmartContactSpoofingReviewDialogPropsType } from '../../state/smart/ContactSpoofingReviewDialog.preload.js'; +import type { GroupNameCollisionsWithIdsByTitle } from '../../util/groupMemberNameCollisions.std.js'; +import { hasUnacknowledgedCollisions } from '../../util/groupMemberNameCollisions.std.js'; +import { TimelineFloatingHeader } from './TimelineFloatingHeader.dom.js'; import { getScrollAnchorBeforeUpdate, getWidthBreakpoint, ScrollAnchor, TimelineMessageLoadingState, UnreadIndicatorPlacement, -} from '../../util/timelineUtil.js'; +} from '../../util/timelineUtil.std.js'; import { getScrollBottom, scrollToBottom, setScrollBottom, -} from '../../util/scrollUtil.js'; -import { LastSeenIndicator } from './LastSeenIndicator.js'; -import { MINUTE, SECOND } from '../../util/durations/index.js'; -import { SizeObserver } from '../../hooks/useSizeObserver.js'; +} from '../../util/scrollUtil.std.js'; +import { LastSeenIndicator } from './LastSeenIndicator.dom.js'; +import { MINUTE, SECOND } from '../../util/durations/index.std.js'; +import { SizeObserver } from '../../hooks/useSizeObserver.dom.js'; import { createScrollerLock, ScrollerLockContext, -} from '../../hooks/useScrollLock.js'; +} from '../../hooks/useScrollLock.dom.js'; const { first, get, isNumber, last, throttle } = lodash; diff --git a/ts/components/conversation/TimelineDateHeader.tsx b/ts/components/conversation/TimelineDateHeader.tsx index 7041954592..690578ad85 100644 --- a/ts/components/conversation/TimelineDateHeader.tsx +++ b/ts/components/conversation/TimelineDateHeader.tsx @@ -4,10 +4,10 @@ import type { ReactElement } from 'react'; import React, { useEffect, useState } from 'react'; import classNames from 'classnames'; -import * as durations from '../../util/durations/index.js'; -import type { LocalizerType } from '../../types/Util.js'; -import { formatDate } from '../../util/timestamp.js'; -import { Time } from '../Time.js'; +import * as durations from '../../util/durations/index.std.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import { formatDate } from '../../util/formatTimestamp.dom.js'; +import { Time } from '../Time.dom.js'; export function TimelineDateHeader({ floating = false, diff --git a/ts/components/conversation/TimelineFloatingHeader.stories.tsx b/ts/components/conversation/TimelineFloatingHeader.stories.tsx index fcf18acced..ef412b78e4 100644 --- a/ts/components/conversation/TimelineFloatingHeader.stories.tsx +++ b/ts/components/conversation/TimelineFloatingHeader.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './TimelineFloatingHeader.js'; -import { TimelineFloatingHeader } from './TimelineFloatingHeader.js'; +import type { PropsType } from './TimelineFloatingHeader.dom.js'; +import { TimelineFloatingHeader } from './TimelineFloatingHeader.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/TimelineFloatingHeader.tsx b/ts/components/conversation/TimelineFloatingHeader.tsx index df944ab9dc..c3728d7af7 100644 --- a/ts/components/conversation/TimelineFloatingHeader.tsx +++ b/ts/components/conversation/TimelineFloatingHeader.tsx @@ -6,10 +6,10 @@ import type { CSSProperties, ReactElement } from 'react'; import React, { useEffect, useState } from 'react'; import { animated, useSpring } from '@react-spring/web'; -import type { LocalizerType } from '../../types/Util.js'; -import { drop } from '../../util/drop.js'; -import { TimelineDateHeader } from './TimelineDateHeader.js'; -import { Spinner } from '../Spinner.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import { drop } from '../../util/drop.std.js'; +import { TimelineDateHeader } from './TimelineDateHeader.dom.js'; +import { Spinner } from '../Spinner.dom.js'; export type PropsType = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/conversation/TimelineItem.stories.tsx b/ts/components/conversation/TimelineItem.stories.tsx index 1e06c25daf..33ab42b746 100644 --- a/ts/components/conversation/TimelineItem.stories.tsx +++ b/ts/components/conversation/TimelineItem.stories.tsx @@ -4,17 +4,17 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { DurationInSeconds } from '../../util/durations/index.js'; -import type { PropsType as TimelineItemProps } from './TimelineItem.js'; -import { TimelineItem } from './TimelineItem.js'; -import { UniversalTimerNotification } from './UniversalTimerNotification.js'; -import { CallMode } from '../../types/CallDisposition.js'; -import { AvatarColors } from '../../types/Colors.js'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; -import { WidthBreakpoint } from '../_util.js'; -import { ThemeType } from '../../types/Util.js'; -import { PaymentEventKind } from '../../types/Payment.js'; -import { ErrorBoundary } from './ErrorBoundary.js'; +import { DurationInSeconds } from '../../util/durations/index.std.js'; +import type { PropsType as TimelineItemProps } from './TimelineItem.dom.js'; +import { TimelineItem } from './TimelineItem.dom.js'; +import { UniversalTimerNotification } from './UniversalTimerNotification.dom.js'; +import { CallMode } from '../../types/CallDisposition.std.js'; +import { AvatarColors } from '../../types/Colors.std.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.std.js'; +import { WidthBreakpoint } from '../_util.std.js'; +import { ThemeType } from '../../types/Util.std.js'; +import { PaymentEventKind } from '../../types/Payment.std.js'; +import { ErrorBoundary } from './ErrorBoundary.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/TimelineItem.tsx b/ts/components/conversation/TimelineItem.tsx index aa82dcaffd..acdb93c566 100644 --- a/ts/components/conversation/TimelineItem.tsx +++ b/ts/components/conversation/TimelineItem.tsx @@ -4,65 +4,65 @@ import type { ReactChild, RefObject } from 'react'; import React, { memo } from 'react'; -import type { LocalizerType, ThemeType } from '../../types/Util.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.std.js'; -import type { InteractionModeType } from '../../state/ducks/conversations.js'; -import { TimelineDateHeader } from './TimelineDateHeader.js'; +import type { InteractionModeType } from '../../state/ducks/conversations.preload.js'; +import { TimelineDateHeader } from './TimelineDateHeader.dom.js'; import type { Props as AllMessageProps, PropsData as TimelineMessageProps, PropsActions as MessageActionsType, -} from './TimelineMessage.js'; -import type { PropsActionsType as CallingNotificationActionsType } from './CallingNotification.js'; -import { CallingNotification } from './CallingNotification.js'; -import { ChatSessionRefreshedNotification } from './ChatSessionRefreshedNotification.js'; -import type { PropsDataType as DeliveryIssueProps } from './DeliveryIssueNotification.js'; -import { DeliveryIssueNotification } from './DeliveryIssueNotification.js'; -import type { PropsData as ChangeNumberNotificationProps } from './ChangeNumberNotification.js'; -import { ChangeNumberNotification } from './ChangeNumberNotification.js'; -import type { PropsData as JoinedSignalNotificationProps } from './JoinedSignalNotification.js'; -import { JoinedSignalNotification } from './JoinedSignalNotification.js'; -import type { PropsData as TitleTransitionNotificationProps } from './TitleTransitionNotification.js'; -import { TitleTransitionNotification } from './TitleTransitionNotification.js'; -import type { CallingNotificationType } from '../../util/callingNotification.js'; -import { InlineNotificationWrapper } from './InlineNotificationWrapper.js'; -import type { PropsData as UnsupportedMessageProps } from './UnsupportedMessage.js'; -import { UnsupportedMessage } from './UnsupportedMessage.js'; -import type { PropsData as TimerNotificationProps } from './TimerNotification.js'; -import { TimerNotification } from './TimerNotification.js'; +} from './TimelineMessage.dom.js'; +import type { PropsActionsType as CallingNotificationActionsType } from './CallingNotification.dom.js'; +import { CallingNotification } from './CallingNotification.dom.js'; +import { ChatSessionRefreshedNotification } from './ChatSessionRefreshedNotification.dom.js'; +import type { PropsDataType as DeliveryIssueProps } from './DeliveryIssueNotification.dom.js'; +import { DeliveryIssueNotification } from './DeliveryIssueNotification.dom.js'; +import type { PropsData as ChangeNumberNotificationProps } from './ChangeNumberNotification.dom.js'; +import { ChangeNumberNotification } from './ChangeNumberNotification.dom.js'; +import type { PropsData as JoinedSignalNotificationProps } from './JoinedSignalNotification.dom.js'; +import { JoinedSignalNotification } from './JoinedSignalNotification.dom.js'; +import type { PropsData as TitleTransitionNotificationProps } from './TitleTransitionNotification.dom.js'; +import { TitleTransitionNotification } from './TitleTransitionNotification.dom.js'; +import type { CallingNotificationType } from '../../util/callingNotification.std.js'; +import { InlineNotificationWrapper } from './InlineNotificationWrapper.dom.js'; +import type { PropsData as UnsupportedMessageProps } from './UnsupportedMessage.dom.js'; +import { UnsupportedMessage } from './UnsupportedMessage.dom.js'; +import type { PropsData as TimerNotificationProps } from './TimerNotification.dom.js'; +import { TimerNotification } from './TimerNotification.dom.js'; import type { PropsActions as SafetyNumberActionsType, PropsData as SafetyNumberNotificationProps, -} from './SafetyNumberNotification.js'; -import { SafetyNumberNotification } from './SafetyNumberNotification.js'; -import type { PropsData as VerificationNotificationProps } from './VerificationNotification.js'; -import { VerificationNotification } from './VerificationNotification.js'; -import type { PropsData as GroupNotificationProps } from './GroupNotification.js'; -import { GroupNotification } from './GroupNotification.js'; +} from './SafetyNumberNotification.dom.js'; +import { SafetyNumberNotification } from './SafetyNumberNotification.dom.js'; +import type { PropsData as VerificationNotificationProps } from './VerificationNotification.dom.js'; +import { VerificationNotification } from './VerificationNotification.dom.js'; +import type { PropsData as GroupNotificationProps } from './GroupNotification.dom.js'; +import { GroupNotification } from './GroupNotification.dom.js'; import type { PropsDataType as GroupV2ChangeProps, PropsActionsType as GroupV2ChangeActionsType, -} from './GroupV2Change.js'; -import { GroupV2Change } from './GroupV2Change.js'; -import type { PropsDataType as GroupV1MigrationProps } from './GroupV1Migration.js'; -import { GroupV1Migration } from './GroupV1Migration.js'; -import type { SmartContactRendererType } from '../../groupChange.js'; -import { ResetSessionNotification } from './ResetSessionNotification.js'; -import type { PropsType as ProfileChangeNotificationPropsType } from './ProfileChangeNotification.js'; -import { ProfileChangeNotification } from './ProfileChangeNotification.js'; -import type { PropsType as PaymentEventNotificationPropsType } from './PaymentEventNotification.js'; -import { PaymentEventNotification } from './PaymentEventNotification.js'; -import type { PropsDataType as ConversationMergeNotificationPropsType } from './ConversationMergeNotification.js'; -import { ConversationMergeNotification } from './ConversationMergeNotification.js'; -import type { PropsDataType as PhoneNumberDiscoveryNotificationPropsType } from './PhoneNumberDiscoveryNotification.js'; -import { PhoneNumberDiscoveryNotification } from './PhoneNumberDiscoveryNotification.js'; -import { SystemMessage } from './SystemMessage.js'; -import { TimelineMessage } from './TimelineMessage.js'; +} from './GroupV2Change.dom.js'; +import { GroupV2Change } from './GroupV2Change.dom.js'; +import type { PropsDataType as GroupV1MigrationProps } from './GroupV1Migration.dom.js'; +import { GroupV1Migration } from './GroupV1Migration.dom.js'; +import type { SmartContactRendererType } from '../../groupChange.std.js'; +import { ResetSessionNotification } from './ResetSessionNotification.dom.js'; +import type { PropsType as ProfileChangeNotificationPropsType } from './ProfileChangeNotification.dom.js'; +import { ProfileChangeNotification } from './ProfileChangeNotification.dom.js'; +import type { PropsType as PaymentEventNotificationPropsType } from './PaymentEventNotification.dom.js'; +import { PaymentEventNotification } from './PaymentEventNotification.dom.js'; +import type { PropsDataType as ConversationMergeNotificationPropsType } from './ConversationMergeNotification.dom.js'; +import { ConversationMergeNotification } from './ConversationMergeNotification.dom.js'; +import type { PropsDataType as PhoneNumberDiscoveryNotificationPropsType } from './PhoneNumberDiscoveryNotification.dom.js'; +import { PhoneNumberDiscoveryNotification } from './PhoneNumberDiscoveryNotification.dom.js'; +import { SystemMessage } from './SystemMessage.dom.js'; +import { TimelineMessage } from './TimelineMessage.dom.js'; import { MessageRequestResponseNotification, type MessageRequestResponseNotificationData, -} from './MessageRequestResponseNotification.js'; -import type { MessageRequestState } from './MessageRequestActionsConfirmation.js'; +} from './MessageRequestResponseNotification.dom.js'; +import type { MessageRequestState } from './MessageRequestActionsConfirmation.dom.js'; type CallHistoryType = { type: 'callHistory'; diff --git a/ts/components/conversation/TimelineMessage.stories.tsx b/ts/components/conversation/TimelineMessage.stories.tsx index 8e76808cef..7dc0882133 100644 --- a/ts/components/conversation/TimelineMessage.stories.tsx +++ b/ts/components/conversation/TimelineMessage.stories.tsx @@ -7,12 +7,12 @@ import lodash from 'lodash'; import { action } from '@storybook/addon-actions'; import type { Meta, StoryFn } from '@storybook/react'; -import { SignalService } from '../../protobuf/index.js'; -import { ConversationColors } from '../../types/Colors.js'; -import type { AudioAttachmentProps } from './Message.js'; -import type { Props } from './TimelineMessage.js'; -import { TimelineMessage } from './TimelineMessage.js'; -import { TextDirection } from './Message.js'; +import { SignalService } from '../../protobuf/index.std.js'; +import { ConversationColors } from '../../types/Colors.std.js'; +import type { AudioAttachmentProps } from './Message.dom.js'; +import type { Props } from './TimelineMessage.dom.js'; +import { TimelineMessage } from './TimelineMessage.dom.js'; +import { TextDirection } from './Message.dom.js'; import { AUDIO_MP3, IMAGE_JPEG, @@ -23,26 +23,26 @@ import { stringToMIMEType, IMAGE_GIF, VIDEO_QUICKTIME, -} from '../../types/MIME.js'; -import { ReadStatus } from '../../messages/MessageReadStatus.js'; -import { MessageAudio } from './MessageAudio.js'; -import { computePeaks } from '../VoiceNotesPlaybackContext.js'; -import { pngUrl } from '../../storybook/Fixtures.js'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; -import { WidthBreakpoint } from '../_util.js'; -import { DAY, HOUR, MINUTE, SECOND } from '../../util/durations/index.js'; -import { ContactFormType } from '../../types/EmbeddedContact.js'; -import { GiftBadgeStates } from '../../types/GiftBadgeStates.js'; -import { generateAci } from '../../types/ServiceId.js'; +} from '../../types/MIME.std.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.std.js'; +import { MessageAudio } from './MessageAudio.dom.js'; +import { computePeaks } from '../VoiceNotesPlaybackContext.dom.js'; +import { pngUrl } from '../../storybook/Fixtures.std.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.std.js'; +import { WidthBreakpoint } from '../_util.std.js'; +import { DAY, HOUR, MINUTE, SECOND } from '../../util/durations/index.std.js'; +import { ContactFormType } from '../../types/EmbeddedContact.std.js'; +import { GiftBadgeStates } from '../../types/GiftBadgeStates.std.js'; +import { generateAci } from '../../types/ServiceId.std.js'; import { fakeAttachment, fakeThumbnail, -} from '../../test-helpers/fakeAttachment.js'; -import { getFakeBadge } from '../../test-helpers/getFakeBadge.js'; -import { ThemeType } from '../../types/Util.js'; -import { BadgeCategory } from '../../badges/BadgeCategory.js'; -import { PaymentEventKind } from '../../types/Payment.js'; +} from '../../test-helpers/fakeAttachment.std.js'; +import { getFakeBadge } from '../../test-helpers/getFakeBadge.std.js'; +import { ThemeType } from '../../types/Util.std.js'; +import { BadgeCategory } from '../../badges/BadgeCategory.std.js'; +import { PaymentEventKind } from '../../types/Payment.std.js'; const { isBoolean, noop } = lodash; diff --git a/ts/components/conversation/TimelineMessage.tsx b/ts/components/conversation/TimelineMessage.tsx index 89ad3a1dbf..6ec8a316b6 100644 --- a/ts/components/conversation/TimelineMessage.tsx +++ b/ts/components/conversation/TimelineMessage.tsx @@ -15,41 +15,41 @@ import { ContextMenuTrigger } from 'react-contextmenu'; import { createPortal } from 'react-dom'; import { Manager, Popper, Reference } from 'react-popper'; import type { PreventOverflowModifier } from '@popperjs/core/lib/modifiers/preventOverflow.js'; -import { isDownloaded } from '../../util/Attachment.js'; -import type { LocalizerType } from '../../types/I18N.js'; -import { handleOutsideClick } from '../../util/handleOutsideClick.js'; -import { offsetDistanceModifier } from '../../util/popperUtil.js'; -import { StopPropagation } from '../StopPropagation.js'; -import { WidthBreakpoint } from '../_util.js'; -import { Message } from './Message.js'; -import type { SmartReactionPicker } from '../../state/smart/ReactionPicker.js'; +import { isDownloaded } from '../../util/Attachment.std.js'; +import type { LocalizerType } from '../../types/I18N.std.js'; +import { handleOutsideClick } from '../../util/handleOutsideClick.dom.js'; +import { offsetDistanceModifier } from '../../util/popperUtil.std.js'; +import { StopPropagation } from '../StopPropagation.dom.js'; +import { WidthBreakpoint } from '../_util.std.js'; +import { Message } from './Message.dom.js'; +import type { SmartReactionPicker } from '../../state/smart/ReactionPicker.dom.js'; import type { Props as MessageProps, PropsActions as MessagePropsActions, PropsData as MessagePropsData, PropsHousekeeping, -} from './Message.js'; -import type { PushPanelForConversationActionType } from '../../state/ducks/conversations.js'; -import { doesMessageBodyOverflow } from './MessageBodyReadMore.js'; +} from './Message.dom.js'; +import type { PushPanelForConversationActionType } from '../../state/ducks/conversations.preload.js'; +import { doesMessageBodyOverflow } from './MessageBodyReadMore.dom.js'; import { useKeyboardShortcutsConditionally, useOpenContextMenu, useToggleReactionPicker, -} from '../../hooks/useKeyboardShortcuts.js'; -import { PanelType } from '../../types/Panels.js'; +} from '../../hooks/useKeyboardShortcuts.dom.js'; +import { PanelType } from '../../types/Panels.std.js'; import type { DeleteMessagesPropsType, ForwardMessagesPayload, -} from '../../state/ducks/globalModals.js'; -import { useScrollerLock } from '../../hooks/useScrollLock.js'; +} from '../../state/ducks/globalModals.preload.js'; +import { useScrollerLock } from '../../hooks/useScrollLock.dom.js'; import { type ContextMenuTriggerType, MessageContextMenu, useHandleMessageContextMenu, -} from './MessageContextMenu.js'; -import { ForwardMessagesModalType } from '../ForwardMessagesModal.js'; -import { useGroupedAndOrderedReactions } from '../../util/groupAndOrderReactions.js'; -import { isNotNil } from '../../util/isNotNil.js'; +} from './MessageContextMenu.dom.js'; +import { ForwardMessagesModalType } from '../ForwardMessagesModal.dom.js'; +import { useGroupedAndOrderedReactions } from '../../util/groupAndOrderReactions.dom.js'; +import { isNotNil } from '../../util/isNotNil.std.js'; const { noop } = lodash; diff --git a/ts/components/conversation/TimelineWarning.tsx b/ts/components/conversation/TimelineWarning.tsx index 50ad1a7bb2..5348f8c14a 100644 --- a/ts/components/conversation/TimelineWarning.tsx +++ b/ts/components/conversation/TimelineWarning.tsx @@ -4,7 +4,7 @@ import type { ReactNode } from 'react'; import React from 'react'; -import type { LocalizerType } from '../../types/Util.js'; +import type { LocalizerType } from '../../types/Util.std.js'; const CLASS_NAME = 'module-TimelineWarning'; const ICON_CONTAINER_CLASS_NAME = `${CLASS_NAME}__icon-container`; diff --git a/ts/components/conversation/TimerNotification.stories.tsx b/ts/components/conversation/TimerNotification.stories.tsx index 015cdf20fd..d30e301627 100644 --- a/ts/components/conversation/TimerNotification.stories.tsx +++ b/ts/components/conversation/TimerNotification.stories.tsx @@ -3,9 +3,9 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import { DurationInSeconds } from '../../util/durations/index.js'; -import type { Props } from './TimerNotification.js'; -import { TimerNotification } from './TimerNotification.js'; +import { DurationInSeconds } from '../../util/durations/index.std.js'; +import type { Props } from './TimerNotification.dom.js'; +import { TimerNotification } from './TimerNotification.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/TimerNotification.tsx b/ts/components/conversation/TimerNotification.tsx index 5793ea7e36..5f7981230b 100644 --- a/ts/components/conversation/TimerNotification.tsx +++ b/ts/components/conversation/TimerNotification.tsx @@ -4,13 +4,13 @@ import type { ReactNode } from 'react'; import React from 'react'; -import { ContactName } from './ContactName.js'; -import { SystemMessage } from './SystemMessage.js'; -import { I18n } from '../I18n.js'; -import type { LocalizerType } from '../../types/Util.js'; -import * as expirationTimer from '../../util/expirationTimer.js'; -import type { DurationInSeconds } from '../../util/durations/index.js'; -import { createLogger } from '../../logging/log.js'; +import { ContactName } from './ContactName.dom.js'; +import { SystemMessage } from './SystemMessage.dom.js'; +import { I18n } from '../I18n.dom.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import * as expirationTimer from '../../util/expirationTimer.std.js'; +import type { DurationInSeconds } from '../../util/durations/index.std.js'; +import { createLogger } from '../../logging/log.std.js'; const log = createLogger('TimerNotification'); diff --git a/ts/components/conversation/TitleTransitionNotification.stories.tsx b/ts/components/conversation/TitleTransitionNotification.stories.tsx index ca3a6d9f3e..8c91b5c17a 100644 --- a/ts/components/conversation/TitleTransitionNotification.stories.tsx +++ b/ts/components/conversation/TitleTransitionNotification.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './TitleTransitionNotification.js'; -import { TitleTransitionNotification } from './TitleTransitionNotification.js'; +import type { Props } from './TitleTransitionNotification.dom.js'; +import { TitleTransitionNotification } from './TitleTransitionNotification.dom.js'; export default { title: 'Components/Conversation/TitleTransitionNotification', diff --git a/ts/components/conversation/TitleTransitionNotification.tsx b/ts/components/conversation/TitleTransitionNotification.tsx index a2c5cb79c2..0f57e7aaee 100644 --- a/ts/components/conversation/TitleTransitionNotification.tsx +++ b/ts/components/conversation/TitleTransitionNotification.tsx @@ -3,11 +3,11 @@ import React from 'react'; -import type { LocalizerType } from '../../types/Util.js'; -import { I18n } from '../I18n.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import { I18n } from '../I18n.dom.js'; -import { SystemMessage } from './SystemMessage.js'; -import { UserText } from '../UserText.js'; +import { SystemMessage } from './SystemMessage.dom.js'; +import { UserText } from '../UserText.dom.js'; export type PropsData = { oldTitle: string; diff --git a/ts/components/conversation/TypingAnimation.stories.tsx b/ts/components/conversation/TypingAnimation.stories.tsx index f86eb0bc8e..58c4b0e3ed 100644 --- a/ts/components/conversation/TypingAnimation.stories.tsx +++ b/ts/components/conversation/TypingAnimation.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './TypingAnimation.js'; -import { TypingAnimation } from './TypingAnimation.js'; +import type { Props } from './TypingAnimation.dom.js'; +import { TypingAnimation } from './TypingAnimation.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/TypingAnimation.tsx b/ts/components/conversation/TypingAnimation.tsx index f7999f5cdc..268408940a 100644 --- a/ts/components/conversation/TypingAnimation.tsx +++ b/ts/components/conversation/TypingAnimation.tsx @@ -4,7 +4,7 @@ import React from 'react'; import classNames from 'classnames'; -import type { LocalizerType } from '../../types/Util.js'; +import type { LocalizerType } from '../../types/Util.std.js'; export type Props = { i18n: LocalizerType; diff --git a/ts/components/conversation/TypingBubble.stories.tsx b/ts/components/conversation/TypingBubble.stories.tsx index 882b0c861f..b2829acd13 100644 --- a/ts/components/conversation/TypingBubble.stories.tsx +++ b/ts/components/conversation/TypingBubble.stories.tsx @@ -5,12 +5,12 @@ import React, { useEffect, useState } from 'react'; import lodash from 'lodash'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; -import type { TypingBubblePropsType } from './TypingBubble.js'; -import { TypingBubble } from './TypingBubble.js'; -import { AvatarColors } from '../../types/Colors.js'; -import { getFakeBadge } from '../../test-helpers/getFakeBadge.js'; -import { ThemeType } from '../../types/Util.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.std.js'; +import type { TypingBubblePropsType } from './TypingBubble.dom.js'; +import { TypingBubble } from './TypingBubble.dom.js'; +import { AvatarColors } from '../../types/Colors.std.js'; +import { getFakeBadge } from '../../test-helpers/getFakeBadge.std.js'; +import { ThemeType } from '../../types/Util.std.js'; const { times } = lodash; diff --git a/ts/components/conversation/TypingBubble.tsx b/ts/components/conversation/TypingBubble.tsx index 25b964277f..204bdf18f7 100644 --- a/ts/components/conversation/TypingBubble.tsx +++ b/ts/components/conversation/TypingBubble.tsx @@ -6,14 +6,14 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react'; import classNames from 'classnames'; import { animated, useSpring } from '@react-spring/web'; -import { TypingAnimation } from './TypingAnimation.js'; -import { Avatar } from '../Avatar.js'; +import { TypingAnimation } from './TypingAnimation.dom.js'; +import { Avatar } from '../Avatar.dom.js'; -import type { LocalizerType, ThemeType } from '../../types/Util.js'; -import type { ConversationType } from '../../state/ducks/conversations.js'; -import type { PreferredBadgeSelectorType } from '../../state/selectors/badges.js'; -import { drop } from '../../util/drop.js'; -import { useReducedMotion } from '../../hooks/useReducedMotion.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.std.js'; +import type { ConversationType } from '../../state/ducks/conversations.preload.js'; +import type { PreferredBadgeSelectorType } from '../../state/selectors/badges.preload.js'; +import { drop } from '../../util/drop.std.js'; +import { useReducedMotion } from '../../hooks/useReducedMotion.dom.js'; const MAX_AVATARS_COUNT = 3; diff --git a/ts/components/conversation/UniversalTimerNotification.stories.tsx b/ts/components/conversation/UniversalTimerNotification.stories.tsx index 095f99ec2a..ecf27ad154 100644 --- a/ts/components/conversation/UniversalTimerNotification.stories.tsx +++ b/ts/components/conversation/UniversalTimerNotification.stories.tsx @@ -3,9 +3,9 @@ import React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './UniversalTimerNotification.js'; -import { UniversalTimerNotification } from './UniversalTimerNotification.js'; -import { EXPIRE_TIMERS } from '../../test-helpers/expireTimers.js'; +import type { Props } from './UniversalTimerNotification.dom.js'; +import { UniversalTimerNotification } from './UniversalTimerNotification.dom.js'; +import { EXPIRE_TIMERS } from '../../test-helpers/expireTimers.std.js'; export default { title: 'Components/UniversalTimerNotification', diff --git a/ts/components/conversation/UniversalTimerNotification.tsx b/ts/components/conversation/UniversalTimerNotification.tsx index be8707d310..7aa4cd084c 100644 --- a/ts/components/conversation/UniversalTimerNotification.tsx +++ b/ts/components/conversation/UniversalTimerNotification.tsx @@ -3,10 +3,10 @@ import React from 'react'; -import { SystemMessage } from './SystemMessage.js'; -import type { LocalizerType } from '../../types/Util.js'; -import * as expirationTimer from '../../util/expirationTimer.js'; -import type { DurationInSeconds } from '../../util/durations/index.js'; +import { SystemMessage } from './SystemMessage.dom.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import * as expirationTimer from '../../util/expirationTimer.std.js'; +import type { DurationInSeconds } from '../../util/durations/index.std.js'; export type Props = { i18n: LocalizerType; diff --git a/ts/components/conversation/UnsupportedMessage.stories.tsx b/ts/components/conversation/UnsupportedMessage.stories.tsx index 28f0c48160..b59ec23ec9 100644 --- a/ts/components/conversation/UnsupportedMessage.stories.tsx +++ b/ts/components/conversation/UnsupportedMessage.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { ContactType, Props } from './UnsupportedMessage.js'; -import { UnsupportedMessage } from './UnsupportedMessage.js'; +import type { ContactType, Props } from './UnsupportedMessage.dom.js'; +import { UnsupportedMessage } from './UnsupportedMessage.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/UnsupportedMessage.tsx b/ts/components/conversation/UnsupportedMessage.tsx index 6a131dd7fb..b7eeaaa6e9 100644 --- a/ts/components/conversation/UnsupportedMessage.tsx +++ b/ts/components/conversation/UnsupportedMessage.tsx @@ -3,12 +3,12 @@ import React from 'react'; -import { SystemMessage } from './SystemMessage.js'; -import { Button, ButtonSize, ButtonVariant } from '../Button.js'; -import { ContactName } from './ContactName.js'; -import { I18n } from '../I18n.js'; -import type { LocalizerType } from '../../types/Util.js'; -import { openLinkInWebBrowser } from '../../util/openLinkInWebBrowser.js'; +import { SystemMessage } from './SystemMessage.dom.js'; +import { Button, ButtonSize, ButtonVariant } from '../Button.dom.js'; +import { ContactName } from './ContactName.dom.js'; +import { I18n } from '../I18n.dom.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import { openLinkInWebBrowser } from '../../util/openLinkInWebBrowser.dom.js'; export type ContactType = { id: string; diff --git a/ts/components/conversation/VerificationNotification.stories.tsx b/ts/components/conversation/VerificationNotification.stories.tsx index 3b005664c6..ba173ebe31 100644 --- a/ts/components/conversation/VerificationNotification.stories.tsx +++ b/ts/components/conversation/VerificationNotification.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './VerificationNotification.js'; -import { VerificationNotification } from './VerificationNotification.js'; +import type { Props } from './VerificationNotification.dom.js'; +import { VerificationNotification } from './VerificationNotification.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/VerificationNotification.tsx b/ts/components/conversation/VerificationNotification.tsx index 20ed18e55a..dcdd09af29 100644 --- a/ts/components/conversation/VerificationNotification.tsx +++ b/ts/components/conversation/VerificationNotification.tsx @@ -3,12 +3,12 @@ import React from 'react'; -import { SystemMessage } from './SystemMessage.js'; -import { ContactName } from './ContactName.js'; -import { I18n } from '../I18n.js'; -import type { LocalizerType } from '../../types/Util.js'; +import { SystemMessage } from './SystemMessage.dom.js'; +import { ContactName } from './ContactName.dom.js'; +import { I18n } from '../I18n.dom.js'; +import type { LocalizerType } from '../../types/Util.std.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; type Contact = { title: string }; diff --git a/ts/components/conversation/Waveform.tsx b/ts/components/conversation/Waveform.tsx index 7875892685..407983ce16 100644 --- a/ts/components/conversation/Waveform.tsx +++ b/ts/components/conversation/Waveform.tsx @@ -3,7 +3,7 @@ import classNames from 'classnames'; import React from 'react'; -import { assertDev } from '../../util/assert.js'; +import { assertDev } from '../../util/assert.std.js'; type Props = { peaks: ReadonlyArray; diff --git a/ts/components/conversation/WaveformScrubber.tsx b/ts/components/conversation/WaveformScrubber.tsx index 102632077f..3d25acafbc 100644 --- a/ts/components/conversation/WaveformScrubber.tsx +++ b/ts/components/conversation/WaveformScrubber.tsx @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useCallback, useRef } from 'react'; -import { useRefMerger } from '../../hooks/useRefMerger.js'; -import type { LocalizerType } from '../../types/Util.js'; -import { durationToPlaybackText } from '../../util/durationToPlaybackText.js'; -import { Waveform } from './Waveform.js'; -import { arrow } from '../../util/keyboard.js'; +import { useRefMerger } from '../../hooks/useRefMerger.std.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import { durationToPlaybackText } from '../../util/durationToPlaybackText.std.js'; +import { Waveform } from './Waveform.dom.js'; +import { arrow } from '../../util/keyboard.dom.js'; type Props = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/conversation/contactUtil.tsx b/ts/components/conversation/contactUtil.tsx index 51146e96c9..ec9cd0a293 100644 --- a/ts/components/conversation/contactUtil.tsx +++ b/ts/components/conversation/contactUtil.tsx @@ -5,13 +5,13 @@ import React from 'react'; import classNames from 'classnames'; import type { ReadonlyDeep } from 'type-fest'; -import { Avatar, AvatarBlur } from '../Avatar.js'; -import { AvatarColors } from '../../types/Colors.js'; -import { getName } from '../../types/EmbeddedContact.js'; -import { AttachmentStatusIcon } from './AttachmentStatusIcon.js'; +import { Avatar, AvatarBlur } from '../Avatar.dom.js'; +import { AvatarColors } from '../../types/Colors.std.js'; +import { getName } from '../../types/EmbeddedContact.std.js'; +import { AttachmentStatusIcon } from './AttachmentStatusIcon.dom.js'; -import type { LocalizerType } from '../../types/Util.js'; -import type { EmbeddedContactForUIType } from '../../types/EmbeddedContact.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import type { EmbeddedContactForUIType } from '../../types/EmbeddedContact.std.js'; export function renderAvatar({ contact, diff --git a/ts/components/conversation/conversation-details/AddGroupMembersModal.stories.tsx b/ts/components/conversation/conversation-details/AddGroupMembersModal.stories.tsx index a52a34c007..065047e6c0 100644 --- a/ts/components/conversation/conversation-details/AddGroupMembersModal.stories.tsx +++ b/ts/components/conversation/conversation-details/AddGroupMembersModal.stories.tsx @@ -6,17 +6,17 @@ import React, { useState } from 'react'; import lodash from 'lodash'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { sleep } from '../../../util/sleep.js'; -import { makeLookup } from '../../../util/makeLookup.js'; -import { deconstructLookup } from '../../../util/deconstructLookup.js'; -import type { ConversationType } from '../../../state/ducks/conversations.js'; -import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.js'; -import { AddGroupMembersModal } from './AddGroupMembersModal.js'; -import { ChooseGroupMembersModal } from './AddGroupMembersModal/ChooseGroupMembersModal.js'; -import { ConfirmAdditionsModal } from './AddGroupMembersModal/ConfirmAdditionsModal.js'; -import { RequestState } from './util.js'; -import { ThemeType } from '../../../types/Util.js'; -import { makeFakeLookupConversationWithoutServiceId } from '../../../test-helpers/fakeLookupConversationWithoutServiceId.js'; +import { sleep } from '../../../util/sleep.std.js'; +import { makeLookup } from '../../../util/makeLookup.std.js'; +import { deconstructLookup } from '../../../util/deconstructLookup.std.js'; +import type { ConversationType } from '../../../state/ducks/conversations.preload.js'; +import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.std.js'; +import { AddGroupMembersModal } from './AddGroupMembersModal.dom.js'; +import { ChooseGroupMembersModal } from './AddGroupMembersModal/ChooseGroupMembersModal.dom.js'; +import { ConfirmAdditionsModal } from './AddGroupMembersModal/ConfirmAdditionsModal.dom.js'; +import { RequestState } from './util.std.js'; +import { ThemeType } from '../../../types/Util.std.js'; +import { makeFakeLookupConversationWithoutServiceId } from '../../../test-helpers/fakeLookupConversationWithoutServiceId.std.js'; const { times } = lodash; diff --git a/ts/components/conversation/conversation-details/AddGroupMembersModal.tsx b/ts/components/conversation/conversation-details/AddGroupMembersModal.tsx index 3d87ebe85f..5f738718cc 100644 --- a/ts/components/conversation/conversation-details/AddGroupMembersModal.tsx +++ b/ts/components/conversation/conversation-details/AddGroupMembersModal.tsx @@ -4,19 +4,19 @@ import React, { useReducer } from 'react'; import lodash from 'lodash'; -import type { LocalizerType } from '../../../types/Util.js'; +import type { LocalizerType } from '../../../types/Util.std.js'; import { AddGroupMemberErrorDialog, AddGroupMemberErrorDialogMode, -} from '../../AddGroupMemberErrorDialog.js'; -import type { SmartChooseGroupMembersModalPropsType } from '../../../state/smart/ChooseGroupMembersModal.js'; -import type { SmartConfirmAdditionsModalPropsType } from '../../../state/smart/ConfirmAdditionsModal.js'; +} from '../../AddGroupMemberErrorDialog.dom.js'; +import type { SmartChooseGroupMembersModalPropsType } from '../../../state/smart/ChooseGroupMembersModal.preload.js'; +import type { SmartConfirmAdditionsModalPropsType } from '../../../state/smart/ConfirmAdditionsModal.dom.js'; import { toggleSelectedContactForGroupAddition, OneTimeModalState, -} from '../../../groups/toggleSelectedContactForGroupAddition.js'; -import { missingCaseError } from '../../../util/missingCaseError.js'; -import type { RequestState } from './util.js'; +} from '../../../groups/toggleSelectedContactForGroupAddition.std.js'; +import { missingCaseError } from '../../../util/missingCaseError.std.js'; +import type { RequestState } from './util.std.js'; const { without } = lodash; diff --git a/ts/components/conversation/conversation-details/AddGroupMembersModal/ChooseGroupMembersModal.tsx b/ts/components/conversation/conversation-details/AddGroupMembersModal/ChooseGroupMembersModal.tsx index 265c8c4964..bfc08be162 100644 --- a/ts/components/conversation/conversation-details/AddGroupMembersModal/ChooseGroupMembersModal.tsx +++ b/ts/components/conversation/conversation-details/AddGroupMembersModal/ChooseGroupMembersModal.tsx @@ -11,39 +11,39 @@ import React, { import lodash from 'lodash'; import type { ListRowProps } from 'react-virtualized'; -import type { LocalizerType, ThemeType } from '../../../../types/Util.js'; -import { strictAssert, assertDev } from '../../../../util/assert.js'; -import { refMerger } from '../../../../util/refMerger.js'; -import { useRestoreFocus } from '../../../../hooks/useRestoreFocus.js'; -import { missingCaseError } from '../../../../util/missingCaseError.js'; -import type { LookupConversationWithoutServiceIdActionsType } from '../../../../util/lookupConversationWithoutServiceId.js'; -import { parseAndFormatPhoneNumber } from '../../../../util/libphonenumberInstance.js'; -import type { ParsedE164Type } from '../../../../util/libphonenumberInstance.js'; -import { filterAndSortConversations } from '../../../../util/filterAndSortConversations.js'; -import type { ConversationType } from '../../../../state/ducks/conversations.js'; +import type { LocalizerType, ThemeType } from '../../../../types/Util.std.js'; +import { strictAssert, assertDev } from '../../../../util/assert.std.js'; +import { refMerger } from '../../../../util/refMerger.std.js'; +import { useRestoreFocus } from '../../../../hooks/useRestoreFocus.dom.js'; +import { missingCaseError } from '../../../../util/missingCaseError.std.js'; +import type { LookupConversationWithoutServiceIdActionsType } from '../../../../util/lookupConversationWithoutServiceId.preload.js'; +import { parseAndFormatPhoneNumber } from '../../../../util/libphonenumberInstance.std.js'; +import type { ParsedE164Type } from '../../../../util/libphonenumberInstance.std.js'; +import { filterAndSortConversations } from '../../../../util/filterAndSortConversations.std.js'; +import type { ConversationType } from '../../../../state/ducks/conversations.preload.js'; import type { UUIDFetchStateKeyType, UUIDFetchStateType, -} from '../../../../util/uuidFetchState.js'; +} from '../../../../util/uuidFetchState.std.js'; import { isFetchingByE164, isFetchingByUsername, -} from '../../../../util/uuidFetchState.js'; -import { ModalHost } from '../../../ModalHost.js'; -import { ContactPills } from '../../../ContactPills.js'; -import { ContactPill } from '../../../ContactPill.js'; -import type { Row } from '../../../ConversationList.js'; -import { RowType } from '../../../ConversationList.js'; +} from '../../../../util/uuidFetchState.std.js'; +import { ModalHost } from '../../../ModalHost.dom.js'; +import { ContactPills } from '../../../ContactPills.dom.js'; +import { ContactPill } from '../../../ContactPill.dom.js'; +import type { Row } from '../../../ConversationList.dom.js'; +import { RowType } from '../../../ConversationList.dom.js'; import { ContactCheckbox, ContactCheckboxDisabledReason, -} from '../../../conversationList/ContactCheckbox.js'; -import { Button, ButtonVariant } from '../../../Button.js'; -import { SearchInput } from '../../../SearchInput.js'; -import { ListView } from '../../../ListView.js'; -import { UsernameCheckbox } from '../../../conversationList/UsernameCheckbox.js'; -import { PhoneNumberCheckbox } from '../../../conversationList/PhoneNumberCheckbox.js'; -import { SizeObserver } from '../../../../hooks/useSizeObserver.js'; +} from '../../../conversationList/ContactCheckbox.dom.js'; +import { Button, ButtonVariant } from '../../../Button.dom.js'; +import { SearchInput } from '../../../SearchInput.dom.js'; +import { ListView } from '../../../ListView.dom.js'; +import { UsernameCheckbox } from '../../../conversationList/UsernameCheckbox.dom.js'; +import { PhoneNumberCheckbox } from '../../../conversationList/PhoneNumberCheckbox.dom.js'; +import { SizeObserver } from '../../../../hooks/useSizeObserver.dom.js'; const { omit } = lodash; diff --git a/ts/components/conversation/conversation-details/AddGroupMembersModal/ConfirmAdditionsModal.tsx b/ts/components/conversation/conversation-details/AddGroupMembersModal/ConfirmAdditionsModal.tsx index 0ca1ef4c50..39a7c7fd10 100644 --- a/ts/components/conversation/conversation-details/AddGroupMembersModal/ConfirmAdditionsModal.tsx +++ b/ts/components/conversation/conversation-details/AddGroupMembersModal/ConfirmAdditionsModal.tsx @@ -4,16 +4,16 @@ import type { ReactNode } from 'react'; import React from 'react'; -import type { LocalizerType } from '../../../../types/Util.js'; -import { assertDev } from '../../../../util/assert.js'; -import { ModalHost } from '../../../ModalHost.js'; -import { Button, ButtonVariant } from '../../../Button.js'; -import { Spinner } from '../../../Spinner.js'; -import type { ConversationType } from '../../../../state/ducks/conversations.js'; -import { RequestState } from '../util.js'; -import { I18n } from '../../../I18n.js'; -import { ContactName } from '../../ContactName.js'; -import { UserText } from '../../../UserText.js'; +import type { LocalizerType } from '../../../../types/Util.std.js'; +import { assertDev } from '../../../../util/assert.std.js'; +import { ModalHost } from '../../../ModalHost.dom.js'; +import { Button, ButtonVariant } from '../../../Button.dom.js'; +import { Spinner } from '../../../Spinner.dom.js'; +import type { ConversationType } from '../../../../state/ducks/conversations.preload.js'; +import { RequestState } from '../util.std.js'; +import { I18n } from '../../../I18n.dom.js'; +import { ContactName } from '../../ContactName.dom.js'; +import { UserText } from '../../../UserText.dom.js'; export type StatePropsType = { groupTitle: string; diff --git a/ts/components/conversation/conversation-details/CallHistoryGroupPanelSection.tsx b/ts/components/conversation/conversation-details/CallHistoryGroupPanelSection.tsx index 7cd2e37127..bf25be0be5 100644 --- a/ts/components/conversation/conversation-details/CallHistoryGroupPanelSection.tsx +++ b/ts/components/conversation/conversation-details/CallHistoryGroupPanelSection.tsx @@ -7,15 +7,15 @@ import { CallType, DirectCallStatus, GroupCallStatus, -} from '../../../types/CallDisposition.js'; +} from '../../../types/CallDisposition.std.js'; import type { CallStatus, CallHistoryGroup, -} from '../../../types/CallDisposition.js'; -import type { LocalizerType } from '../../../types/I18N.js'; -import { formatDate, formatTime } from '../../../util/timestamp.js'; -import { PanelSection } from './PanelSection.js'; -import { getDirectCallNotificationText } from '../../../util/callingNotification.js'; +} from '../../../types/CallDisposition.std.js'; +import type { LocalizerType } from '../../../types/I18N.std.js'; +import { formatDate, formatTime } from '../../../util/formatTimestamp.dom.js'; +import { PanelSection } from './PanelSection.dom.js'; +import { getDirectCallNotificationText } from '../../../util/callingNotification.std.js'; function describeCallHistory( i18n: LocalizerType, diff --git a/ts/components/conversation/conversation-details/ConversationDetails.stories.tsx b/ts/components/conversation/conversation-details/ConversationDetails.stories.tsx index e771372369..5f8e0ae4be 100644 --- a/ts/components/conversation/conversation-details/ConversationDetails.stories.tsx +++ b/ts/components/conversation/conversation-details/ConversationDetails.stories.tsx @@ -7,17 +7,17 @@ import { action } from '@storybook/addon-actions'; import lodash from 'lodash'; import type { Meta } from '@storybook/react'; -import type { Props } from './ConversationDetails.js'; -import { ConversationDetails } from './ConversationDetails.js'; -import { ChooseGroupMembersModal } from './AddGroupMembersModal/ChooseGroupMembersModal.js'; -import { ConfirmAdditionsModal } from './AddGroupMembersModal/ConfirmAdditionsModal.js'; -import type { ConversationType } from '../../../state/ducks/conversations.js'; -import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.js'; -import { makeFakeLookupConversationWithoutServiceId } from '../../../test-helpers/fakeLookupConversationWithoutServiceId.js'; -import { ThemeType } from '../../../types/Util.js'; -import { DurationInSeconds } from '../../../util/durations/index.js'; -import { NavTab } from '../../../types/Nav.js'; -import { getFakeCallHistoryGroup } from '../../../test-helpers/getFakeCallHistoryGroup.js'; +import type { Props } from './ConversationDetails.dom.js'; +import { ConversationDetails } from './ConversationDetails.dom.js'; +import { ChooseGroupMembersModal } from './AddGroupMembersModal/ChooseGroupMembersModal.dom.js'; +import { ConfirmAdditionsModal } from './AddGroupMembersModal/ConfirmAdditionsModal.dom.js'; +import type { ConversationType } from '../../../state/ducks/conversations.preload.js'; +import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.std.js'; +import { makeFakeLookupConversationWithoutServiceId } from '../../../test-helpers/fakeLookupConversationWithoutServiceId.std.js'; +import { ThemeType } from '../../../types/Util.std.js'; +import { DurationInSeconds } from '../../../util/durations/index.std.js'; +import { NavTab } from '../../../types/Nav.std.js'; +import { getFakeCallHistoryGroup } from '../../../test-helpers/getFakeCallHistoryGroup.std.js'; const { times } = lodash; diff --git a/ts/components/conversation/conversation-details/ConversationDetails.tsx b/ts/components/conversation/conversation-details/ConversationDetails.tsx index f77b56d56f..f4652b08d1 100644 --- a/ts/components/conversation/conversation-details/ConversationDetails.tsx +++ b/ts/components/conversation/conversation-details/ConversationDetails.tsx @@ -4,65 +4,65 @@ import type { ReactNode } from 'react'; import React, { useEffect, useState, useCallback } from 'react'; -import { Button, ButtonIconType, ButtonVariant } from '../../Button.js'; +import { Button, ButtonIconType, ButtonVariant } from '../../Button.dom.js'; import type { ConversationType, PushPanelForConversationActionType, ShowConversationType, -} from '../../../state/ducks/conversations.js'; -import type { PreferredBadgeSelectorType } from '../../../state/selectors/badges.js'; -import type { SmartChooseGroupMembersModalPropsType } from '../../../state/smart/ChooseGroupMembersModal.js'; -import type { SmartConfirmAdditionsModalPropsType } from '../../../state/smart/ConfirmAdditionsModal.js'; -import { assertDev } from '../../../util/assert.js'; -import { getMutedUntilText } from '../../../util/getMutedUntilText.js'; +} from '../../../state/ducks/conversations.preload.js'; +import type { PreferredBadgeSelectorType } from '../../../state/selectors/badges.preload.js'; +import type { SmartChooseGroupMembersModalPropsType } from '../../../state/smart/ChooseGroupMembersModal.preload.js'; +import type { SmartConfirmAdditionsModalPropsType } from '../../../state/smart/ConfirmAdditionsModal.dom.js'; +import { assertDev } from '../../../util/assert.std.js'; +import { getMutedUntilText } from '../../../util/getMutedUntilText.std.js'; -import type { LocalizerType, ThemeType } from '../../../types/Util.js'; -import type { BadgeType } from '../../../badges/types.js'; -import { missingCaseError } from '../../../util/missingCaseError.js'; -import { DurationInSeconds } from '../../../util/durations/index.js'; +import type { LocalizerType, ThemeType } from '../../../types/Util.std.js'; +import type { BadgeType } from '../../../badges/types.std.js'; +import { missingCaseError } from '../../../util/missingCaseError.std.js'; +import { DurationInSeconds } from '../../../util/durations/index.std.js'; -import { DisappearingTimerSelect } from '../../DisappearingTimerSelect.js'; +import { DisappearingTimerSelect } from '../../DisappearingTimerSelect.dom.js'; -import { PanelRow } from './PanelRow.js'; -import { PanelSection } from './PanelSection.js'; -import { AddGroupMembersModal } from './AddGroupMembersModal.js'; -import { ConversationDetailsActions } from './ConversationDetailsActions.js'; -import { ConversationDetailsHeader } from './ConversationDetailsHeader.js'; +import { PanelRow } from './PanelRow.dom.js'; +import { PanelSection } from './PanelSection.dom.js'; +import { AddGroupMembersModal } from './AddGroupMembersModal.dom.js'; +import { ConversationDetailsActions } from './ConversationDetailsActions.dom.js'; +import { ConversationDetailsHeader } from './ConversationDetailsHeader.dom.js'; import { ConversationDetailsIcon, IconType, -} from './ConversationDetailsIcon.js'; -import type { GroupV2Membership } from './ConversationDetailsMembershipList.js'; -import { ConversationDetailsMembershipList } from './ConversationDetailsMembershipList.js'; +} from './ConversationDetailsIcon.dom.js'; +import type { GroupV2Membership } from './ConversationDetailsMembershipList.dom.js'; +import { ConversationDetailsMembershipList } from './ConversationDetailsMembershipList.dom.js'; import type { GroupV2PendingMembership, GroupV2RequestingMembership, -} from './PendingInvites.js'; -import { EditConversationAttributesModal } from './EditConversationAttributesModal.js'; -import { RequestState } from './util.js'; -import { getCustomColorStyle } from '../../../util/getCustomColorStyle.js'; -import { openLinkInWebBrowser } from '../../../util/openLinkInWebBrowser.js'; -import { ConfirmationDialog } from '../../ConfirmationDialog.js'; -import { ConversationNotificationsModal } from './ConversationNotificationsModal.js'; +} from './PendingInvites.dom.js'; +import { EditConversationAttributesModal } from './EditConversationAttributesModal.dom.js'; +import { RequestState } from './util.std.js'; +import { getCustomColorStyle } from '../../../util/getCustomColorStyle.dom.js'; +import { openLinkInWebBrowser } from '../../../util/openLinkInWebBrowser.dom.js'; +import { ConfirmationDialog } from '../../ConfirmationDialog.dom.js'; +import { ConversationNotificationsModal } from './ConversationNotificationsModal.dom.js'; import type { AvatarDataType, DeleteAvatarFromDiskActionType, ReplaceAvatarActionType, SaveAvatarToDiskActionType, -} from '../../../types/Avatar.js'; -import { isConversationMuted } from '../../../util/isConversationMuted.js'; -import { ConversationDetailsGroups } from './ConversationDetailsGroups.js'; -import { PanelType } from '../../../types/Panels.js'; -import { type CallHistoryGroup } from '../../../types/CallDisposition.js'; -import { NavTab } from '../../../types/Nav.js'; -import { ContextMenu } from '../../ContextMenu.js'; -import { canHaveNicknameAndNote } from '../../../util/nicknames.js'; -import { CallHistoryGroupPanelSection } from './CallHistoryGroupPanelSection.js'; +} from '../../../types/Avatar.std.js'; +import { isConversationMuted } from '../../../util/isConversationMuted.std.js'; +import { ConversationDetailsGroups } from './ConversationDetailsGroups.dom.js'; +import { PanelType } from '../../../types/Panels.std.js'; +import { type CallHistoryGroup } from '../../../types/CallDisposition.std.js'; +import { NavTab } from '../../../types/Nav.std.js'; +import { ContextMenu } from '../../ContextMenu.dom.js'; +import { canHaveNicknameAndNote } from '../../../util/nicknames.dom.js'; +import { CallHistoryGroupPanelSection } from './CallHistoryGroupPanelSection.dom.js'; import { InAnotherCallTooltip, getTooltipContent, -} from '../InAnotherCallTooltip.js'; -import { BadgeSustainerInstructionsDialog } from '../../BadgeSustainerInstructionsDialog.js'; +} from '../InAnotherCallTooltip.dom.js'; +import { BadgeSustainerInstructionsDialog } from '../../BadgeSustainerInstructionsDialog.dom.js'; enum ModalState { AddingGroupMembers, diff --git a/ts/components/conversation/conversation-details/ConversationDetailsActions.stories.tsx b/ts/components/conversation/conversation-details/ConversationDetailsActions.stories.tsx index abd38b7008..404ae49260 100644 --- a/ts/components/conversation/conversation-details/ConversationDetailsActions.stories.tsx +++ b/ts/components/conversation/conversation-details/ConversationDetailsActions.stories.tsx @@ -5,8 +5,8 @@ import * as React from 'react'; import lodash from 'lodash'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './ConversationDetailsActions.js'; -import { ConversationDetailsActions } from './ConversationDetailsActions.js'; +import type { Props } from './ConversationDetailsActions.dom.js'; +import { ConversationDetailsActions } from './ConversationDetailsActions.dom.js'; const { isBoolean } = lodash; diff --git a/ts/components/conversation/conversation-details/ConversationDetailsActions.tsx b/ts/components/conversation/conversation-details/ConversationDetailsActions.tsx index 493284f1f6..a605590cdc 100644 --- a/ts/components/conversation/conversation-details/ConversationDetailsActions.tsx +++ b/ts/components/conversation/conversation-details/ConversationDetailsActions.tsx @@ -5,16 +5,16 @@ import type { ReactNode } from 'react'; import React, { useState } from 'react'; import classNames from 'classnames'; -import type { LocalizerType } from '../../../types/Util.js'; -import { ConfirmationDialog } from '../../ConfirmationDialog.js'; -import { Tooltip, TooltipPlacement } from '../../Tooltip.js'; +import type { LocalizerType } from '../../../types/Util.std.js'; +import { ConfirmationDialog } from '../../ConfirmationDialog.dom.js'; +import { Tooltip, TooltipPlacement } from '../../Tooltip.dom.js'; -import { PanelRow } from './PanelRow.js'; -import { PanelSection } from './PanelSection.js'; +import { PanelRow } from './PanelRow.dom.js'; +import { PanelSection } from './PanelSection.dom.js'; import { ConversationDetailsIcon, IconType, -} from './ConversationDetailsIcon.js'; +} from './ConversationDetailsIcon.dom.js'; export type Props = { acceptConversation: (id: string) => void; diff --git a/ts/components/conversation/conversation-details/ConversationDetailsGroups.tsx b/ts/components/conversation/conversation-details/ConversationDetailsGroups.tsx index 41bc1b6e90..e32855e7ce 100644 --- a/ts/components/conversation/conversation-details/ConversationDetailsGroups.tsx +++ b/ts/components/conversation/conversation-details/ConversationDetailsGroups.tsx @@ -5,15 +5,15 @@ import React from 'react'; import type { ConversationType, ShowConversationType, -} from '../../../state/ducks/conversations.js'; -import type { LocalizerType } from '../../../types/Util.js'; -import { Avatar, AvatarSize } from '../../Avatar.js'; +} from '../../../state/ducks/conversations.preload.js'; +import type { LocalizerType } from '../../../types/Util.std.js'; +import { Avatar, AvatarSize } from '../../Avatar.dom.js'; import { ConversationDetailsIcon, IconType, -} from './ConversationDetailsIcon.js'; -import { PanelRow } from './PanelRow.js'; -import { PanelSection } from './PanelSection.js'; +} from './ConversationDetailsIcon.dom.js'; +import { PanelRow } from './PanelRow.dom.js'; +import { PanelSection } from './PanelSection.dom.js'; type Props = { contactId: string; diff --git a/ts/components/conversation/conversation-details/ConversationDetailsHeader.stories.tsx b/ts/components/conversation/conversation-details/ConversationDetailsHeader.stories.tsx index 368062bc8f..1e54cb5867 100644 --- a/ts/components/conversation/conversation-details/ConversationDetailsHeader.stories.tsx +++ b/ts/components/conversation/conversation-details/ConversationDetailsHeader.stories.tsx @@ -4,12 +4,12 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.js'; -import { getFakeBadges } from '../../../test-helpers/getFakeBadge.js'; +import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.std.js'; +import { getFakeBadges } from '../../../test-helpers/getFakeBadge.std.js'; import { StorybookThemeContext } from '../../../../.storybook/StorybookThemeContext.js'; -import type { ConversationType } from '../../../state/ducks/conversations.js'; -import type { Props } from './ConversationDetailsHeader.js'; -import { ConversationDetailsHeader } from './ConversationDetailsHeader.js'; +import type { ConversationType } from '../../../state/ducks/conversations.preload.js'; +import type { Props } from './ConversationDetailsHeader.dom.js'; +import { ConversationDetailsHeader } from './ConversationDetailsHeader.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/conversation-details/ConversationDetailsHeader.tsx b/ts/components/conversation/conversation-details/ConversationDetailsHeader.tsx index 8db6f11ed3..24645d68ec 100644 --- a/ts/components/conversation/conversation-details/ConversationDetailsHeader.tsx +++ b/ts/components/conversation/conversation-details/ConversationDetailsHeader.tsx @@ -4,18 +4,18 @@ import type { ReactNode } from 'react'; import React, { useState } from 'react'; -import { Avatar, AvatarBlur, AvatarSize } from '../../Avatar.js'; -import { AvatarLightbox } from '../../AvatarLightbox.js'; -import type { ConversationType } from '../../../state/ducks/conversations.js'; -import { GroupDescription } from '../GroupDescription.js'; -import { About } from '../About.js'; -import type { LocalizerType, ThemeType } from '../../../types/Util.js'; -import { assertDev } from '../../../util/assert.js'; -import { BadgeDialog } from '../../BadgeDialog.js'; -import type { BadgeType } from '../../../badges/types.js'; -import { UserText } from '../../UserText.js'; -import { isInSystemContacts } from '../../../util/isInSystemContacts.js'; -import { InContactsIcon } from '../../InContactsIcon.js'; +import { Avatar, AvatarBlur, AvatarSize } from '../../Avatar.dom.js'; +import { AvatarLightbox } from '../../AvatarLightbox.dom.js'; +import type { ConversationType } from '../../../state/ducks/conversations.preload.js'; +import { GroupDescription } from '../GroupDescription.dom.js'; +import { About } from '../About.dom.js'; +import type { LocalizerType, ThemeType } from '../../../types/Util.std.js'; +import { assertDev } from '../../../util/assert.std.js'; +import { BadgeDialog } from '../../BadgeDialog.dom.js'; +import type { BadgeType } from '../../../badges/types.std.js'; +import { UserText } from '../../UserText.dom.js'; +import { isInSystemContacts } from '../../../util/isInSystemContacts.std.js'; +import { InContactsIcon } from '../../InContactsIcon.dom.js'; export type Props = { areWeASubscriber: boolean; diff --git a/ts/components/conversation/conversation-details/ConversationDetailsIcon.stories.tsx b/ts/components/conversation/conversation-details/ConversationDetailsIcon.stories.tsx index 290614bbb1..75f49ccc07 100644 --- a/ts/components/conversation/conversation-details/ConversationDetailsIcon.stories.tsx +++ b/ts/components/conversation/conversation-details/ConversationDetailsIcon.stories.tsx @@ -4,11 +4,11 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './ConversationDetailsIcon.js'; +import type { Props } from './ConversationDetailsIcon.dom.js'; import { ConversationDetailsIcon, IconType, -} from './ConversationDetailsIcon.js'; +} from './ConversationDetailsIcon.dom.js'; export default { title: 'Components/Conversation/ConversationDetails/ConversationDetailIcon', diff --git a/ts/components/conversation/conversation-details/ConversationDetailsIcon.tsx b/ts/components/conversation/conversation-details/ConversationDetailsIcon.tsx index c725fbe6a0..113ff2409c 100644 --- a/ts/components/conversation/conversation-details/ConversationDetailsIcon.tsx +++ b/ts/components/conversation/conversation-details/ConversationDetailsIcon.tsx @@ -4,8 +4,8 @@ import React from 'react'; import classNames from 'classnames'; -import { Spinner } from '../../Spinner.js'; -import { bemGenerator } from './util.js'; +import { Spinner } from '../../Spinner.dom.js'; +import { bemGenerator } from './util.std.js'; export enum IconType { 'approveAllMembers' = 'approveAllMembers', diff --git a/ts/components/conversation/conversation-details/ConversationDetailsMembershipList.stories.tsx b/ts/components/conversation/conversation-details/ConversationDetailsMembershipList.stories.tsx index 98050f6504..3291ffcf29 100644 --- a/ts/components/conversation/conversation-details/ConversationDetailsMembershipList.stories.tsx +++ b/ts/components/conversation/conversation-details/ConversationDetailsMembershipList.stories.tsx @@ -4,14 +4,14 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.js'; -import { ThemeType } from '../../../types/Util.js'; +import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.std.js'; +import { ThemeType } from '../../../types/Util.std.js'; import type { Props, GroupV2Membership, -} from './ConversationDetailsMembershipList.js'; -import { ConversationDetailsMembershipList } from './ConversationDetailsMembershipList.js'; +} from './ConversationDetailsMembershipList.dom.js'; +import { ConversationDetailsMembershipList } from './ConversationDetailsMembershipList.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/conversation-details/ConversationDetailsMembershipList.tsx b/ts/components/conversation/conversation-details/ConversationDetailsMembershipList.tsx index 66e92075cf..37828a6df3 100644 --- a/ts/components/conversation/conversation-details/ConversationDetailsMembershipList.tsx +++ b/ts/components/conversation/conversation-details/ConversationDetailsMembershipList.tsx @@ -3,19 +3,19 @@ import React from 'react'; -import type { LocalizerType, ThemeType } from '../../../types/Util.js'; +import type { LocalizerType, ThemeType } from '../../../types/Util.std.js'; -import { Avatar, AvatarSize } from '../../Avatar.js'; -import { Emojify } from '../Emojify.js'; +import { Avatar, AvatarSize } from '../../Avatar.dom.js'; +import { Emojify } from '../Emojify.dom.js'; import { ConversationDetailsIcon, IconType, -} from './ConversationDetailsIcon.js'; -import type { ConversationType } from '../../../state/ducks/conversations.js'; -import type { PreferredBadgeSelectorType } from '../../../state/selectors/badges.js'; -import { PanelRow } from './PanelRow.js'; -import { PanelSection } from './PanelSection.js'; +} from './ConversationDetailsIcon.dom.js'; +import type { ConversationType } from '../../../state/ducks/conversations.preload.js'; +import type { PreferredBadgeSelectorType } from '../../../state/selectors/badges.preload.js'; +import { PanelRow } from './PanelRow.dom.js'; +import { PanelSection } from './PanelSection.dom.js'; export type GroupV2Membership = { isAdmin: boolean; diff --git a/ts/components/conversation/conversation-details/ConversationNotificationsModal.tsx b/ts/components/conversation/conversation-details/ConversationNotificationsModal.tsx index ea29a3b5de..bb7264a853 100644 --- a/ts/components/conversation/conversation-details/ConversationNotificationsModal.tsx +++ b/ts/components/conversation/conversation-details/ConversationNotificationsModal.tsx @@ -4,12 +4,12 @@ import React, { useMemo, useState } from 'react'; import { v4 as uuid } from 'uuid'; -import type { LocalizerType } from '../../../types/Util.js'; -import { getMuteOptions } from '../../../util/getMuteOptions.js'; -import { parseIntOrThrow } from '../../../util/parseIntOrThrow.js'; -import { CircleCheckbox, Variant } from '../../CircleCheckbox.js'; -import { Modal } from '../../Modal.js'; -import { Button, ButtonVariant } from '../../Button.js'; +import type { LocalizerType } from '../../../types/Util.std.js'; +import { getMuteOptions } from '../../../util/getMuteOptions.std.js'; +import { parseIntOrThrow } from '../../../util/parseIntOrThrow.std.js'; +import { CircleCheckbox, Variant } from '../../CircleCheckbox.dom.js'; +import { Modal } from '../../Modal.dom.js'; +import { Button, ButtonVariant } from '../../Button.dom.js'; type PropsType = { i18n: LocalizerType; diff --git a/ts/components/conversation/conversation-details/ConversationNotificationsSettings.stories.tsx b/ts/components/conversation/conversation-details/ConversationNotificationsSettings.stories.tsx index fa6f5ccb0b..804d37c376 100644 --- a/ts/components/conversation/conversation-details/ConversationNotificationsSettings.stories.tsx +++ b/ts/components/conversation/conversation-details/ConversationNotificationsSettings.stories.tsx @@ -4,8 +4,8 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './ConversationNotificationsSettings.js'; -import { ConversationNotificationsSettings } from './ConversationNotificationsSettings.js'; +import type { PropsType } from './ConversationNotificationsSettings.dom.js'; +import { ConversationNotificationsSettings } from './ConversationNotificationsSettings.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/conversation-details/ConversationNotificationsSettings.tsx b/ts/components/conversation/conversation-details/ConversationNotificationsSettings.tsx index 89fd57c635..e072f9e42b 100644 --- a/ts/components/conversation/conversation-details/ConversationNotificationsSettings.tsx +++ b/ts/components/conversation/conversation-details/ConversationNotificationsSettings.tsx @@ -2,18 +2,18 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useMemo, useId } from 'react'; -import type { ConversationTypeType } from '../../../state/ducks/conversations.js'; -import type { LocalizerType } from '../../../types/Util.js'; -import { PanelSection } from './PanelSection.js'; -import { PanelRow } from './PanelRow.js'; +import type { ConversationTypeType } from '../../../state/ducks/conversations.preload.js'; +import type { LocalizerType } from '../../../types/Util.std.js'; +import { PanelSection } from './PanelSection.dom.js'; +import { PanelRow } from './PanelRow.dom.js'; import { ConversationDetailsIcon, IconType, -} from './ConversationDetailsIcon.js'; -import { Select } from '../../Select.js'; -import { isConversationMuted } from '../../../util/isConversationMuted.js'; -import { getMuteOptions } from '../../../util/getMuteOptions.js'; -import { parseIntOrThrow } from '../../../util/parseIntOrThrow.js'; +} from './ConversationDetailsIcon.dom.js'; +import { Select } from '../../Select.dom.js'; +import { isConversationMuted } from '../../../util/isConversationMuted.std.js'; +import { getMuteOptions } from '../../../util/getMuteOptions.std.js'; +import { parseIntOrThrow } from '../../../util/parseIntOrThrow.std.js'; export type PropsType = { id: string; diff --git a/ts/components/conversation/conversation-details/EditConversationAttributesModal.stories.tsx b/ts/components/conversation/conversation-details/EditConversationAttributesModal.stories.tsx index 0ccb065398..d30daa98fd 100644 --- a/ts/components/conversation/conversation-details/EditConversationAttributesModal.stories.tsx +++ b/ts/components/conversation/conversation-details/EditConversationAttributesModal.stories.tsx @@ -5,8 +5,8 @@ import type { ComponentProps } from 'react'; import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { EditConversationAttributesModal } from './EditConversationAttributesModal.js'; -import { RequestState } from './util.js'; +import { EditConversationAttributesModal } from './EditConversationAttributesModal.dom.js'; +import { RequestState } from './util.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/conversation-details/EditConversationAttributesModal.tsx b/ts/components/conversation/conversation-details/EditConversationAttributesModal.tsx index b53afa89dd..78a51bc901 100644 --- a/ts/components/conversation/conversation-details/EditConversationAttributesModal.tsx +++ b/ts/components/conversation/conversation-details/EditConversationAttributesModal.tsx @@ -4,23 +4,23 @@ import type { FormEventHandler } from 'react'; import React, { useCallback, useRef, useState } from 'react'; -import type { LocalizerType } from '../../../types/Util.js'; -import { Modal } from '../../Modal.js'; -import { AvatarEditor } from '../../AvatarEditor.js'; -import { AvatarPreview } from '../../AvatarPreview.js'; -import { Button, ButtonVariant } from '../../Button.js'; -import { Spinner } from '../../Spinner.js'; -import { GroupDescriptionInput } from '../../GroupDescriptionInput.js'; -import { GroupTitleInput } from '../../GroupTitleInput.js'; -import { RequestState } from './util.js'; +import type { LocalizerType } from '../../../types/Util.std.js'; +import { Modal } from '../../Modal.dom.js'; +import { AvatarEditor } from '../../AvatarEditor.dom.js'; +import { AvatarPreview } from '../../AvatarPreview.dom.js'; +import { Button, ButtonVariant } from '../../Button.dom.js'; +import { Spinner } from '../../Spinner.dom.js'; +import { GroupDescriptionInput } from '../../GroupDescriptionInput.dom.js'; +import { GroupTitleInput } from '../../GroupTitleInput.dom.js'; +import { RequestState } from './util.std.js'; import type { AvatarDataType, DeleteAvatarFromDiskActionType, ReplaceAvatarActionType, SaveAvatarToDiskActionType, -} from '../../../types/Avatar.js'; -import type { AvatarColorType } from '../../../types/Colors.js'; -import { useConfirmDiscard } from '../../../hooks/useConfirmDiscard.js'; +} from '../../../types/Avatar.std.js'; +import type { AvatarColorType } from '../../../types/Colors.std.js'; +import { useConfirmDiscard } from '../../../hooks/useConfirmDiscard.dom.js'; type PropsType = { avatarColor?: AvatarColorType; diff --git a/ts/components/conversation/conversation-details/GroupLinkManagement.stories.tsx b/ts/components/conversation/conversation-details/GroupLinkManagement.stories.tsx index 315a8ffb79..362f0a8ac7 100644 --- a/ts/components/conversation/conversation-details/GroupLinkManagement.stories.tsx +++ b/ts/components/conversation/conversation-details/GroupLinkManagement.stories.tsx @@ -4,11 +4,11 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './GroupLinkManagement.js'; -import { GroupLinkManagement } from './GroupLinkManagement.js'; -import { SignalService as Proto } from '../../../protobuf/index.js'; -import type { ConversationType } from '../../../state/ducks/conversations.js'; -import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.js'; +import type { PropsType } from './GroupLinkManagement.dom.js'; +import { GroupLinkManagement } from './GroupLinkManagement.dom.js'; +import { SignalService as Proto } from '../../../protobuf/index.std.js'; +import type { ConversationType } from '../../../state/ducks/conversations.preload.js'; +import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/conversation-details/GroupLinkManagement.tsx b/ts/components/conversation/conversation-details/GroupLinkManagement.tsx index f7ad017a41..ae79fce0c7 100644 --- a/ts/components/conversation/conversation-details/GroupLinkManagement.tsx +++ b/ts/components/conversation/conversation-details/GroupLinkManagement.tsx @@ -1,20 +1,20 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import React, { useId, useState } from 'react'; -import type { ConversationType } from '../../../state/ducks/conversations.js'; -import type { LocalizerType } from '../../../types/Util.js'; -import { ConfirmationDialog } from '../../ConfirmationDialog.js'; +import type { ConversationType } from '../../../state/ducks/conversations.preload.js'; +import type { LocalizerType } from '../../../types/Util.std.js'; +import { ConfirmationDialog } from '../../ConfirmationDialog.dom.js'; import { ConversationDetailsIcon, IconType, -} from './ConversationDetailsIcon.js'; -import { PanelRow } from './PanelRow.js'; -import { PanelSection } from './PanelSection.js'; -import { Select } from '../../Select.js'; -import { SignalService as Proto } from '../../../protobuf/index.js'; -import { copyGroupLink } from '../../../util/copyLinksWithToast.js'; -import { drop } from '../../../util/drop.js'; -import { useDelayedRestoreFocus } from '../../../hooks/useRestoreFocus.js'; +} from './ConversationDetailsIcon.dom.js'; +import { PanelRow } from './PanelRow.dom.js'; +import { PanelSection } from './PanelSection.dom.js'; +import { Select } from '../../Select.dom.js'; +import { SignalService as Proto } from '../../../protobuf/index.std.js'; +import { copyGroupLink } from '../../../util/copyLinksWithToast.dom.js'; +import { drop } from '../../../util/drop.std.js'; +import { useDelayedRestoreFocus } from '../../../hooks/useRestoreFocus.dom.js'; const AccessControlEnum = Proto.AccessControl.AccessRequired; diff --git a/ts/components/conversation/conversation-details/GroupV2Permissions.stories.tsx b/ts/components/conversation/conversation-details/GroupV2Permissions.stories.tsx index 433cbf04c3..79d5c72ba1 100644 --- a/ts/components/conversation/conversation-details/GroupV2Permissions.stories.tsx +++ b/ts/components/conversation/conversation-details/GroupV2Permissions.stories.tsx @@ -4,10 +4,10 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { PropsType } from './GroupV2Permissions.js'; -import { GroupV2Permissions } from './GroupV2Permissions.js'; -import type { ConversationType } from '../../../state/ducks/conversations.js'; -import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.js'; +import type { PropsType } from './GroupV2Permissions.dom.js'; +import { GroupV2Permissions } from './GroupV2Permissions.dom.js'; +import type { ConversationType } from '../../../state/ducks/conversations.preload.js'; +import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/conversation-details/GroupV2Permissions.tsx b/ts/components/conversation/conversation-details/GroupV2Permissions.tsx index fe58e56c09..bf16233b50 100644 --- a/ts/components/conversation/conversation-details/GroupV2Permissions.tsx +++ b/ts/components/conversation/conversation-details/GroupV2Permissions.tsx @@ -1,13 +1,13 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import React, { useId } from 'react'; -import type { ConversationType } from '../../../state/ducks/conversations.js'; -import type { LocalizerType } from '../../../types/Util.js'; -import { getAccessControlOptions } from '../../../util/getAccessControlOptions.js'; -import { SignalService as Proto } from '../../../protobuf/index.js'; -import { PanelRow } from './PanelRow.js'; -import { PanelSection } from './PanelSection.js'; -import { Select } from '../../Select.js'; +import type { ConversationType } from '../../../state/ducks/conversations.preload.js'; +import type { LocalizerType } from '../../../types/Util.std.js'; +import { getAccessControlOptions } from '../../../util/getAccessControlOptions.std.js'; +import { SignalService as Proto } from '../../../protobuf/index.std.js'; +import { PanelRow } from './PanelRow.dom.js'; +import { PanelSection } from './PanelSection.dom.js'; +import { Select } from '../../Select.dom.js'; export type PropsDataType = { conversation?: ConversationType; diff --git a/ts/components/conversation/conversation-details/PanelRow.stories.tsx b/ts/components/conversation/conversation-details/PanelRow.stories.tsx index be8487be14..3be51a46d7 100644 --- a/ts/components/conversation/conversation-details/PanelRow.stories.tsx +++ b/ts/components/conversation/conversation-details/PanelRow.stories.tsx @@ -4,12 +4,12 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './PanelRow.js'; -import { PanelRow } from './PanelRow.js'; +import type { Props } from './PanelRow.dom.js'; +import { PanelRow } from './PanelRow.dom.js'; import { ConversationDetailsIcon, IconType, -} from './ConversationDetailsIcon.js'; +} from './ConversationDetailsIcon.dom.js'; export default { title: 'Components/Conversation/ConversationDetails/PanelRow', diff --git a/ts/components/conversation/conversation-details/PanelRow.tsx b/ts/components/conversation/conversation-details/PanelRow.tsx index cdafd4f7dd..f47d100fa0 100644 --- a/ts/components/conversation/conversation-details/PanelRow.tsx +++ b/ts/components/conversation/conversation-details/PanelRow.tsx @@ -3,7 +3,7 @@ import React from 'react'; import classNames from 'classnames'; -import { bemGenerator } from './util.js'; +import { bemGenerator } from './util.std.js'; export type Props = { alwaysShowActions?: boolean; diff --git a/ts/components/conversation/conversation-details/PanelSection.stories.tsx b/ts/components/conversation/conversation-details/PanelSection.stories.tsx index 85d91d85b0..13e9b02a9e 100644 --- a/ts/components/conversation/conversation-details/PanelSection.stories.tsx +++ b/ts/components/conversation/conversation-details/PanelSection.stories.tsx @@ -4,9 +4,9 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './PanelSection.js'; -import { PanelSection } from './PanelSection.js'; -import { PanelRow } from './PanelRow.js'; +import type { Props } from './PanelSection.dom.js'; +import { PanelSection } from './PanelSection.dom.js'; +import { PanelRow } from './PanelRow.dom.js'; export default { title: 'Components/Conversation/ConversationDetails/PanelSection', diff --git a/ts/components/conversation/conversation-details/PanelSection.tsx b/ts/components/conversation/conversation-details/PanelSection.tsx index d2328c0fd5..644eb18aad 100644 --- a/ts/components/conversation/conversation-details/PanelSection.tsx +++ b/ts/components/conversation/conversation-details/PanelSection.tsx @@ -3,7 +3,7 @@ import React from 'react'; import classNames from 'classnames'; -import { bemGenerator } from './util.js'; +import { bemGenerator } from './util.std.js'; export type Props = { actions?: React.ReactNode; diff --git a/ts/components/conversation/conversation-details/PendingInvites.stories.tsx b/ts/components/conversation/conversation-details/PendingInvites.stories.tsx index 0784bd8768..849be1bf26 100644 --- a/ts/components/conversation/conversation-details/PendingInvites.stories.tsx +++ b/ts/components/conversation/conversation-details/PendingInvites.stories.tsx @@ -5,13 +5,13 @@ import * as React from 'react'; import lodash from 'lodash'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { generateAci } from '../../../types/ServiceId.js'; -import { StorySendMode } from '../../../types/Stories.js'; -import type { PropsType } from './PendingInvites.js'; -import { PendingInvites } from './PendingInvites.js'; -import type { ConversationType } from '../../../state/ducks/conversations.js'; -import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.js'; -import { getFakeBadge } from '../../../test-helpers/getFakeBadge.js'; +import { generateAci } from '../../../types/ServiceId.std.js'; +import { StorySendMode } from '../../../types/Stories.std.js'; +import type { PropsType } from './PendingInvites.dom.js'; +import { PendingInvites } from './PendingInvites.dom.js'; +import type { ConversationType } from '../../../state/ducks/conversations.preload.js'; +import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.std.js'; +import { getFakeBadge } from '../../../test-helpers/getFakeBadge.std.js'; import { StorybookThemeContext } from '../../../../.storybook/StorybookThemeContext.js'; const { times } = lodash; diff --git a/ts/components/conversation/conversation-details/PendingInvites.tsx b/ts/components/conversation/conversation-details/PendingInvites.tsx index 68fe359ac7..9aacc16f38 100644 --- a/ts/components/conversation/conversation-details/PendingInvites.tsx +++ b/ts/components/conversation/conversation-details/PendingInvites.tsx @@ -4,21 +4,21 @@ import React from 'react'; import _ from 'lodash'; -import type { ConversationType } from '../../../state/ducks/conversations.js'; -import type { LocalizerType, ThemeType } from '../../../types/Util.js'; -import type { PreferredBadgeSelectorType } from '../../../state/selectors/badges.js'; -import type { AciString } from '../../../types/ServiceId.js'; -import { Avatar, AvatarSize } from '../../Avatar.js'; -import { ConfirmationDialog } from '../../ConfirmationDialog.js'; -import { PanelSection } from './PanelSection.js'; -import { PanelRow } from './PanelRow.js'; +import type { ConversationType } from '../../../state/ducks/conversations.preload.js'; +import type { LocalizerType, ThemeType } from '../../../types/Util.std.js'; +import type { PreferredBadgeSelectorType } from '../../../state/selectors/badges.preload.js'; +import type { AciString } from '../../../types/ServiceId.std.js'; +import { Avatar, AvatarSize } from '../../Avatar.dom.js'; +import { ConfirmationDialog } from '../../ConfirmationDialog.dom.js'; +import { PanelSection } from './PanelSection.dom.js'; +import { PanelRow } from './PanelRow.dom.js'; import { ConversationDetailsIcon, IconType, -} from './ConversationDetailsIcon.js'; -import { isAccessControlEnabled } from '../../../groups/util.js'; -import { Tabs } from '../../Tabs.js'; -import { assertDev } from '../../../util/assert.js'; +} from './ConversationDetailsIcon.dom.js'; +import { isAccessControlEnabled } from '../../../groups/util.std.js'; +import { Tabs } from '../../Tabs.dom.js'; +import { assertDev } from '../../../util/assert.std.js'; export type PropsDataType = { readonly conversation?: ConversationType; diff --git a/ts/components/conversation/media-gallery/AttachmentSection.stories.tsx b/ts/components/conversation/media-gallery/AttachmentSection.stories.tsx index 42cefee062..5a72f80a82 100644 --- a/ts/components/conversation/media-gallery/AttachmentSection.stories.tsx +++ b/ts/components/conversation/media-gallery/AttachmentSection.stories.tsx @@ -6,13 +6,13 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './AttachmentSection.js'; -import { AttachmentSection } from './AttachmentSection.js'; +import type { Props } from './AttachmentSection.dom.js'; +import { AttachmentSection } from './AttachmentSection.dom.js'; import { createRandomDocuments, createRandomMedia, days, -} from './utils/mocks.js'; +} from './utils/mocks.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/media-gallery/AttachmentSection.tsx b/ts/components/conversation/media-gallery/AttachmentSection.tsx index 30a5e67370..d32ef1e446 100644 --- a/ts/components/conversation/media-gallery/AttachmentSection.tsx +++ b/ts/components/conversation/media-gallery/AttachmentSection.tsx @@ -3,14 +3,14 @@ import React from 'react'; -import type { ItemClickEvent } from './types/ItemClickEvent.js'; -import type { LocalizerType, ThemeType } from '../../../types/Util.js'; -import type { MediaItemType } from '../../../types/MediaItem.js'; -import { DocumentListItem } from './DocumentListItem.js'; -import { MediaGridItem } from './MediaGridItem.js'; -import type { AttachmentStatusType } from '../../../hooks/useAttachmentStatus.js'; -import { missingCaseError } from '../../../util/missingCaseError.js'; -import { tw } from '../../../axo/tw.js'; +import type { ItemClickEvent } from './types/ItemClickEvent.std.js'; +import type { LocalizerType, ThemeType } from '../../../types/Util.std.js'; +import type { MediaItemType } from '../../../types/MediaItem.std.js'; +import { DocumentListItem } from './DocumentListItem.dom.js'; +import { MediaGridItem } from './MediaGridItem.dom.js'; +import type { AttachmentStatusType } from '../../../hooks/useAttachmentStatus.std.js'; +import { missingCaseError } from '../../../util/missingCaseError.std.js'; +import { tw } from '../../../axo/tw.dom.js'; export type Props = { header?: string; diff --git a/ts/components/conversation/media-gallery/DocumentListItem.stories.tsx b/ts/components/conversation/media-gallery/DocumentListItem.stories.tsx index afe69ea32e..04d28cf65c 100644 --- a/ts/components/conversation/media-gallery/DocumentListItem.stories.tsx +++ b/ts/components/conversation/media-gallery/DocumentListItem.stories.tsx @@ -4,12 +4,12 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './DocumentListItem.js'; -import { DocumentListItem } from './DocumentListItem.js'; +import type { Props } from './DocumentListItem.dom.js'; +import { DocumentListItem } from './DocumentListItem.dom.js'; import { createPreparedMediaItems, createRandomDocuments, -} from './utils/mocks.js'; +} from './utils/mocks.std.js'; export default { title: 'Components/Conversation/MediaGallery/DocumentListItem', diff --git a/ts/components/conversation/media-gallery/DocumentListItem.tsx b/ts/components/conversation/media-gallery/DocumentListItem.tsx index 8e9853429c..074d5b34e0 100644 --- a/ts/components/conversation/media-gallery/DocumentListItem.tsx +++ b/ts/components/conversation/media-gallery/DocumentListItem.tsx @@ -4,18 +4,18 @@ import React, { useCallback } from 'react'; import moment from 'moment'; -import { formatFileSize } from '../../../util/formatFileSize.js'; -import { missingCaseError } from '../../../util/missingCaseError.js'; -import type { MediaItemType } from '../../../types/MediaItem.js'; -import type { LocalizerType } from '../../../types/Util.js'; -import { SpinnerV2 } from '../../SpinnerV2.js'; -import { tw } from '../../../axo/tw.js'; -import { AxoSymbol } from '../../../axo/AxoSymbol.js'; -import { FileThumbnail } from '../../FileThumbnail.js'; +import { formatFileSize } from '../../../util/formatFileSize.std.js'; +import { missingCaseError } from '../../../util/missingCaseError.std.js'; +import type { MediaItemType } from '../../../types/MediaItem.std.js'; +import type { LocalizerType } from '../../../types/Util.std.js'; +import { SpinnerV2 } from '../../SpinnerV2.dom.js'; +import { tw } from '../../../axo/tw.dom.js'; +import { AxoSymbol } from '../../../axo/AxoSymbol.dom.js'; +import { FileThumbnail } from '../../FileThumbnail.dom.js'; import { useAttachmentStatus, type AttachmentStatusType, -} from '../../../hooks/useAttachmentStatus.js'; +} from '../../../hooks/useAttachmentStatus.std.js'; export type Props = { i18n: LocalizerType; diff --git a/ts/components/conversation/media-gallery/EmptyState.stories.tsx b/ts/components/conversation/media-gallery/EmptyState.stories.tsx index 5a7e9adf0c..2dd7683a26 100644 --- a/ts/components/conversation/media-gallery/EmptyState.stories.tsx +++ b/ts/components/conversation/media-gallery/EmptyState.stories.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './EmptyState.js'; -import { EmptyState } from './EmptyState.js'; +import type { Props } from './EmptyState.dom.js'; +import { EmptyState } from './EmptyState.dom.js'; export default { title: 'Components/Conversation/MediaGallery/EmptyState', diff --git a/ts/components/conversation/media-gallery/MediaGallery.stories.tsx b/ts/components/conversation/media-gallery/MediaGallery.stories.tsx index a7640b5efc..d9b93d3710 100644 --- a/ts/components/conversation/media-gallery/MediaGallery.stories.tsx +++ b/ts/components/conversation/media-gallery/MediaGallery.stories.tsx @@ -4,14 +4,14 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './MediaGallery.js'; -import { MediaGallery } from './MediaGallery.js'; +import type { Props } from './MediaGallery.dom.js'; +import { MediaGallery } from './MediaGallery.dom.js'; import { createPreparedMediaItems, createRandomDocuments, createRandomMedia, days, -} from './utils/mocks.js'; +} from './utils/mocks.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/media-gallery/MediaGallery.tsx b/ts/components/conversation/media-gallery/MediaGallery.tsx index 8d39463a92..8e33a856b6 100644 --- a/ts/components/conversation/media-gallery/MediaGallery.tsx +++ b/ts/components/conversation/media-gallery/MediaGallery.tsx @@ -5,17 +5,17 @@ import React, { useEffect, useRef } from 'react'; import moment from 'moment'; -import type { ItemClickEvent } from './types/ItemClickEvent.js'; -import type { LocalizerType, ThemeType } from '../../../types/Util.js'; -import type { MediaItemType } from '../../../types/MediaItem.js'; -import type { SaveAttachmentActionCreatorType } from '../../../state/ducks/conversations.js'; -import { AttachmentSection } from './AttachmentSection.js'; -import { EmptyState } from './EmptyState.js'; -import { Tabs } from '../../Tabs.js'; -import { groupMediaItemsByDate } from './groupMediaItemsByDate.js'; -import { missingCaseError } from '../../../util/missingCaseError.js'; -import { usePrevious } from '../../../hooks/usePrevious.js'; -import type { AttachmentType } from '../../../types/Attachment.js'; +import type { ItemClickEvent } from './types/ItemClickEvent.std.js'; +import type { LocalizerType, ThemeType } from '../../../types/Util.std.js'; +import type { MediaItemType } from '../../../types/MediaItem.std.js'; +import type { SaveAttachmentActionCreatorType } from '../../../state/ducks/conversations.preload.js'; +import { AttachmentSection } from './AttachmentSection.dom.js'; +import { EmptyState } from './EmptyState.dom.js'; +import { Tabs } from '../../Tabs.dom.js'; +import { groupMediaItemsByDate } from './groupMediaItemsByDate.std.js'; +import { missingCaseError } from '../../../util/missingCaseError.std.js'; +import { usePrevious } from '../../../hooks/usePrevious.std.js'; +import type { AttachmentType } from '../../../types/Attachment.std.js'; enum TabViews { Media = 'Media', diff --git a/ts/components/conversation/media-gallery/MediaGridItem.stories.tsx b/ts/components/conversation/media-gallery/MediaGridItem.stories.tsx index a6b91c57de..844f6f8e11 100644 --- a/ts/components/conversation/media-gallery/MediaGridItem.stories.tsx +++ b/ts/components/conversation/media-gallery/MediaGridItem.stories.tsx @@ -5,16 +5,16 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; import { StorybookThemeContext } from '../../../../.storybook/StorybookThemeContext.js'; -import type { MediaItemType } from '../../../types/MediaItem.js'; -import { SignalService } from '../../../protobuf/index.js'; +import type { MediaItemType } from '../../../types/MediaItem.std.js'; +import { SignalService } from '../../../protobuf/index.std.js'; import { IMAGE_JPEG, VIDEO_MP4, APPLICATION_OCTET_STREAM, type MIMEType, -} from '../../../types/MIME.js'; -import type { Props } from './MediaGridItem.js'; -import { MediaGridItem } from './MediaGridItem.js'; +} from '../../../types/MIME.std.js'; +import type { Props } from './MediaGridItem.dom.js'; +import { MediaGridItem } from './MediaGridItem.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/conversation/media-gallery/MediaGridItem.tsx b/ts/components/conversation/media-gallery/MediaGridItem.tsx index e21e4036a1..8eb70e42dc 100644 --- a/ts/components/conversation/media-gallery/MediaGridItem.tsx +++ b/ts/components/conversation/media-gallery/MediaGridItem.tsx @@ -4,27 +4,27 @@ import React, { useCallback } from 'react'; import type { ReadonlyDeep } from 'type-fest'; -import { formatFileSize } from '../../../util/formatFileSize.js'; -import { formatDuration } from '../../../util/formatDuration.js'; -import { missingCaseError } from '../../../util/missingCaseError.js'; -import type { LocalizerType, ThemeType } from '../../../types/Util.js'; -import type { MediaItemType } from '../../../types/MediaItem.js'; -import type { AttachmentForUIType } from '../../../types/Attachment.js'; +import { formatFileSize } from '../../../util/formatFileSize.std.js'; +import { formatDuration } from '../../../util/formatDuration.std.js'; +import { missingCaseError } from '../../../util/missingCaseError.std.js'; +import type { LocalizerType, ThemeType } from '../../../types/Util.std.js'; +import type { MediaItemType } from '../../../types/MediaItem.std.js'; +import type { AttachmentForUIType } from '../../../types/Attachment.std.js'; import { getAlt, getUrl, defaultBlurHash, isGIF, isVideoAttachment, -} from '../../../util/Attachment.js'; -import { ImageOrBlurhash } from '../../ImageOrBlurhash.js'; -import { SpinnerV2 } from '../../SpinnerV2.js'; -import { tw } from '../../../axo/tw.js'; -import { AxoSymbol } from '../../../axo/AxoSymbol.js'; +} from '../../../util/Attachment.std.js'; +import { ImageOrBlurhash } from '../../ImageOrBlurhash.dom.js'; +import { SpinnerV2 } from '../../SpinnerV2.dom.js'; +import { tw } from '../../../axo/tw.dom.js'; +import { AxoSymbol } from '../../../axo/AxoSymbol.dom.js'; import { useAttachmentStatus, type AttachmentStatusType, -} from '../../../hooks/useAttachmentStatus.js'; +} from '../../../hooks/useAttachmentStatus.std.js'; export type Props = Readonly<{ mediaItem: ReadonlyDeep; diff --git a/ts/components/conversation/media-gallery/groupMediaItemsByDate.ts b/ts/components/conversation/media-gallery/groupMediaItemsByDate.ts index 872596d979..7133a4f01a 100644 --- a/ts/components/conversation/media-gallery/groupMediaItemsByDate.ts +++ b/ts/components/conversation/media-gallery/groupMediaItemsByDate.ts @@ -3,8 +3,8 @@ import moment from 'moment'; import lodash from 'lodash'; -import type { MediaItemType } from '../../../types/MediaItem.js'; -import { missingCaseError } from '../../../util/missingCaseError.js'; +import type { MediaItemType } from '../../../types/MediaItem.std.js'; +import { missingCaseError } from '../../../util/missingCaseError.std.js'; const { compact, groupBy, sortBy } = lodash; diff --git a/ts/components/conversation/media-gallery/types/ItemClickEvent.ts b/ts/components/conversation/media-gallery/types/ItemClickEvent.ts index 811f392f3a..fdb370d056 100644 --- a/ts/components/conversation/media-gallery/types/ItemClickEvent.ts +++ b/ts/components/conversation/media-gallery/types/ItemClickEvent.ts @@ -1,8 +1,8 @@ // Copyright 2018 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AttachmentType } from '../../../../types/Attachment.js'; -import type { AttachmentStatusType } from '../../../../hooks/useAttachmentStatus.js'; +import type { AttachmentType } from '../../../../types/Attachment.std.js'; +import type { AttachmentStatusType } from '../../../../hooks/useAttachmentStatus.std.js'; export type ItemClickEvent = { message: { id: string; sentAt: number }; diff --git a/ts/components/conversation/media-gallery/utils/mocks.ts b/ts/components/conversation/media-gallery/utils/mocks.ts index d16a8a61f9..69f003056d 100644 --- a/ts/components/conversation/media-gallery/utils/mocks.ts +++ b/ts/components/conversation/media-gallery/utils/mocks.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import lodash from 'lodash'; -import { type MIMEType, IMAGE_JPEG } from '../../../../types/MIME.js'; -import type { MediaItemType } from '../../../../types/MediaItem.js'; -import { randomBlurHash } from '../../../../util/randomBlurHash.js'; -import { SignalService } from '../../../../protobuf/index.js'; +import { type MIMEType, IMAGE_JPEG } from '../../../../types/MIME.std.js'; +import type { MediaItemType } from '../../../../types/MediaItem.std.js'; +import { randomBlurHash } from '../../../../util/randomBlurHash.std.js'; +import { SignalService } from '../../../../protobuf/index.std.js'; const { random, range, sample, sortBy } = lodash; diff --git a/ts/components/conversation/poll-message/PollMessageContents.tsx b/ts/components/conversation/poll-message/PollMessageContents.tsx index c6d93f922b..e411354bec 100644 --- a/ts/components/conversation/poll-message/PollMessageContents.tsx +++ b/ts/components/conversation/poll-message/PollMessageContents.tsx @@ -3,13 +3,13 @@ import React, { memo, useState } from 'react'; import { Checkbox } from 'radix-ui'; -import { tw } from '../../../axo/tw.js'; -import { AxoButton } from '../../../axo/AxoButton.js'; -import { AxoSymbol } from '../../../axo/AxoSymbol.js'; -import type { DirectionType } from '../Message.js'; -import type { PollWithResolvedVotersType } from '../../../state/selectors/message.js'; -import type { LocalizerType } from '../../../types/Util.js'; -import { PollVotesModal } from './PollVotesModal.js'; +import { tw } from '../../../axo/tw.dom.js'; +import { AxoButton } from '../../../axo/AxoButton.dom.js'; +import { AxoSymbol } from '../../../axo/AxoSymbol.dom.js'; +import type { DirectionType } from '../Message.dom.js'; +import type { PollWithResolvedVotersType } from '../../../state/selectors/message.preload.js'; +import type { LocalizerType } from '../../../types/Util.std.js'; +import { PollVotesModal } from './PollVotesModal.dom.js'; function VotedCheckmark({ isIncoming, diff --git a/ts/components/conversation/poll-message/PollVotesModal.tsx b/ts/components/conversation/poll-message/PollVotesModal.tsx index 15c2affd0b..2c371aa678 100644 --- a/ts/components/conversation/poll-message/PollVotesModal.tsx +++ b/ts/components/conversation/poll-message/PollVotesModal.tsx @@ -2,15 +2,15 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import { tw } from '../../../axo/tw.js'; -import { Modal } from '../../Modal.js'; -import { Avatar, AvatarSize } from '../../Avatar.js'; -import { ContactName } from '../ContactName.js'; -import type { LocalizerType } from '../../../types/Util.js'; +import { tw } from '../../../axo/tw.dom.js'; +import { Modal } from '../../Modal.dom.js'; +import { Avatar, AvatarSize } from '../../Avatar.dom.js'; +import { ContactName } from '../ContactName.dom.js'; +import type { LocalizerType } from '../../../types/Util.std.js'; import type { PollVoteWithUserType, PollWithResolvedVotersType, -} from '../../../state/selectors/message.js'; +} from '../../../state/selectors/message.preload.js'; type PollVotesModalProps = { i18n: LocalizerType; diff --git a/ts/components/conversationList/BaseConversationListItem.tsx b/ts/components/conversationList/BaseConversationListItem.tsx index f5b6d461f8..8d877ca72e 100644 --- a/ts/components/conversationList/BaseConversationListItem.tsx +++ b/ts/components/conversationList/BaseConversationListItem.tsx @@ -7,16 +7,16 @@ import classNames from 'classnames'; import lodash from 'lodash'; import { v4 as generateUuid } from 'uuid'; -import { Avatar, AvatarSize } from '../Avatar.js'; -import type { BadgeType } from '../../badges/types.js'; -import { isConversationUnread } from '../../util/isConversationUnread.js'; -import { cleanId } from '../_util.js'; -import type { LocalizerType, ThemeType } from '../../types/Util.js'; -import type { ConversationType } from '../../state/ducks/conversations.js'; -import { Spinner } from '../Spinner.js'; -import { Time } from '../Time.js'; -import { formatDateTimeShort } from '../../util/timestamp.js'; -import * as durations from '../../util/durations/index.js'; +import { Avatar, AvatarSize } from '../Avatar.dom.js'; +import type { BadgeType } from '../../badges/types.std.js'; +import { isConversationUnread } from '../../util/isConversationUnread.std.js'; +import { cleanId } from '../_util.std.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.std.js'; +import type { ConversationType } from '../../state/ducks/conversations.preload.js'; +import { Spinner } from '../Spinner.dom.js'; +import { Time } from '../Time.dom.js'; +import { formatDateTimeShort } from '../../util/formatTimestamp.dom.js'; +import * as durations from '../../util/durations/index.std.js'; const { isBoolean, isNumber } = lodash; diff --git a/ts/components/conversationList/ComposeStepButton.tsx b/ts/components/conversationList/ComposeStepButton.tsx index 8dc9efeece..13c59bf95f 100644 --- a/ts/components/conversationList/ComposeStepButton.tsx +++ b/ts/components/conversationList/ComposeStepButton.tsx @@ -4,7 +4,7 @@ import type { FunctionComponent } from 'react'; import React from 'react'; -import { ListTile } from '../ListTile.js'; +import { ListTile } from '../ListTile.dom.js'; export enum Icon { Group = 'group', diff --git a/ts/components/conversationList/ContactCheckbox.tsx b/ts/components/conversationList/ContactCheckbox.tsx index 152e611cbe..754ad24524 100644 --- a/ts/components/conversationList/ContactCheckbox.tsx +++ b/ts/components/conversationList/ContactCheckbox.tsx @@ -4,14 +4,14 @@ import React from 'react'; import type { FunctionComponent } from 'react'; -import { HEADER_CONTACT_NAME_CLASS_NAME } from './BaseConversationListItem.js'; -import type { ConversationType } from '../../state/ducks/conversations.js'; -import type { BadgeType } from '../../badges/types.js'; -import type { LocalizerType, ThemeType } from '../../types/Util.js'; -import { ContactName } from '../conversation/ContactName.js'; -import { About } from '../conversation/About.js'; -import { ListTile } from '../ListTile.js'; -import { Avatar, AvatarSize } from '../Avatar.js'; +import { HEADER_CONTACT_NAME_CLASS_NAME } from './BaseConversationListItem.dom.js'; +import type { ConversationType } from '../../state/ducks/conversations.preload.js'; +import type { BadgeType } from '../../badges/types.std.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.std.js'; +import { ContactName } from '../conversation/ContactName.dom.js'; +import { About } from '../conversation/About.dom.js'; +import { ListTile } from '../ListTile.dom.js'; +import { Avatar, AvatarSize } from '../Avatar.dom.js'; export enum ContactCheckboxDisabledReason { // We start the enum at 1 because the default starting value of 0 is falsy. diff --git a/ts/components/conversationList/ContactListItem.tsx b/ts/components/conversationList/ContactListItem.tsx index 1454266097..20a5d03de5 100644 --- a/ts/components/conversationList/ContactListItem.tsx +++ b/ts/components/conversationList/ContactListItem.tsx @@ -4,20 +4,20 @@ import type { FunctionComponent } from 'react'; import React, { useMemo, useState } from 'react'; -import { HEADER_CONTACT_NAME_CLASS_NAME } from './BaseConversationListItem.js'; -import type { ConversationType } from '../../state/ducks/conversations.js'; -import type { BadgeType } from '../../badges/types.js'; -import type { LocalizerType, ThemeType } from '../../types/Util.js'; -import { ContactName } from '../conversation/ContactName.js'; -import { About } from '../conversation/About.js'; -import { ListTile } from '../ListTile.js'; -import { Avatar, AvatarSize } from '../Avatar.js'; -import { ContextMenu } from '../ContextMenu.js'; -import { I18n } from '../I18n.js'; -import { ConfirmationDialog } from '../ConfirmationDialog.js'; -import { isSignalConversation } from '../../util/isSignalConversation.js'; -import { isInSystemContacts } from '../../util/isInSystemContacts.js'; -import { InContactsIcon } from '../InContactsIcon.js'; +import { HEADER_CONTACT_NAME_CLASS_NAME } from './BaseConversationListItem.dom.js'; +import type { ConversationType } from '../../state/ducks/conversations.preload.js'; +import type { BadgeType } from '../../badges/types.std.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.std.js'; +import { ContactName } from '../conversation/ContactName.dom.js'; +import { About } from '../conversation/About.dom.js'; +import { ListTile } from '../ListTile.dom.js'; +import { Avatar, AvatarSize } from '../Avatar.dom.js'; +import { ContextMenu } from '../ContextMenu.dom.js'; +import { I18n } from '../I18n.dom.js'; +import { ConfirmationDialog } from '../ConfirmationDialog.dom.js'; +import { isSignalConversation } from '../../util/isSignalConversation.dom.js'; +import { isInSystemContacts } from '../../util/isInSystemContacts.std.js'; +import { InContactsIcon } from '../InContactsIcon.dom.js'; export type ContactListItemConversationType = Pick< ConversationType, diff --git a/ts/components/conversationList/ConversationListItem.tsx b/ts/components/conversationList/ConversationListItem.tsx index 84d3d46966..43db0a0eb6 100644 --- a/ts/components/conversationList/ConversationListItem.tsx +++ b/ts/components/conversationList/ConversationListItem.tsx @@ -5,22 +5,22 @@ import type { FunctionComponent, ReactNode } from 'react'; import React, { useCallback } from 'react'; import classNames from 'classnames'; -import type { RenderConversationListItemContextMenuProps } from './BaseConversationListItem.js'; +import type { RenderConversationListItemContextMenuProps } from './BaseConversationListItem.dom.js'; import { BaseConversationListItem, HEADER_NAME_CLASS_NAME, HEADER_CONTACT_NAME_CLASS_NAME, MESSAGE_TEXT_CLASS_NAME, -} from './BaseConversationListItem.js'; -import { MessageBody } from '../conversation/MessageBody.js'; -import { ContactName } from '../conversation/ContactName.js'; -import { TypingAnimation } from '../conversation/TypingAnimation.js'; +} from './BaseConversationListItem.dom.js'; +import { MessageBody } from '../conversation/MessageBody.dom.js'; +import { ContactName } from '../conversation/ContactName.dom.js'; +import { TypingAnimation } from '../conversation/TypingAnimation.dom.js'; -import type { LocalizerType, ThemeType } from '../../types/Util.js'; -import type { ConversationType } from '../../state/ducks/conversations.js'; -import type { BadgeType } from '../../badges/types.js'; -import { isSignalConversation } from '../../util/isSignalConversation.js'; -import { RenderLocation } from '../conversation/MessageTextRenderer.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.std.js'; +import type { ConversationType } from '../../state/ducks/conversations.preload.js'; +import type { BadgeType } from '../../badges/types.std.js'; +import { isSignalConversation } from '../../util/isSignalConversation.dom.js'; +import { RenderLocation } from '../conversation/MessageTextRenderer.dom.js'; const EMPTY_OBJECT = Object.freeze(Object.create(null)); const MESSAGE_STATUS_ICON_CLASS_NAME = `${MESSAGE_TEXT_CLASS_NAME}__status-icon`; diff --git a/ts/components/conversationList/GroupListItem.tsx b/ts/components/conversationList/GroupListItem.tsx index e03e41fbef..ed2d2c1456 100644 --- a/ts/components/conversationList/GroupListItem.tsx +++ b/ts/components/conversationList/GroupListItem.tsx @@ -2,12 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import type { ConversationType } from '../../state/ducks/conversations.js'; -import type { LocalizerType } from '../../types/Util.js'; -import type { AciString } from '../../types/ServiceId.js'; -import { Avatar, AvatarSize } from '../Avatar.js'; -import { ListTile } from '../ListTile.js'; -import { UserText } from '../UserText.js'; +import type { ConversationType } from '../../state/ducks/conversations.preload.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import type { AciString } from '../../types/ServiceId.std.js'; +import { Avatar, AvatarSize } from '../Avatar.dom.js'; +import { ListTile } from '../ListTile.dom.js'; +import { UserText } from '../UserText.dom.js'; export enum DisabledReason { AlreadyMember = 'already-member', diff --git a/ts/components/conversationList/MessageSearchResult.stories.tsx b/ts/components/conversationList/MessageSearchResult.stories.tsx index ff4cfd0003..42d70c05b2 100644 --- a/ts/components/conversationList/MessageSearchResult.stories.tsx +++ b/ts/components/conversationList/MessageSearchResult.stories.tsx @@ -5,13 +5,13 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; import { StorybookThemeContext } from '../../../.storybook/StorybookThemeContext.js'; -import { strictAssert } from '../../util/assert.js'; -import { getFakeBadge } from '../../test-helpers/getFakeBadge.js'; -import type { PropsType } from './MessageSearchResult.js'; -import { MessageSearchResult } from './MessageSearchResult.js'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; -import { BodyRange } from '../../types/BodyRange.js'; -import { generateAci } from '../../types/ServiceId.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { getFakeBadge } from '../../test-helpers/getFakeBadge.std.js'; +import type { PropsType } from './MessageSearchResult.dom.js'; +import { MessageSearchResult } from './MessageSearchResult.dom.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.std.js'; +import { BodyRange } from '../../types/BodyRange.std.js'; +import { generateAci } from '../../types/ServiceId.std.js'; const SERVICE_ID_1 = generateAci(); const SERVICE_ID_2 = generateAci(); diff --git a/ts/components/conversationList/MessageSearchResult.tsx b/ts/components/conversationList/MessageSearchResult.tsx index 77dccf1cc8..38c8a427c8 100644 --- a/ts/components/conversationList/MessageSearchResult.tsx +++ b/ts/components/conversationList/MessageSearchResult.tsx @@ -5,22 +5,22 @@ import type { FunctionComponent, ReactNode } from 'react'; import React, { useCallback } from 'react'; import lodash from 'lodash'; -import { ContactName } from '../conversation/ContactName.js'; +import { ContactName } from '../conversation/ContactName.dom.js'; -import type { BodyRangesForDisplayType } from '../../types/BodyRange.js'; -import { processBodyRangesForSearchResult } from '../../types/BodyRange.js'; -import type { LocalizerType, ThemeType } from '../../types/Util.js'; -import { BaseConversationListItem } from './BaseConversationListItem.js'; +import type { BodyRangesForDisplayType } from '../../types/BodyRange.std.js'; +import { processBodyRangesForSearchResult } from '../../types/BodyRange.std.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.std.js'; +import { BaseConversationListItem } from './BaseConversationListItem.dom.js'; import type { ConversationType, ShowConversationType, -} from '../../state/ducks/conversations.js'; -import type { PreferredBadgeSelectorType } from '../../state/selectors/badges.js'; -import { I18n } from '../I18n.js'; +} from '../../state/ducks/conversations.preload.js'; +import type { PreferredBadgeSelectorType } from '../../state/selectors/badges.preload.js'; +import { I18n } from '../I18n.dom.js'; import { MessageTextRenderer, RenderLocation, -} from '../conversation/MessageTextRenderer.js'; +} from '../conversation/MessageTextRenderer.dom.js'; const { noop } = lodash; diff --git a/ts/components/conversationList/PhoneNumberCheckbox.tsx b/ts/components/conversationList/PhoneNumberCheckbox.tsx index 11f3764617..339afe7ff0 100644 --- a/ts/components/conversationList/PhoneNumberCheckbox.tsx +++ b/ts/components/conversationList/PhoneNumberCheckbox.tsx @@ -4,17 +4,17 @@ import type { FunctionComponent } from 'react'; import React, { useState } from 'react'; -import { ButtonVariant } from '../Button.js'; -import { ConfirmationDialog } from '../ConfirmationDialog.js'; -import { SPINNER_CLASS_NAME } from './BaseConversationListItem.js'; -import type { ParsedE164Type } from '../../util/libphonenumberInstance.js'; -import type { LocalizerType, ThemeType } from '../../types/Util.js'; -import { AvatarColors } from '../../types/Colors.js'; -import type { LookupConversationWithoutServiceIdActionsType } from '../../util/lookupConversationWithoutServiceId.js'; -import { ListTile } from '../ListTile.js'; -import { Avatar, AvatarSize } from '../Avatar.js'; -import { Spinner } from '../Spinner.js'; -import { UserText } from '../UserText.js'; +import { ButtonVariant } from '../Button.dom.js'; +import { ConfirmationDialog } from '../ConfirmationDialog.dom.js'; +import { SPINNER_CLASS_NAME } from './BaseConversationListItem.dom.js'; +import type { ParsedE164Type } from '../../util/libphonenumberInstance.std.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.std.js'; +import { AvatarColors } from '../../types/Colors.std.js'; +import type { LookupConversationWithoutServiceIdActionsType } from '../../util/lookupConversationWithoutServiceId.preload.js'; +import { ListTile } from '../ListTile.dom.js'; +import { Avatar, AvatarSize } from '../Avatar.dom.js'; +import { Spinner } from '../Spinner.dom.js'; +import { UserText } from '../UserText.dom.js'; export type PropsDataType = { phoneNumber: ParsedE164Type; diff --git a/ts/components/conversationList/StartNewConversation.tsx b/ts/components/conversationList/StartNewConversation.tsx index 5194a7c076..7defd877c1 100644 --- a/ts/components/conversationList/StartNewConversation.tsx +++ b/ts/components/conversationList/StartNewConversation.tsx @@ -4,17 +4,17 @@ import type { FunctionComponent } from 'react'; import React, { useCallback, useState } from 'react'; -import { ButtonVariant } from '../Button.js'; -import { ConfirmationDialog } from '../ConfirmationDialog.js'; -import { SPINNER_CLASS_NAME } from './BaseConversationListItem.js'; -import { ListTile } from '../ListTile.js'; -import { Avatar, AvatarSize } from '../Avatar.js'; -import { Spinner } from '../Spinner.js'; +import { ButtonVariant } from '../Button.dom.js'; +import { ConfirmationDialog } from '../ConfirmationDialog.dom.js'; +import { SPINNER_CLASS_NAME } from './BaseConversationListItem.dom.js'; +import { ListTile } from '../ListTile.dom.js'; +import { Avatar, AvatarSize } from '../Avatar.dom.js'; +import { Spinner } from '../Spinner.dom.js'; -import type { ParsedE164Type } from '../../util/libphonenumberInstance.js'; -import type { LookupConversationWithoutServiceIdActionsType } from '../../util/lookupConversationWithoutServiceId.js'; -import type { LocalizerType } from '../../types/Util.js'; -import type { ShowConversationType } from '../../state/ducks/conversations.js'; +import type { ParsedE164Type } from '../../util/libphonenumberInstance.std.js'; +import type { LookupConversationWithoutServiceIdActionsType } from '../../util/lookupConversationWithoutServiceId.preload.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import type { ShowConversationType } from '../../state/ducks/conversations.preload.js'; type PropsData = { phoneNumber: ParsedE164Type; diff --git a/ts/components/conversationList/UsernameCheckbox.tsx b/ts/components/conversationList/UsernameCheckbox.tsx index 081a2a9478..faa37f1d09 100644 --- a/ts/components/conversationList/UsernameCheckbox.tsx +++ b/ts/components/conversationList/UsernameCheckbox.tsx @@ -4,13 +4,13 @@ import React from 'react'; import type { FunctionComponent } from 'react'; -import type { LocalizerType, ThemeType } from '../../types/Util.js'; -import { AvatarColors } from '../../types/Colors.js'; -import type { LookupConversationWithoutServiceIdActionsType } from '../../util/lookupConversationWithoutServiceId.js'; -import { ListTile } from '../ListTile.js'; -import { Avatar, AvatarSize } from '../Avatar.js'; -import { Spinner } from '../Spinner.js'; -import { SPINNER_CLASS_NAME } from './BaseConversationListItem.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.std.js'; +import { AvatarColors } from '../../types/Colors.std.js'; +import type { LookupConversationWithoutServiceIdActionsType } from '../../util/lookupConversationWithoutServiceId.preload.js'; +import { ListTile } from '../ListTile.dom.js'; +import { Avatar, AvatarSize } from '../Avatar.dom.js'; +import { Spinner } from '../Spinner.dom.js'; +import { SPINNER_CLASS_NAME } from './BaseConversationListItem.dom.js'; export type PropsDataType = { username: string; diff --git a/ts/components/conversationList/UsernameSearchResultListItem.tsx b/ts/components/conversationList/UsernameSearchResultListItem.tsx index 35b30775eb..8822315bb2 100644 --- a/ts/components/conversationList/UsernameSearchResultListItem.tsx +++ b/ts/components/conversationList/UsernameSearchResultListItem.tsx @@ -3,14 +3,14 @@ import React, { useCallback } from 'react'; -import { SPINNER_CLASS_NAME } from './BaseConversationListItem.js'; -import { ListTile } from '../ListTile.js'; -import { Avatar, AvatarSize } from '../Avatar.js'; -import { Spinner } from '../Spinner.js'; +import { SPINNER_CLASS_NAME } from './BaseConversationListItem.dom.js'; +import { ListTile } from '../ListTile.dom.js'; +import { Avatar, AvatarSize } from '../Avatar.dom.js'; +import { Spinner } from '../Spinner.dom.js'; -import type { LocalizerType } from '../../types/Util.js'; -import type { LookupConversationWithoutServiceIdActionsType } from '../../util/lookupConversationWithoutServiceId.js'; -import type { ShowConversationType } from '../../state/ducks/conversations.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import type { LookupConversationWithoutServiceIdActionsType } from '../../util/lookupConversationWithoutServiceId.preload.js'; +import type { ShowConversationType } from '../../state/ducks/conversations.preload.js'; type PropsData = { username: string; diff --git a/ts/components/fun/FunButton.tsx b/ts/components/fun/FunButton.tsx index 2cd868cb0d..51e38b721c 100644 --- a/ts/components/fun/FunButton.tsx +++ b/ts/components/fun/FunButton.tsx @@ -3,10 +3,13 @@ import React, { useMemo } from 'react'; import { VisuallyHidden } from 'react-aria'; import { Button } from 'react-aria-components'; -import type { LocalizerType } from '../../types/I18N.js'; -import { type EmojiVariantKey, getEmojiVariantByKey } from './data/emojis.js'; -import { FunStaticEmoji } from './FunEmoji.js'; -import { useFunEmojiLocalizer } from './useFunEmojiLocalizer.js'; +import type { LocalizerType } from '../../types/I18N.std.js'; +import { + type EmojiVariantKey, + getEmojiVariantByKey, +} from './data/emojis.std.js'; +import { FunStaticEmoji } from './FunEmoji.dom.js'; +import { useFunEmojiLocalizer } from './useFunEmojiLocalizer.dom.js'; /** * Fun Picker Button diff --git a/ts/components/fun/FunEmoji.stories.tsx b/ts/components/fun/FunEmoji.stories.tsx index 78ce0c90fc..037868da8b 100644 --- a/ts/components/fun/FunEmoji.stories.tsx +++ b/ts/components/fun/FunEmoji.stories.tsx @@ -3,16 +3,16 @@ import { useVirtualizer } from '@tanstack/react-virtual'; import lodash from 'lodash'; import React, { useCallback, useEffect, useRef } from 'react'; -import { type ComponentMeta } from '../../storybook/types.js'; -import type { FunStaticEmojiProps } from './FunEmoji.js'; -import { FunInlineEmoji, FunStaticEmoji } from './FunEmoji.js'; +import { type ComponentMeta } from '../../storybook/types.std.js'; +import type { FunStaticEmojiProps } from './FunEmoji.dom.js'; +import { FunInlineEmoji, FunStaticEmoji } from './FunEmoji.dom.js'; import { _getAllEmojiVariantKeys, EMOJI_VARIANT_KEY_CONSTANTS, getEmojiParentByKey, getEmojiParentKeyByVariantKey, getEmojiVariantByKey, -} from './data/emojis.js'; +} from './data/emojis.std.js'; const { chunk } = lodash; diff --git a/ts/components/fun/FunEmoji.tsx b/ts/components/fun/FunEmoji.tsx index 8ac3b8b604..ea031e9a8a 100644 --- a/ts/components/fun/FunEmoji.tsx +++ b/ts/components/fun/FunEmoji.tsx @@ -4,8 +4,8 @@ import classNames from 'classnames'; import type { CSSProperties } from 'react'; import React, { useMemo } from 'react'; import MANIFEST from '../../../build/jumbomoji.json'; -import type { EmojiVariantData } from './data/emojis.js'; -import type { FunImageAriaProps } from './types.js'; +import type { EmojiVariantData } from './data/emojis.std.js'; +import type { FunImageAriaProps } from './types.dom.js'; export const FUN_STATIC_EMOJI_CLASS = 'FunStaticEmoji'; export const FUN_INLINE_EMOJI_CLASS = 'FunInlineEmoji'; diff --git a/ts/components/fun/FunEmojiLocalizationProvider.tsx b/ts/components/fun/FunEmojiLocalizationProvider.tsx index 605281b605..15440f9485 100644 --- a/ts/components/fun/FunEmojiLocalizationProvider.tsx +++ b/ts/components/fun/FunEmojiLocalizationProvider.tsx @@ -9,25 +9,25 @@ import React, { useMemo, useState, } from 'react'; -import type { LocaleEmojiListType } from '../../types/emoji.js'; -import { createLogger } from '../../logging/log.js'; -import * as Errors from '../../types/errors.js'; -import { drop } from '../../util/drop.js'; +import type { LocaleEmojiListType } from '../../types/emoji.std.js'; +import { createLogger } from '../../logging/log.std.js'; +import * as Errors from '../../types/errors.std.js'; +import { drop } from '../../util/drop.std.js'; import { getEmojiDefaultEnglishLocalizerIndex, getEmojiDefaultEnglishSearchIndex, -} from './data/emojis.js'; +} from './data/emojis.std.js'; import { createFunEmojiLocalizerIndex, type FunEmojiLocalizerIndex, -} from './useFunEmojiLocalizer.js'; +} from './useFunEmojiLocalizer.dom.js'; import { createFunEmojiSearchIndex, type FunEmojiSearchIndex, -} from './useFunEmojiSearch.js'; -import type { LocalizerType } from '../../types/I18N.js'; -import { strictAssert } from '../../util/assert.js'; -import { isTestOrMockEnvironment } from '../../environment.js'; +} from './useFunEmojiSearch.dom.js'; +import type { LocalizerType } from '../../types/I18N.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { isTestOrMockEnvironment } from '../../environment.std.js'; const log = createLogger('FunEmojiLocalizationProvider'); diff --git a/ts/components/fun/FunEmojiPicker.stories.tsx b/ts/components/fun/FunEmojiPicker.stories.tsx index 615bb4558c..a206f8ef1f 100644 --- a/ts/components/fun/FunEmojiPicker.stories.tsx +++ b/ts/components/fun/FunEmojiPicker.stories.tsx @@ -3,14 +3,14 @@ import React, { useCallback, useState } from 'react'; import { Button } from 'react-aria-components'; import { action } from '@storybook/addon-actions'; -import { type ComponentMeta } from '../../storybook/types.js'; -import type { FunEmojiPickerProps } from './FunEmojiPicker.js'; -import { FunEmojiPicker } from './FunEmojiPicker.js'; -import { MOCK_RECENT_EMOJIS, MOCK_THIS_MESSAGE_EMOJIS } from './mocks.js'; -import { FunProvider } from './FunProvider.js'; -import { packs, recentStickers } from '../stickers/mocks.js'; -import { EmojiSkinTone } from './data/emojis.js'; -import { Select } from '../Select.js'; +import { type ComponentMeta } from '../../storybook/types.std.js'; +import type { FunEmojiPickerProps } from './FunEmojiPicker.dom.js'; +import { FunEmojiPicker } from './FunEmojiPicker.dom.js'; +import { MOCK_RECENT_EMOJIS, MOCK_THIS_MESSAGE_EMOJIS } from './mocks.dom.js'; +import { FunProvider } from './FunProvider.dom.js'; +import { packs, recentStickers } from '../stickers/mocks.std.js'; +import { EmojiSkinTone } from './data/emojis.std.js'; +import { Select } from '../Select.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/fun/FunEmojiPicker.tsx b/ts/components/fun/FunEmojiPicker.tsx index 6159826366..f23a3bcea8 100644 --- a/ts/components/fun/FunEmojiPicker.tsx +++ b/ts/components/fun/FunEmojiPicker.tsx @@ -4,13 +4,13 @@ import type { ReactNode } from 'react'; import React, { memo, useCallback } from 'react'; import type { Placement } from 'react-aria'; import { DialogTrigger } from 'react-aria-components'; -import { FunPopover } from './base/FunPopover.js'; -import type { FunEmojiSelection } from './panels/FunPanelEmojis.js'; -import { FunPanelEmojis } from './panels/FunPanelEmojis.js'; -import { useFunContext } from './FunProvider.js'; -import type { ThemeType } from '../../types/Util.js'; -import { FunErrorBoundary } from './base/FunErrorBoundary.js'; -import type { EmojiVariantKey } from './data/emojis.js'; +import { FunPopover } from './base/FunPopover.dom.js'; +import type { FunEmojiSelection } from './panels/FunPanelEmojis.dom.js'; +import { FunPanelEmojis } from './panels/FunPanelEmojis.dom.js'; +import { useFunContext } from './FunProvider.dom.js'; +import type { ThemeType } from '../../types/Util.std.js'; +import { FunErrorBoundary } from './base/FunErrorBoundary.dom.js'; +import type { EmojiVariantKey } from './data/emojis.std.js'; export type FunEmojiPickerProps = Readonly<{ open: boolean; diff --git a/ts/components/fun/FunGif.stories.tsx b/ts/components/fun/FunGif.stories.tsx index b2c0dd2c5d..bf2f5ea997 100644 --- a/ts/components/fun/FunGif.stories.tsx +++ b/ts/components/fun/FunGif.stories.tsx @@ -3,8 +3,8 @@ import React, { useEffect, useState, useId } from 'react'; import type { Meta } from '@storybook/react'; import { VisuallyHidden } from 'react-aria'; -import { FunGif, FunGifPreview } from './FunGif.js'; -import { LoadingState } from '../../util/loadable.js'; +import { FunGif, FunGifPreview } from './FunGif.dom.js'; +import { LoadingState } from '../../util/loadable.std.js'; export default { title: 'Components/Fun/FunGif', diff --git a/ts/components/fun/FunGif.tsx b/ts/components/fun/FunGif.tsx index 6aecc753db..d52c28fd70 100644 --- a/ts/components/fun/FunGif.tsx +++ b/ts/components/fun/FunGif.tsx @@ -3,14 +3,14 @@ import type { CSSProperties, ForwardedRef } from 'react'; import React, { forwardRef, useEffect, useRef, useState } from 'react'; import { useReducedMotion } from '@react-spring/web'; -import { SpinnerV2 } from '../SpinnerV2.js'; -import { strictAssert } from '../../util/assert.js'; -import type { Loadable } from '../../util/loadable.js'; -import { LoadingState } from '../../util/loadable.js'; -import { useIntent } from './base/FunImage.js'; -import { createLogger } from '../../logging/log.js'; -import * as Errors from '../../types/errors.js'; -import { isAbortError } from '../../util/isAbortError.js'; +import { SpinnerV2 } from '../SpinnerV2.dom.js'; +import { strictAssert } from '../../util/assert.std.js'; +import type { Loadable } from '../../util/loadable.std.js'; +import { LoadingState } from '../../util/loadable.std.js'; +import { useIntent } from './base/FunImage.dom.js'; +import { createLogger } from '../../logging/log.std.js'; +import * as Errors from '../../types/errors.std.js'; +import { isAbortError } from '../../util/isAbortError.std.js'; const log = createLogger('FunGif'); diff --git a/ts/components/fun/FunPicker.stories.tsx b/ts/components/fun/FunPicker.stories.tsx index c82697fcc2..b3680ab31a 100644 --- a/ts/components/fun/FunPicker.stories.tsx +++ b/ts/components/fun/FunPicker.stories.tsx @@ -3,13 +3,16 @@ import React, { useCallback, useState } from 'react'; import { Button } from 'react-aria-components'; import { action } from '@storybook/addon-actions'; -import { type ComponentMeta } from '../../storybook/types.js'; -import { packs, recentStickers } from '../stickers/mocks.js'; -import type { FunPickerProps } from './FunPicker.js'; -import { FunPicker } from './FunPicker.js'; -import { FunProvider } from './FunProvider.js'; -import { MOCK_GIFS_PAGINATED_ONE_PAGE, MOCK_RECENT_EMOJIS } from './mocks.js'; -import { EmojiSkinTone } from './data/emojis.js'; +import { type ComponentMeta } from '../../storybook/types.std.js'; +import { packs, recentStickers } from '../stickers/mocks.std.js'; +import type { FunPickerProps } from './FunPicker.dom.js'; +import { FunPicker } from './FunPicker.dom.js'; +import { FunProvider } from './FunProvider.dom.js'; +import { + MOCK_GIFS_PAGINATED_ONE_PAGE, + MOCK_RECENT_EMOJIS, +} from './mocks.dom.js'; +import { EmojiSkinTone } from './data/emojis.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/fun/FunPicker.tsx b/ts/components/fun/FunPicker.tsx index ce8974717c..47196b7482 100644 --- a/ts/components/fun/FunPicker.tsx +++ b/ts/components/fun/FunPicker.tsx @@ -5,23 +5,23 @@ import React, { memo, useCallback, useEffect } from 'react'; import type { Placement } from 'react-aria'; import { DialogTrigger } from 'react-aria-components'; import { createKeybindingsHandler } from 'tinykeys'; -import { FunPickerTabKey } from './constants.js'; -import { FunPopover } from './base/FunPopover.js'; +import { FunPickerTabKey } from './constants.dom.js'; +import { FunPopover } from './base/FunPopover.dom.js'; import { FunPickerTab, FunTabList, FunTabPanel, FunTabs, -} from './base/FunTabs.js'; -import type { FunEmojiSelection } from './panels/FunPanelEmojis.js'; -import { FunPanelEmojis } from './panels/FunPanelEmojis.js'; -import type { FunGifSelection } from './panels/FunPanelGifs.js'; -import { FunPanelGifs } from './panels/FunPanelGifs.js'; -import type { FunStickerSelection } from './panels/FunPanelStickers.js'; -import { FunPanelStickers } from './panels/FunPanelStickers.js'; -import { useFunContext } from './FunProvider.js'; -import type { ThemeType } from '../../types/Util.js'; -import { FunErrorBoundary } from './base/FunErrorBoundary.js'; +} from './base/FunTabs.dom.js'; +import type { FunEmojiSelection } from './panels/FunPanelEmojis.dom.js'; +import { FunPanelEmojis } from './panels/FunPanelEmojis.dom.js'; +import type { FunGifSelection } from './panels/FunPanelGifs.dom.js'; +import { FunPanelGifs } from './panels/FunPanelGifs.dom.js'; +import type { FunStickerSelection } from './panels/FunPanelStickers.dom.js'; +import { FunPanelStickers } from './panels/FunPanelStickers.dom.js'; +import { useFunContext } from './FunProvider.dom.js'; +import type { ThemeType } from '../../types/Util.std.js'; +import { FunErrorBoundary } from './base/FunErrorBoundary.dom.js'; /** * FunPicker diff --git a/ts/components/fun/FunProvider.tsx b/ts/components/fun/FunProvider.tsx index 41a14797d5..5f4d1fee7c 100644 --- a/ts/components/fun/FunProvider.tsx +++ b/ts/components/fun/FunProvider.tsx @@ -7,20 +7,23 @@ import React, { useContext, useState, } from 'react'; -import { strictAssert } from '../../util/assert.js'; -import type { LocalizerType } from '../../types/I18N.js'; +import { strictAssert } from '../../util/assert.std.js'; +import type { LocalizerType } from '../../types/I18N.std.js'; import type { StickerPackType, StickerType, -} from '../../state/ducks/stickers.js'; -import type { EmojiSkinTone, EmojiParentKey } from './data/emojis.js'; -import type { FunGifSelection, GifType } from './panels/FunPanelGifs.js'; -import { FunPickerTabKey } from './constants.js'; -import type { fetchGifsFeatured, fetchGifsSearch } from './data/gifs.js'; -import type { tenorDownload } from './data/tenor.js'; -import type { FunEmojiSelection } from './panels/FunPanelEmojis.js'; -import type { FunStickerSelection } from './panels/FunPanelStickers.js'; -import { FunEmojiLocalizationProvider } from './FunEmojiLocalizationProvider.js'; +} from '../../state/ducks/stickers.preload.js'; +import type { EmojiSkinTone, EmojiParentKey } from './data/emojis.std.js'; +import type { FunGifSelection, GifType } from './panels/FunPanelGifs.dom.js'; +import { FunPickerTabKey } from './constants.dom.js'; +import type { + fetchGifsFeatured, + fetchGifsSearch, +} from './data/gifs.preload.js'; +import type { tenorDownload } from './data/tenor.preload.js'; +import type { FunEmojiSelection } from './panels/FunPanelEmojis.dom.js'; +import type { FunStickerSelection } from './panels/FunPanelStickers.dom.js'; +import { FunEmojiLocalizationProvider } from './FunEmojiLocalizationProvider.dom.js'; export type FunContextSmartProps = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/fun/FunSkinTones.tsx b/ts/components/fun/FunSkinTones.tsx index 16254a9b9c..0948f81841 100644 --- a/ts/components/fun/FunSkinTones.tsx +++ b/ts/components/fun/FunSkinTones.tsx @@ -3,14 +3,14 @@ import React, { useCallback, useMemo } from 'react'; import type { Selection } from 'react-aria-components'; import { ListBox, ListBoxItem } from 'react-aria-components'; -import type { EmojiParentKey } from './data/emojis.js'; +import type { EmojiParentKey } from './data/emojis.std.js'; import { EmojiSkinTone, getEmojiVariantByParentKeyAndSkinTone, -} from './data/emojis.js'; -import { strictAssert } from '../../util/assert.js'; -import { FunStaticEmoji } from './FunEmoji.js'; -import type { LocalizerType } from '../../types/I18N.js'; +} from './data/emojis.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { FunStaticEmoji } from './FunEmoji.dom.js'; +import type { LocalizerType } from '../../types/I18N.std.js'; export type FunSkinTonesListProps = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/fun/FunSticker.stories.tsx b/ts/components/fun/FunSticker.stories.tsx index 7d4df793c7..58a3d022c6 100644 --- a/ts/components/fun/FunSticker.stories.tsx +++ b/ts/components/fun/FunSticker.stories.tsx @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; import type { Meta } from '@storybook/react'; -import { FunSticker, type FunStickerProps } from './FunSticker.js'; +import { FunSticker, type FunStickerProps } from './FunSticker.dom.js'; export default { title: 'Components/Fun/FunSticker', diff --git a/ts/components/fun/FunSticker.tsx b/ts/components/fun/FunSticker.tsx index 3d32e8b660..5b7dc058cf 100644 --- a/ts/components/fun/FunSticker.tsx +++ b/ts/components/fun/FunSticker.tsx @@ -1,8 +1,8 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import { FunImage } from './base/FunImage.js'; -import type { FunImageAriaProps } from './types.js'; +import { FunImage } from './base/FunImage.dom.js'; +import type { FunImageAriaProps } from './types.dom.js'; export type FunStickerProps = FunImageAriaProps & Readonly<{ diff --git a/ts/components/fun/FunStickerPicker.stories.tsx b/ts/components/fun/FunStickerPicker.stories.tsx index 15a8673b58..df95175c7f 100644 --- a/ts/components/fun/FunStickerPicker.stories.tsx +++ b/ts/components/fun/FunStickerPicker.stories.tsx @@ -3,13 +3,13 @@ import React, { useCallback, useState } from 'react'; import { Button } from 'react-aria-components'; import { action } from '@storybook/addon-actions'; -import { type ComponentMeta } from '../../storybook/types.js'; -import type { FunStickerPickerProps } from './FunStickerPicker.js'; -import { FunStickerPicker } from './FunStickerPicker.js'; -import { MOCK_RECENT_EMOJIS } from './mocks.js'; -import { FunProvider } from './FunProvider.js'; -import { packs, recentStickers } from '../stickers/mocks.js'; -import { EmojiSkinTone } from './data/emojis.js'; +import { type ComponentMeta } from '../../storybook/types.std.js'; +import type { FunStickerPickerProps } from './FunStickerPicker.dom.js'; +import { FunStickerPicker } from './FunStickerPicker.dom.js'; +import { MOCK_RECENT_EMOJIS } from './mocks.dom.js'; +import { FunProvider } from './FunProvider.dom.js'; +import { packs, recentStickers } from '../stickers/mocks.std.js'; +import { EmojiSkinTone } from './data/emojis.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/fun/FunStickerPicker.tsx b/ts/components/fun/FunStickerPicker.tsx index 42bb696fd9..86ec40a9f1 100644 --- a/ts/components/fun/FunStickerPicker.tsx +++ b/ts/components/fun/FunStickerPicker.tsx @@ -4,13 +4,13 @@ import type { ReactNode } from 'react'; import React, { memo, useCallback } from 'react'; import type { Placement } from 'react-aria'; import { DialogTrigger } from 'react-aria-components'; -import { FunPopover } from './base/FunPopover.js'; -import type { FunStickerSelection } from './panels/FunPanelStickers.js'; -import { FunPanelStickers } from './panels/FunPanelStickers.js'; -import { useFunContext } from './FunProvider.js'; -import type { ThemeType } from '../../types/Util.js'; -import { FunErrorBoundary } from './base/FunErrorBoundary.js'; -import type { FunTimeStickerStyle } from './constants.js'; +import { FunPopover } from './base/FunPopover.dom.js'; +import type { FunStickerSelection } from './panels/FunPanelStickers.dom.js'; +import { FunPanelStickers } from './panels/FunPanelStickers.dom.js'; +import { useFunContext } from './FunProvider.dom.js'; +import type { ThemeType } from '../../types/Util.std.js'; +import { FunErrorBoundary } from './base/FunErrorBoundary.dom.js'; +import type { FunTimeStickerStyle } from './constants.dom.js'; export type FunStickerPickerProps = Readonly<{ open: boolean; diff --git a/ts/components/fun/base/FunErrorBoundary.tsx b/ts/components/fun/base/FunErrorBoundary.tsx index acf5126509..e35e89cb6a 100644 --- a/ts/components/fun/base/FunErrorBoundary.tsx +++ b/ts/components/fun/base/FunErrorBoundary.tsx @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { ReactNode, ErrorInfo } from 'react'; import React, { Component, useCallback } from 'react'; -import { createLogger } from '../../../logging/log.js'; -import * as Errors from '../../../types/errors.js'; -import { ToastType } from '../../../types/Toast.js'; -import { isProduction } from '../../../util/version.js'; +import { createLogger } from '../../../logging/log.std.js'; +import * as Errors from '../../../types/errors.std.js'; +import { ToastType } from '../../../types/Toast.dom.js'; +import { isProduction } from '../../../util/version.std.js'; const log = createLogger('FunErrorBoundary'); diff --git a/ts/components/fun/base/FunGrid.tsx b/ts/components/fun/base/FunGrid.tsx index 1a59c1315b..de49f8a74f 100644 --- a/ts/components/fun/base/FunGrid.tsx +++ b/ts/components/fun/base/FunGrid.tsx @@ -5,7 +5,7 @@ import React from 'react'; import { FocusScope } from 'react-aria'; import classNames from 'classnames'; import { Button, Dialog, Header, Popover } from 'react-aria-components'; -import { FunScrollerSection } from './FunScroller.js'; +import { FunScrollerSection } from './FunScroller.dom.js'; /** * Grid Container diff --git a/ts/components/fun/base/FunImage.tsx b/ts/components/fun/base/FunImage.tsx index 05a899c18d..62ecb55339 100644 --- a/ts/components/fun/base/FunImage.tsx +++ b/ts/components/fun/base/FunImage.tsx @@ -4,9 +4,9 @@ import type { ForwardedRef, RefObject } from 'react'; import React, { useRef, useEffect, useState, forwardRef } from 'react'; import classNames from 'classnames'; import { isFocusable } from '@react-aria/focus'; -import { strictAssert } from '../../../util/assert.js'; -import { useReducedMotion } from '../../../hooks/useReducedMotion.js'; -import type { FunImageAriaProps } from '../types.js'; +import { strictAssert } from '../../../util/assert.std.js'; +import { useReducedMotion } from '../../../hooks/useReducedMotion.dom.js'; +import type { FunImageAriaProps } from '../types.dom.js'; export type FunImageProps = FunImageAriaProps & Readonly<{ diff --git a/ts/components/fun/base/FunItem.tsx b/ts/components/fun/base/FunItem.tsx index 4b69d817fd..88ee7b6abc 100644 --- a/ts/components/fun/base/FunItem.tsx +++ b/ts/components/fun/base/FunItem.tsx @@ -8,7 +8,7 @@ import type { } from 'react'; import React, { forwardRef, useCallback, useEffect, useMemo } from 'react'; import { mergeProps } from '@react-aria/utils'; -import { strictAssert } from '../../../util/assert.js'; +import { strictAssert } from '../../../util/assert.std.js'; /** * Button diff --git a/ts/components/fun/base/FunLightbox.tsx b/ts/components/fun/base/FunLightbox.tsx index 9367e2b3d1..7413e88384 100644 --- a/ts/components/fun/base/FunLightbox.tsx +++ b/ts/components/fun/base/FunLightbox.tsx @@ -3,7 +3,7 @@ import type { ReactNode, RefObject } from 'react'; import React, { createContext, useContext, useEffect, useState } from 'react'; import { createPortal } from 'react-dom'; -import { strictAssert } from '../../../util/assert.js'; +import { strictAssert } from '../../../util/assert.std.js'; /** * Tracks the current `data-key` that has a long-press/long-focus diff --git a/ts/components/fun/base/FunPopover.tsx b/ts/components/fun/base/FunPopover.tsx index 83b26801e1..8bdf02b4d3 100644 --- a/ts/components/fun/base/FunPopover.tsx +++ b/ts/components/fun/base/FunPopover.tsx @@ -6,7 +6,7 @@ import type { Placement } from 'react-aria'; import { Dialog, Popover } from 'react-aria-components'; import classNames from 'classnames'; import * as Tooltip from '@radix-ui/react-tooltip'; -import { ThemeType } from '../../../types/Util.js'; +import { ThemeType } from '../../../types/Util.std.js'; export type FunPopoverProps = Readonly<{ placement?: Placement; diff --git a/ts/components/fun/base/FunResults.tsx b/ts/components/fun/base/FunResults.tsx index 400e16aeb9..43f9558fec 100644 --- a/ts/components/fun/base/FunResults.tsx +++ b/ts/components/fun/base/FunResults.tsx @@ -3,7 +3,7 @@ import type { ReactNode } from 'react'; import React from 'react'; import { Button, Header } from 'react-aria-components'; -import { SpinnerV2 } from '../../SpinnerV2.js'; +import { SpinnerV2 } from '../../SpinnerV2.dom.js'; export type FunResultsProps = Readonly<{ 'aria-busy': boolean; diff --git a/ts/components/fun/base/FunScroller.tsx b/ts/components/fun/base/FunScroller.tsx index c4acad7d6b..9968623986 100644 --- a/ts/components/fun/base/FunScroller.tsx +++ b/ts/components/fun/base/FunScroller.tsx @@ -18,8 +18,8 @@ import { isScrollAtTop, isScrollOverflowVertical, useScrollObserver, -} from '../../../hooks/useSizeObserver.js'; -import { strictAssert } from '../../../util/assert.js'; +} from '../../../hooks/useSizeObserver.dom.js'; +import { strictAssert } from '../../../util/assert.std.js'; const { maxBy } = lodash; diff --git a/ts/components/fun/base/FunSearch.tsx b/ts/components/fun/base/FunSearch.tsx index d916fc28bd..2a69fd94bf 100644 --- a/ts/components/fun/base/FunSearch.tsx +++ b/ts/components/fun/base/FunSearch.tsx @@ -4,8 +4,8 @@ import type { ChangeEvent } from 'react'; import React, { useCallback } from 'react'; import { VisuallyHidden } from 'react-aria'; import { getInteractionModality } from '@react-aria/interactions'; -import type { LocalizerType } from '../../../types/I18N.js'; -import { useFunContext } from '../FunProvider.js'; +import type { LocalizerType } from '../../../types/I18N.std.js'; +import { useFunContext } from '../FunProvider.dom.js'; export type FunSearchProps = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/fun/base/FunSubNav.tsx b/ts/components/fun/base/FunSubNav.tsx index d2350c0512..2e32584d41 100644 --- a/ts/components/fun/base/FunSubNav.tsx +++ b/ts/components/fun/base/FunSubNav.tsx @@ -21,12 +21,12 @@ import { getScrollLeftDistance, getScrollRightDistance, useScrollObserver, -} from '../../../hooks/useSizeObserver.js'; -import { createLogger } from '../../../logging/log.js'; -import * as Errors from '../../../types/errors.js'; -import { strictAssert } from '../../../util/assert.js'; -import { FunImage } from './FunImage.js'; -import { FunTooltip } from './FunTooltip.js'; +} from '../../../hooks/useSizeObserver.dom.js'; +import { createLogger } from '../../../logging/log.std.js'; +import * as Errors from '../../../types/errors.std.js'; +import { strictAssert } from '../../../util/assert.std.js'; +import { FunImage } from './FunImage.dom.js'; +import { FunTooltip } from './FunTooltip.dom.js'; const log = createLogger('FunSubNav'); diff --git a/ts/components/fun/base/FunTabs.tsx b/ts/components/fun/base/FunTabs.tsx index ca4583518d..a3827c1166 100644 --- a/ts/components/fun/base/FunTabs.tsx +++ b/ts/components/fun/base/FunTabs.tsx @@ -6,7 +6,7 @@ import type { ReactNode } from 'react'; import React, { useCallback, useId } from 'react'; import type { Key } from 'react-aria'; import { Tab, TabList, TabPanel, Tabs } from 'react-aria-components'; -import type { FunPickerTabKey } from '../constants.js'; +import type { FunPickerTabKey } from '../constants.dom.js'; export type FunTabsProps = Readonly<{ value: FunPickerTabKey; diff --git a/ts/components/fun/base/FunTooltip.tsx b/ts/components/fun/base/FunTooltip.tsx index ef2e94f81b..05a0b01ab4 100644 --- a/ts/components/fun/base/FunTooltip.tsx +++ b/ts/components/fun/base/FunTooltip.tsx @@ -4,7 +4,7 @@ import React, { useRef, useState, type ReactNode } from 'react'; import * as Tooltip from '@radix-ui/react-tooltip'; import { useLayoutEffect } from '@react-aria/utils'; -import { strictAssert } from '../../../util/assert.js'; +import { strictAssert } from '../../../util/assert.std.js'; export type FunTooltipProps = Readonly<{ open?: boolean; diff --git a/ts/components/fun/constants.tsx b/ts/components/fun/constants.tsx index ff4483d64e..6023a28060 100644 --- a/ts/components/fun/constants.tsx +++ b/ts/components/fun/constants.tsx @@ -1,8 +1,8 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { EmojiPickerCategory } from './data/emojis.js'; -import type { StickerPackType } from '../../state/ducks/stickers.js'; +import { EmojiPickerCategory } from './data/emojis.std.js'; +import type { StickerPackType } from '../../state/ducks/stickers.preload.js'; export enum FunPickerTabKey { Emoji = 'Emoji', diff --git a/ts/components/fun/data/emojis.ts b/ts/components/fun/data/emojis.ts index 1e62e7ec2c..14ee2c38ed 100644 --- a/ts/components/fun/data/emojis.ts +++ b/ts/components/fun/data/emojis.ts @@ -2,14 +2,14 @@ // SPDX-License-Identifier: AGPL-3.0-only import { z } from 'zod'; import emojiRegex from 'emoji-regex'; -import { strictAssert } from '../../../util/assert.js'; -import { parseUnknown } from '../../../util/schemas.js'; +import { strictAssert } from '../../../util/assert.std.js'; +import { parseUnknown } from '../../../util/schemas.std.js'; import type { FunEmojiSearchIndex, FunEmojiSearchIndexEntry, -} from '../useFunEmojiSearch.js'; -import type { FunEmojiLocalizerIndex } from '../useFunEmojiLocalizer.js'; -import { removeDiacritics } from '../../../util/removeDiacritics.js'; +} from '../useFunEmojiSearch.dom.js'; +import type { FunEmojiLocalizerIndex } from '../useFunEmojiLocalizer.dom.js'; +import { removeDiacritics } from '../../../util/removeDiacritics.std.js'; // Import emoji-datasource dynamically to avoid costly typechecking. // eslint-disable-next-line import/no-dynamic-require, @typescript-eslint/no-var-requires diff --git a/ts/components/fun/data/gifs.ts b/ts/components/fun/data/gifs.ts index 15d95fa72d..74ffc75d73 100644 --- a/ts/components/fun/data/gifs.ts +++ b/ts/components/fun/data/gifs.ts @@ -1,14 +1,14 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { strictAssert } from '../../../util/assert.js'; -import type { GifType } from '../panels/FunPanelGifs.js'; +import { strictAssert } from '../../../util/assert.std.js'; +import type { GifType } from '../panels/FunPanelGifs.dom.js'; import type { TenorContentFormat, TenorNextCursor, TenorResponseResult, -} from './tenor.js'; -import { tenor, isTenorTailCursor } from './tenor.js'; +} from './tenor.preload.js'; +import { tenor, isTenorTailCursor } from './tenor.preload.js'; const PREVIEW_CONTENT_FORMAT: TenorContentFormat = 'tinymp4'; const ATTACHMENT_CONTENT_FORMAT: TenorContentFormat = 'mp4'; diff --git a/ts/components/fun/data/infinite.ts b/ts/components/fun/data/infinite.ts index bbe9eb0ed5..ead3f294cb 100644 --- a/ts/components/fun/data/infinite.ts +++ b/ts/components/fun/data/infinite.ts @@ -1,10 +1,10 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import { useCallback, useEffect, useRef, useState } from 'react'; -import { drop } from '../../../util/drop.js'; -import { createLogger } from '../../../logging/log.js'; -import * as Errors from '../../../types/errors.js'; -import { strictAssert } from '../../../util/assert.js'; +import { drop } from '../../../util/drop.std.js'; +import { createLogger } from '../../../logging/log.std.js'; +import * as Errors from '../../../types/errors.std.js'; +import { strictAssert } from '../../../util/assert.std.js'; const log = createLogger('infinite'); diff --git a/ts/components/fun/data/segments.ts b/ts/components/fun/data/segments.ts index 80bdaa97c5..4cf223d1e8 100644 --- a/ts/components/fun/data/segments.ts +++ b/ts/components/fun/data/segments.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { strictAssert } from '../../../util/assert.js'; -import type { fetchBytesViaProxy } from '../../../textsecure/WebAPI.js'; +import { strictAssert } from '../../../util/assert.std.js'; +import type { fetchBytesViaProxy } from '../../../textsecure/WebAPI.preload.js'; /** @internal Exported for testing */ export const _SEGMENT_SIZE_BUCKETS: ReadonlyArray = [ diff --git a/ts/components/fun/data/tenor.ts b/ts/components/fun/data/tenor.ts index e7dfa40c6c..87210240bf 100644 --- a/ts/components/fun/data/tenor.ts +++ b/ts/components/fun/data/tenor.ts @@ -3,13 +3,13 @@ import { z } from 'zod'; import type { Simplify } from 'type-fest'; -import { strictAssert } from '../../../util/assert.js'; -import { parseUnknown } from '../../../util/schemas.js'; +import { strictAssert } from '../../../util/assert.std.js'; +import { parseUnknown } from '../../../util/schemas.std.js'; import { fetchJsonViaProxy, fetchBytesViaProxy, -} from '../../../textsecure/WebAPI.js'; -import { fetchInSegments } from './segments.js'; +} from '../../../textsecure/WebAPI.preload.js'; +import { fetchInSegments } from './segments.std.js'; const BASE_URL = 'https://tenor.googleapis.com/v2'; const API_KEY = 'AIzaSyBt6SUfSsCQic2P2VkNkLjsGI7HGWZI95g'; diff --git a/ts/components/fun/keyboard/FunKeyboard.tsx b/ts/components/fun/keyboard/FunKeyboard.tsx index 3507929db1..d63e34c23d 100644 --- a/ts/components/fun/keyboard/FunKeyboard.tsx +++ b/ts/components/fun/keyboard/FunKeyboard.tsx @@ -4,7 +4,7 @@ import { focusSafely, getFocusableTreeWalker } from '@react-aria/focus'; import type { ReactNode, RefObject } from 'react'; import React, { useEffect, useRef } from 'react'; import { createKeybindingsHandler } from 'tinykeys'; -import { strictAssert } from '../../../util/assert.js'; +import { strictAssert } from '../../../util/assert.std.js'; export abstract class KeyboardDelegate { abstract scrollToState(state: State): void; diff --git a/ts/components/fun/keyboard/GridKeyboardDelegate.tsx b/ts/components/fun/keyboard/GridKeyboardDelegate.tsx index 4f3bacd35f..66bfc3e02c 100644 --- a/ts/components/fun/keyboard/GridKeyboardDelegate.tsx +++ b/ts/components/fun/keyboard/GridKeyboardDelegate.tsx @@ -2,14 +2,14 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { VirtualItem, Virtualizer } from '@tanstack/react-virtual'; import lodash from 'lodash'; -import { strictAssert } from '../../../util/assert.js'; +import { strictAssert } from '../../../util/assert.std.js'; import type { CellKey, Layout, RowKey, SectionKey, -} from '../virtual/useFunVirtualGrid.js'; -import { KeyboardDelegate } from './FunKeyboard.js'; +} from '../virtual/useFunVirtualGrid.dom.js'; +import { KeyboardDelegate } from './FunKeyboard.dom.js'; const { findLast, sortBy } = lodash; diff --git a/ts/components/fun/keyboard/WaterfallKeyboardDelegate.tsx b/ts/components/fun/keyboard/WaterfallKeyboardDelegate.tsx index 197b788658..6531a46675 100644 --- a/ts/components/fun/keyboard/WaterfallKeyboardDelegate.tsx +++ b/ts/components/fun/keyboard/WaterfallKeyboardDelegate.tsx @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { VirtualItem, Virtualizer } from '@tanstack/react-virtual'; import lodash from 'lodash'; -import { strictAssert } from '../../../util/assert.js'; -import { KeyboardDelegate } from './FunKeyboard.js'; +import { strictAssert } from '../../../util/assert.std.js'; +import { KeyboardDelegate } from './FunKeyboard.dom.js'; const { findLast, maxBy } = lodash; diff --git a/ts/components/fun/mocks.tsx b/ts/components/fun/mocks.tsx index 452ab5cf0f..6d237a3d1a 100644 --- a/ts/components/fun/mocks.tsx +++ b/ts/components/fun/mocks.tsx @@ -1,15 +1,15 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { strictAssert } from '../../util/assert.js'; -import type { EmojiParentKey, EmojiVariantKey } from './data/emojis.js'; +import { strictAssert } from '../../util/assert.std.js'; +import type { EmojiParentKey, EmojiVariantKey } from './data/emojis.std.js'; import { EmojiSkinTone, getEmojiParentKeyByEnglishShortName, getEmojiVariantKeyByParentKeyAndSkinTone, isEmojiEnglishShortName, -} from './data/emojis.js'; -import type { GifsPaginated } from './data/gifs.js'; +} from './data/emojis.std.js'; +import type { GifsPaginated } from './data/gifs.preload.js'; function getEmoji(input: string): EmojiParentKey { strictAssert( diff --git a/ts/components/fun/panels/FunPanelEmojis.tsx b/ts/components/fun/panels/FunPanelEmojis.tsx index e0f4ad5862..ce8c324b21 100644 --- a/ts/components/fun/panels/FunPanelEmojis.tsx +++ b/ts/components/fun/panels/FunPanelEmojis.tsx @@ -11,15 +11,15 @@ import { } from 'react-aria-components'; import { VisuallyHidden } from 'react-aria'; import * as Tooltip from '@radix-ui/react-tooltip'; -import type { LocalizerType } from '../../../types/I18N.js'; -import { strictAssert } from '../../../util/assert.js'; -import { missingCaseError } from '../../../util/missingCaseError.js'; -import type { FunEmojisSection } from '../constants.js'; +import type { LocalizerType } from '../../../types/I18N.std.js'; +import { strictAssert } from '../../../util/assert.std.js'; +import { missingCaseError } from '../../../util/missingCaseError.std.js'; +import type { FunEmojisSection } from '../constants.dom.js'; import { FunEmojisBase, FunEmojisSectionOrder, FunSectionCommon, -} from '../constants.js'; +} from '../constants.dom.js'; import { FunGridCell, FunGridContainer, @@ -32,23 +32,23 @@ import { FunGridRow, FunGridRowGroup, FunGridScrollerSection, -} from '../base/FunGrid.js'; -import { FunItemButton } from '../base/FunItem.js'; +} from '../base/FunGrid.dom.js'; +import { FunItemButton } from '../base/FunItem.dom.js'; import { FunPanel, FunPanelBody, FunPanelFooter, FunPanelHeader, -} from '../base/FunPanel.js'; -import { FunScroller } from '../base/FunScroller.js'; -import { FunSearch } from '../base/FunSearch.js'; +} from '../base/FunPanel.dom.js'; +import { FunScroller } from '../base/FunScroller.dom.js'; +import { FunSearch } from '../base/FunSearch.dom.js'; import { FunSubNav, FunSubNavIcon, FunSubNavListBox, FunSubNavListBoxItem, -} from '../base/FunSubNav.js'; -import type { EmojiVariantKey } from '../data/emojis.js'; +} from '../base/FunSubNav.dom.js'; +import type { EmojiVariantKey } from '../data/emojis.std.js'; import { EmojiSkinTone, EmojiPickerCategory, @@ -61,23 +61,23 @@ import { getEmojiVariantByKey, EMOJI_PARENT_KEY_CONSTANTS, EMOJI_VARIANT_KEY_CONSTANTS, -} from '../data/emojis.js'; -import { useFunEmojiSearch } from '../useFunEmojiSearch.js'; -import { FunKeyboard } from '../keyboard/FunKeyboard.js'; -import type { GridKeyboardState } from '../keyboard/GridKeyboardDelegate.js'; -import { GridKeyboardDelegate } from '../keyboard/GridKeyboardDelegate.js'; +} from '../data/emojis.std.js'; +import { useFunEmojiSearch } from '../useFunEmojiSearch.dom.js'; +import { FunKeyboard } from '../keyboard/FunKeyboard.dom.js'; +import type { GridKeyboardState } from '../keyboard/GridKeyboardDelegate.dom.js'; +import { GridKeyboardDelegate } from '../keyboard/GridKeyboardDelegate.dom.js'; import type { CellKey, CellLayoutNode, GridSectionNode, -} from '../virtual/useFunVirtualGrid.js'; -import { useFunVirtualGrid } from '../virtual/useFunVirtualGrid.js'; -import { FunSkinTonesList } from '../FunSkinTones.js'; -import { FunStaticEmoji } from '../FunEmoji.js'; -import { useFunContext } from '../FunProvider.js'; -import { FunResults, FunResultsHeader } from '../base/FunResults.js'; -import { useFunEmojiLocalizer } from '../useFunEmojiLocalizer.js'; -import { FunTooltip } from '../base/FunTooltip.js'; +} from '../virtual/useFunVirtualGrid.dom.js'; +import { useFunVirtualGrid } from '../virtual/useFunVirtualGrid.dom.js'; +import { FunSkinTonesList } from '../FunSkinTones.dom.js'; +import { FunStaticEmoji } from '../FunEmoji.dom.js'; +import { useFunContext } from '../FunProvider.dom.js'; +import { FunResults, FunResultsHeader } from '../base/FunResults.dom.js'; +import { useFunEmojiLocalizer } from '../useFunEmojiLocalizer.dom.js'; +import { FunTooltip } from '../base/FunTooltip.dom.js'; function getTitleForSection( i18n: LocalizerType, diff --git a/ts/components/fun/panels/FunPanelGifs.tsx b/ts/components/fun/panels/FunPanelGifs.tsx index afce0ef909..b365b72af1 100644 --- a/ts/components/fun/panels/FunPanelGifs.tsx +++ b/ts/components/fun/panels/FunPanelGifs.tsx @@ -14,61 +14,61 @@ import React, { } from 'react'; import { VisuallyHidden } from 'react-aria'; import { LRUCache } from 'lru-cache'; -import { FunItemButton } from '../base/FunItem.js'; +import { FunItemButton } from '../base/FunItem.dom.js'; import { FunPanel, FunPanelBody, FunPanelFooter, FunPanelHeader, -} from '../base/FunPanel.js'; -import { FunScroller } from '../base/FunScroller.js'; -import { FunSearch } from '../base/FunSearch.js'; +} from '../base/FunPanel.dom.js'; +import { FunScroller } from '../base/FunScroller.dom.js'; +import { FunSearch } from '../base/FunSearch.dom.js'; import { FunSubNav, FunSubNavIcon, FunSubNavListBox, FunSubNavListBoxItem, -} from '../base/FunSubNav.js'; +} from '../base/FunSubNav.dom.js'; import { FunWaterfallContainer, FunWaterfallItem, -} from '../base/FunWaterfall.js'; -import type { FunGifsSection } from '../constants.js'; -import { FunGifsCategory, FunSectionCommon } from '../constants.js'; -import { FunKeyboard } from '../keyboard/FunKeyboard.js'; -import type { WaterfallKeyboardState } from '../keyboard/WaterfallKeyboardDelegate.js'; -import { WaterfallKeyboardDelegate } from '../keyboard/WaterfallKeyboardDelegate.js'; -import { useInfiniteQuery } from '../data/infinite.js'; -import { missingCaseError } from '../../../util/missingCaseError.js'; -import { strictAssert } from '../../../util/assert.js'; -import type { GifsPaginated } from '../data/gifs.js'; -import { drop } from '../../../util/drop.js'; -import { useFunContext } from '../FunProvider.js'; +} from '../base/FunWaterfall.dom.js'; +import type { FunGifsSection } from '../constants.dom.js'; +import { FunGifsCategory, FunSectionCommon } from '../constants.dom.js'; +import { FunKeyboard } from '../keyboard/FunKeyboard.dom.js'; +import type { WaterfallKeyboardState } from '../keyboard/WaterfallKeyboardDelegate.dom.js'; +import { WaterfallKeyboardDelegate } from '../keyboard/WaterfallKeyboardDelegate.dom.js'; +import { useInfiniteQuery } from '../data/infinite.std.js'; +import { missingCaseError } from '../../../util/missingCaseError.std.js'; +import { strictAssert } from '../../../util/assert.std.js'; +import type { GifsPaginated } from '../data/gifs.preload.js'; +import { drop } from '../../../util/drop.std.js'; +import { useFunContext } from '../FunProvider.dom.js'; import { FunResults, FunResultsButton, FunResultsFigure, FunResultsHeader, FunResultsSpinner, -} from '../base/FunResults.js'; -import { FunStaticEmoji } from '../FunEmoji.js'; +} from '../base/FunResults.dom.js'; +import { FunStaticEmoji } from '../FunEmoji.dom.js'; import { FunLightboxPortal, FunLightboxBackdrop, FunLightboxDialog, FunLightboxProvider, useFunLightboxKey, -} from '../base/FunLightbox.js'; -import type { tenorDownload } from '../data/tenor.js'; -import { FunGif } from '../FunGif.js'; -import type { LocalizerType } from '../../../types/I18N.js'; -import { isAbortError } from '../../../util/isAbortError.js'; -import { createLogger } from '../../../logging/log.js'; -import * as Errors from '../../../types/errors.js'; +} from '../base/FunLightbox.dom.js'; +import type { tenorDownload } from '../data/tenor.preload.js'; +import { FunGif } from '../FunGif.dom.js'; +import type { LocalizerType } from '../../../types/I18N.std.js'; +import { isAbortError } from '../../../util/isAbortError.std.js'; +import { createLogger } from '../../../logging/log.std.js'; +import * as Errors from '../../../types/errors.std.js'; import { EMOJI_VARIANT_KEY_CONSTANTS, getEmojiVariantByKey, -} from '../data/emojis.js'; +} from '../data/emojis.std.js'; const log = createLogger('FunPanelGifs'); diff --git a/ts/components/fun/panels/FunPanelStickers.tsx b/ts/components/fun/panels/FunPanelStickers.tsx index d43401c071..03c9707b38 100644 --- a/ts/components/fun/panels/FunPanelStickers.tsx +++ b/ts/components/fun/panels/FunPanelStickers.tsx @@ -13,20 +13,20 @@ import { VisuallyHidden } from 'react-aria'; import type { StickerPackType, StickerType, -} from '../../../state/ducks/stickers.js'; -import type { LocalizerType } from '../../../types/I18N.js'; -import { strictAssert } from '../../../util/assert.js'; +} from '../../../state/ducks/stickers.preload.js'; +import type { LocalizerType } from '../../../types/I18N.std.js'; +import { strictAssert } from '../../../util/assert.std.js'; import type { FunStickersPackSection, FunStickersSection, FunTimeStickerStyle, -} from '../constants.js'; +} from '../constants.dom.js'; import { FunSectionCommon, FunStickersSectionBase, FunTimeStickerStylesOrder, toFunStickersPackSection, -} from '../constants.js'; +} from '../constants.dom.js'; import { FunGridCell, FunGridContainer, @@ -35,16 +35,16 @@ import { FunGridRow, FunGridRowGroup, FunGridScrollerSection, -} from '../base/FunGrid.js'; -import { FunItemButton } from '../base/FunItem.js'; +} from '../base/FunGrid.dom.js'; +import { FunItemButton } from '../base/FunItem.dom.js'; import { FunPanel, FunPanelBody, FunPanelFooter, FunPanelHeader, -} from '../base/FunPanel.js'; -import { FunScroller } from '../base/FunScroller.js'; -import { FunSearch } from '../base/FunSearch.js'; +} from '../base/FunPanel.dom.js'; +import { FunScroller } from '../base/FunScroller.dom.js'; +import { FunSearch } from '../base/FunSearch.dom.js'; import { FunSubNav, FunSubNavButton, @@ -54,37 +54,37 @@ import { FunSubNavListBox, FunSubNavListBoxItem, FunSubNavScroller, -} from '../base/FunSubNav.js'; +} from '../base/FunSubNav.dom.js'; import { EMOJI_VARIANT_KEY_CONSTANTS, type EmojiParentKey, getEmojiParentKeyByValue, getEmojiVariantByKey, isEmojiParentValue, -} from '../data/emojis.js'; -import { FunKeyboard } from '../keyboard/FunKeyboard.js'; -import type { GridKeyboardState } from '../keyboard/GridKeyboardDelegate.js'; -import { GridKeyboardDelegate } from '../keyboard/GridKeyboardDelegate.js'; +} from '../data/emojis.std.js'; +import { FunKeyboard } from '../keyboard/FunKeyboard.dom.js'; +import type { GridKeyboardState } from '../keyboard/GridKeyboardDelegate.dom.js'; +import { GridKeyboardDelegate } from '../keyboard/GridKeyboardDelegate.dom.js'; import type { CellKey, CellLayoutNode, GridSectionNode, -} from '../virtual/useFunVirtualGrid.js'; -import { useFunVirtualGrid } from '../virtual/useFunVirtualGrid.js'; -import { useFunContext } from '../FunProvider.js'; -import { FunResults, FunResultsHeader } from '../base/FunResults.js'; -import { FunStaticEmoji } from '../FunEmoji.js'; +} from '../virtual/useFunVirtualGrid.dom.js'; +import { useFunVirtualGrid } from '../virtual/useFunVirtualGrid.dom.js'; +import { useFunContext } from '../FunProvider.dom.js'; +import { FunResults, FunResultsHeader } from '../base/FunResults.dom.js'; +import { FunStaticEmoji } from '../FunEmoji.dom.js'; import { FunLightboxPortal, FunLightboxBackdrop, FunLightboxDialog, FunLightboxProvider, useFunLightboxKey, -} from '../base/FunLightbox.js'; -import { FunSticker } from '../FunSticker.js'; -import { getAnalogTime } from '../../../util/getAnalogTime.js'; -import { getDateTimeFormatter } from '../../../util/formatTimestamp.js'; -import { useFunEmojiSearch } from '../useFunEmojiSearch.js'; +} from '../base/FunLightbox.dom.js'; +import { FunSticker } from '../FunSticker.dom.js'; +import { getAnalogTime } from '../../../util/getAnalogTime.std.js'; +import { getDateTimeFormatter } from '../../../util/formatTimestamp.dom.js'; +import { useFunEmojiSearch } from '../useFunEmojiSearch.dom.js'; const STICKER_GRID_COLUMNS = 4; const STICKER_GRID_CELL_WIDTH = 80; diff --git a/ts/components/fun/useFunEmojiLocalizer.tsx b/ts/components/fun/useFunEmojiLocalizer.tsx index 131e57b4d1..067c23e552 100644 --- a/ts/components/fun/useFunEmojiLocalizer.tsx +++ b/ts/components/fun/useFunEmojiLocalizer.tsx @@ -1,16 +1,16 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import { useMemo } from 'react'; -import type { EmojiParentKey, EmojiVariantKey } from './data/emojis.js'; +import type { EmojiParentKey, EmojiVariantKey } from './data/emojis.std.js'; import { getEmojiParentByKey, getEmojiParentKeyByVariantKey, getEmojiVariantKeyByValue, isEmojiVariantValue, -} from './data/emojis.js'; -import type { LocaleEmojiListType } from '../../types/emoji.js'; -import { strictAssert } from '../../util/assert.js'; -import { useFunEmojiLocalization } from './FunEmojiLocalizationProvider.js'; +} from './data/emojis.std.js'; +import type { LocaleEmojiListType } from '../../types/emoji.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { useFunEmojiLocalization } from './FunEmojiLocalizationProvider.dom.js'; export type FunEmojiLocalizerIndex = Readonly<{ parentKeyToLocaleShortName: ReadonlyMap; diff --git a/ts/components/fun/useFunEmojiSearch.tsx b/ts/components/fun/useFunEmojiSearch.tsx index 850cfc9734..fbe98a7a35 100644 --- a/ts/components/fun/useFunEmojiSearch.tsx +++ b/ts/components/fun/useFunEmojiSearch.tsx @@ -3,16 +3,16 @@ import Fuse from 'fuse.js'; import lodash from 'lodash'; import { useMemo } from 'react'; -import type { EmojiParentKey } from './data/emojis.js'; +import type { EmojiParentKey } from './data/emojis.std.js'; import { getEmojiParentByKey, getEmojiParentKeyByValue, isEmojiParentValue, isEmojiParentValueDeprecated, normalizeShortNameCompletionQuery, -} from './data/emojis.js'; -import type { LocaleEmojiListType } from '../../types/emoji.js'; -import { useFunEmojiLocalization } from './FunEmojiLocalizationProvider.js'; +} from './data/emojis.std.js'; +import type { LocaleEmojiListType } from '../../types/emoji.std.js'; +import { useFunEmojiLocalization } from './FunEmojiLocalizationProvider.dom.js'; const { sortBy } = lodash; diff --git a/ts/components/fun/virtual/useFunVirtualGrid.tsx b/ts/components/fun/virtual/useFunVirtualGrid.tsx index b65b0589d5..c19f1510d7 100644 --- a/ts/components/fun/virtual/useFunVirtualGrid.tsx +++ b/ts/components/fun/virtual/useFunVirtualGrid.tsx @@ -9,8 +9,8 @@ import { import lodash from 'lodash'; import type { RefObject } from 'react'; import { useCallback, useMemo } from 'react'; -import { strictAssert } from '../../../util/assert.js'; -import { missingCaseError } from '../../../util/missingCaseError.js'; +import { strictAssert } from '../../../util/assert.std.js'; +import { missingCaseError } from '../../../util/missingCaseError.std.js'; const { chunk, groupBy } = lodash; diff --git a/ts/components/installScreen/InstallScreenBackupImportStep.stories.tsx b/ts/components/installScreen/InstallScreenBackupImportStep.stories.tsx index cbb5fc8d2c..77050dedb0 100644 --- a/ts/components/installScreen/InstallScreenBackupImportStep.stories.tsx +++ b/ts/components/installScreen/InstallScreenBackupImportStep.stories.tsx @@ -4,14 +4,14 @@ import React, { useState, useCallback, useEffect } from 'react'; import type { Meta, StoryFn } from '@storybook/react'; import { action } from '@storybook/addon-actions'; -import { sleep } from '../../util/sleep.js'; +import { sleep } from '../../util/sleep.std.js'; import { InstallScreenBackupStep, InstallScreenBackupError, -} from '../../types/InstallScreen.js'; -import { DialogType } from '../../types/Dialogs.js'; -import type { PropsType } from './InstallScreenBackupImportStep.js'; -import { InstallScreenBackupImportStep } from './InstallScreenBackupImportStep.js'; +} from '../../types/InstallScreen.std.js'; +import { DialogType } from '../../types/Dialogs.std.js'; +import type { PropsType } from './InstallScreenBackupImportStep.dom.js'; +import { InstallScreenBackupImportStep } from './InstallScreenBackupImportStep.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/installScreen/InstallScreenBackupImportStep.tsx b/ts/components/installScreen/InstallScreenBackupImportStep.tsx index cd1e326319..edaa647c3d 100644 --- a/ts/components/installScreen/InstallScreenBackupImportStep.tsx +++ b/ts/components/installScreen/InstallScreenBackupImportStep.tsx @@ -3,23 +3,23 @@ import React, { useState, useCallback } from 'react'; -import type { LocalizerType } from '../../types/Util.js'; -import type { UpdatesStateType } from '../../state/ducks/updates.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import type { UpdatesStateType } from '../../state/ducks/updates.preload.js'; import { InstallScreenStep, InstallScreenBackupStep, InstallScreenBackupError, -} from '../../types/InstallScreen.js'; -import { formatFileSize } from '../../util/formatFileSize.js'; -import { TitlebarDragArea } from '../TitlebarDragArea.js'; -import { ProgressBar } from '../ProgressBar.js'; -import { ConfirmationDialog } from '../ConfirmationDialog.js'; -import { InstallScreenSignalLogo } from './InstallScreenSignalLogo.js'; -import { roundFractionForProgressBar } from '../../util/numbers.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; -import { SYNCING_MESSAGES_SECURITY_URL } from '../../types/support.js'; -import { I18n } from '../I18n.js'; -import { InstallScreenUpdateDialog } from './InstallScreenUpdateDialog.js'; +} from '../../types/InstallScreen.std.js'; +import { formatFileSize } from '../../util/formatFileSize.std.js'; +import { TitlebarDragArea } from '../TitlebarDragArea.dom.js'; +import { ProgressBar } from '../ProgressBar.dom.js'; +import { ConfirmationDialog } from '../ConfirmationDialog.dom.js'; +import { InstallScreenSignalLogo } from './InstallScreenSignalLogo.dom.js'; +import { roundFractionForProgressBar } from '../../util/numbers.std.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; +import { SYNCING_MESSAGES_SECURITY_URL } from '../../types/support.std.js'; +import { I18n } from '../I18n.dom.js'; +import { InstallScreenUpdateDialog } from './InstallScreenUpdateDialog.dom.js'; // We can't always use destructuring assignment because of the complexity of this props // type. diff --git a/ts/components/installScreen/InstallScreenErrorStep.stories.tsx b/ts/components/installScreen/InstallScreenErrorStep.stories.tsx index c11b34318e..a5734e6671 100644 --- a/ts/components/installScreen/InstallScreenErrorStep.stories.tsx +++ b/ts/components/installScreen/InstallScreenErrorStep.stories.tsx @@ -4,9 +4,9 @@ import React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import { InstallScreenError } from '../../types/InstallScreen.js'; -import type { Props } from './InstallScreenErrorStep.js'; -import { InstallScreenErrorStep } from './InstallScreenErrorStep.js'; +import { InstallScreenError } from '../../types/InstallScreen.std.js'; +import type { Props } from './InstallScreenErrorStep.dom.js'; +import { InstallScreenErrorStep } from './InstallScreenErrorStep.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/installScreen/InstallScreenErrorStep.tsx b/ts/components/installScreen/InstallScreenErrorStep.tsx index 260cf4f6ee..5de44e1794 100644 --- a/ts/components/installScreen/InstallScreenErrorStep.tsx +++ b/ts/components/installScreen/InstallScreenErrorStep.tsx @@ -3,14 +3,14 @@ import React, { type ReactElement, useCallback } from 'react'; -import type { LocalizerType } from '../../types/Util.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; -import { openLinkInWebBrowser } from '../../util/openLinkInWebBrowser.js'; -import { Button, ButtonVariant } from '../Button.js'; -import { TitlebarDragArea } from '../TitlebarDragArea.js'; -import { InstallScreenSignalLogo } from './InstallScreenSignalLogo.js'; -import { LINK_SIGNAL_DESKTOP } from '../../types/support.js'; -import { InstallScreenError } from '../../types/InstallScreen.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; +import { openLinkInWebBrowser } from '../../util/openLinkInWebBrowser.dom.js'; +import { Button, ButtonVariant } from '../Button.dom.js'; +import { TitlebarDragArea } from '../TitlebarDragArea.dom.js'; +import { InstallScreenSignalLogo } from './InstallScreenSignalLogo.dom.js'; +import { LINK_SIGNAL_DESKTOP } from '../../types/support.std.js'; +import { InstallScreenError } from '../../types/InstallScreen.std.js'; export type Props = Readonly<{ error: InstallScreenError; diff --git a/ts/components/installScreen/InstallScreenLinkInProgress.stories.tsx b/ts/components/installScreen/InstallScreenLinkInProgress.stories.tsx index dba2bccca3..396095b2f5 100644 --- a/ts/components/installScreen/InstallScreenLinkInProgress.stories.tsx +++ b/ts/components/installScreen/InstallScreenLinkInProgress.stories.tsx @@ -3,8 +3,8 @@ import React from 'react'; import type { Meta } from '@storybook/react'; -import type { Props } from './InstallScreenLinkInProgressStep.js'; -import { InstallScreenLinkInProgressStep } from './InstallScreenLinkInProgressStep.js'; +import type { Props } from './InstallScreenLinkInProgressStep.dom.js'; +import { InstallScreenLinkInProgressStep } from './InstallScreenLinkInProgressStep.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/installScreen/InstallScreenLinkInProgressStep.tsx b/ts/components/installScreen/InstallScreenLinkInProgressStep.tsx index 7c82c57bd9..9bd5b3456d 100644 --- a/ts/components/installScreen/InstallScreenLinkInProgressStep.tsx +++ b/ts/components/installScreen/InstallScreenLinkInProgressStep.tsx @@ -4,11 +4,11 @@ import type { ReactElement } from 'react'; import React from 'react'; -import type { LocalizerType } from '../../types/Util.js'; +import type { LocalizerType } from '../../types/Util.std.js'; -import { Spinner } from '../Spinner.js'; -import { TitlebarDragArea } from '../TitlebarDragArea.js'; -import { InstallScreenSignalLogo } from './InstallScreenSignalLogo.js'; +import { Spinner } from '../Spinner.dom.js'; +import { TitlebarDragArea } from '../TitlebarDragArea.dom.js'; +import { InstallScreenSignalLogo } from './InstallScreenSignalLogo.dom.js'; export type Props = Readonly<{ i18n: LocalizerType }>; diff --git a/ts/components/installScreen/InstallScreenQrCodeNotScannedStep.stories.tsx b/ts/components/installScreen/InstallScreenQrCodeNotScannedStep.stories.tsx index 99c963b143..61c902857e 100644 --- a/ts/components/installScreen/InstallScreenQrCodeNotScannedStep.stories.tsx +++ b/ts/components/installScreen/InstallScreenQrCodeNotScannedStep.stories.tsx @@ -4,12 +4,12 @@ import React, { useEffect, useState } from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta, StoryFn } from '@storybook/react'; -import { DialogType } from '../../types/Dialogs.js'; -import { InstallScreenQRCodeError } from '../../types/InstallScreen.js'; -import type { Loadable } from '../../util/loadable.js'; -import { LoadingState } from '../../util/loadable.js'; -import type { PropsType } from './InstallScreenQrCodeNotScannedStep.js'; -import { InstallScreenQrCodeNotScannedStep } from './InstallScreenQrCodeNotScannedStep.js'; +import { DialogType } from '../../types/Dialogs.std.js'; +import { InstallScreenQRCodeError } from '../../types/InstallScreen.std.js'; +import type { Loadable } from '../../util/loadable.std.js'; +import { LoadingState } from '../../util/loadable.std.js'; +import type { PropsType } from './InstallScreenQrCodeNotScannedStep.dom.js'; +import { InstallScreenQrCodeNotScannedStep } from './InstallScreenQrCodeNotScannedStep.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/installScreen/InstallScreenQrCodeNotScannedStep.tsx b/ts/components/installScreen/InstallScreenQrCodeNotScannedStep.tsx index 4942107b37..a5d0a099cd 100644 --- a/ts/components/installScreen/InstallScreenQrCodeNotScannedStep.tsx +++ b/ts/components/installScreen/InstallScreenQrCodeNotScannedStep.tsx @@ -6,25 +6,25 @@ import React, { useCallback, useState, useEffect } from 'react'; import classNames from 'classnames'; import lodash from 'lodash'; -import type { LocalizerType } from '../../types/Util.js'; +import type { LocalizerType } from '../../types/Util.std.js'; import { InstallScreenStep, InstallScreenQRCodeError, -} from '../../types/InstallScreen.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; -import type { Loadable } from '../../util/loadable.js'; -import { LoadingState } from '../../util/loadable.js'; -import { drop } from '../../util/drop.js'; -import { getEnvironment, Environment } from '../../environment.js'; +} from '../../types/InstallScreen.std.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; +import type { Loadable } from '../../util/loadable.std.js'; +import { LoadingState } from '../../util/loadable.std.js'; +import { drop } from '../../util/drop.std.js'; +import { getEnvironment, Environment } from '../../environment.std.js'; -import { I18n } from '../I18n.js'; -import { Spinner } from '../Spinner.js'; -import { BrandedQRCode } from '../BrandedQRCode.js'; -import { TitlebarDragArea } from '../TitlebarDragArea.js'; -import { InstallScreenSignalLogo } from './InstallScreenSignalLogo.js'; -import { InstallScreenUpdateDialog } from './InstallScreenUpdateDialog.js'; -import { getClassNamesFor } from '../../util/getClassNamesFor.js'; -import type { UpdatesStateType } from '../../state/ducks/updates.js'; +import { I18n } from '../I18n.dom.js'; +import { Spinner } from '../Spinner.dom.js'; +import { BrandedQRCode } from '../BrandedQRCode.dom.js'; +import { TitlebarDragArea } from '../TitlebarDragArea.dom.js'; +import { InstallScreenSignalLogo } from './InstallScreenSignalLogo.dom.js'; +import { InstallScreenUpdateDialog } from './InstallScreenUpdateDialog.dom.js'; +import { getClassNamesFor } from '../../util/getClassNamesFor.std.js'; +import type { UpdatesStateType } from '../../state/ducks/updates.preload.js'; const { noop } = lodash; diff --git a/ts/components/installScreen/InstallScreenUpdateDialog.tsx b/ts/components/installScreen/InstallScreenUpdateDialog.tsx index d81a18ff81..1b80885cf1 100644 --- a/ts/components/installScreen/InstallScreenUpdateDialog.tsx +++ b/ts/components/installScreen/InstallScreenUpdateDialog.tsx @@ -4,22 +4,22 @@ import React from 'react'; import lodash from 'lodash'; -import { DialogType } from '../../types/Dialogs.js'; -import { InstallScreenStep } from '../../types/InstallScreen.js'; -import type { LocalizerType } from '../../types/Util.js'; +import { DialogType } from '../../types/Dialogs.std.js'; +import { InstallScreenStep } from '../../types/InstallScreen.std.js'; +import type { LocalizerType } from '../../types/Util.std.js'; import { PRODUCTION_DOWNLOAD_URL, BETA_DOWNLOAD_URL, UNSUPPORTED_OS_URL, -} from '../../types/support.js'; -import type { UpdatesStateType } from '../../state/ducks/updates.js'; -import { isBeta } from '../../util/version.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; -import { roundFractionForProgressBar } from '../../util/numbers.js'; -import { ConfirmationDialog } from '../ConfirmationDialog.js'; -import { Modal } from '../Modal.js'; -import { I18n } from '../I18n.js'; -import { formatFileSize } from '../../util/formatFileSize.js'; +} from '../../types/support.std.js'; +import type { UpdatesStateType } from '../../state/ducks/updates.preload.js'; +import { isBeta } from '../../util/version.std.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; +import { roundFractionForProgressBar } from '../../util/numbers.std.js'; +import { ConfirmationDialog } from '../ConfirmationDialog.dom.js'; +import { Modal } from '../Modal.dom.js'; +import { I18n } from '../I18n.dom.js'; +import { formatFileSize } from '../../util/formatFileSize.std.js'; const { noop } = lodash; diff --git a/ts/components/leftPane/LeftPaneArchiveHelper.tsx b/ts/components/leftPane/LeftPaneArchiveHelper.tsx index 8a653d3d56..863d505bb2 100644 --- a/ts/components/leftPane/LeftPaneArchiveHelper.tsx +++ b/ts/components/leftPane/LeftPaneArchiveHelper.tsx @@ -5,21 +5,21 @@ import type { ReactChild } from 'react'; import React from 'react'; import lodash from 'lodash'; -import type { ToFindType } from './LeftPaneHelper.js'; -import { LeftPaneHelper } from './LeftPaneHelper.js'; -import { getConversationInDirection } from './getConversationInDirection.js'; -import type { Row } from '../ConversationList.js'; -import { RowType } from '../ConversationList.js'; -import type { PropsData as ConversationListItemPropsType } from '../conversationList/ConversationListItem.js'; -import type { LocalizerType } from '../../types/Util.js'; +import type { ToFindType } from './LeftPaneHelper.dom.js'; +import { LeftPaneHelper } from './LeftPaneHelper.dom.js'; +import { getConversationInDirection } from './getConversationInDirection.dom.js'; +import type { Row } from '../ConversationList.dom.js'; +import { RowType } from '../ConversationList.dom.js'; +import type { PropsData as ConversationListItemPropsType } from '../conversationList/ConversationListItem.dom.js'; +import type { LocalizerType } from '../../types/Util.std.js'; import type { ConversationType, ShowConversationType, -} from '../../state/ducks/conversations.js'; -import { LeftPaneSearchInput } from '../LeftPaneSearchInput.js'; -import type { LeftPaneSearchPropsType } from './LeftPaneSearchHelper.js'; -import { LeftPaneSearchHelper } from './LeftPaneSearchHelper.js'; -import * as KeyboardLayout from '../../services/keyboardLayout.js'; +} from '../../state/ducks/conversations.preload.js'; +import { LeftPaneSearchInput } from '../LeftPaneSearchInput.dom.js'; +import type { LeftPaneSearchPropsType } from './LeftPaneSearchHelper.dom.js'; +import { LeftPaneSearchHelper } from './LeftPaneSearchHelper.dom.js'; +import * as KeyboardLayout from '../../services/keyboardLayout.dom.js'; const { last } = lodash; diff --git a/ts/components/leftPane/LeftPaneChatFolders.tsx b/ts/components/leftPane/LeftPaneChatFolders.tsx index 01b26cf352..640109fe7c 100644 --- a/ts/components/leftPane/LeftPaneChatFolders.tsx +++ b/ts/components/leftPane/LeftPaneChatFolders.tsx @@ -10,25 +10,25 @@ import { ChatFolderType, type ChatFolder, type ChatFolderId, -} from '../../types/ChatFolder.js'; -import type { LocalizerType } from '../../types/I18N.js'; -import { ExperimentalAxoSegmentedControl } from '../../axo/AxoSegmentedControl.js'; -import { tw } from '../../axo/tw.js'; +} from '../../types/ChatFolder.std.js'; +import type { LocalizerType } from '../../types/I18N.std.js'; +import { ExperimentalAxoSegmentedControl } from '../../axo/AxoSegmentedControl.dom.js'; +import { tw } from '../../axo/tw.dom.js'; import type { AllChatFoldersUnreadStats, UnreadStats, -} from '../../util/countUnreadStats.js'; -import { WidthBreakpoint } from '../_util.js'; -import { AxoSelect } from '../../axo/AxoSelect.js'; -import { AxoContextMenu } from '../../axo/AxoContextMenu.js'; -import { getMuteValuesOptions } from '../../util/getMuteOptions.js'; +} from '../../util/countUnreadStats.std.js'; +import { WidthBreakpoint } from '../_util.std.js'; +import { AxoSelect } from '../../axo/AxoSelect.dom.js'; +import { AxoContextMenu } from '../../axo/AxoContextMenu.dom.js'; +import { getMuteValuesOptions } from '../../util/getMuteOptions.std.js'; import type { AllChatFoldersMutedStats, MutedStats, -} from '../../util/countMutedStats.js'; -import type { AxoSymbol } from '../../axo/AxoSymbol.js'; -import { UserText } from '../UserText.js'; -import { CurrentChatFolders } from '../../types/CurrentChatFolders.js'; +} from '../../util/countMutedStats.std.js'; +import type { AxoSymbol } from '../../axo/AxoSymbol.dom.js'; +import { UserText } from '../UserText.dom.js'; +import { CurrentChatFolders } from '../../types/CurrentChatFolders.std.js'; export type LeftPaneChatFoldersProps = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/leftPane/LeftPaneChooseGroupMembersHelper.tsx b/ts/components/leftPane/LeftPaneChooseGroupMembersHelper.tsx index 5661016fec..2cfc7bbc5f 100644 --- a/ts/components/leftPane/LeftPaneChooseGroupMembersHelper.tsx +++ b/ts/components/leftPane/LeftPaneChooseGroupMembersHelper.tsx @@ -4,27 +4,27 @@ import type { ReactChild, ChangeEvent } from 'react'; import React from 'react'; -import { LeftPaneHelper } from './LeftPaneHelper.js'; -import type { Row } from '../ConversationList.js'; -import { RowType } from '../ConversationList.js'; -import type { ConversationType } from '../../state/ducks/conversations.js'; -import { ContactCheckboxDisabledReason } from '../conversationList/ContactCheckbox.js'; -import { ContactPills } from '../ContactPills.js'; -import { ContactPill } from '../ContactPill.js'; -import { SearchInput } from '../SearchInput.js'; +import { LeftPaneHelper } from './LeftPaneHelper.dom.js'; +import type { Row } from '../ConversationList.dom.js'; +import { RowType } from '../ConversationList.dom.js'; +import type { ConversationType } from '../../state/ducks/conversations.preload.js'; +import { ContactCheckboxDisabledReason } from '../conversationList/ContactCheckbox.dom.js'; +import { ContactPills } from '../ContactPills.dom.js'; +import { ContactPill } from '../ContactPill.dom.js'; +import { SearchInput } from '../SearchInput.dom.js'; import { AddGroupMemberErrorDialog, AddGroupMemberErrorDialogMode, -} from '../AddGroupMemberErrorDialog.js'; -import { Button } from '../Button.js'; -import type { LocalizerType } from '../../types/Util.js'; -import type { ParsedE164Type } from '../../util/libphonenumberInstance.js'; -import { parseAndFormatPhoneNumber } from '../../util/libphonenumberInstance.js'; -import type { UUIDFetchStateType } from '../../util/uuidFetchState.js'; +} from '../AddGroupMemberErrorDialog.dom.js'; +import { Button } from '../Button.dom.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import type { ParsedE164Type } from '../../util/libphonenumberInstance.std.js'; +import { parseAndFormatPhoneNumber } from '../../util/libphonenumberInstance.std.js'; +import type { UUIDFetchStateType } from '../../util/uuidFetchState.std.js'; import { isFetchingByUsername, isFetchingByE164, -} from '../../util/uuidFetchState.js'; +} from '../../util/uuidFetchState.std.js'; export type LeftPaneChooseGroupMembersPropsType = { uuidFetchState: UUIDFetchStateType; diff --git a/ts/components/leftPane/LeftPaneComposeHelper.tsx b/ts/components/leftPane/LeftPaneComposeHelper.tsx index b1797ad782..fdaff51b6a 100644 --- a/ts/components/leftPane/LeftPaneComposeHelper.tsx +++ b/ts/components/leftPane/LeftPaneComposeHelper.tsx @@ -4,21 +4,21 @@ import type { ReactChild, ChangeEvent } from 'react'; import React from 'react'; -import { LeftPaneHelper } from './LeftPaneHelper.js'; -import type { Row } from '../ConversationList.js'; -import { RowType } from '../ConversationList.js'; -import type { ContactListItemConversationType } from '../conversationList/ContactListItem.js'; -import { SearchInput } from '../SearchInput.js'; -import type { LocalizerType } from '../../types/Util.js'; -import type { ParsedE164Type } from '../../util/libphonenumberInstance.js'; -import { parseAndFormatPhoneNumber } from '../../util/libphonenumberInstance.js'; -import type { UUIDFetchStateType } from '../../util/uuidFetchState.js'; +import { LeftPaneHelper } from './LeftPaneHelper.dom.js'; +import type { Row } from '../ConversationList.dom.js'; +import { RowType } from '../ConversationList.dom.js'; +import type { ContactListItemConversationType } from '../conversationList/ContactListItem.dom.js'; +import { SearchInput } from '../SearchInput.dom.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import type { ParsedE164Type } from '../../util/libphonenumberInstance.std.js'; +import { parseAndFormatPhoneNumber } from '../../util/libphonenumberInstance.std.js'; +import type { UUIDFetchStateType } from '../../util/uuidFetchState.std.js'; import { isFetchingByUsername, isFetchingByE164, -} from '../../util/uuidFetchState.js'; -import type { GroupListItemConversationType } from '../conversationList/GroupListItem.js'; -import { isProbablyAUsername } from '../../util/Username.js'; +} from '../../util/uuidFetchState.std.js'; +import type { GroupListItemConversationType } from '../conversationList/GroupListItem.dom.js'; +import { isProbablyAUsername } from '../../util/Username.dom.js'; export type LeftPaneComposePropsType = { composeContacts: ReadonlyArray; diff --git a/ts/components/leftPane/LeftPaneConversationListItemContextMenu.tsx b/ts/components/leftPane/LeftPaneConversationListItemContextMenu.tsx index 02d353a624..91c7388801 100644 --- a/ts/components/leftPane/LeftPaneConversationListItemContextMenu.tsx +++ b/ts/components/leftPane/LeftPaneConversationListItemContextMenu.tsx @@ -2,19 +2,19 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { FC, ReactNode } from 'react'; import React, { memo, useCallback, useMemo, useState } from 'react'; -import { AxoContextMenu } from '../../axo/AxoContextMenu.js'; -import type { LocalizerType } from '../../types/I18N.js'; -import type { ConversationType } from '../../state/ducks/conversations.js'; -import { isConversationUnread } from '../../util/isConversationUnread.js'; +import { AxoContextMenu } from '../../axo/AxoContextMenu.dom.js'; +import type { LocalizerType } from '../../types/I18N.std.js'; +import type { ConversationType } from '../../state/ducks/conversations.preload.js'; +import { isConversationUnread } from '../../util/isConversationUnread.std.js'; import { Environment, getEnvironment, isMockEnvironment, -} from '../../environment.js'; -import { isAlpha } from '../../util/version.js'; -import { drop } from '../../util/drop.js'; -import { DeleteMessagesConfirmationDialog } from '../DeleteMessagesConfirmationDialog.js'; -import { getMuteOptions } from '../../util/getMuteOptions.js'; +} from '../../environment.std.js'; +import { isAlpha } from '../../util/version.std.js'; +import { drop } from '../../util/drop.std.js'; +import { DeleteMessagesConfirmationDialog } from '../DeleteMessagesConfirmationDialog.dom.js'; +import { getMuteOptions } from '../../util/getMuteOptions.std.js'; function isEnabled() { const env = getEnvironment(); diff --git a/ts/components/leftPane/LeftPaneFindByPhoneNumberHelper.tsx b/ts/components/leftPane/LeftPaneFindByPhoneNumberHelper.tsx index 90de08978d..5360bd0f23 100644 --- a/ts/components/leftPane/LeftPaneFindByPhoneNumberHelper.tsx +++ b/ts/components/leftPane/LeftPaneFindByPhoneNumberHelper.tsx @@ -4,22 +4,22 @@ import type { ReactChild } from 'react'; import React from 'react'; -import { LeftPaneHelper } from './LeftPaneHelper.js'; -import type { Row } from '../ConversationList.js'; -import { RowType } from '../ConversationList.js'; -import { SearchInput } from '../SearchInput.js'; -import type { LocalizerType } from '../../types/Util.js'; -import type { ShowConversationType } from '../../state/ducks/conversations.js'; -import type { ParsedE164Type } from '../../util/libphonenumberInstance.js'; -import { parseAndFormatPhoneNumber } from '../../util/libphonenumberInstance.js'; -import type { UUIDFetchStateType } from '../../util/uuidFetchState.js'; -import type { CountryDataType } from '../../util/getCountryData.js'; -import { isFetchingByE164 } from '../../util/uuidFetchState.js'; -import { drop } from '../../util/drop.js'; -import type { LookupConversationWithoutServiceIdActionsType } from '../../util/lookupConversationWithoutServiceId.js'; -import { Spinner } from '../Spinner.js'; -import { Button } from '../Button.js'; -import { CountryCodeSelect } from '../CountryCodeSelect.js'; +import { LeftPaneHelper } from './LeftPaneHelper.dom.js'; +import type { Row } from '../ConversationList.dom.js'; +import { RowType } from '../ConversationList.dom.js'; +import { SearchInput } from '../SearchInput.dom.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import type { ShowConversationType } from '../../state/ducks/conversations.preload.js'; +import type { ParsedE164Type } from '../../util/libphonenumberInstance.std.js'; +import { parseAndFormatPhoneNumber } from '../../util/libphonenumberInstance.std.js'; +import type { UUIDFetchStateType } from '../../util/uuidFetchState.std.js'; +import type { CountryDataType } from '../../util/getCountryData.dom.js'; +import { isFetchingByE164 } from '../../util/uuidFetchState.std.js'; +import { drop } from '../../util/drop.std.js'; +import type { LookupConversationWithoutServiceIdActionsType } from '../../util/lookupConversationWithoutServiceId.preload.js'; +import { Spinner } from '../Spinner.dom.js'; +import { Button } from '../Button.dom.js'; +import { CountryCodeSelect } from '../CountryCodeSelect.dom.js'; export type LeftPaneFindByPhoneNumberPropsType = { searchTerm: string; diff --git a/ts/components/leftPane/LeftPaneFindByUsernameHelper.tsx b/ts/components/leftPane/LeftPaneFindByUsernameHelper.tsx index b4468b1385..164374861d 100644 --- a/ts/components/leftPane/LeftPaneFindByUsernameHelper.tsx +++ b/ts/components/leftPane/LeftPaneFindByUsernameHelper.tsx @@ -4,18 +4,18 @@ import type { ReactChild } from 'react'; import React from 'react'; -import { LeftPaneHelper } from './LeftPaneHelper.js'; -import type { Row } from '../ConversationList.js'; -import { RowType } from '../ConversationList.js'; -import { SearchInput } from '../SearchInput.js'; -import type { LocalizerType } from '../../types/Util.js'; -import type { ShowConversationType } from '../../state/ducks/conversations.js'; -import type { UUIDFetchStateType } from '../../util/uuidFetchState.js'; -import { isFetchingByUsername } from '../../util/uuidFetchState.js'; -import { drop } from '../../util/drop.js'; -import type { LookupConversationWithoutServiceIdActionsType } from '../../util/lookupConversationWithoutServiceId.js'; -import { Spinner } from '../Spinner.js'; -import { Button } from '../Button.js'; +import { LeftPaneHelper } from './LeftPaneHelper.dom.js'; +import type { Row } from '../ConversationList.dom.js'; +import { RowType } from '../ConversationList.dom.js'; +import { SearchInput } from '../SearchInput.dom.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import type { ShowConversationType } from '../../state/ducks/conversations.preload.js'; +import type { UUIDFetchStateType } from '../../util/uuidFetchState.std.js'; +import { isFetchingByUsername } from '../../util/uuidFetchState.std.js'; +import { drop } from '../../util/drop.std.js'; +import type { LookupConversationWithoutServiceIdActionsType } from '../../util/lookupConversationWithoutServiceId.preload.js'; +import { Spinner } from '../Spinner.dom.js'; +import { Button } from '../Button.dom.js'; export type LeftPaneFindByUsernamePropsType = { searchTerm: string; diff --git a/ts/components/leftPane/LeftPaneHelper.tsx b/ts/components/leftPane/LeftPaneHelper.tsx index 3883b33b25..6da236cac9 100644 --- a/ts/components/leftPane/LeftPaneHelper.tsx +++ b/ts/components/leftPane/LeftPaneHelper.tsx @@ -3,16 +3,16 @@ import type { ChangeEvent, ReactChild } from 'react'; -import type { Row } from '../ConversationList.js'; -import type { LocalizerType } from '../../types/Util.js'; +import type { Row } from '../ConversationList.dom.js'; +import type { LocalizerType } from '../../types/Util.std.js'; import type { DeleteAvatarFromDiskActionType, ReplaceAvatarActionType, SaveAvatarToDiskActionType, -} from '../../types/Avatar.js'; -import type { DurationInSeconds } from '../../util/durations/index.js'; -import type { LookupConversationWithoutServiceIdActionsType } from '../../util/lookupConversationWithoutServiceId.js'; -import type { ShowConversationType } from '../../state/ducks/conversations.js'; +} from '../../types/Avatar.std.js'; +import type { DurationInSeconds } from '../../util/durations/index.std.js'; +import type { LookupConversationWithoutServiceIdActionsType } from '../../util/lookupConversationWithoutServiceId.preload.js'; +import type { ShowConversationType } from '../../state/ducks/conversations.preload.js'; export enum FindDirection { Up, diff --git a/ts/components/leftPane/LeftPaneInboxHelper.tsx b/ts/components/leftPane/LeftPaneInboxHelper.tsx index f6710c3074..c22558e53f 100644 --- a/ts/components/leftPane/LeftPaneInboxHelper.tsx +++ b/ts/components/leftPane/LeftPaneInboxHelper.tsx @@ -5,24 +5,24 @@ import lodash from 'lodash'; import type { ReactChild, ReactNode } from 'react'; import React from 'react'; -import type { ToFindType } from './LeftPaneHelper.js'; +import type { ToFindType } from './LeftPaneHelper.dom.js'; import type { ConversationType, ShowConversationType, -} from '../../state/ducks/conversations.js'; -import { LeftPaneHelper } from './LeftPaneHelper.js'; -import { getConversationInDirection } from './getConversationInDirection.js'; -import type { Row } from '../ConversationList.js'; -import { RowType } from '../ConversationList.js'; -import type { PropsData as ConversationListItemPropsType } from '../conversationList/ConversationListItem.js'; -import type { LocalizerType } from '../../types/Util.js'; -import { handleKeydownForSearch } from './handleKeydownForSearch.js'; -import { LeftPaneSearchInput } from '../LeftPaneSearchInput.js'; -import type { ChatFolder } from '../../types/ChatFolder.js'; -import { ChatFolderType } from '../../types/ChatFolder.js'; -import { AxoButton } from '../../axo/AxoButton.js'; -import { NavTab, SettingsPage, type Location } from '../../types/Nav.js'; -import { tw } from '../../axo/tw.js'; +} from '../../state/ducks/conversations.preload.js'; +import { LeftPaneHelper } from './LeftPaneHelper.dom.js'; +import { getConversationInDirection } from './getConversationInDirection.dom.js'; +import type { Row } from '../ConversationList.dom.js'; +import { RowType } from '../ConversationList.dom.js'; +import type { PropsData as ConversationListItemPropsType } from '../conversationList/ConversationListItem.dom.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import { handleKeydownForSearch } from './handleKeydownForSearch.dom.js'; +import { LeftPaneSearchInput } from '../LeftPaneSearchInput.dom.js'; +import type { ChatFolder } from '../../types/ChatFolder.std.js'; +import { ChatFolderType } from '../../types/ChatFolder.std.js'; +import { AxoButton } from '../../axo/AxoButton.dom.js'; +import { NavTab, SettingsPage, type Location } from '../../types/Nav.std.js'; +import { tw } from '../../axo/tw.dom.js'; const { last } = lodash; diff --git a/ts/components/leftPane/LeftPaneSearchHelper.tsx b/ts/components/leftPane/LeftPaneSearchHelper.tsx index 7c8a9d050a..382acc226a 100644 --- a/ts/components/leftPane/LeftPaneSearchHelper.tsx +++ b/ts/components/leftPane/LeftPaneSearchHelper.tsx @@ -4,22 +4,22 @@ import type { ReactChild } from 'react'; import React from 'react'; -import type { ToFindType } from './LeftPaneHelper.js'; -import { LeftPaneHelper } from './LeftPaneHelper.js'; -import type { LocalizerType } from '../../types/Util.js'; -import type { Row } from '../ConversationList.js'; -import { RowType } from '../ConversationList.js'; -import type { PropsData as ConversationListItemPropsType } from '../conversationList/ConversationListItem.js'; -import { handleKeydownForSearch } from './handleKeydownForSearch.js'; +import type { ToFindType } from './LeftPaneHelper.dom.js'; +import { LeftPaneHelper } from './LeftPaneHelper.dom.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import type { Row } from '../ConversationList.dom.js'; +import { RowType } from '../ConversationList.dom.js'; +import type { PropsData as ConversationListItemPropsType } from '../conversationList/ConversationListItem.dom.js'; +import { handleKeydownForSearch } from './handleKeydownForSearch.dom.js'; import type { ConversationType, ShowConversationType, -} from '../../state/ducks/conversations.js'; -import { LeftPaneSearchInput } from '../LeftPaneSearchInput.js'; +} from '../../state/ducks/conversations.preload.js'; +import { LeftPaneSearchInput } from '../LeftPaneSearchInput.dom.js'; -import { I18n } from '../I18n.js'; -import { assertDev } from '../../util/assert.js'; -import { UserText } from '../UserText.js'; +import { I18n } from '../I18n.dom.js'; +import { assertDev } from '../../util/assert.std.js'; +import { UserText } from '../UserText.dom.js'; // The "correct" thing to do is to measure the size of the left pane and render enough // search results for the container height. But (1) that's slow (2) the list is diff --git a/ts/components/leftPane/LeftPaneSetGroupMetadataHelper.tsx b/ts/components/leftPane/LeftPaneSetGroupMetadataHelper.tsx index c0437435c7..1f6a264f8d 100644 --- a/ts/components/leftPane/LeftPaneSetGroupMetadataHelper.tsx +++ b/ts/components/leftPane/LeftPaneSetGroupMetadataHelper.tsx @@ -4,27 +4,27 @@ import type { ReactChild } from 'react'; import React from 'react'; -import { LeftPaneHelper } from './LeftPaneHelper.js'; -import type { Row } from '../ConversationList.js'; -import { RowType } from '../ConversationList.js'; -import type { ContactListItemConversationType } from '../conversationList/ContactListItem.js'; -import { DisappearingTimerSelect } from '../DisappearingTimerSelect.js'; -import type { LocalizerType } from '../../types/Util.js'; -import type { DurationInSeconds } from '../../util/durations/index.js'; -import { Alert } from '../Alert.js'; -import { AvatarEditor } from '../AvatarEditor.js'; -import { AvatarPreview } from '../AvatarPreview.js'; -import { Spinner } from '../Spinner.js'; -import { Button } from '../Button.js'; -import { Modal } from '../Modal.js'; -import { GroupTitleInput } from '../GroupTitleInput.js'; +import { LeftPaneHelper } from './LeftPaneHelper.dom.js'; +import type { Row } from '../ConversationList.dom.js'; +import { RowType } from '../ConversationList.dom.js'; +import type { ContactListItemConversationType } from '../conversationList/ContactListItem.dom.js'; +import { DisappearingTimerSelect } from '../DisappearingTimerSelect.dom.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import type { DurationInSeconds } from '../../util/durations/index.std.js'; +import { Alert } from '../Alert.dom.js'; +import { AvatarEditor } from '../AvatarEditor.dom.js'; +import { AvatarPreview } from '../AvatarPreview.dom.js'; +import { Spinner } from '../Spinner.dom.js'; +import { Button } from '../Button.dom.js'; +import { Modal } from '../Modal.dom.js'; +import { GroupTitleInput } from '../GroupTitleInput.dom.js'; import type { AvatarDataType, DeleteAvatarFromDiskActionType, ReplaceAvatarActionType, SaveAvatarToDiskActionType, -} from '../../types/Avatar.js'; -import { AvatarColors } from '../../types/Colors.js'; +} from '../../types/Avatar.std.js'; +import { AvatarColors } from '../../types/Colors.std.js'; export type LeftPaneSetGroupMetadataPropsType = { groupAvatar: undefined | Uint8Array; diff --git a/ts/components/leftPane/getConversationInDirection.ts b/ts/components/leftPane/getConversationInDirection.ts index ff7cd85170..6bfa09e4d0 100644 --- a/ts/components/leftPane/getConversationInDirection.ts +++ b/ts/components/leftPane/getConversationInDirection.ts @@ -3,10 +3,10 @@ import lodash from 'lodash'; -import type { PropsData as ConversationListItemPropsType } from '../conversationList/ConversationListItem.js'; -import { isConversationUnread } from '../../util/isConversationUnread.js'; -import type { ToFindType } from './LeftPaneHelper.js'; -import { FindDirection } from './LeftPaneHelper.js'; +import type { PropsData as ConversationListItemPropsType } from '../conversationList/ConversationListItem.dom.js'; +import { isConversationUnread } from '../../util/isConversationUnread.std.js'; +import type { ToFindType } from './LeftPaneHelper.dom.js'; +import { FindDirection } from './LeftPaneHelper.dom.js'; const { find: findFirst, findLast, first, last } = lodash; diff --git a/ts/components/leftPane/handleKeydownForSearch.ts b/ts/components/leftPane/handleKeydownForSearch.ts index bd84448789..d30b807736 100644 --- a/ts/components/leftPane/handleKeydownForSearch.ts +++ b/ts/components/leftPane/handleKeydownForSearch.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as KeyboardLayout from '../../services/keyboardLayout.js'; +import * as KeyboardLayout from '../../services/keyboardLayout.dom.js'; export function handleKeydownForSearch( event: Readonly, diff --git a/ts/components/preferences/PreferencesSelectChatsDialog.tsx b/ts/components/preferences/PreferencesSelectChatsDialog.tsx index f2486c62f5..e482ef4abd 100644 --- a/ts/components/preferences/PreferencesSelectChatsDialog.tsx +++ b/ts/components/preferences/PreferencesSelectChatsDialog.tsx @@ -3,29 +3,29 @@ import type { ChangeEvent } from 'react'; import React, { useCallback, useMemo, useState } from 'react'; -import type { ConversationType } from '../../state/ducks/conversations.js'; -import type { PreferredBadgeSelectorType } from '../../state/selectors/badges.js'; -import type { LocalizerType } from '../../types/I18N.js'; -import type { ThemeType } from '../../types/Util.js'; -import { filterAndSortConversations } from '../../util/filterAndSortConversations.js'; -import { ContactPills } from '../ContactPills.js'; -import { ContactPill } from '../ContactPill.js'; +import type { ConversationType } from '../../state/ducks/conversations.preload.js'; +import type { PreferredBadgeSelectorType } from '../../state/selectors/badges.preload.js'; +import type { LocalizerType } from '../../types/I18N.std.js'; +import type { ThemeType } from '../../types/Util.std.js'; +import { filterAndSortConversations } from '../../util/filterAndSortConversations.std.js'; +import { ContactPills } from '../ContactPills.dom.js'; +import { ContactPill } from '../ContactPill.dom.js'; import { asyncShouldNeverBeCalled, shouldNeverBeCalled, -} from '../../util/shouldNeverBeCalled.js'; -import { SearchInput } from '../SearchInput.js'; -import { Button, ButtonVariant } from '../Button.js'; -import { Modal } from '../Modal.js'; -import type { Row } from '../ConversationList.js'; +} from '../../util/shouldNeverBeCalled.std.js'; +import { SearchInput } from '../SearchInput.dom.js'; +import { Button, ButtonVariant } from '../Button.dom.js'; +import { Modal } from '../Modal.dom.js'; +import type { Row } from '../ConversationList.dom.js'; import { ConversationList, GenericCheckboxRowIcon, RowType, -} from '../ConversationList.js'; -import type { GetConversationByIdType } from '../../state/selectors/conversations.js'; -import { SizeObserver } from '../../hooks/useSizeObserver.js'; -import { tw } from '../../axo/tw.js'; +} from '../ConversationList.dom.js'; +import type { GetConversationByIdType } from '../../state/selectors/conversations.dom.js'; +import { SizeObserver } from '../../hooks/useSizeObserver.dom.js'; +import { tw } from '../../axo/tw.dom.js'; export type ChatFolderSelection = Readonly<{ selectedRecipientIds: ReadonlyArray; diff --git a/ts/components/preferences/chatFolders/DeleteChatFolderDialog.tsx b/ts/components/preferences/chatFolders/DeleteChatFolderDialog.tsx index 30f5799828..7db2616269 100644 --- a/ts/components/preferences/chatFolders/DeleteChatFolderDialog.tsx +++ b/ts/components/preferences/chatFolders/DeleteChatFolderDialog.tsx @@ -3,8 +3,8 @@ import type { ReactNode } from 'react'; import React from 'react'; -import type { LocalizerType } from '../../../types/I18N.js'; -import { ConfirmationDialog } from '../../ConfirmationDialog.js'; +import type { LocalizerType } from '../../../types/I18N.std.js'; +import { ConfirmationDialog } from '../../ConfirmationDialog.dom.js'; export function DeleteChatFolderDialog(props: { i18n: LocalizerType; diff --git a/ts/components/preferences/chatFolders/PreferencesChatFolderItems.tsx b/ts/components/preferences/chatFolders/PreferencesChatFolderItems.tsx index d5ee7c1623..383414443a 100644 --- a/ts/components/preferences/chatFolders/PreferencesChatFolderItems.tsx +++ b/ts/components/preferences/chatFolders/PreferencesChatFolderItems.tsx @@ -4,10 +4,10 @@ import classNames from 'classnames'; import React, { forwardRef } from 'react'; import type { ForwardedRef, HTMLAttributes, ReactNode } from 'react'; -import { tw } from '../../../axo/tw.js'; -import type { LocalizerType } from '../../../types/I18N.js'; -import { AxoSymbol } from '../../../axo/AxoSymbol.js'; -import type { ChatFolderPresetId } from './PreferencesChatFoldersPage.js'; +import { tw } from '../../../axo/tw.dom.js'; +import type { LocalizerType } from '../../../types/I18N.std.js'; +import { AxoSymbol } from '../../../axo/AxoSymbol.dom.js'; +import type { ChatFolderPresetId } from './PreferencesChatFoldersPage.dom.js'; export const itemClassName = classNames( tw('group'), diff --git a/ts/components/preferences/chatFolders/PreferencesChatFoldersPage.tsx b/ts/components/preferences/chatFolders/PreferencesChatFoldersPage.tsx index 986a5d9042..03497feb68 100644 --- a/ts/components/preferences/chatFolders/PreferencesChatFoldersPage.tsx +++ b/ts/components/preferences/chatFolders/PreferencesChatFoldersPage.tsx @@ -6,30 +6,30 @@ import type { MutableRefObject, ReactNode } from 'react'; import { ListBox, ListBoxItem, useDragAndDrop } from 'react-aria-components'; import { isEqual, partition } from 'lodash'; import classNames from 'classnames'; -import type { LocalizerType } from '../../../types/I18N.js'; -import { PreferencesContent } from '../../Preferences.js'; -import { SettingsRow } from '../../PreferencesUtil.js'; +import type { LocalizerType } from '../../../types/I18N.std.js'; +import { PreferencesContent } from '../../Preferences.dom.js'; +import { SettingsRow } from '../../PreferencesUtil.dom.js'; import { CHAT_FOLDER_PRESETS, matchesChatFolderPreset, ChatFolderType, -} from '../../../types/ChatFolder.js'; +} from '../../../types/ChatFolder.std.js'; import type { ChatFolderId, ChatFolderParams, ChatFolderPreset, ChatFolder, -} from '../../../types/ChatFolder.js'; -import { AxoContextMenu } from '../../../axo/AxoContextMenu.js'; -import { DeleteChatFolderDialog } from './DeleteChatFolderDialog.js'; -import { strictAssert } from '../../../util/assert.js'; -import { tw } from '../../../axo/tw.js'; -import { UserText } from '../../UserText.js'; -import { I18n } from '../../I18n.js'; -import { NavTab, SettingsPage, type Location } from '../../../types/Nav.js'; -import { AxoButton } from '../../../axo/AxoButton.js'; -import type { CurrentChatFolder } from '../../../types/CurrentChatFolders.js'; -import { CurrentChatFolders } from '../../../types/CurrentChatFolders.js'; +} from '../../../types/ChatFolder.std.js'; +import { AxoContextMenu } from '../../../axo/AxoContextMenu.dom.js'; +import { DeleteChatFolderDialog } from './DeleteChatFolderDialog.dom.js'; +import { strictAssert } from '../../../util/assert.std.js'; +import { tw } from '../../../axo/tw.dom.js'; +import { UserText } from '../../UserText.dom.js'; +import { I18n } from '../../I18n.dom.js'; +import { NavTab, SettingsPage, type Location } from '../../../types/Nav.std.js'; +import { AxoButton } from '../../../axo/AxoButton.dom.js'; +import type { CurrentChatFolder } from '../../../types/CurrentChatFolders.std.js'; +import { CurrentChatFolders } from '../../../types/CurrentChatFolders.std.js'; import { ItemAvatar, ItemBody, @@ -41,7 +41,7 @@ import { ItemDragHandle, itemListItemClassName, ItemTitle, -} from './PreferencesChatFolderItems.js'; +} from './PreferencesChatFolderItems.dom.js'; function moveChatFolders( chatFolders: ReadonlyArray, diff --git a/ts/components/preferences/chatFolders/PreferencesEditChatFoldersPage.tsx b/ts/components/preferences/chatFolders/PreferencesEditChatFoldersPage.tsx index 38290bc59f..675f5fdcad 100644 --- a/ts/components/preferences/chatFolders/PreferencesEditChatFoldersPage.tsx +++ b/ts/components/preferences/chatFolders/PreferencesEditChatFoldersPage.tsx @@ -3,42 +3,42 @@ import type { MutableRefObject } from 'react'; import React, { useCallback, useMemo, useRef, useState } from 'react'; import classNames from 'classnames'; -import type { ConversationType } from '../../../state/ducks/conversations.js'; -import type { PreferredBadgeSelectorType } from '../../../state/selectors/badges.js'; -import type { LocalizerType } from '../../../types/I18N.js'; -import type { ThemeType } from '../../../types/Util.js'; -import { Input } from '../../Input.js'; -import { Button, ButtonVariant } from '../../Button.js'; -import { ConfirmationDialog } from '../../ConfirmationDialog.js'; -import type { ChatFolderSelection } from '../PreferencesSelectChatsDialog.js'; -import { SettingsControl, SettingsRow } from '../../PreferencesUtil.js'; -import { PreferencesSelectChatsDialog } from '../PreferencesSelectChatsDialog.js'; -import { Avatar, AvatarSize } from '../../Avatar.js'; -import { PreferencesContent } from '../../Preferences.js'; +import type { ConversationType } from '../../../state/ducks/conversations.preload.js'; +import type { PreferredBadgeSelectorType } from '../../../state/selectors/badges.preload.js'; +import type { LocalizerType } from '../../../types/I18N.std.js'; +import type { ThemeType } from '../../../types/Util.std.js'; +import { Input } from '../../Input.dom.js'; +import { Button, ButtonVariant } from '../../Button.dom.js'; +import { ConfirmationDialog } from '../../ConfirmationDialog.dom.js'; +import type { ChatFolderSelection } from '../PreferencesSelectChatsDialog.dom.js'; +import { SettingsControl, SettingsRow } from '../../PreferencesUtil.dom.js'; +import { PreferencesSelectChatsDialog } from '../PreferencesSelectChatsDialog.dom.js'; +import { Avatar, AvatarSize } from '../../Avatar.dom.js'; +import { PreferencesContent } from '../../Preferences.dom.js'; import { CHAT_FOLDER_NAME_MAX_CHAR_LENGTH, ChatFolderParamsSchema, isSameChatFolderParams, validateChatFolderParams, -} from '../../../types/ChatFolder.js'; +} from '../../../types/ChatFolder.std.js'; import type { ChatFolderId, ChatFolderParams, -} from '../../../types/ChatFolder.js'; -import type { GetConversationByIdType } from '../../../state/selectors/conversations.js'; -import { strictAssert } from '../../../util/assert.js'; -import { parseStrict } from '../../../util/schemas.js'; -import { BeforeNavigateResponse } from '../../../services/BeforeNavigate.js'; -import { NavTab, SettingsPage } from '../../../types/Nav.js'; -import type { Location } from '../../../types/Nav.js'; -import { useNavBlocker } from '../../../hooks/useNavBlocker.js'; -import { DeleteChatFolderDialog } from './DeleteChatFolderDialog.js'; -import { UserText } from '../../UserText.js'; -import { AxoSwitch } from '../../../axo/AxoSwitch.js'; -import { FunEmojiPickerButton } from '../../fun/FunButton.js'; -import { FunEmojiPicker } from '../../fun/FunEmojiPicker.js'; -import type { FunEmojiSelection } from '../../fun/panels/FunPanelEmojis.js'; -import { getEmojiVariantByKey } from '../../fun/data/emojis.js'; +} from '../../../types/ChatFolder.std.js'; +import type { GetConversationByIdType } from '../../../state/selectors/conversations.dom.js'; +import { strictAssert } from '../../../util/assert.std.js'; +import { parseStrict } from '../../../util/schemas.std.js'; +import { BeforeNavigateResponse } from '../../../services/BeforeNavigate.std.js'; +import { NavTab, SettingsPage } from '../../../types/Nav.std.js'; +import type { Location } from '../../../types/Nav.std.js'; +import { useNavBlocker } from '../../../hooks/useNavBlocker.std.js'; +import { DeleteChatFolderDialog } from './DeleteChatFolderDialog.dom.js'; +import { UserText } from '../../UserText.dom.js'; +import { AxoSwitch } from '../../../axo/AxoSwitch.dom.js'; +import { FunEmojiPickerButton } from '../../fun/FunButton.dom.js'; +import { FunEmojiPicker } from '../../fun/FunEmojiPicker.dom.js'; +import type { FunEmojiSelection } from '../../fun/panels/FunPanelEmojis.dom.js'; +import { getEmojiVariantByKey } from '../../fun/data/emojis.std.js'; import { ItemAvatar, ItemBody, @@ -46,7 +46,7 @@ import { itemClassName, ItemContent, ItemTitle, -} from './PreferencesChatFolderItems.js'; +} from './PreferencesChatFolderItems.dom.js'; export type PreferencesEditChatFolderPageProps = Readonly<{ i18n: LocalizerType; diff --git a/ts/components/preferences/donations/DonateInputAmount.tsx b/ts/components/preferences/donations/DonateInputAmount.tsx index f5443233e7..9c404ffe78 100644 --- a/ts/components/preferences/donations/DonateInputAmount.tsx +++ b/ts/components/preferences/donations/DonateInputAmount.tsx @@ -3,12 +3,12 @@ import type { FormEvent } from 'react'; import React, { memo, useCallback, useEffect, useMemo, useRef } from 'react'; import type { Formatter, FormatterToken } from '@signalapp/minimask'; -import { useInputMask } from '../../../hooks/useInputMask.js'; -import type { CurrencyFormatResult } from '../../../util/currency.js'; +import { useInputMask } from '../../../hooks/useInputMask.dom.js'; +import type { CurrencyFormatResult } from '../../../util/currency.dom.js'; import { getCurrencyFormat, ZERO_DECIMAL_CURRENCIES, -} from '../../../util/currency.js'; +} from '../../../util/currency.dom.js'; export type DonateInputAmountProps = Readonly<{ className: string; diff --git a/ts/components/preferences/donations/DonateInputCardCvc.stories.tsx b/ts/components/preferences/donations/DonateInputCardCvc.stories.tsx index 1a39f093e5..42b046a624 100644 --- a/ts/components/preferences/donations/DonateInputCardCvc.stories.tsx +++ b/ts/components/preferences/donations/DonateInputCardCvc.stories.tsx @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { action } from '@storybook/addon-actions'; import React, { useState } from 'react'; -import { DonateInputCardCvc } from './DonateInputCardCvc.js'; -import type { DonateInputCardCvcProps } from './DonateInputCardCvc.js'; -import type { ComponentMeta } from '../../../storybook/types.js'; +import { DonateInputCardCvc } from './DonateInputCardCvc.dom.js'; +import type { DonateInputCardCvcProps } from './DonateInputCardCvc.dom.js'; +import type { ComponentMeta } from '../../../storybook/types.std.js'; export default { component: DonateInputCardCvc, diff --git a/ts/components/preferences/donations/DonateInputCardCvc.tsx b/ts/components/preferences/donations/DonateInputCardCvc.tsx index cbe9b47ec3..b28caffc17 100644 --- a/ts/components/preferences/donations/DonateInputCardCvc.tsx +++ b/ts/components/preferences/donations/DonateInputCardCvc.tsx @@ -2,10 +2,13 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { FormEvent, KeyboardEvent } from 'react'; import React, { memo, useCallback, useRef } from 'react'; -import { CC_CVC_FORMATTER, useInputMask } from '../../../hooks/useInputMask.js'; -import type { LocalizerType } from '../../../types/I18N.js'; -import { CardCvcError } from '../../../types/DonationsCardForm.js'; -import { missingCaseError } from '../../../util/missingCaseError.js'; +import { + CC_CVC_FORMATTER, + useInputMask, +} from '../../../hooks/useInputMask.dom.js'; +import type { LocalizerType } from '../../../types/I18N.std.js'; +import { CardCvcError } from '../../../types/DonationsCardForm.std.js'; +import { missingCaseError } from '../../../util/missingCaseError.std.js'; export function getCardCvcErrorMessage( i18n: LocalizerType, diff --git a/ts/components/preferences/donations/DonateInputCardExp.stories.tsx b/ts/components/preferences/donations/DonateInputCardExp.stories.tsx index 06d62f3c94..41a8c3ed52 100644 --- a/ts/components/preferences/donations/DonateInputCardExp.stories.tsx +++ b/ts/components/preferences/donations/DonateInputCardExp.stories.tsx @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { action } from '@storybook/addon-actions'; import React, { useState } from 'react'; -import { DonateInputCardExp } from './DonateInputCardExp.js'; -import type { DonateInputCardExpProps } from './DonateInputCardExp.js'; -import type { ComponentMeta } from '../../../storybook/types.js'; +import { DonateInputCardExp } from './DonateInputCardExp.dom.js'; +import type { DonateInputCardExpProps } from './DonateInputCardExp.dom.js'; +import type { ComponentMeta } from '../../../storybook/types.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/preferences/donations/DonateInputCardExp.tsx b/ts/components/preferences/donations/DonateInputCardExp.tsx index dd5cf4c3d8..160a4a86f3 100644 --- a/ts/components/preferences/donations/DonateInputCardExp.tsx +++ b/ts/components/preferences/donations/DonateInputCardExp.tsx @@ -2,10 +2,13 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { FormEvent, KeyboardEvent } from 'react'; import React, { memo, useCallback, useRef } from 'react'; -import { CC_EXP_FORMATTER, useInputMask } from '../../../hooks/useInputMask.js'; -import { CardExpirationError } from '../../../types/DonationsCardForm.js'; -import { missingCaseError } from '../../../util/missingCaseError.js'; -import type { LocalizerType } from '../../../types/I18N.js'; +import { + CC_EXP_FORMATTER, + useInputMask, +} from '../../../hooks/useInputMask.dom.js'; +import { CardExpirationError } from '../../../types/DonationsCardForm.std.js'; +import { missingCaseError } from '../../../util/missingCaseError.std.js'; +import type { LocalizerType } from '../../../types/I18N.std.js'; export function getCardExpirationErrorMessage( i18n: LocalizerType, diff --git a/ts/components/preferences/donations/DonateInputCardNumber.stories.tsx b/ts/components/preferences/donations/DonateInputCardNumber.stories.tsx index 9a120dd552..acdd868069 100644 --- a/ts/components/preferences/donations/DonateInputCardNumber.stories.tsx +++ b/ts/components/preferences/donations/DonateInputCardNumber.stories.tsx @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { action } from '@storybook/addon-actions'; import React, { useState } from 'react'; -import { DonateInputCardNumber } from './DonateInputCardNumber.js'; -import type { DonateInputCardNumberProps } from './DonateInputCardNumber.js'; -import type { ComponentMeta } from '../../../storybook/types.js'; +import { DonateInputCardNumber } from './DonateInputCardNumber.dom.js'; +import type { DonateInputCardNumberProps } from './DonateInputCardNumber.dom.js'; +import type { ComponentMeta } from '../../../storybook/types.std.js'; export default { component: DonateInputCardNumber, diff --git a/ts/components/preferences/donations/DonateInputCardNumber.tsx b/ts/components/preferences/donations/DonateInputCardNumber.tsx index 42450aa03b..553b7affec 100644 --- a/ts/components/preferences/donations/DonateInputCardNumber.tsx +++ b/ts/components/preferences/donations/DonateInputCardNumber.tsx @@ -5,10 +5,10 @@ import React, { memo, useCallback, useRef } from 'react'; import { CC_NUMBER_FORMATTER, useInputMask, -} from '../../../hooks/useInputMask.js'; -import type { LocalizerType } from '../../../types/I18N.js'; -import { CardNumberError } from '../../../types/DonationsCardForm.js'; -import { missingCaseError } from '../../../util/missingCaseError.js'; +} from '../../../hooks/useInputMask.dom.js'; +import type { LocalizerType } from '../../../types/I18N.std.js'; +import { CardNumberError } from '../../../types/DonationsCardForm.std.js'; +import { missingCaseError } from '../../../util/missingCaseError.std.js'; export function getCardNumberErrorMessage( i18n: LocalizerType, diff --git a/ts/components/stickers/StickerManager.stories.tsx b/ts/components/stickers/StickerManager.stories.tsx index e55ef18ee4..303ff55119 100644 --- a/ts/components/stickers/StickerManager.stories.tsx +++ b/ts/components/stickers/StickerManager.stories.tsx @@ -4,9 +4,9 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './StickerManager.js'; -import { StickerManager } from './StickerManager.js'; -import { createPack, sticker1, sticker2 } from './mocks.js'; +import type { Props } from './StickerManager.dom.js'; +import { StickerManager } from './StickerManager.dom.js'; +import { createPack, sticker1, sticker2 } from './mocks.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/stickers/StickerManager.tsx b/ts/components/stickers/StickerManager.tsx index a787418af9..4ee7a98650 100644 --- a/ts/components/stickers/StickerManager.tsx +++ b/ts/components/stickers/StickerManager.tsx @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import * as React from 'react'; -import { StickerManagerPackRow } from './StickerManagerPackRow.js'; -import { StickerPreviewModal } from './StickerPreviewModal.js'; -import type { LocalizerType } from '../../types/Util.js'; -import type { StickerPackType } from '../../state/ducks/stickers.js'; -import { Tabs } from '../Tabs.js'; +import { StickerManagerPackRow } from './StickerManagerPackRow.dom.js'; +import { StickerPreviewModal } from './StickerPreviewModal.dom.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import type { StickerPackType } from '../../state/ducks/stickers.preload.js'; +import { Tabs } from '../Tabs.dom.js'; export type OwnProps = { readonly blessedPacks: ReadonlyArray; diff --git a/ts/components/stickers/StickerManagerPackRow.tsx b/ts/components/stickers/StickerManagerPackRow.tsx index 6df1340dbb..d17cb5c23f 100644 --- a/ts/components/stickers/StickerManagerPackRow.tsx +++ b/ts/components/stickers/StickerManagerPackRow.tsx @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import * as React from 'react'; -import { ConfirmationDialog } from '../ConfirmationDialog.js'; -import type { LocalizerType } from '../../types/Util.js'; -import type { StickerPackType } from '../../state/ducks/stickers.js'; -import { Button, ButtonVariant } from '../Button.js'; -import { UserText } from '../UserText.js'; +import { ConfirmationDialog } from '../ConfirmationDialog.dom.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import type { StickerPackType } from '../../state/ducks/stickers.preload.js'; +import { Button, ButtonVariant } from '../Button.dom.js'; +import { UserText } from '../UserText.dom.js'; export type OwnProps = { readonly i18n: LocalizerType; diff --git a/ts/components/stickers/StickerPackInstallButton.tsx b/ts/components/stickers/StickerPackInstallButton.tsx index 5cc0a4d49e..5e7b709821 100644 --- a/ts/components/stickers/StickerPackInstallButton.tsx +++ b/ts/components/stickers/StickerPackInstallButton.tsx @@ -4,7 +4,7 @@ import type { ButtonHTMLAttributes } from 'react'; import * as React from 'react'; import classNames from 'classnames'; -import type { LocalizerType } from '../../types/Util.js'; +import type { LocalizerType } from '../../types/Util.std.js'; export type OwnProps = { readonly installed: boolean; diff --git a/ts/components/stickers/StickerPreviewModal.stories.tsx b/ts/components/stickers/StickerPreviewModal.stories.tsx index a13743ca1f..90391f31a6 100644 --- a/ts/components/stickers/StickerPreviewModal.stories.tsx +++ b/ts/components/stickers/StickerPreviewModal.stories.tsx @@ -4,13 +4,13 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; import type { Meta } from '@storybook/react'; -import type { Props } from './StickerPreviewModal.js'; -import { StickerPreviewModal } from './StickerPreviewModal.js'; +import type { Props } from './StickerPreviewModal.dom.js'; +import { StickerPreviewModal } from './StickerPreviewModal.dom.js'; import { landscapeGreenUrl, portraitTealUrl, squareStickerUrl, -} from '../../storybook/Fixtures.js'; +} from '../../storybook/Fixtures.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/components/stickers/StickerPreviewModal.tsx b/ts/components/stickers/StickerPreviewModal.tsx index 42ff5ec27e..003f5253a3 100644 --- a/ts/components/stickers/StickerPreviewModal.tsx +++ b/ts/components/stickers/StickerPreviewModal.tsx @@ -4,14 +4,14 @@ import * as React from 'react'; import lodash from 'lodash'; import classNames from 'classnames'; -import { ConfirmationDialog } from '../ConfirmationDialog.js'; -import type { LocalizerType } from '../../types/Util.js'; -import type { StickerPackType } from '../../state/ducks/stickers.js'; -import { Spinner } from '../Spinner.js'; -import { useRestoreFocus } from '../../hooks/useRestoreFocus.js'; -import { Modal } from '../Modal.js'; -import { Button, ButtonVariant } from '../Button.js'; -import { UserText } from '../UserText.js'; +import { ConfirmationDialog } from '../ConfirmationDialog.dom.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import type { StickerPackType } from '../../state/ducks/stickers.preload.js'; +import { Spinner } from '../Spinner.dom.js'; +import { useRestoreFocus } from '../../hooks/useRestoreFocus.dom.js'; +import { Modal } from '../Modal.dom.js'; +import { Button, ButtonVariant } from '../Button.dom.js'; +import { UserText } from '../UserText.dom.js'; const { isNumber, range } = lodash; diff --git a/ts/components/stickers/mocks.ts b/ts/components/stickers/mocks.ts index 771d58d538..9e538744a0 100644 --- a/ts/components/stickers/mocks.ts +++ b/ts/components/stickers/mocks.ts @@ -5,7 +5,7 @@ import lodash from 'lodash'; import type { StickerPackType, StickerType, -} from '../../state/ducks/stickers.js'; +} from '../../state/ducks/stickers.preload.js'; const { sample } = lodash; diff --git a/ts/context/Crypto.ts b/ts/context/Crypto.ts index 561df42f21..2fda16af75 100644 --- a/ts/context/Crypto.ts +++ b/ts/context/Crypto.ts @@ -5,9 +5,9 @@ import { Buffer } from 'node:buffer'; import type { Decipher } from 'node:crypto'; import crypto from 'node:crypto'; -import { strictAssert } from '../util/assert.js'; -import type { HashType } from '../types/Crypto.js'; -import { CipherType } from '../types/Crypto.js'; +import { strictAssert } from '../util/assert.std.js'; +import type { HashType } from '../types/Crypto.std.js'; +import { CipherType } from '../types/Crypto.std.js'; const AUTH_TAG_SIZE = 16; diff --git a/ts/context/activeWindowService.ts b/ts/context/activeWindowService.ts index b145eaa122..e788ade216 100644 --- a/ts/context/activeWindowService.ts +++ b/ts/context/activeWindowService.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { ipcRenderer } from 'electron'; -import { getActiveWindowService } from '../services/ActiveWindowService.js'; +import { getActiveWindowService } from '../services/ActiveWindowService.std.js'; const activeWindowService = getActiveWindowService( window.document, diff --git a/ts/context/config.ts b/ts/context/config.ts index 90aa1eac78..90a37f18bb 100644 --- a/ts/context/config.ts +++ b/ts/context/config.ts @@ -3,7 +3,7 @@ import { ipcRenderer } from 'electron'; -import type { RendererConfigType } from '../types/RendererConfig.js'; +import type { RendererConfigType } from '../types/RendererConfig.std.js'; const config: RendererConfigType = ipcRenderer.sendSync('get-config'); diff --git a/ts/context/createNativeThemeListener.ts b/ts/context/createNativeThemeListener.ts index 8a0c502d42..f24f9f9d45 100644 --- a/ts/context/createNativeThemeListener.ts +++ b/ts/context/createNativeThemeListener.ts @@ -3,7 +3,7 @@ /* eslint-disable no-restricted-syntax */ import type { NativeThemeState } from '../types/NativeThemeNotifier.d.ts'; -import { SystemThemeType } from '../types/Util.js'; +import { SystemThemeType } from '../types/Util.std.js'; export type Callback = (change: NativeThemeState) => void; diff --git a/ts/context/environment.ts b/ts/context/environment.ts index 93e0c87ee5..d67632fc4e 100644 --- a/ts/context/environment.ts +++ b/ts/context/environment.ts @@ -1,12 +1,12 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { config } from './config.js'; +import { config } from './config.preload.js'; import { getEnvironment, parseEnvironment, setEnvironment, -} from '../environment.js'; +} from '../environment.std.js'; setEnvironment( parseEnvironment(config.environment), diff --git a/ts/context/i18n.ts b/ts/context/i18n.ts index b62e33ea7a..6d50f19ef6 100644 --- a/ts/context/i18n.ts +++ b/ts/context/i18n.ts @@ -1,10 +1,10 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { config } from './config.js'; -import { localeMessages } from './localeMessages.js'; -import { setupI18n } from '../util/setupI18n.js'; -import { strictAssert } from '../util/assert.js'; +import { config } from './config.preload.js'; +import { localeMessages } from './localeMessages.preload.js'; +import { setupI18n } from '../util/setupI18n.dom.js'; +import { strictAssert } from '../util/assert.std.js'; const { resolvedTranslationsLocale } = config; strictAssert( diff --git a/ts/context/waitForSettingsChange.ts b/ts/context/waitForSettingsChange.ts index 2f1429ef15..313596ef0a 100644 --- a/ts/context/waitForSettingsChange.ts +++ b/ts/context/waitForSettingsChange.ts @@ -3,7 +3,7 @@ import { ipcRenderer as ipc } from 'electron'; -import { explodePromise } from '../util/explodePromise.js'; +import { explodePromise } from '../util/explodePromise.std.js'; let preferencesChangeResolvers = new Array<() => void>(); diff --git a/ts/conversations/isConversationTooBigToRing.ts b/ts/conversations/isConversationTooBigToRing.ts index af28266736..b941880d8c 100644 --- a/ts/conversations/isConversationTooBigToRing.ts +++ b/ts/conversations/isConversationTooBigToRing.ts @@ -1,9 +1,9 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { parseIntWithFallback } from '../util/parseIntWithFallback.js'; -import { getValue } from '../RemoteConfig.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; +import { parseIntWithFallback } from '../util/parseIntWithFallback.std.js'; +import { getValue } from '../RemoteConfig.dom.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; const getMaxGroupCallRingSize = (): number => parseIntWithFallback(getValue('global.calling.maxGroupCallRingSize'), 16); diff --git a/ts/environment.ts b/ts/environment.ts index 7b7be18296..927621abc9 100644 --- a/ts/environment.ts +++ b/ts/environment.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { makeEnumParser } from './util/enum.js'; -import { log } from './logging/log.js'; +import { makeEnumParser } from './util/enum.std.js'; +import { log } from './logging/log.std.js'; // Many places rely on this enum being a string. export enum Environment { diff --git a/ts/groupChange.ts b/ts/groupChange.ts index 91132ffe68..e9f2ad2efe 100644 --- a/ts/groupChange.ts +++ b/ts/groupChange.ts @@ -6,20 +6,20 @@ import type { LocalizerType, ICUStringMessageParamsByKeyType, ICUJSXMessageParamsByKeyType, -} from './types/Util.js'; +} from './types/Util.std.js'; import type { ServiceIdString, AciString, PniString, -} from './types/ServiceId.js'; -import { missingCaseError } from './util/missingCaseError.js'; +} from './types/ServiceId.std.js'; +import { missingCaseError } from './util/missingCaseError.std.js'; import type { GroupV2ChangeDetailType, GroupV2ChangeType, -} from './types/groups.ts'; -import { SignalService as Proto } from './protobuf/index.js'; -import { createLogger } from './logging/log.js'; +} from './types/groups.std.js'; +import { SignalService as Proto } from './protobuf/index.std.js'; +import { createLogger } from './logging/log.std.js'; const log = createLogger('groupChange'); diff --git a/ts/groups.ts b/ts/groups.ts index 41f8288db5..4b68e7002d 100644 --- a/ts/groups.ts +++ b/ts/groups.ts @@ -5,23 +5,30 @@ import lodash from 'lodash'; import Long from 'long'; import type { ClientZkGroupCipher } from '@signalapp/libsignal-client/zkgroup.js'; import { LRUCache } from 'lru-cache'; -import { createLogger } from './logging/log.js'; +import { createLogger } from './logging/log.std.js'; import { getCheckedGroupCredentialsForToday, maybeFetchNewCredentials, -} from './services/groupCredentialFetcher.js'; -import { DataReader, DataWriter } from './sql/Client.js'; -import { toWebSafeBase64, fromWebSafeBase64 } from './util/webSafeBase64.js'; -import { assertDev, strictAssert } from './util/assert.js'; -import { isMoreRecentThan } from './util/timestamp.js'; -import { MINUTE, DurationInSeconds, SECOND } from './util/durations/index.js'; -import { drop } from './util/drop.js'; -import { dropNull } from './util/dropNull.js'; +} from './services/groupCredentialFetcher.preload.js'; +import { DataReader, DataWriter } from './sql/Client.preload.js'; +import { + toWebSafeBase64, + fromWebSafeBase64, +} from './util/webSafeBase64.std.js'; +import { assertDev, strictAssert } from './util/assert.std.js'; +import { isMoreRecentThan } from './util/timestamp.std.js'; +import { + MINUTE, + DurationInSeconds, + SECOND, +} from './util/durations/index.std.js'; +import { drop } from './util/drop.std.js'; +import { dropNull } from './util/dropNull.std.js'; import { writeNewAttachmentData, readAttachmentData, deleteAttachmentData, -} from './util/migrations.js'; +} from './util/migrations.preload.js'; import type { ConversationAttributesType, GroupV2MemberType, @@ -48,16 +55,16 @@ import { getClientZkGroupCipher, getClientZkProfileOperations, verifyNotarySignature, -} from './util/zkgroup.js'; +} from './util/zkgroup.node.js'; import { computeHash, deriveMasterKeyFromGroupV1, getRandomBytes, -} from './Crypto.js'; +} from './Crypto.node.js'; import type { GroupCredentialsType, GroupLogResponseType, -} from './textsecure/WebAPI.js'; +} from './textsecure/WebAPI.preload.js'; import { createGroup, getGroup, @@ -67,59 +74,59 @@ import { getExternalGroupCredential, modifyGroup, uploadGroupAvatar, -} from './textsecure/WebAPI.js'; -import { HTTPError } from './types/HTTPError.js'; -import { CURRENT_SCHEMA_VERSION as MAX_MESSAGE_SCHEMA } from './types/Message2.js'; -import type { ConversationModel } from './models/conversations.js'; -import { getGroupSizeHardLimit } from './groups/limits.js'; +} from './textsecure/WebAPI.preload.js'; +import { HTTPError } from './types/HTTPError.std.js'; +import { CURRENT_SCHEMA_VERSION as MAX_MESSAGE_SCHEMA } from './types/Message2.preload.js'; +import type { ConversationModel } from './models/conversations.preload.js'; +import { getGroupSizeHardLimit } from './groups/limits.dom.js'; import { isGroupV1 as getIsGroupV1, isGroupV2 as getIsGroupV2, isGroupV2, isMe, -} from './util/whatTypeOfConversation.js'; -import * as Bytes from './Bytes.js'; -import type { AvatarDataType } from './types/Avatar.js'; -import type { GroupV2ChangeDetailType } from './types/groups.ts'; +} from './util/whatTypeOfConversation.dom.js'; +import * as Bytes from './Bytes.std.js'; +import type { AvatarDataType } from './types/Avatar.std.js'; +import type { GroupV2ChangeDetailType } from './types/groups.std.js'; import type { ServiceIdString, AciString, PniString, -} from './types/ServiceId.js'; +} from './types/ServiceId.std.js'; import { ServiceIdKind, isPniString, isServiceIdString, -} from './types/ServiceId.js'; -import { isAciString } from './util/isAciString.js'; -import * as Errors from './types/errors.js'; -import { SignalService as Proto } from './protobuf/index.js'; -import { isNotNil } from './util/isNotNil.js'; -import { isAccessControlEnabled } from './groups/util.js'; +} from './types/ServiceId.std.js'; +import { isAciString } from './util/isAciString.std.js'; +import * as Errors from './types/errors.std.js'; +import { SignalService as Proto } from './protobuf/index.std.js'; +import { isNotNil } from './util/isNotNil.std.js'; +import { isAccessControlEnabled } from './groups/util.std.js'; import { conversationJobQueue, conversationQueueJobEnum, -} from './jobs/conversationJobQueue.js'; -import { ReadStatus } from './messages/MessageReadStatus.js'; -import { SeenStatus } from './MessageSeenStatus.js'; -import { incrementMessageCounter } from './util/incrementMessageCounter.js'; -import { sleep } from './util/sleep.js'; -import { groupInvitesRoute } from './util/signalRoutes.js'; +} from './jobs/conversationJobQueue.preload.js'; +import { ReadStatus } from './messages/MessageReadStatus.std.js'; +import { SeenStatus } from './MessageSeenStatus.std.js'; +import { incrementMessageCounter } from './util/incrementMessageCounter.preload.js'; +import { sleep } from './util/sleep.std.js'; +import { groupInvitesRoute } from './util/signalRoutes.std.js'; import { decodeGroupSendEndorsementResponse, validateGroupSendEndorsementsExpiration, -} from './util/groupSendEndorsements.js'; -import { getProfile } from './util/getProfile.js'; -import { generateMessageId } from './util/generateMessageId.js'; -import { postSaveUpdates } from './util/cleanup.js'; -import { MessageModel } from './models/messages.js'; -import { areWePending } from './util/groupMembershipUtils.js'; +} from './util/groupSendEndorsements.preload.js'; +import { getProfile } from './util/getProfile.preload.js'; +import { generateMessageId } from './util/generateMessageId.node.js'; +import { postSaveUpdates } from './util/cleanup.preload.js'; +import { MessageModel } from './models/messages.preload.js'; +import { areWePending } from './util/groupMembershipUtils.preload.js'; import { isConversationAccepted, isTrustedContact, -} from './util/isConversationAccepted.js'; -import { itemStorage } from './textsecure/Storage.js'; +} from './util/isConversationAccepted.preload.js'; +import { itemStorage } from './textsecure/Storage.preload.js'; const { compact, difference, flatten, fromPairs, isNumber, omit, values } = lodash; @@ -128,7 +135,7 @@ const log = createLogger('groups'); type AccessRequiredEnum = Proto.AccessControl.AccessRequired; -export { joinViaLink } from './groups/joinViaLink.js'; +export { joinViaLink } from './groups/joinViaLink.preload.js'; export type GroupFields = { readonly id: Uint8Array; diff --git a/ts/groups/joinViaLink.ts b/ts/groups/joinViaLink.ts index c55dbf8056..870eb6696f 100644 --- a/ts/groups/joinViaLink.ts +++ b/ts/groups/joinViaLink.ts @@ -4,17 +4,17 @@ import { createRoot, type Root } from 'react-dom/client'; import type { ConversationAttributesType } from '../model-types.d.ts'; -import type { ConversationModel } from '../models/conversations.js'; -import type { PreJoinConversationType } from '../state/ducks/conversations.js'; +import type { ConversationModel } from '../models/conversations.preload.js'; +import type { PreJoinConversationType } from '../state/ducks/conversations.preload.js'; -import { DataWriter } from '../sql/Client.js'; -import * as Bytes from '../Bytes.js'; -import * as Errors from '../types/errors.js'; -import { createLogger } from '../logging/log.js'; -import { HTTPError } from '../types/HTTPError.js'; -import { SignalService as Proto } from '../protobuf/index.js'; -import type { ContactAvatarType } from '../types/Avatar.js'; -import { ToastType } from '../types/Toast.js'; +import { DataWriter } from '../sql/Client.preload.js'; +import * as Bytes from '../Bytes.std.js'; +import * as Errors from '../types/errors.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { HTTPError } from '../types/HTTPError.std.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; +import type { ContactAvatarType } from '../types/Avatar.std.js'; +import { ToastType } from '../types/Toast.dom.js'; import { applyNewAvatar, decryptGroupDescription, @@ -24,19 +24,19 @@ import { idForLogging, LINK_VERSION_ERROR, parseGroupLink, -} from '../groups.js'; -import { createGroupV2JoinModal } from '../state/roots/createGroupV2JoinModal.js'; -import { explodePromise } from '../util/explodePromise.js'; -import { deleteAttachmentData } from '../util/migrations.js'; -import { isAccessControlEnabled } from './util.js'; -import { isGroupV1 } from '../util/whatTypeOfConversation.js'; -import { longRunningTaskWrapper } from '../util/longRunningTaskWrapper.js'; -import { sleep } from '../util/sleep.js'; -import { dropNull } from '../util/dropNull.js'; -import { getLocalAttachmentUrl } from '../util/getLocalAttachmentUrl.js'; -import { type Loadable, LoadingState } from '../util/loadable.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from '../groups.preload.js'; +import { createGroupV2JoinModal } from '../state/roots/createGroupV2JoinModal.dom.js'; +import { explodePromise } from '../util/explodePromise.std.js'; +import { deleteAttachmentData } from '../util/migrations.preload.js'; +import { isAccessControlEnabled } from './util.std.js'; +import { isGroupV1 } from '../util/whatTypeOfConversation.dom.js'; +import { longRunningTaskWrapper } from '../util/longRunningTaskWrapper.dom.js'; +import { sleep } from '../util/sleep.std.js'; +import { dropNull } from '../util/dropNull.std.js'; +import { getLocalAttachmentUrl } from '../util/getLocalAttachmentUrl.std.js'; +import { type Loadable, LoadingState } from '../util/loadable.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const log = createLogger('joinViaLink'); const { i18n } = window.SignalContext; diff --git a/ts/groups/limits.ts b/ts/groups/limits.ts index d982a80eab..cbdb4a6720 100644 --- a/ts/groups/limits.ts +++ b/ts/groups/limits.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import lodash from 'lodash'; -import { parseIntOrThrow } from '../util/parseIntOrThrow.js'; -import type { ConfigKeyType } from '../RemoteConfig.js'; -import { getValue } from '../RemoteConfig.js'; +import { parseIntOrThrow } from '../util/parseIntOrThrow.std.js'; +import type { ConfigKeyType } from '../RemoteConfig.dom.js'; +import { getValue } from '../RemoteConfig.dom.js'; const { isNumber } = lodash; diff --git a/ts/groups/util.ts b/ts/groups/util.ts index 58c053f545..dd923f4d0a 100644 --- a/ts/groups/util.ts +++ b/ts/groups/util.ts @@ -1,7 +1,7 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { SignalService as Proto } from '../protobuf/index.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; const ACCESS_ENUM = Proto.AccessControl.AccessRequired; diff --git a/ts/hooks/useActivateSpeakerViewOnPresenting.ts b/ts/hooks/useActivateSpeakerViewOnPresenting.ts index fb750499a7..378310a5fc 100644 --- a/ts/hooks/useActivateSpeakerViewOnPresenting.ts +++ b/ts/hooks/useActivateSpeakerViewOnPresenting.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import { useEffect, useMemo } from 'react'; -import type { AciString } from '../types/ServiceId.js'; -import { usePrevious } from './usePrevious.js'; +import type { AciString } from '../types/ServiceId.std.js'; +import { usePrevious } from './usePrevious.std.js'; type RemoteParticipant = { hasRemoteVideo: boolean; diff --git a/ts/hooks/useAnimated.tsx b/ts/hooks/useAnimated.tsx index 69ba0c9a4d..dd0c87ba15 100644 --- a/ts/hooks/useAnimated.tsx +++ b/ts/hooks/useAnimated.tsx @@ -4,7 +4,7 @@ import { useState, useCallback } from 'react'; import type { SpringValues } from '@react-spring/web'; import { useChain, useSpring, useSpringRef } from '@react-spring/web'; -import { useReducedMotion } from './useReducedMotion.js'; +import { useReducedMotion } from './useReducedMotion.dom.js'; export type ModalConfigType = { opacity: number; diff --git a/ts/hooks/useAttachmentStatus.ts b/ts/hooks/useAttachmentStatus.ts index be8face9d1..b18dd8e996 100644 --- a/ts/hooks/useAttachmentStatus.ts +++ b/ts/hooks/useAttachmentStatus.ts @@ -1,12 +1,12 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AttachmentForUIType } from '../types/Attachment.js'; -import { getUrl } from '../util/Attachment.js'; -import { MediaTier } from '../types/AttachmentDownload.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { getAttachmentCiphertextSize } from '../util/AttachmentCrypto.js'; -import { useDelayedValue } from './useDelayedValue.js'; +import type { AttachmentForUIType } from '../types/Attachment.std.js'; +import { getUrl } from '../util/Attachment.std.js'; +import { MediaTier } from '../types/AttachmentDownload.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { getAttachmentCiphertextSize } from '../util/AttachmentCrypto.std.js'; +import { useDelayedValue } from './useDelayedValue.std.js'; const TRANSITION_DELAY = 200; diff --git a/ts/hooks/useComputePeaks.ts b/ts/hooks/useComputePeaks.ts index 8fab407843..e7a3a65e71 100644 --- a/ts/hooks/useComputePeaks.ts +++ b/ts/hooks/useComputePeaks.ts @@ -3,8 +3,8 @@ import lodash from 'lodash'; import { useEffect, useState } from 'react'; -import { computePeaks } from '../components/VoiceNotesPlaybackContext.js'; -import { createLogger } from '../logging/log.js'; +import { computePeaks } from '../components/VoiceNotesPlaybackContext.dom.js'; +import { createLogger } from '../logging/log.std.js'; const { noop } = lodash; diff --git a/ts/hooks/useConfirmDiscard.tsx b/ts/hooks/useConfirmDiscard.tsx index 3de83f3791..e579917aa9 100644 --- a/ts/hooks/useConfirmDiscard.tsx +++ b/ts/hooks/useConfirmDiscard.tsx @@ -3,18 +3,18 @@ import React, { useEffect, useRef, useState } from 'react'; -import { ConfirmDiscardDialog } from '../components/ConfirmDiscardDialog.js'; +import { ConfirmDiscardDialog } from '../components/ConfirmDiscardDialog.dom.js'; import { BeforeNavigateResponse, beforeNavigateService, -} from '../services/BeforeNavigate.js'; +} from '../services/BeforeNavigate.std.js'; import { explodePromise, type ExplodePromiseResultType, -} from '../util/explodePromise.js'; +} from '../util/explodePromise.std.js'; -import type { ConfirmDialogProps } from '../components/ConfirmDiscardDialog.js'; -import type { LocalizerType } from '../types/Util.js'; +import type { ConfirmDialogProps } from '../components/ConfirmDiscardDialog.dom.js'; +import type { LocalizerType } from '../types/Util.std.js'; export function useConfirmDiscard({ i18n, diff --git a/ts/hooks/useInputMask.tsx b/ts/hooks/useInputMask.tsx index d462ca3061..d32477b3c4 100644 --- a/ts/hooks/useInputMask.tsx +++ b/ts/hooks/useInputMask.tsx @@ -9,7 +9,7 @@ import type { FormatterToken, Formatter } from '@signalapp/minimask'; import type { RefObject } from 'react'; import { useEffect } from 'react'; import creditCardType from 'credit-card-type'; -import { strictAssert } from '../util/assert.js'; +import { strictAssert } from '../util/assert.std.js'; export function useInputMask( inputRef: RefObject, diff --git a/ts/hooks/useIntersectionObserver.ts b/ts/hooks/useIntersectionObserver.ts index 364c2d05fe..121c1f411b 100644 --- a/ts/hooks/useIntersectionObserver.ts +++ b/ts/hooks/useIntersectionObserver.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { useCallback, useRef, useState } from 'react'; -import { createLogger } from '../logging/log.js'; +import { createLogger } from '../logging/log.std.js'; const log = createLogger('useIntersectionObserver'); diff --git a/ts/hooks/useKeyboardShortcuts.tsx b/ts/hooks/useKeyboardShortcuts.tsx index ed47d9d658..55f177e59e 100644 --- a/ts/hooks/useKeyboardShortcuts.tsx +++ b/ts/hooks/useKeyboardShortcuts.tsx @@ -4,11 +4,11 @@ import { useCallback, useEffect } from 'react'; import lodash from 'lodash'; import { useSelector } from 'react-redux'; -import * as KeyboardLayout from '../services/keyboardLayout.js'; -import { getHasPanelOpen } from '../state/selectors/conversations.js'; -import { isInFullScreenCall } from '../state/selectors/calling.js'; -import { isShowingAnyModal } from '../state/selectors/globalModals.js'; -import type { ContextMenuTriggerType } from '../components/conversation/MessageContextMenu.js'; +import * as KeyboardLayout from '../services/keyboardLayout.dom.js'; +import { getHasPanelOpen } from '../state/selectors/conversations.dom.js'; +import { isInFullScreenCall } from '../state/selectors/calling.std.js'; +import { isShowingAnyModal } from '../state/selectors/globalModals.std.js'; +import type { ContextMenuTriggerType } from '../components/conversation/MessageContextMenu.dom.js'; const { get } = lodash; diff --git a/ts/hooks/useMinimalConversation.ts b/ts/hooks/useMinimalConversation.ts index 89adc3ac48..80150dc880 100644 --- a/ts/hooks/useMinimalConversation.ts +++ b/ts/hooks/useMinimalConversation.ts @@ -1,7 +1,7 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import { useMemo } from 'react'; -import type { ConversationType } from '../state/ducks/conversations.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; type Primitive = undefined | null | boolean | number | bigint | string; type PrimitiveObject = Record; diff --git a/ts/hooks/useNavBlocker.ts b/ts/hooks/useNavBlocker.ts index 9700a1792a..65920070ac 100644 --- a/ts/hooks/useNavBlocker.ts +++ b/ts/hooks/useNavBlocker.ts @@ -5,11 +5,11 @@ import { useEffect, useRef, useState } from 'react'; import { beforeNavigateService, BeforeNavigateResponse, -} from '../services/BeforeNavigate.js'; +} from '../services/BeforeNavigate.std.js'; import type { BeforeNavigateCallback, BeforeNavigateTransitionDetails, -} from '../services/BeforeNavigate.js'; +} from '../services/BeforeNavigate.std.js'; type NavBlockerBlocked = Readonly<{ state: 'blocked'; diff --git a/ts/hooks/useNowThatUpdatesEveryMinute.ts b/ts/hooks/useNowThatUpdatesEveryMinute.ts index 8fcbd2b88e..45f6547e3f 100644 --- a/ts/hooks/useNowThatUpdatesEveryMinute.ts +++ b/ts/hooks/useNowThatUpdatesEveryMinute.ts @@ -3,7 +3,7 @@ import { useEffect, useState } from 'react'; -import { MINUTE } from '../util/durations/index.js'; +import { MINUTE } from '../util/durations/index.std.js'; const listeners = new Set<() => void>(); diff --git a/ts/hooks/useProxySelector.ts b/ts/hooks/useProxySelector.ts index f0960def1a..9b8353fd61 100644 --- a/ts/hooks/useProxySelector.ts +++ b/ts/hooks/useProxySelector.ts @@ -5,7 +5,7 @@ import { useCallback, useMemo } from 'react'; import { useSelector } from 'react-redux'; import { memoize } from '@indutny/sneequals'; -import type { StateType } from '../state/reducer.js'; +import type { StateType } from '../state/reducer.preload.js'; export function useProxySelector, Result>( selector: (state: StateType, ...params: Params) => Result, diff --git a/ts/hooks/useRefMerger.ts b/ts/hooks/useRefMerger.ts index 3da301fbb1..7d115b7c58 100644 --- a/ts/hooks/useRefMerger.ts +++ b/ts/hooks/useRefMerger.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { useMemo } from 'react'; -import { createRefMerger } from '../util/refMerger.js'; +import { createRefMerger } from '../util/refMerger.std.js'; export const useRefMerger = (): ReturnType => useMemo(createRefMerger, []); diff --git a/ts/hooks/useRetryStorySend.tsx b/ts/hooks/useRetryStorySend.tsx index a5d3949e29..4d30f0a4a3 100644 --- a/ts/hooks/useRetryStorySend.tsx +++ b/ts/hooks/useRetryStorySend.tsx @@ -3,10 +3,10 @@ import React, { useState, useEffect } from 'react'; -import type { LocalizerType } from '../types/Util.js'; -import { Alert } from '../components/Alert.js'; -import { ResolvedSendStatus } from '../types/Stories.js'; -import { usePrevious } from './usePrevious.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { Alert } from '../components/Alert.dom.js'; +import { ResolvedSendStatus } from '../types/Stories.std.js'; +import { usePrevious } from './usePrevious.std.js'; export function useRetryStorySend( i18n: LocalizerType, diff --git a/ts/hooks/useScrollLock.tsx b/ts/hooks/useScrollLock.tsx index 09e41b47b1..5067c97d7b 100644 --- a/ts/hooks/useScrollLock.tsx +++ b/ts/hooks/useScrollLock.tsx @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { useContext, createContext, useEffect, useRef } from 'react'; -import { createLogger } from '../logging/log.js'; +import { createLogger } from '../logging/log.std.js'; const log = createLogger('useScrollLock'); diff --git a/ts/hooks/useSizeObserver.tsx b/ts/hooks/useSizeObserver.tsx index 8aff5105db..606c145282 100644 --- a/ts/hooks/useSizeObserver.tsx +++ b/ts/hooks/useSizeObserver.tsx @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { RefObject } from 'react'; import { useCallback, useEffect, useRef, useState } from 'react'; -import { strictAssert } from '../util/assert.js'; +import { strictAssert } from '../util/assert.std.js'; export type Size = Readonly<{ width: number; diff --git a/ts/hooks/useTabs.tsx b/ts/hooks/useTabs.tsx index ae9d57928d..8fcf3211a4 100644 --- a/ts/hooks/useTabs.tsx +++ b/ts/hooks/useTabs.tsx @@ -4,8 +4,8 @@ import type { KeyboardEvent } from 'react'; import React, { useState } from 'react'; import classNames from 'classnames'; -import { assertDev } from '../util/assert.js'; -import { getClassNamesFor } from '../util/getClassNamesFor.js'; +import { assertDev } from '../util/assert.std.js'; +import { getClassNamesFor } from '../util/getClassNamesFor.std.js'; type Tab = { id: string; diff --git a/ts/hooks/useTheme.ts b/ts/hooks/useTheme.ts index f1b1708f97..5548c7cdf8 100644 --- a/ts/hooks/useTheme.ts +++ b/ts/hooks/useTheme.ts @@ -3,7 +3,7 @@ import { useState, useEffect } from 'react'; -import { ThemeType } from '../types/Util.js'; +import { ThemeType } from '../types/Util.std.js'; // Note that this hook is used in non-main windows (e.g. "About" and // "Debug Log" windows), and thus can't access redux state. diff --git a/ts/indexeddb.ts b/ts/indexeddb.ts index 767096227e..e61a3a73c7 100644 --- a/ts/indexeddb.ts +++ b/ts/indexeddb.ts @@ -1,7 +1,7 @@ // Copyright 2018 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from './logging/log.js'; +import { createLogger } from './logging/log.std.js'; const log = createLogger('indexeddb'); diff --git a/ts/jobs/AttachmentBackupManager.ts b/ts/jobs/AttachmentBackupManager.ts index e2f6776f2f..66dc41a69a 100644 --- a/ts/jobs/AttachmentBackupManager.ts +++ b/ts/jobs/AttachmentBackupManager.ts @@ -5,68 +5,66 @@ import { existsSync } from 'node:fs'; import { PassThrough } from 'node:stream'; -import * as durations from '../util/durations/index.js'; -import { createLogger } from '../logging/log.js'; -import { DataWriter } from '../sql/Client.js'; +import * as durations from '../util/durations/index.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { DataWriter } from '../sql/Client.preload.js'; -import * as Errors from '../types/errors.js'; -import { redactGenericText } from '../util/privacy.js'; +import * as Errors from '../types/errors.std.js'; +import { redactGenericText } from '../util/privacy.node.js'; import { JobManager, type JobManagerParamsType, type JobManagerJobResultType, -} from './JobManager.js'; -import { strictAssert } from '../util/assert.js'; -import { getAbsoluteAttachmentPath as doGetAbsoluteAttachmentPath } from '../util/migrations.js'; +} from './JobManager.std.js'; +import { strictAssert } from '../util/assert.std.js'; +import { getAbsoluteAttachmentPath as doGetAbsoluteAttachmentPath } from '../util/migrations.preload.js'; import { type BackupsService, backupsService, -} from '../services/backups/index.js'; +} from '../services/backups/index.preload.js'; import { type EncryptedAttachmentV2, decryptAttachmentV2ToSink, -} from '../AttachmentCrypto.js'; +} from '../AttachmentCrypto.node.js'; import { getBackupMediaRootKey, deriveBackupMediaKeyMaterial, deriveBackupThumbnailTransitKeyMaterial, -} from '../services/backups/crypto.js'; +} from '../services/backups/crypto.preload.js'; import { type AttachmentBackupJobType, type CoreAttachmentBackupJobType, type StandardAttachmentBackupJobType, type ThumbnailAttachmentBackupJobType, -} from '../types/AttachmentBackup.js'; -import { isInCall as isInCallSelector } from '../state/selectors/calling.js'; -import { encryptAndUploadAttachment } from '../util/uploadAttachment.js'; -import { getAttachmentCiphertextSize } from '../util/AttachmentCrypto.js'; +} from '../types/AttachmentBackup.std.js'; +import { isInCall as isInCallSelector } from '../state/selectors/calling.std.js'; +import { encryptAndUploadAttachment } from '../util/uploadAttachment.preload.js'; +import { getAttachmentCiphertextSize } from '../util/AttachmentCrypto.std.js'; import { getMediaIdFromMediaName, getMediaNameForAttachmentThumbnail, -} from '../services/backups/util/mediaId.js'; -import { fromBase64, toBase64 } from '../Bytes.js'; -import { backupMediaBatch as doBackupMediaBatch } from '../textsecure/WebAPI.js'; -import type { AttachmentType } from '../types/Attachment.js'; -import { - canAttachmentHaveThumbnail, - mightStillBeOnTransitTier, -} from '../util/Attachment.js'; +} from '../services/backups/util/mediaId.preload.js'; +import { fromBase64, toBase64 } from '../Bytes.std.js'; +import { backupMediaBatch as doBackupMediaBatch } from '../textsecure/WebAPI.preload.js'; +import type { AttachmentType } from '../types/Attachment.std.js'; +import { canAttachmentHaveThumbnail } from '../util/Attachment.std.js'; +import { mightStillBeOnTransitTier } from '../util/mightStillBeOnTransitTier.dom.js'; import { type CreatedThumbnailType, makeImageThumbnailForBackup, makeVideoScreenshot, -} from '../types/VisualAttachment.js'; -import { missingCaseError } from '../util/missingCaseError.js'; +} from '../types/VisualAttachment.dom.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; import { isImageTypeSupported, isVideoTypeSupported, -} from '../util/GoogleChrome.js'; -import { getLocalAttachmentUrl } from '../util/getLocalAttachmentUrl.js'; -import { findRetryAfterTimeFromError } from './helpers/findRetryAfterTimeFromError.js'; -import { BackupCredentialType } from '../types/backups.js'; -import { supportsIncrementalMac } from '../types/MIME.js'; -import type { MIMEType } from '../types/MIME.js'; -import { MediaTier } from '../types/AttachmentDownload.js'; +} from '../util/GoogleChrome.std.js'; +import { getLocalAttachmentUrl } from '../util/getLocalAttachmentUrl.std.js'; +import { findRetryAfterTimeFromError } from './helpers/findRetryAfterTimeFromError.std.js'; +import { BackupCredentialType } from '../types/backups.node.js'; +import { supportsIncrementalMac } from '../types/MIME.std.js'; +import type { MIMEType } from '../types/MIME.std.js'; +import { MediaTier } from '../types/AttachmentDownload.std.js'; const log = createLogger('AttachmentBackupManager'); diff --git a/ts/jobs/AttachmentDownloadManager.ts b/ts/jobs/AttachmentDownloadManager.ts index 1ecb7f5058..6bd7e5f6aa 100644 --- a/ts/jobs/AttachmentDownloadManager.ts +++ b/ts/jobs/AttachmentDownloadManager.ts @@ -3,9 +3,9 @@ import lodash from 'lodash'; import { statfs } from 'node:fs/promises'; -import * as durations from '../util/durations/index.js'; -import { createLogger } from '../logging/log.js'; -import type { AttachmentBackfillResponseSyncEvent } from '../textsecure/messageReceiverEvents.js'; +import * as durations from '../util/durations/index.std.js'; +import { createLogger } from '../logging/log.std.js'; +import type { AttachmentBackfillResponseSyncEvent } from '../textsecure/messageReceiverEvents.std.js'; import { type MessageAttachmentType, type AttachmentDownloadJobType, @@ -13,25 +13,25 @@ import { AttachmentDownloadUrgency, coreAttachmentDownloadJobSchema, MediaTier, -} from '../types/AttachmentDownload.js'; +} from '../types/AttachmentDownload.std.js'; import { downloadAttachment as downloadAttachmentUtil, isIncrementalMacVerificationError, -} from '../util/downloadAttachment.js'; +} from '../util/downloadAttachment.preload.js'; import { deleteDownloadData as doDeleteDownloadData, processNewAttachment as doProcessNewAttachment, -} from '../util/migrations.js'; -import { DataReader, DataWriter } from '../sql/Client.js'; -import { getValue } from '../RemoteConfig.js'; +} from '../util/migrations.preload.js'; +import { DataReader, DataWriter } from '../sql/Client.preload.js'; +import { getValue } from '../RemoteConfig.dom.js'; -import { isInCall as isInCallSelector } from '../state/selectors/calling.js'; +import { isInCall as isInCallSelector } from '../state/selectors/calling.std.js'; import { AttachmentSizeError, type AttachmentType, AttachmentVariant, AttachmentPermanentlyUndownloadableError, -} from '../types/Attachment.js'; +} from '../types/Attachment.std.js'; import { wasImportedFromLocalBackup, canAttachmentHaveThumbnail, @@ -39,48 +39,48 @@ import { getUndownloadedAttachmentSignature, isIncremental, hasRequiredInformationForBackup, -} from '../util/Attachment.js'; +} from '../util/Attachment.std.js'; import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; -import { backupsService } from '../services/backups/index.js'; -import { getMessageById } from '../messages/getMessageById.js'; +import { backupsService } from '../services/backups/index.preload.js'; +import { getMessageById } from '../messages/getMessageById.preload.js'; import { KIBIBYTE, getMaximumIncomingAttachmentSizeInKb, getMaximumIncomingTextAttachmentSizeInKb, -} from '../types/AttachmentSize.js'; -import { addAttachmentToMessage } from '../messageModifiers/AttachmentDownloads.js'; -import * as Errors from '../types/errors.js'; -import { redactGenericText } from '../util/privacy.js'; +} from '../types/AttachmentSize.std.js'; +import { addAttachmentToMessage } from '../messageModifiers/AttachmentDownloads.preload.js'; +import * as Errors from '../types/errors.std.js'; +import { redactGenericText } from '../util/privacy.node.js'; import { JobManager, type JobManagerParamsType, type JobManagerJobResultType, type JobManagerJobType, -} from './JobManager.js'; -import { IMAGE_WEBP } from '../types/MIME.js'; -import { AttachmentDownloadSource } from '../sql/Interface.js'; -import { drop } from '../util/drop.js'; -import { type ReencryptedAttachmentV2 } from '../AttachmentCrypto.js'; -import { safeParsePartial } from '../util/schemas.js'; -import { deleteDownloadsJobQueue } from './deleteDownloadsJobQueue.js'; -import { createBatcher } from '../util/batcher.js'; -import { showDownloadFailedToast } from '../util/showDownloadFailedToast.js'; -import { markAttachmentAsPermanentlyErrored } from '../util/attachments/markAttachmentAsPermanentlyErrored.js'; +} from './JobManager.std.js'; +import { IMAGE_WEBP } from '../types/MIME.std.js'; +import { AttachmentDownloadSource } from '../sql/Interface.std.js'; +import { drop } from '../util/drop.std.js'; +import { type ReencryptedAttachmentV2 } from '../AttachmentCrypto.node.js'; +import { safeParsePartial } from '../util/schemas.std.js'; +import { deleteDownloadsJobQueue } from './deleteDownloadsJobQueue.preload.js'; +import { createBatcher } from '../util/batcher.std.js'; +import { showDownloadFailedToast } from '../util/showDownloadFailedToast.dom.js'; +import { markAttachmentAsPermanentlyErrored } from '../util/attachments/markAttachmentAsPermanentlyErrored.std.js'; import { AttachmentBackfill, isPermanentlyUndownloadable, isPermanentlyUndownloadableWithoutBackfill, -} from './helpers/attachmentBackfill.js'; -import { formatCountForLogging } from '../logging/formatCountForLogging.js'; -import { strictAssert } from '../util/assert.js'; -import { getAttachmentCiphertextSize } from '../util/AttachmentCrypto.js'; -import { updateBackupMediaDownloadProgress } from '../util/updateBackupMediaDownloadProgress.js'; -import { HTTPError } from '../types/HTTPError.js'; -import { isOlderThan } from '../util/timestamp.js'; -import { getMessageQueueTime as doGetMessageQueueTime } from '../util/getMessageQueueTime.js'; -import { JobCancelReason } from './types.js'; -import { isAbortError } from '../util/isAbortError.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from './helpers/attachmentBackfill.preload.js'; +import { formatCountForLogging } from '../logging/formatCountForLogging.std.js'; +import { strictAssert } from '../util/assert.std.js'; +import { getAttachmentCiphertextSize } from '../util/AttachmentCrypto.std.js'; +import { updateBackupMediaDownloadProgress } from '../util/updateBackupMediaDownloadProgress.preload.js'; +import { HTTPError } from '../types/HTTPError.std.js'; +import { isOlderThan } from '../util/timestamp.std.js'; +import { getMessageQueueTime as doGetMessageQueueTime } from '../util/getMessageQueueTime.dom.js'; +import { JobCancelReason } from './types.std.js'; +import { isAbortError } from '../util/isAbortError.std.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const { noop, omit, throttle } = lodash; diff --git a/ts/jobs/AttachmentLocalBackupManager.ts b/ts/jobs/AttachmentLocalBackupManager.ts index e628d8333f..5c06237187 100644 --- a/ts/jobs/AttachmentLocalBackupManager.ts +++ b/ts/jobs/AttachmentLocalBackupManager.ts @@ -6,36 +6,36 @@ import { existsSync } from 'node:fs'; import { PassThrough } from 'node:stream'; import { constants as FS_CONSTANTS, copyFile, mkdir } from 'node:fs/promises'; -import * as durations from '../util/durations/index.js'; -import { createLogger } from '../logging/log.js'; +import * as durations from '../util/durations/index.std.js'; +import { createLogger } from '../logging/log.std.js'; -import * as Errors from '../types/errors.js'; -import { redactGenericText } from '../util/privacy.js'; +import * as Errors from '../types/errors.std.js'; +import { redactGenericText } from '../util/privacy.node.js'; import { getAbsoluteAttachmentPath, getAbsoluteAttachmentPath as doGetAbsoluteAttachmentPath, -} from '../util/migrations.js'; +} from '../util/migrations.preload.js'; import { JobManager, type JobManagerParamsType, type JobManagerJobResultType, -} from './JobManager.js'; +} from './JobManager.std.js'; import { type BackupsService, backupsService, -} from '../services/backups/index.js'; -import { decryptAttachmentV2ToSink } from '../AttachmentCrypto.js'; +} from '../services/backups/index.preload.js'; +import { decryptAttachmentV2ToSink } from '../AttachmentCrypto.node.js'; import { type AttachmentLocalBackupJobType, type CoreAttachmentLocalBackupJobType, -} from '../types/AttachmentBackup.js'; -import { isInCall as isInCallSelector } from '../state/selectors/calling.js'; -import { encryptAndUploadAttachment } from '../util/uploadAttachment.js'; -import { backupMediaBatch as doBackupMediaBatch } from '../textsecure/WebAPI.js'; +} from '../types/AttachmentBackup.std.js'; +import { isInCall as isInCallSelector } from '../state/selectors/calling.std.js'; +import { encryptAndUploadAttachment } from '../util/uploadAttachment.preload.js'; +import { backupMediaBatch as doBackupMediaBatch } from '../textsecure/WebAPI.preload.js'; import { getLocalBackupDirectoryForMediaName, getLocalBackupPathForMediaName, -} from '../services/backups/util/localBackup.js'; +} from '../services/backups/util/localBackup.node.js'; const log = createLogger('AttachmentLocalBackupManager'); diff --git a/ts/jobs/CallLinkFinalizeDeleteManager.ts b/ts/jobs/CallLinkFinalizeDeleteManager.ts index 4796057578..a16e3736f9 100644 --- a/ts/jobs/CallLinkFinalizeDeleteManager.ts +++ b/ts/jobs/CallLinkFinalizeDeleteManager.ts @@ -1,14 +1,14 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as durations from '../util/durations/index.js'; -import { createLogger } from '../logging/log.js'; -import { DataReader, DataWriter } from '../sql/Client.js'; +import * as durations from '../util/durations/index.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { DataReader, DataWriter } from '../sql/Client.preload.js'; import { JobManager, type JobManagerParamsType, type JobManagerJobResultType, type JobManagerJobType, -} from './JobManager.js'; +} from './JobManager.std.js'; const log = createLogger('CallLinkFinalizeDeleteManager'); diff --git a/ts/jobs/Job.ts b/ts/jobs/Job.ts index 7af94f88ee..3756fe37cb 100644 --- a/ts/jobs/Job.ts +++ b/ts/jobs/Job.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ParsedJob } from './types.js'; +import type { ParsedJob } from './types.std.js'; /** * A single job instance. Shouldn't be instantiated directly, except by `JobQueue`. diff --git a/ts/jobs/JobError.ts b/ts/jobs/JobError.ts index 24082744f5..a0574cb85c 100644 --- a/ts/jobs/JobError.ts +++ b/ts/jobs/JobError.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { reallyJsonStringify } from '../util/reallyJsonStringify.js'; +import { reallyJsonStringify } from '../util/reallyJsonStringify.std.js'; /** * An error that wraps job errors. diff --git a/ts/jobs/JobLogger.ts b/ts/jobs/JobLogger.ts index 18d5d31354..4669443901 100644 --- a/ts/jobs/JobLogger.ts +++ b/ts/jobs/JobLogger.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LoggerType } from '../types/Logging.js'; -import type { ParsedJob } from './types.js'; +import type { LoggerType } from '../types/Logging.std.js'; +import type { ParsedJob } from './types.std.js'; export class JobLogger implements LoggerType { #id: string; diff --git a/ts/jobs/JobManager.ts b/ts/jobs/JobManager.ts index f1ba4f74aa..4b12e4df50 100644 --- a/ts/jobs/JobManager.ts +++ b/ts/jobs/JobManager.ts @@ -1,22 +1,22 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import * as z from 'zod'; -import { MINUTE, SECOND } from '../util/durations/index.js'; +import { MINUTE, SECOND } from '../util/durations/index.std.js'; import { explodePromise, type ExplodePromiseResultType, -} from '../util/explodePromise.js'; -import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.js'; -import { drop } from '../util/drop.js'; -import { createLogger } from '../logging/log.js'; -import { missingCaseError } from '../util/missingCaseError.js'; +} from '../util/explodePromise.std.js'; +import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.std.js'; +import { drop } from '../util/drop.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; import { type ExponentialBackoffOptionsType, exponentialBackoffSleepTime, -} from '../util/exponentialBackoff.js'; -import * as Errors from '../types/errors.js'; -import { sleep } from '../util/sleep.js'; -import type { JobCancelReason } from './types.js'; +} from '../util/exponentialBackoff.std.js'; +import * as Errors from '../types/errors.std.js'; +import { sleep } from '../util/sleep.std.js'; +import type { JobCancelReason } from './types.std.js'; const log = createLogger('JobManager'); diff --git a/ts/jobs/JobQueue.ts b/ts/jobs/JobQueue.ts index 76e42ea8d7..0353a0cf28 100644 --- a/ts/jobs/JobQueue.ts +++ b/ts/jobs/JobQueue.ts @@ -5,17 +5,17 @@ import PQueue from 'p-queue'; import { v7 as uuid } from 'uuid'; import lodash from 'lodash'; -import { Job } from './Job.js'; -import { JobError } from './JobError.js'; -import type { ParsedJob, StoredJob, JobQueueStore } from './types.js'; -import { assertDev } from '../util/assert.js'; -import { createLogger } from '../logging/log.js'; -import { JobLogger } from './JobLogger.js'; -import * as Errors from '../types/errors.js'; -import type { LoggerType } from '../types/Logging.js'; -import { drop } from '../util/drop.js'; -import { sleep } from '../util/sleep.js'; -import { SECOND } from '../util/durations/index.js'; +import { Job } from './Job.std.js'; +import { JobError } from './JobError.std.js'; +import type { ParsedJob, StoredJob, JobQueueStore } from './types.std.js'; +import { assertDev } from '../util/assert.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { JobLogger } from './JobLogger.std.js'; +import * as Errors from '../types/errors.std.js'; +import type { LoggerType } from '../types/Logging.std.js'; +import { drop } from '../util/drop.std.js'; +import { sleep } from '../util/sleep.std.js'; +import { SECOND } from '../util/durations/index.std.js'; const { noop } = lodash; diff --git a/ts/jobs/JobQueueDatabaseStore.ts b/ts/jobs/JobQueueDatabaseStore.ts index 2360a42e7f..d4b0c31c1c 100644 --- a/ts/jobs/JobQueueDatabaseStore.ts +++ b/ts/jobs/JobQueueDatabaseStore.ts @@ -2,12 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import lodash from 'lodash'; -import { AsyncQueue } from '../util/AsyncQueue.js'; -import { concat, wrapPromise } from '../util/asyncIterables.js'; -import type { JobQueueStore, StoredJob } from './types.js'; -import { formatJobForInsert } from './formatJobForInsert.js'; -import { DataReader, DataWriter } from '../sql/Client.js'; -import { createLogger } from '../logging/log.js'; +import { AsyncQueue } from '../util/AsyncQueue.std.js'; +import { concat, wrapPromise } from '../util/asyncIterables.std.js'; +import type { JobQueueStore, StoredJob } from './types.std.js'; +import { formatJobForInsert } from './formatJobForInsert.std.js'; +import { DataReader, DataWriter } from '../sql/Client.preload.js'; +import { createLogger } from '../logging/log.std.js'; const { noop } = lodash; diff --git a/ts/jobs/callLinkRefreshJobQueue.ts b/ts/jobs/callLinkRefreshJobQueue.ts index 9a1e92e6bb..740915094d 100644 --- a/ts/jobs/callLinkRefreshJobQueue.ts +++ b/ts/jobs/callLinkRefreshJobQueue.ts @@ -4,23 +4,26 @@ import * as z from 'zod'; import PQueue from 'p-queue'; import { CallLinkRootKey, CallLinkEpoch } from '@signalapp/ringrtc'; -import { createLogger } from '../logging/log.js'; -import type { LoggerType } from '../types/Logging.js'; -import { exponentialBackoffMaxAttempts } from '../util/exponentialBackoff.js'; -import type { ParsedJob, StoredJob } from './types.js'; -import type { JOB_STATUS } from './JobQueue.js'; -import { JobQueue } from './JobQueue.js'; -import { jobQueueDatabaseStore } from './JobQueueDatabaseStore.js'; -import { DAY, SECOND } from '../util/durations/index.js'; -import { commonShouldJobContinue } from './helpers/commonShouldJobContinue.js'; -import { DataReader, DataWriter } from '../sql/Client.js'; -import type { CallLinkType, PendingCallLinkType } from '../types/CallLink.js'; -import { calling } from '../services/calling.js'; -import { sleeper } from '../util/sleeper.js'; -import { parseUnknown } from '../util/schemas.js'; -import { getRoomIdFromRootKey } from '../util/callLinksRingrtc.js'; -import { toCallHistoryFromUnusedCallLink } from '../util/callLinks.js'; -import type { StorageServiceFieldsType } from '../sql/Interface.js'; +import { createLogger } from '../logging/log.std.js'; +import type { LoggerType } from '../types/Logging.std.js'; +import { exponentialBackoffMaxAttempts } from '../util/exponentialBackoff.std.js'; +import type { ParsedJob, StoredJob } from './types.std.js'; +import type { JOB_STATUS } from './JobQueue.std.js'; +import { JobQueue } from './JobQueue.std.js'; +import { jobQueueDatabaseStore } from './JobQueueDatabaseStore.preload.js'; +import { DAY, SECOND } from '../util/durations/index.std.js'; +import { commonShouldJobContinue } from './helpers/commonShouldJobContinue.preload.js'; +import { DataReader, DataWriter } from '../sql/Client.preload.js'; +import type { + CallLinkType, + PendingCallLinkType, +} from '../types/CallLink.std.js'; +import { calling } from '../services/calling.preload.js'; +import { sleeper } from '../util/sleeper.std.js'; +import { parseUnknown } from '../util/schemas.std.js'; +import { getRoomIdFromRootKey } from '../util/callLinksRingrtc.node.js'; +import { toCallHistoryFromUnusedCallLink } from '../util/callLinks.std.js'; +import type { StorageServiceFieldsType } from '../sql/Interface.std.js'; const globalLogger = createLogger('callLinkRefreshJobQueue'); diff --git a/ts/jobs/conversationJobQueue.ts b/ts/jobs/conversationJobQueue.ts index 931813996b..08fcab46a5 100644 --- a/ts/jobs/conversationJobQueue.ts +++ b/ts/jobs/conversationJobQueue.ts @@ -3,58 +3,58 @@ import { z } from 'zod'; import type PQueue from 'p-queue'; -import { createLogger } from '../logging/log.js'; +import { createLogger } from '../logging/log.std.js'; -import * as durations from '../util/durations/index.js'; -import { exponentialBackoffMaxAttempts } from '../util/exponentialBackoff.js'; -import { InMemoryQueues } from './helpers/InMemoryQueues.js'; -import { jobQueueDatabaseStore } from './JobQueueDatabaseStore.js'; -import { JOB_STATUS, JobQueue } from './JobQueue.js'; +import * as durations from '../util/durations/index.std.js'; +import { exponentialBackoffMaxAttempts } from '../util/exponentialBackoff.std.js'; +import { InMemoryQueues } from './helpers/InMemoryQueues.std.js'; +import { jobQueueDatabaseStore } from './JobQueueDatabaseStore.preload.js'; +import { JOB_STATUS, JobQueue } from './JobQueue.std.js'; -import { sendNormalMessage } from './helpers/sendNormalMessage.js'; -import { sendCallingMessage } from './helpers/sendCallingMessage.js'; -import { sendDirectExpirationTimerUpdate } from './helpers/sendDirectExpirationTimerUpdate.js'; -import { sendGroupCallUpdate } from './helpers/sendGroupCallUpdate.js'; -import { sendGroupUpdate } from './helpers/sendGroupUpdate.js'; -import { sendDeleteForEveryone } from './helpers/sendDeleteForEveryone.js'; -import { sendDeleteStoryForEveryone } from './helpers/sendDeleteStoryForEveryone.js'; -import { sendProfileKey } from './helpers/sendProfileKey.js'; -import { sendReaction } from './helpers/sendReaction.js'; -import { sendStory } from './helpers/sendStory.js'; -import { sendReceipts } from './helpers/sendReceipts.js'; +import { sendNormalMessage } from './helpers/sendNormalMessage.preload.js'; +import { sendCallingMessage } from './helpers/sendCallingMessage.preload.js'; +import { sendDirectExpirationTimerUpdate } from './helpers/sendDirectExpirationTimerUpdate.preload.js'; +import { sendGroupCallUpdate } from './helpers/sendGroupCallUpdate.preload.js'; +import { sendGroupUpdate } from './helpers/sendGroupUpdate.preload.js'; +import { sendDeleteForEveryone } from './helpers/sendDeleteForEveryone.preload.js'; +import { sendDeleteStoryForEveryone } from './helpers/sendDeleteStoryForEveryone.preload.js'; +import { sendProfileKey } from './helpers/sendProfileKey.preload.js'; +import { sendReaction } from './helpers/sendReaction.preload.js'; +import { sendStory } from './helpers/sendStory.preload.js'; +import { sendReceipts } from './helpers/sendReceipts.preload.js'; -import type { LoggerType } from '../types/Logging.js'; -import { ConversationVerificationState } from '../state/ducks/conversationsEnums.js'; -import { MINUTE } from '../util/durations/index.js'; +import type { LoggerType } from '../types/Logging.std.js'; +import { ConversationVerificationState } from '../state/ducks/conversationsEnums.std.js'; +import { MINUTE } from '../util/durations/index.std.js'; import { OutgoingIdentityKeyError, SendMessageChallengeError, SendMessageProtoError, -} from '../textsecure/Errors.js'; -import { strictAssert } from '../util/assert.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { explodePromise } from '../util/explodePromise.js'; -import type { Job } from './Job.js'; -import type { ParsedJob, StoredJob } from './types.js'; +} from '../textsecure/Errors.std.js'; +import { strictAssert } from '../util/assert.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { explodePromise } from '../util/explodePromise.std.js'; +import type { Job } from './Job.std.js'; +import type { ParsedJob, StoredJob } from './types.std.js'; import { type MessageSender, messageSender, -} from '../textsecure/SendMessage.js'; -import type { ServiceIdString } from '../types/ServiceId.js'; -import { commonShouldJobContinue } from './helpers/commonShouldJobContinue.js'; -import { sleeper } from '../util/sleeper.js'; -import { receiptSchema, ReceiptType } from '../types/Receipt.js'; -import { serviceIdSchema, aciSchema } from '../types/ServiceId.js'; -import { sendResendRequest } from './helpers/sendResendRequest.js'; -import { sendNullMessage } from './helpers/sendNullMessage.js'; -import { sendSenderKeyDistribution } from './helpers/sendSenderKeyDistribution.js'; -import { sendSavedProto } from './helpers/sendSavedProto.js'; -import { drop } from '../util/drop.js'; -import { isInPast } from '../util/timestamp.js'; -import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.js'; -import { FIBONACCI } from '../util/BackOff.js'; -import { parseUnknown } from '../util/schemas.js'; -import { challengeHandler } from '../services/challengeHandler.js'; +} from '../textsecure/SendMessage.preload.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; +import { commonShouldJobContinue } from './helpers/commonShouldJobContinue.preload.js'; +import { sleeper } from '../util/sleeper.std.js'; +import { receiptSchema, ReceiptType } from '../types/Receipt.std.js'; +import { serviceIdSchema, aciSchema } from '../types/ServiceId.std.js'; +import { sendResendRequest } from './helpers/sendResendRequest.preload.js'; +import { sendNullMessage } from './helpers/sendNullMessage.preload.js'; +import { sendSenderKeyDistribution } from './helpers/sendSenderKeyDistribution.preload.js'; +import { sendSavedProto } from './helpers/sendSavedProto.preload.js'; +import { drop } from '../util/drop.std.js'; +import { isInPast } from '../util/timestamp.std.js'; +import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.std.js'; +import { FIBONACCI } from '../util/BackOff.std.js'; +import { parseUnknown } from '../util/schemas.std.js'; +import { challengeHandler } from '../services/challengeHandler.preload.js'; const globalLogger = createLogger('conversationJobQueue'); diff --git a/ts/jobs/deleteDownloadsJobQueue.ts b/ts/jobs/deleteDownloadsJobQueue.ts index 8d5a4119a2..6b30a255d0 100644 --- a/ts/jobs/deleteDownloadsJobQueue.ts +++ b/ts/jobs/deleteDownloadsJobQueue.ts @@ -4,18 +4,18 @@ import { z } from 'zod'; import lodash from 'lodash'; -import { JobQueue } from './JobQueue.js'; -import { jobQueueDatabaseStore } from './JobQueueDatabaseStore.js'; -import { parseUnknown } from '../util/schemas.js'; -import { deleteDownloadData } from '../util/migrations.js'; -import { DataReader } from '../sql/Client.js'; +import { JobQueue } from './JobQueue.std.js'; +import { jobQueueDatabaseStore } from './JobQueueDatabaseStore.preload.js'; +import { parseUnknown } from '../util/schemas.std.js'; +import { deleteDownloadData } from '../util/migrations.preload.js'; +import { DataReader } from '../sql/Client.preload.js'; -import type { JOB_STATUS } from './JobQueue.js'; -import type { LoggerType } from '../types/Logging.js'; -import { commonShouldJobContinue } from './helpers/commonShouldJobContinue.js'; -import { DAY } from '../util/durations/index.js'; -import { exponentialBackoffMaxAttempts } from '../util/exponentialBackoff.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import type { JOB_STATUS } from './JobQueue.std.js'; +import type { LoggerType } from '../types/Logging.std.js'; +import { commonShouldJobContinue } from './helpers/commonShouldJobContinue.preload.js'; +import { DAY } from '../util/durations/index.std.js'; +import { exponentialBackoffMaxAttempts } from '../util/exponentialBackoff.std.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const { omit } = lodash; diff --git a/ts/jobs/formatJobForInsert.ts b/ts/jobs/formatJobForInsert.ts index 801402de8e..dd5980078a 100644 --- a/ts/jobs/formatJobForInsert.ts +++ b/ts/jobs/formatJobForInsert.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ParsedJob, StoredJob } from './types.js'; +import type { ParsedJob, StoredJob } from './types.std.js'; /** * Format a job to be inserted into the database. diff --git a/ts/jobs/groupAvatarJobQueue.ts b/ts/jobs/groupAvatarJobQueue.ts index ae39c4f090..7deb762868 100644 --- a/ts/jobs/groupAvatarJobQueue.ts +++ b/ts/jobs/groupAvatarJobQueue.ts @@ -2,15 +2,15 @@ // SPDX-License-Identifier: AGPL-3.0-only import * as z from 'zod'; -import type { LoggerType } from '../types/Logging.js'; -import { applyNewAvatar } from '../groups.js'; -import { isGroupV2 } from '../util/whatTypeOfConversation.js'; -import { DataWriter } from '../sql/Client.js'; +import type { LoggerType } from '../types/Logging.std.js'; +import { applyNewAvatar } from '../groups.preload.js'; +import { isGroupV2 } from '../util/whatTypeOfConversation.dom.js'; +import { DataWriter } from '../sql/Client.preload.js'; -import type { JOB_STATUS } from './JobQueue.js'; -import { JobQueue } from './JobQueue.js'; -import { jobQueueDatabaseStore } from './JobQueueDatabaseStore.js'; -import { parseUnknown } from '../util/schemas.js'; +import type { JOB_STATUS } from './JobQueue.std.js'; +import { JobQueue } from './JobQueue.std.js'; +import { jobQueueDatabaseStore } from './JobQueueDatabaseStore.preload.js'; +import { parseUnknown } from '../util/schemas.std.js'; const groupAvatarJobDataSchema = z.object({ conversationId: z.string(), diff --git a/ts/jobs/helpers/addReportSpamJob.ts b/ts/jobs/helpers/addReportSpamJob.ts index 511b04917c..9e9e33d824 100644 --- a/ts/jobs/helpers/addReportSpamJob.ts +++ b/ts/jobs/helpers/addReportSpamJob.ts @@ -1,12 +1,12 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { assertDev } from '../../util/assert.js'; -import { isDirectConversation } from '../../util/whatTypeOfConversation.js'; -import { createLogger } from '../../logging/log.js'; -import { isAciString } from '../../util/isAciString.js'; -import type { reportSpamJobQueue } from '../reportSpamJobQueue.js'; -import type { ConversationType } from '../../state/ducks/conversations.js'; +import { assertDev } from '../../util/assert.std.js'; +import { isDirectConversation } from '../../util/whatTypeOfConversation.dom.js'; +import { createLogger } from '../../logging/log.std.js'; +import { isAciString } from '../../util/isAciString.std.js'; +import type { reportSpamJobQueue } from '../reportSpamJobQueue.preload.js'; +import type { ConversationType } from '../../state/ducks/conversations.preload.js'; const log = createLogger('addReportSpamJob'); diff --git a/ts/jobs/helpers/areAllErrorsUnregistered.ts b/ts/jobs/helpers/areAllErrorsUnregistered.ts index 9e42915e9e..40b7f9e800 100644 --- a/ts/jobs/helpers/areAllErrorsUnregistered.ts +++ b/ts/jobs/helpers/areAllErrorsUnregistered.ts @@ -5,8 +5,8 @@ import type { ConversationAttributesType } from '../../model-types.d.ts'; import { SendMessageProtoError, UnregisteredUserError, -} from '../../textsecure/Errors.js'; -import { isGroup } from '../../util/whatTypeOfConversation.js'; +} from '../../textsecure/Errors.std.js'; +import { isGroup } from '../../util/whatTypeOfConversation.dom.js'; export function areAllErrorsUnregistered( conversation: ConversationAttributesType, diff --git a/ts/jobs/helpers/attachmentBackfill.ts b/ts/jobs/helpers/attachmentBackfill.ts index fca0dab346..7ca7e48880 100644 --- a/ts/jobs/helpers/attachmentBackfill.ts +++ b/ts/jobs/helpers/attachmentBackfill.ts @@ -1,49 +1,49 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AttachmentBackfillResponseSyncEvent } from '../../textsecure/messageReceiverEvents.js'; -import { MessageSender } from '../../textsecure/SendMessage.js'; -import { createLogger } from '../../logging/log.js'; +import type { AttachmentBackfillResponseSyncEvent } from '../../textsecure/messageReceiverEvents.std.js'; +import { MessageSender } from '../../textsecure/SendMessage.preload.js'; +import { createLogger } from '../../logging/log.std.js'; import type { ReadonlyMessageAttributesType } from '../../model-types.d.ts'; -import type { AttachmentType } from '../../types/Attachment.js'; +import type { AttachmentType } from '../../types/Attachment.std.js'; import { isDownloading, isDownloaded, isDownloadable, getUndownloadedAttachmentSignature, -} from '../../util/Attachment.js'; +} from '../../util/Attachment.std.js'; import { type MessageAttachmentType, AttachmentDownloadUrgency, -} from '../../types/AttachmentDownload.js'; -import { AttachmentDownloadSource } from '../../sql/Interface.js'; -import { APPLICATION_OCTET_STREAM } from '../../types/MIME.js'; +} from '../../types/AttachmentDownload.std.js'; +import { AttachmentDownloadSource } from '../../sql/Interface.std.js'; +import { APPLICATION_OCTET_STREAM } from '../../types/MIME.std.js'; import { getConversationIdentifier, getAddressableMessage, getConversationFromTarget, getMessageQueryFromTarget, findMatchingMessage, -} from '../../util/syncIdentifiers.js'; -import { strictAssert } from '../../util/assert.js'; -import { drop } from '../../util/drop.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; -import { isStagingServer } from '../../util/isStagingServer.js'; +} from '../../util/syncIdentifiers.preload.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { drop } from '../../util/drop.std.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; +import { isStagingServer } from '../../util/isStagingServer.dom.js'; import { ensureBodyAttachmentsAreSeparated, queueAttachmentDownloads, -} from '../../util/queueAttachmentDownloads.js'; -import { SECOND } from '../../util/durations/index.js'; -import { showDownloadFailedToast } from '../../util/showDownloadFailedToast.js'; -import { markAttachmentAsPermanentlyErrored } from '../../util/attachments/markAttachmentAsPermanentlyErrored.js'; -import { singleProtoJobQueue } from '../singleProtoJobQueue.js'; -import { MessageModel } from '../../models/messages.js'; -import { getMessageById } from '../../messages/getMessageById.js'; -import { addAttachmentToMessage } from '../../messageModifiers/AttachmentDownloads.js'; -import { SignalService as Proto } from '../../protobuf/index.js'; -import * as RemoteConfig from '../../RemoteConfig.js'; -import { isTestOrMockEnvironment } from '../../environment.js'; -import { BackfillFailureKind } from '../../components/BackfillFailureModal.js'; +} from '../../util/queueAttachmentDownloads.preload.js'; +import { SECOND } from '../../util/durations/index.std.js'; +import { showDownloadFailedToast } from '../../util/showDownloadFailedToast.dom.js'; +import { markAttachmentAsPermanentlyErrored } from '../../util/attachments/markAttachmentAsPermanentlyErrored.std.js'; +import { singleProtoJobQueue } from '../singleProtoJobQueue.preload.js'; +import { MessageModel } from '../../models/messages.preload.js'; +import { getMessageById } from '../../messages/getMessageById.preload.js'; +import { addAttachmentToMessage } from '../../messageModifiers/AttachmentDownloads.preload.js'; +import { SignalService as Proto } from '../../protobuf/index.std.js'; +import * as RemoteConfig from '../../RemoteConfig.dom.js'; +import { isTestOrMockEnvironment } from '../../environment.std.js'; +import { BackfillFailureKind } from '../../components/BackfillFailureModal.dom.js'; const log = createLogger('attachmentBackfill'); diff --git a/ts/jobs/helpers/commonShouldJobContinue.ts b/ts/jobs/helpers/commonShouldJobContinue.ts index 909e0f0388..af6f30bcf5 100644 --- a/ts/jobs/helpers/commonShouldJobContinue.ts +++ b/ts/jobs/helpers/commonShouldJobContinue.ts @@ -1,13 +1,13 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LoggerType } from '../../types/Logging.js'; -import { isOnline } from '../../textsecure/WebAPI.js'; -import { waitForOnline } from '../../util/waitForOnline.js'; -import { exponentialBackoffSleepTime } from '../../util/exponentialBackoff.js'; -import { isDone as isDeviceLinked } from '../../util/registration.js'; -import { sleeper } from '../../util/sleeper.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +import type { LoggerType } from '../../types/Logging.std.js'; +import { isOnline } from '../../textsecure/WebAPI.preload.js'; +import { waitForOnline } from '../../util/waitForOnline.dom.js'; +import { exponentialBackoffSleepTime } from '../../util/exponentialBackoff.std.js'; +import { isDone as isDeviceLinked } from '../../util/registration.preload.js'; +import { sleeper } from '../../util/sleeper.std.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; export async function commonShouldJobContinue({ attempt, diff --git a/ts/jobs/helpers/findRetryAfterTimeFromError.ts b/ts/jobs/helpers/findRetryAfterTimeFromError.ts index e9edb6bace..c2e50b440b 100644 --- a/ts/jobs/helpers/findRetryAfterTimeFromError.ts +++ b/ts/jobs/helpers/findRetryAfterTimeFromError.ts @@ -1,9 +1,9 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { isRecord } from '../../util/isRecord.js'; -import { HTTPError } from '../../types/HTTPError.js'; -import { parseRetryAfterWithDefault } from '../../util/parseRetryAfter.js'; +import { isRecord } from '../../util/isRecord.std.js'; +import { HTTPError } from '../../types/HTTPError.std.js'; +import { parseRetryAfterWithDefault } from '../../util/parseRetryAfter.std.js'; export function findRetryAfterTimeFromError( err: unknown, diff --git a/ts/jobs/helpers/getHttpErrorCode.ts b/ts/jobs/helpers/getHttpErrorCode.ts index a75484e819..e8abbe43dc 100644 --- a/ts/jobs/helpers/getHttpErrorCode.ts +++ b/ts/jobs/helpers/getHttpErrorCode.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { isRecord } from '../../util/isRecord.js'; -import { parseIntWithFallback } from '../../util/parseIntWithFallback.js'; +import { isRecord } from '../../util/isRecord.std.js'; +import { parseIntWithFallback } from '../../util/parseIntWithFallback.std.js'; /** * Looks for an HTTP code. First tries the top level error, then looks at its `httpError` diff --git a/ts/jobs/helpers/getUntrustedConversationServiceIds.ts b/ts/jobs/helpers/getUntrustedConversationServiceIds.ts index 47d75322cf..65b5874555 100644 --- a/ts/jobs/helpers/getUntrustedConversationServiceIds.ts +++ b/ts/jobs/helpers/getUntrustedConversationServiceIds.ts @@ -1,9 +1,9 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { isNotNil } from '../../util/isNotNil.js'; -import { createLogger } from '../../logging/log.js'; -import type { ServiceIdString } from '../../types/ServiceId.js'; +import { isNotNil } from '../../util/isNotNil.std.js'; +import { createLogger } from '../../logging/log.std.js'; +import type { ServiceIdString } from '../../types/ServiceId.std.js'; const log = createLogger('getUntrustedConversationServiceIds'); diff --git a/ts/jobs/helpers/getValidRecipients.ts b/ts/jobs/helpers/getValidRecipients.ts index 7cbb78ca5d..d1acdad90b 100644 --- a/ts/jobs/helpers/getValidRecipients.ts +++ b/ts/jobs/helpers/getValidRecipients.ts @@ -1,10 +1,10 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { isNotNil } from '../../util/isNotNil.js'; +import { isNotNil } from '../../util/isNotNil.std.js'; -import type { LoggerType } from '../../types/Logging.js'; -import type { ServiceIdString } from '../../types/ServiceId.js'; +import type { LoggerType } from '../../types/Logging.std.js'; +import type { ServiceIdString } from '../../types/ServiceId.std.js'; export function getValidRecipients( recipients: Array, diff --git a/ts/jobs/helpers/handleCommonJobRequestError.ts b/ts/jobs/helpers/handleCommonJobRequestError.ts index 3fd1fedc17..21eda2839d 100644 --- a/ts/jobs/helpers/handleCommonJobRequestError.ts +++ b/ts/jobs/helpers/handleCommonJobRequestError.ts @@ -1,9 +1,9 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LoggerType } from '../../types/Logging.js'; -import { sleepForRateLimitRetryAfterTime } from './sleepForRateLimitRetryAfterTime.js'; -import { getHttpErrorCode } from './getHttpErrorCode.js'; +import type { LoggerType } from '../../types/Logging.std.js'; +import { sleepForRateLimitRetryAfterTime } from './sleepForRateLimitRetryAfterTime.std.js'; +import { getHttpErrorCode } from './getHttpErrorCode.std.js'; export async function handleCommonJobRequestError({ err, diff --git a/ts/jobs/helpers/handleMultipleSendErrors.ts b/ts/jobs/helpers/handleMultipleSendErrors.ts index be25263393..dcd9709ab3 100644 --- a/ts/jobs/helpers/handleMultipleSendErrors.ts +++ b/ts/jobs/helpers/handleMultipleSendErrors.ts @@ -1,13 +1,13 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LoggerType } from '../../types/Logging.js'; -import * as Errors from '../../types/errors.js'; -import { sleepForRateLimitRetryAfterTime } from './sleepForRateLimitRetryAfterTime.js'; -import { getHttpErrorCode } from './getHttpErrorCode.js'; -import { strictAssert } from '../../util/assert.js'; -import { findRetryAfterTimeFromError } from './findRetryAfterTimeFromError.js'; -import { SendMessageProtoError } from '../../textsecure/Errors.js'; +import type { LoggerType } from '../../types/Logging.std.js'; +import * as Errors from '../../types/errors.std.js'; +import { sleepForRateLimitRetryAfterTime } from './sleepForRateLimitRetryAfterTime.std.js'; +import { getHttpErrorCode } from './getHttpErrorCode.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { findRetryAfterTimeFromError } from './findRetryAfterTimeFromError.std.js'; +import { SendMessageProtoError } from '../../textsecure/Errors.std.js'; export function maybeExpandErrors(error: unknown): ReadonlyArray { if (error instanceof SendMessageProtoError) { diff --git a/ts/jobs/helpers/sendCallingMessage.ts b/ts/jobs/helpers/sendCallingMessage.ts index 5d1d412c5c..e0698ef156 100644 --- a/ts/jobs/helpers/sendCallingMessage.ts +++ b/ts/jobs/helpers/sendCallingMessage.ts @@ -3,32 +3,32 @@ import { ContentHint } from '@signalapp/libsignal-client'; -import { handleMessageSend } from '../../util/handleMessageSend.js'; -import { getSendOptions } from '../../util/getSendOptions.js'; +import { handleMessageSend } from '../../util/handleMessageSend.preload.js'; +import { getSendOptions } from '../../util/getSendOptions.preload.js'; import { isDirectConversation, isGroup, -} from '../../util/whatTypeOfConversation.js'; -import { SignalService as Proto } from '../../protobuf/index.js'; +} from '../../util/whatTypeOfConversation.dom.js'; +import { SignalService as Proto } from '../../protobuf/index.std.js'; import { handleMultipleSendErrors, maybeExpandErrors, -} from './handleMultipleSendErrors.js'; +} from './handleMultipleSendErrors.std.js'; -import type { ConversationModel } from '../../models/conversations.js'; +import type { ConversationModel } from '../../models/conversations.preload.js'; import type { ConversationQueueJobBundle, CallingMessageJobData, -} from '../conversationJobQueue.js'; -import { isConversationUnregistered } from '../../util/isConversationUnregistered.js'; +} from '../conversationJobQueue.preload.js'; +import { isConversationUnregistered } from '../../util/isConversationUnregistered.dom.js'; import { OutgoingIdentityKeyError, UnregisteredUserError, -} from '../../textsecure/Errors.js'; -import { getUntrustedConversationServiceIds } from './getUntrustedConversationServiceIds.js'; -import { sendContentMessageToGroup } from '../../util/sendToGroup.js'; -import * as Bytes from '../../Bytes.js'; -import { getValidRecipients } from './getValidRecipients.js'; +} from '../../textsecure/Errors.std.js'; +import { getUntrustedConversationServiceIds } from './getUntrustedConversationServiceIds.dom.js'; +import { sendContentMessageToGroup } from '../../util/sendToGroup.preload.js'; +import * as Bytes from '../../Bytes.std.js'; +import { getValidRecipients } from './getValidRecipients.dom.js'; export async function sendCallingMessage( conversation: ConversationModel, diff --git a/ts/jobs/helpers/sendDeleteForEveryone.ts b/ts/jobs/helpers/sendDeleteForEveryone.ts index 44323a9a8f..0286f48169 100644 --- a/ts/jobs/helpers/sendDeleteForEveryone.ts +++ b/ts/jobs/helpers/sendDeleteForEveryone.ts @@ -4,40 +4,40 @@ import { ContentHint } from '@signalapp/libsignal-client'; import lodash from 'lodash'; -import * as Errors from '../../types/errors.js'; -import { getSendOptions } from '../../util/getSendOptions.js'; +import * as Errors from '../../types/errors.std.js'; +import { getSendOptions } from '../../util/getSendOptions.preload.js'; import { isDirectConversation, isGroupV2, isMe, -} from '../../util/whatTypeOfConversation.js'; -import { SignalService as Proto } from '../../protobuf/index.js'; +} from '../../util/whatTypeOfConversation.dom.js'; +import { SignalService as Proto } from '../../protobuf/index.std.js'; import { handleMultipleSendErrors, maybeExpandErrors, -} from './handleMultipleSendErrors.js'; -import { ourProfileKeyService } from '../../services/ourProfileKey.js'; -import { wrapWithSyncMessageSend } from '../../util/wrapWithSyncMessageSend.js'; +} from './handleMultipleSendErrors.std.js'; +import { ourProfileKeyService } from '../../services/ourProfileKey.std.js'; +import { wrapWithSyncMessageSend } from '../../util/wrapWithSyncMessageSend.preload.js'; -import type { ConversationModel } from '../../models/conversations.js'; +import type { ConversationModel } from '../../models/conversations.preload.js'; import type { ConversationQueueJobBundle, DeleteForEveryoneJobData, -} from '../conversationJobQueue.js'; -import { getUntrustedConversationServiceIds } from './getUntrustedConversationServiceIds.js'; -import { handleMessageSend } from '../../util/handleMessageSend.js'; -import { isConversationAccepted } from '../../util/isConversationAccepted.js'; -import { isConversationUnregistered } from '../../util/isConversationUnregistered.js'; -import { getMessageById } from '../../messages/getMessageById.js'; -import { isNotNil } from '../../util/isNotNil.js'; +} from '../conversationJobQueue.preload.js'; +import { getUntrustedConversationServiceIds } from './getUntrustedConversationServiceIds.dom.js'; +import { handleMessageSend } from '../../util/handleMessageSend.preload.js'; +import { isConversationAccepted } from '../../util/isConversationAccepted.preload.js'; +import { isConversationUnregistered } from '../../util/isConversationUnregistered.dom.js'; +import { getMessageById } from '../../messages/getMessageById.preload.js'; +import { isNotNil } from '../../util/isNotNil.std.js'; import type { CallbackResultType } from '../../textsecure/Types.d.ts'; -import type { MessageModel } from '../../models/messages.js'; -import { SendMessageProtoError } from '../../textsecure/Errors.js'; -import { strictAssert } from '../../util/assert.js'; -import type { LoggerType } from '../../types/Logging.js'; -import type { ServiceIdString } from '../../types/ServiceId.js'; -import { isStory } from '../../messages/helpers.js'; -import { sendToGroup } from '../../util/sendToGroup.js'; +import type { MessageModel } from '../../models/messages.preload.js'; +import { SendMessageProtoError } from '../../textsecure/Errors.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import type { LoggerType } from '../../types/Logging.std.js'; +import type { ServiceIdString } from '../../types/ServiceId.std.js'; +import { isStory } from '../../messages/helpers.std.js'; +import { sendToGroup } from '../../util/sendToGroup.preload.js'; const { isNumber } = lodash; diff --git a/ts/jobs/helpers/sendDeleteStoryForEveryone.ts b/ts/jobs/helpers/sendDeleteStoryForEveryone.ts index 8f3e4740ad..7f44403848 100644 --- a/ts/jobs/helpers/sendDeleteStoryForEveryone.ts +++ b/ts/jobs/helpers/sendDeleteStoryForEveryone.ts @@ -3,35 +3,35 @@ import { ContentHint } from '@signalapp/libsignal-client'; -import * as Errors from '../../types/errors.js'; -import { getSendOptions } from '../../util/getSendOptions.js'; +import * as Errors from '../../types/errors.std.js'; +import { getSendOptions } from '../../util/getSendOptions.preload.js'; import { isDirectConversation, isMe, -} from '../../util/whatTypeOfConversation.js'; +} from '../../util/whatTypeOfConversation.dom.js'; import { handleMultipleSendErrors, maybeExpandErrors, -} from './handleMultipleSendErrors.js'; -import { ourProfileKeyService } from '../../services/ourProfileKey.js'; +} from './handleMultipleSendErrors.std.js'; +import { ourProfileKeyService } from '../../services/ourProfileKey.std.js'; -import type { ConversationModel } from '../../models/conversations.js'; +import type { ConversationModel } from '../../models/conversations.preload.js'; import type { ConversationQueueJobBundle, DeleteStoryForEveryoneJobData, -} from '../conversationJobQueue.js'; -import { getUntrustedConversationServiceIds } from './getUntrustedConversationServiceIds.js'; -import { handleMessageSend } from '../../util/handleMessageSend.js'; -import { isConversationAccepted } from '../../util/isConversationAccepted.js'; -import { isConversationUnregistered } from '../../util/isConversationUnregistered.js'; -import { getMessageById } from '../../messages/getMessageById.js'; -import { isNotNil } from '../../util/isNotNil.js'; +} from '../conversationJobQueue.preload.js'; +import { getUntrustedConversationServiceIds } from './getUntrustedConversationServiceIds.dom.js'; +import { handleMessageSend } from '../../util/handleMessageSend.preload.js'; +import { isConversationAccepted } from '../../util/isConversationAccepted.preload.js'; +import { isConversationUnregistered } from '../../util/isConversationUnregistered.dom.js'; +import { getMessageById } from '../../messages/getMessageById.preload.js'; +import { isNotNil } from '../../util/isNotNil.std.js'; import type { CallbackResultType } from '../../textsecure/Types.d.ts'; -import type { MessageModel } from '../../models/messages.js'; -import { SendMessageProtoError } from '../../textsecure/Errors.js'; -import { strictAssert } from '../../util/assert.js'; -import type { LoggerType } from '../../types/Logging.js'; -import { isStory } from '../../messages/helpers.js'; +import type { MessageModel } from '../../models/messages.preload.js'; +import { SendMessageProtoError } from '../../textsecure/Errors.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import type { LoggerType } from '../../types/Logging.std.js'; +import { isStory } from '../../messages/helpers.std.js'; export async function sendDeleteStoryForEveryone( ourConversation: ConversationModel, diff --git a/ts/jobs/helpers/sendDirectExpirationTimerUpdate.ts b/ts/jobs/helpers/sendDirectExpirationTimerUpdate.ts index 09a73986a9..58ef6d7a60 100644 --- a/ts/jobs/helpers/sendDirectExpirationTimerUpdate.ts +++ b/ts/jobs/helpers/sendDirectExpirationTimerUpdate.ts @@ -3,28 +3,28 @@ import { ContentHint } from '@signalapp/libsignal-client'; -import { getSendOptions } from '../../util/getSendOptions.js'; +import { getSendOptions } from '../../util/getSendOptions.preload.js'; import { isDirectConversation, isMe, -} from '../../util/whatTypeOfConversation.js'; -import { SignalService as Proto } from '../../protobuf/index.js'; +} from '../../util/whatTypeOfConversation.dom.js'; +import { SignalService as Proto } from '../../protobuf/index.std.js'; import { handleMultipleSendErrors, maybeExpandErrors, -} from './handleMultipleSendErrors.js'; -import { wrapWithSyncMessageSend } from '../../util/wrapWithSyncMessageSend.js'; -import { ourProfileKeyService } from '../../services/ourProfileKey.js'; +} from './handleMultipleSendErrors.std.js'; +import { wrapWithSyncMessageSend } from '../../util/wrapWithSyncMessageSend.preload.js'; +import { ourProfileKeyService } from '../../services/ourProfileKey.std.js'; -import type { ConversationModel } from '../../models/conversations.js'; +import type { ConversationModel } from '../../models/conversations.preload.js'; import type { ExpirationTimerUpdateJobData, ConversationQueueJobBundle, -} from '../conversationJobQueue.js'; -import { handleMessageSend } from '../../util/handleMessageSend.js'; -import { isConversationAccepted } from '../../util/isConversationAccepted.js'; -import { isConversationUnregistered } from '../../util/isConversationUnregistered.js'; -import { DurationInSeconds } from '../../util/durations/index.js'; +} from '../conversationJobQueue.preload.js'; +import { handleMessageSend } from '../../util/handleMessageSend.preload.js'; +import { isConversationAccepted } from '../../util/isConversationAccepted.preload.js'; +import { isConversationUnregistered } from '../../util/isConversationUnregistered.dom.js'; +import { DurationInSeconds } from '../../util/durations/index.std.js'; export async function sendDirectExpirationTimerUpdate( conversation: ConversationModel, diff --git a/ts/jobs/helpers/sendGroupCallUpdate.ts b/ts/jobs/helpers/sendGroupCallUpdate.ts index a530054d4a..d58c51da88 100644 --- a/ts/jobs/helpers/sendGroupCallUpdate.ts +++ b/ts/jobs/helpers/sendGroupCallUpdate.ts @@ -3,22 +3,22 @@ import { ContentHint } from '@signalapp/libsignal-client'; -import { getSendOptions } from '../../util/getSendOptions.js'; -import { isGroup } from '../../util/whatTypeOfConversation.js'; +import { getSendOptions } from '../../util/getSendOptions.preload.js'; +import { isGroup } from '../../util/whatTypeOfConversation.dom.js'; import { handleMultipleSendErrors, maybeExpandErrors, -} from './handleMultipleSendErrors.js'; +} from './handleMultipleSendErrors.std.js'; -import type { ConversationModel } from '../../models/conversations.js'; +import type { ConversationModel } from '../../models/conversations.preload.js'; import type { ConversationQueueJobBundle, GroupCallUpdateJobData, -} from '../conversationJobQueue.js'; -import { getUntrustedConversationServiceIds } from './getUntrustedConversationServiceIds.js'; -import { sendToGroup } from '../../util/sendToGroup.js'; -import { wrapWithSyncMessageSend } from '../../util/wrapWithSyncMessageSend.js'; -import { getValidRecipients } from './getValidRecipients.js'; +} from '../conversationJobQueue.preload.js'; +import { getUntrustedConversationServiceIds } from './getUntrustedConversationServiceIds.dom.js'; +import { sendToGroup } from '../../util/sendToGroup.preload.js'; +import { wrapWithSyncMessageSend } from '../../util/wrapWithSyncMessageSend.preload.js'; +import { getValidRecipients } from './getValidRecipients.dom.js'; export async function sendGroupCallUpdate( conversation: ConversationModel, diff --git a/ts/jobs/helpers/sendGroupUpdate.ts b/ts/jobs/helpers/sendGroupUpdate.ts index 8f87d01df7..de4d49ced1 100644 --- a/ts/jobs/helpers/sendGroupUpdate.ts +++ b/ts/jobs/helpers/sendGroupUpdate.ts @@ -3,26 +3,26 @@ import { ContentHint } from '@signalapp/libsignal-client'; -import { getSendOptionsForRecipients } from '../../util/getSendOptions.js'; -import { isGroupV2 } from '../../util/whatTypeOfConversation.js'; +import { getSendOptionsForRecipients } from '../../util/getSendOptions.preload.js'; +import { isGroupV2 } from '../../util/whatTypeOfConversation.dom.js'; import { handleMultipleSendErrors, maybeExpandErrors, -} from './handleMultipleSendErrors.js'; -import { wrapWithSyncMessageSend } from '../../util/wrapWithSyncMessageSend.js'; -import * as Bytes from '../../Bytes.js'; -import { strictAssert } from '../../util/assert.js'; -import { ourProfileKeyService } from '../../services/ourProfileKey.js'; +} from './handleMultipleSendErrors.std.js'; +import { wrapWithSyncMessageSend } from '../../util/wrapWithSyncMessageSend.preload.js'; +import * as Bytes from '../../Bytes.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { ourProfileKeyService } from '../../services/ourProfileKey.std.js'; -import type { ConversationModel } from '../../models/conversations.js'; -import type { GroupV2InfoType } from '../../textsecure/SendMessage.js'; +import type { ConversationModel } from '../../models/conversations.preload.js'; +import type { GroupV2InfoType } from '../../textsecure/SendMessage.preload.js'; import type { GroupUpdateJobData, ConversationQueueJobBundle, -} from '../conversationJobQueue.js'; -import { getUntrustedConversationServiceIds } from './getUntrustedConversationServiceIds.js'; -import { sendToGroup } from '../../util/sendToGroup.js'; -import { getValidRecipients } from './getValidRecipients.js'; +} from '../conversationJobQueue.preload.js'; +import { getUntrustedConversationServiceIds } from './getUntrustedConversationServiceIds.dom.js'; +import { sendToGroup } from '../../util/sendToGroup.preload.js'; +import { getValidRecipients } from './getValidRecipients.dom.js'; // Note: because we don't have a recipient map, if some sends fail, we will resend this // message to folks that got it on the first go-round. This is okay, because receivers diff --git a/ts/jobs/helpers/sendNormalMessage.ts b/ts/jobs/helpers/sendNormalMessage.ts index fbe83f766d..648073339d 100644 --- a/ts/jobs/helpers/sendNormalMessage.ts +++ b/ts/jobs/helpers/sendNormalMessage.ts @@ -6,81 +6,85 @@ import PQueue from 'p-queue'; import { ContentHint } from '@signalapp/libsignal-client'; import Long from 'long'; -import * as Errors from '../../types/errors.js'; -import { strictAssert } from '../../util/assert.js'; -import type { MessageModel } from '../../models/messages.js'; -import { getMessageById } from '../../messages/getMessageById.js'; -import type { ConversationModel } from '../../models/conversations.js'; -import { isGroup, isGroupV2, isMe } from '../../util/whatTypeOfConversation.js'; -import { getSendOptions } from '../../util/getSendOptions.js'; -import { handleMessageSend } from '../../util/handleMessageSend.js'; -import { findAndFormatContact } from '../../util/findAndFormatContact.js'; -import { uploadAttachment } from '../../util/uploadAttachment.js'; +import * as Errors from '../../types/errors.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import type { MessageModel } from '../../models/messages.preload.js'; +import { getMessageById } from '../../messages/getMessageById.preload.js'; +import type { ConversationModel } from '../../models/conversations.preload.js'; +import { + isGroup, + isGroupV2, + isMe, +} from '../../util/whatTypeOfConversation.dom.js'; +import { getSendOptions } from '../../util/getSendOptions.preload.js'; +import { handleMessageSend } from '../../util/handleMessageSend.preload.js'; +import { findAndFormatContact } from '../../util/findAndFormatContact.preload.js'; +import { uploadAttachment } from '../../util/uploadAttachment.preload.js'; import { loadAttachmentData, loadQuoteData, loadPreviewData, loadStickerData, loadContactData, -} from '../../util/migrations.js'; +} from '../../util/migrations.preload.js'; import type { CallbackResultType } from '../../textsecure/Types.d.ts'; -import { isSent } from '../../messages/MessageSendState.js'; -import { isOutgoing, canReact } from '../../state/selectors/message.js'; +import { isSent } from '../../messages/MessageSendState.std.js'; +import { isOutgoing, canReact } from '../../state/selectors/message.preload.js'; import type { ReactionType, OutgoingQuoteType, OutgoingQuoteAttachmentType, OutgoingLinkPreviewType, OutgoingStickerType, -} from '../../textsecure/SendMessage.js'; +} from '../../textsecure/SendMessage.preload.js'; import type { AttachmentDownloadableFromTransitTier, AttachmentType, UploadedAttachmentType, -} from '../../types/Attachment.js'; -import { copyCdnFields } from '../../util/attachments.js'; -import type { RawBodyRange } from '../../types/BodyRange.js'; -import type { EmbeddedContactWithUploadedAvatar } from '../../types/EmbeddedContact.js'; -import type { StoryContextType } from '../../types/Util.js'; -import type { LoggerType } from '../../types/Logging.js'; -import { GROUP } from '../../types/Message2.js'; +} from '../../types/Attachment.std.js'; +import { copyCdnFields } from '../../util/attachments.preload.js'; +import type { RawBodyRange } from '../../types/BodyRange.std.js'; +import type { EmbeddedContactWithUploadedAvatar } from '../../types/EmbeddedContact.std.js'; +import type { StoryContextType } from '../../types/Util.std.js'; +import type { LoggerType } from '../../types/Logging.std.js'; +import { GROUP } from '../../types/Message2.preload.js'; import type { ConversationQueueJobBundle, NormalMessageSendJobData, -} from '../conversationJobQueue.js'; +} from '../conversationJobQueue.preload.js'; import type { QuotedMessageType } from '../../model-types.d.ts'; -import { handleMultipleSendErrors } from './handleMultipleSendErrors.js'; -import { ourProfileKeyService } from '../../services/ourProfileKey.js'; -import { isConversationUnregistered } from '../../util/isConversationUnregistered.js'; -import { isConversationAccepted } from '../../util/isConversationAccepted.js'; -import { sendToGroup } from '../../util/sendToGroup.js'; -import type { DurationInSeconds } from '../../util/durations/index.js'; -import type { ServiceIdString } from '../../types/ServiceId.js'; -import { normalizeAci } from '../../util/normalizeAci.js'; +import { handleMultipleSendErrors } from './handleMultipleSendErrors.std.js'; +import { ourProfileKeyService } from '../../services/ourProfileKey.std.js'; +import { isConversationUnregistered } from '../../util/isConversationUnregistered.dom.js'; +import { isConversationAccepted } from '../../util/isConversationAccepted.preload.js'; +import { sendToGroup } from '../../util/sendToGroup.preload.js'; +import type { DurationInSeconds } from '../../util/durations/index.std.js'; +import type { ServiceIdString } from '../../types/ServiceId.std.js'; +import { normalizeAci } from '../../util/normalizeAci.std.js'; import { getPropForTimestamp, getTargetOfThisEditTimestamp, getChangesForPropAtTimestamp, -} from '../../util/editHelpers.js'; -import { getMessageSentTimestamp } from '../../util/getMessageSentTimestamp.js'; -import { isSignalConversation } from '../../util/isSignalConversation.js'; +} from '../../util/editHelpers.std.js'; +import { getMessageSentTimestamp } from '../../util/getMessageSentTimestamp.std.js'; +import { isSignalConversation } from '../../util/isSignalConversation.dom.js'; import { isBodyTooLong, MAX_BODY_ATTACHMENT_BYTE_LENGTH, trimBody, -} from '../../util/longAttachment.js'; +} from '../../util/longAttachment.std.js'; import { markFailed, saveErrorsOnMessage, -} from '../../test-node/util/messageFailures.js'; -import { getMessageIdForLogging } from '../../util/idForLogging.js'; -import { send, sendSyncMessageOnly } from '../../messages/send.js'; -import type { SignalService } from '../../protobuf/index.js'; -import { uuidToBytes } from '../../util/uuidToBytes.js'; -import { fromBase64 } from '../../Bytes.js'; -import { MIMETypeToString } from '../../types/MIME.js'; -import { canReuseExistingTransitCdnPointerForEditedMessage } from '../../util/Attachment.js'; +} from '../../test-node/util/messageFailures.preload.js'; +import { getMessageIdForLogging } from '../../util/idForLogging.preload.js'; +import { send, sendSyncMessageOnly } from '../../messages/send.preload.js'; +import type { SignalService } from '../../protobuf/index.std.js'; +import { uuidToBytes } from '../../util/uuidToBytes.std.js'; +import { fromBase64 } from '../../Bytes.std.js'; +import { MIMETypeToString } from '../../types/MIME.std.js'; +import { canReuseExistingTransitCdnPointerForEditedMessage } from '../../util/Attachment.std.js'; const { isNumber } = lodash; diff --git a/ts/jobs/helpers/sendNullMessage.ts b/ts/jobs/helpers/sendNullMessage.ts index 87f12f8201..3ffb388327 100644 --- a/ts/jobs/helpers/sendNullMessage.ts +++ b/ts/jobs/helpers/sendNullMessage.ts @@ -3,28 +3,28 @@ import { ContentHint } from '@signalapp/libsignal-client'; -import { handleMessageSend } from '../../util/handleMessageSend.js'; -import { getSendOptions } from '../../util/getSendOptions.js'; -import { isDirectConversation } from '../../util/whatTypeOfConversation.js'; +import { handleMessageSend } from '../../util/handleMessageSend.preload.js'; +import { getSendOptions } from '../../util/getSendOptions.preload.js'; +import { isDirectConversation } from '../../util/whatTypeOfConversation.dom.js'; import { handleMultipleSendErrors, maybeExpandErrors, -} from './handleMultipleSendErrors.js'; +} from './handleMultipleSendErrors.std.js'; -import type { ConversationModel } from '../../models/conversations.js'; +import type { ConversationModel } from '../../models/conversations.preload.js'; import type { ConversationQueueJobBundle, NullMessageJobData, -} from '../conversationJobQueue.js'; +} from '../conversationJobQueue.preload.js'; import type { SessionResetsType } from '../../textsecure/Types.d.ts'; -import { isConversationUnregistered } from '../../util/isConversationUnregistered.js'; +import { isConversationUnregistered } from '../../util/isConversationUnregistered.dom.js'; import { OutgoingIdentityKeyError, UnregisteredUserError, -} from '../../textsecure/Errors.js'; -import { MessageSender } from '../../textsecure/SendMessage.js'; -import { sendToGroup } from '../../util/sendToGroup.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +} from '../../textsecure/Errors.std.js'; +import { MessageSender } from '../../textsecure/SendMessage.preload.js'; +import { sendToGroup } from '../../util/sendToGroup.preload.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; async function clearResetsTracking(idForTracking: string | undefined) { if (!idForTracking) { diff --git a/ts/jobs/helpers/sendProfileKey.ts b/ts/jobs/helpers/sendProfileKey.ts index b0c1e5d2e3..3f75065b11 100644 --- a/ts/jobs/helpers/sendProfileKey.ts +++ b/ts/jobs/helpers/sendProfileKey.ts @@ -4,37 +4,37 @@ import lodash from 'lodash'; import { ContentHint } from '@signalapp/libsignal-client'; -import { handleMessageSend } from '../../util/handleMessageSend.js'; -import { getSendOptions } from '../../util/getSendOptions.js'; +import { handleMessageSend } from '../../util/handleMessageSend.preload.js'; +import { getSendOptions } from '../../util/getSendOptions.preload.js'; import { isDirectConversation, isGroup, isGroupV2, -} from '../../util/whatTypeOfConversation.js'; -import { SignalService as Proto } from '../../protobuf/index.js'; +} from '../../util/whatTypeOfConversation.dom.js'; +import { SignalService as Proto } from '../../protobuf/index.std.js'; import { handleMultipleSendErrors, maybeExpandErrors, -} from './handleMultipleSendErrors.js'; -import { ourProfileKeyService } from '../../services/ourProfileKey.js'; +} from './handleMultipleSendErrors.std.js'; +import { ourProfileKeyService } from '../../services/ourProfileKey.std.js'; -import type { ConversationModel } from '../../models/conversations.js'; +import type { ConversationModel } from '../../models/conversations.preload.js'; import type { ConversationQueueJobBundle, ProfileKeyJobData, -} from '../conversationJobQueue.js'; +} from '../conversationJobQueue.preload.js'; import type { CallbackResultType } from '../../textsecure/Types.d.ts'; -import { isConversationUnregistered } from '../../util/isConversationUnregistered.js'; +import { isConversationUnregistered } from '../../util/isConversationUnregistered.dom.js'; import type { ConversationAttributesType } from '../../model-types.d.ts'; import { OutgoingIdentityKeyError, SendMessageChallengeError, SendMessageProtoError, UnregisteredUserError, -} from '../../textsecure/Errors.js'; -import { shouldSendToConversation } from './shouldSendToConversation.js'; -import { sendToGroup } from '../../util/sendToGroup.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +} from '../../textsecure/Errors.std.js'; +import { shouldSendToConversation } from './shouldSendToConversation.preload.js'; +import { sendToGroup } from '../../util/sendToGroup.preload.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; const { isNumber } = lodash; diff --git a/ts/jobs/helpers/sendReaction.ts b/ts/jobs/helpers/sendReaction.ts index 6c0ab01e1a..bb8822b7f5 100644 --- a/ts/jobs/helpers/sendReaction.ts +++ b/ts/jobs/helpers/sendReaction.ts @@ -4,45 +4,45 @@ import lodash from 'lodash'; import { ContentHint } from '@signalapp/libsignal-client'; -import * as Errors from '../../types/errors.js'; -import { strictAssert } from '../../util/assert.js'; -import { repeat, zipObject } from '../../util/iterables.js'; +import * as Errors from '../../types/errors.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { repeat, zipObject } from '../../util/iterables.std.js'; import type { CallbackResultType } from '../../textsecure/Types.d.ts'; -import { MessageModel } from '../../models/messages.js'; +import { MessageModel } from '../../models/messages.preload.js'; import type { MessageReactionType } from '../../model-types.d.ts'; -import type { ConversationModel } from '../../models/conversations.js'; +import type { ConversationModel } from '../../models/conversations.preload.js'; -import * as reactionUtil from '../../reactions/util.js'; -import { isSent, SendStatus } from '../../messages/MessageSendState.js'; -import { getMessageById } from '../../messages/getMessageById.js'; -import { isIncoming } from '../../messages/helpers.js'; +import * as reactionUtil from '../../reactions/util.std.js'; +import { isSent, SendStatus } from '../../messages/MessageSendState.std.js'; +import { getMessageById } from '../../messages/getMessageById.preload.js'; +import { isIncoming } from '../../messages/helpers.std.js'; import { isMe, isDirectConversation, isGroupV2, -} from '../../util/whatTypeOfConversation.js'; -import { getSendOptions } from '../../util/getSendOptions.js'; -import { handleMessageSend } from '../../util/handleMessageSend.js'; -import { ourProfileKeyService } from '../../services/ourProfileKey.js'; -import { canReact, isStory } from '../../state/selectors/message.js'; -import { findAndFormatContact } from '../../util/findAndFormatContact.js'; -import type { AciString, ServiceIdString } from '../../types/ServiceId.js'; -import { isAciString } from '../../util/isAciString.js'; -import { handleMultipleSendErrors } from './handleMultipleSendErrors.js'; -import { incrementMessageCounter } from '../../util/incrementMessageCounter.js'; -import { generateMessageId } from '../../util/generateMessageId.js'; +} from '../../util/whatTypeOfConversation.dom.js'; +import { getSendOptions } from '../../util/getSendOptions.preload.js'; +import { handleMessageSend } from '../../util/handleMessageSend.preload.js'; +import { ourProfileKeyService } from '../../services/ourProfileKey.std.js'; +import { canReact, isStory } from '../../state/selectors/message.preload.js'; +import { findAndFormatContact } from '../../util/findAndFormatContact.preload.js'; +import type { AciString, ServiceIdString } from '../../types/ServiceId.std.js'; +import { isAciString } from '../../util/isAciString.std.js'; +import { handleMultipleSendErrors } from './handleMultipleSendErrors.std.js'; +import { incrementMessageCounter } from '../../util/incrementMessageCounter.preload.js'; +import { generateMessageId } from '../../util/generateMessageId.node.js'; import type { ConversationQueueJobBundle, ReactionJobData, -} from '../conversationJobQueue.js'; -import { isConversationAccepted } from '../../util/isConversationAccepted.js'; -import { isConversationUnregistered } from '../../util/isConversationUnregistered.js'; -import type { LoggerType } from '../../types/Logging.js'; -import { sendToGroup } from '../../util/sendToGroup.js'; -import { hydrateStoryContext } from '../../util/hydrateStoryContext.js'; -import { send, sendSyncMessageOnly } from '../../messages/send.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +} from '../conversationJobQueue.preload.js'; +import { isConversationAccepted } from '../../util/isConversationAccepted.preload.js'; +import { isConversationUnregistered } from '../../util/isConversationUnregistered.dom.js'; +import type { LoggerType } from '../../types/Logging.std.js'; +import { sendToGroup } from '../../util/sendToGroup.preload.js'; +import { hydrateStoryContext } from '../../util/hydrateStoryContext.preload.js'; +import { send, sendSyncMessageOnly } from '../../messages/send.preload.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; const { isNumber } = lodash; diff --git a/ts/jobs/helpers/sendReceipts.ts b/ts/jobs/helpers/sendReceipts.ts index 4ed10e7962..221f0561f0 100644 --- a/ts/jobs/helpers/sendReceipts.ts +++ b/ts/jobs/helpers/sendReceipts.ts @@ -1,13 +1,13 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationModel } from '../../models/conversations.js'; -import { sendReceipts as sendReceiptsTask } from '../../util/sendReceipts.js'; +import type { ConversationModel } from '../../models/conversations.preload.js'; +import { sendReceipts as sendReceiptsTask } from '../../util/sendReceipts.preload.js'; import type { ConversationQueueJobBundle, ReceiptsJobData, -} from '../conversationJobQueue.js'; -import { shouldSendToConversation } from './shouldSendToConversation.js'; +} from '../conversationJobQueue.preload.js'; +import { shouldSendToConversation } from './shouldSendToConversation.preload.js'; export async function sendReceipts( conversation: ConversationModel, diff --git a/ts/jobs/helpers/sendResendRequest.ts b/ts/jobs/helpers/sendResendRequest.ts index dc42dab137..eb610df271 100644 --- a/ts/jobs/helpers/sendResendRequest.ts +++ b/ts/jobs/helpers/sendResendRequest.ts @@ -3,30 +3,30 @@ import { ContentHint, PlaintextContent } from '@signalapp/libsignal-client'; -import { handleMessageSend } from '../../util/handleMessageSend.js'; -import { getSendOptions } from '../../util/getSendOptions.js'; -import { isDirectConversation } from '../../util/whatTypeOfConversation.js'; +import { handleMessageSend } from '../../util/handleMessageSend.preload.js'; +import { getSendOptions } from '../../util/getSendOptions.preload.js'; +import { isDirectConversation } from '../../util/whatTypeOfConversation.dom.js'; import { handleMultipleSendErrors, maybeExpandErrors, -} from './handleMultipleSendErrors.js'; +} from './handleMultipleSendErrors.std.js'; -import type { ConversationModel } from '../../models/conversations.js'; +import type { ConversationModel } from '../../models/conversations.preload.js'; import type { ConversationQueueJobBundle, ResendRequestJobData, -} from '../conversationJobQueue.js'; -import { isConversationUnregistered } from '../../util/isConversationUnregistered.js'; +} from '../conversationJobQueue.preload.js'; +import { isConversationUnregistered } from '../../util/isConversationUnregistered.dom.js'; import { OutgoingIdentityKeyError, UnregisteredUserError, -} from '../../textsecure/Errors.js'; -import { drop } from '../../util/drop.js'; -import type { DecryptionErrorEventData } from '../../textsecure/messageReceiverEvents.js'; -import { retryPlaceholders } from '../../services/retryPlaceholders.js'; -import type { LoggerType } from '../../types/Logging.js'; -import { startAutomaticSessionReset } from '../../util/handleRetry.js'; -import * as Bytes from '../../Bytes.js'; +} from '../../textsecure/Errors.std.js'; +import { drop } from '../../util/drop.std.js'; +import type { DecryptionErrorEventData } from '../../textsecure/messageReceiverEvents.std.js'; +import { retryPlaceholders } from '../../services/retryPlaceholders.std.js'; +import type { LoggerType } from '../../types/Logging.std.js'; +import { startAutomaticSessionReset } from '../../util/handleRetry.preload.js'; +import * as Bytes from '../../Bytes.std.js'; function failoverToLocalReset( logger: LoggerType, diff --git a/ts/jobs/helpers/sendSavedProto.ts b/ts/jobs/helpers/sendSavedProto.ts index 924682df57..f53a8f522b 100644 --- a/ts/jobs/helpers/sendSavedProto.ts +++ b/ts/jobs/helpers/sendSavedProto.ts @@ -1,26 +1,26 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { handleMessageSend } from '../../util/handleMessageSend.js'; -import { getSendOptions } from '../../util/getSendOptions.js'; -import { isDirectConversation } from '../../util/whatTypeOfConversation.js'; -import { SignalService as Proto } from '../../protobuf/index.js'; +import { handleMessageSend } from '../../util/handleMessageSend.preload.js'; +import { getSendOptions } from '../../util/getSendOptions.preload.js'; +import { isDirectConversation } from '../../util/whatTypeOfConversation.dom.js'; +import { SignalService as Proto } from '../../protobuf/index.std.js'; import { handleMultipleSendErrors, maybeExpandErrors, -} from './handleMultipleSendErrors.js'; +} from './handleMultipleSendErrors.std.js'; -import type { ConversationModel } from '../../models/conversations.js'; +import type { ConversationModel } from '../../models/conversations.preload.js'; import type { ConversationQueueJobBundle, SavedProtoJobData, -} from '../conversationJobQueue.js'; -import { isConversationUnregistered } from '../../util/isConversationUnregistered.js'; +} from '../conversationJobQueue.preload.js'; +import { isConversationUnregistered } from '../../util/isConversationUnregistered.dom.js'; import { OutgoingIdentityKeyError, UnregisteredUserError, -} from '../../textsecure/Errors.js'; -import * as Bytes from '../../Bytes.js'; +} from '../../textsecure/Errors.std.js'; +import * as Bytes from '../../Bytes.std.js'; export async function sendSavedProto( conversation: ConversationModel, diff --git a/ts/jobs/helpers/sendSenderKeyDistribution.ts b/ts/jobs/helpers/sendSenderKeyDistribution.ts index c83dc2e13c..6cd3d3a703 100644 --- a/ts/jobs/helpers/sendSenderKeyDistribution.ts +++ b/ts/jobs/helpers/sendSenderKeyDistribution.ts @@ -1,26 +1,26 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { handleMessageSend } from '../../util/handleMessageSend.js'; -import { getSendOptions } from '../../util/getSendOptions.js'; -import { isDirectConversation } from '../../util/whatTypeOfConversation.js'; +import { handleMessageSend } from '../../util/handleMessageSend.preload.js'; +import { getSendOptions } from '../../util/getSendOptions.preload.js'; +import { isDirectConversation } from '../../util/whatTypeOfConversation.dom.js'; import { handleMultipleSendErrors, maybeExpandErrors, -} from './handleMultipleSendErrors.js'; +} from './handleMultipleSendErrors.std.js'; -import type { ConversationModel } from '../../models/conversations.js'; +import type { ConversationModel } from '../../models/conversations.preload.js'; import type { ConversationQueueJobBundle, SenderKeyDistributionJobData, -} from '../conversationJobQueue.js'; -import { isConversationUnregistered } from '../../util/isConversationUnregistered.js'; +} from '../conversationJobQueue.preload.js'; +import { isConversationUnregistered } from '../../util/isConversationUnregistered.dom.js'; import { NoSenderKeyError, OutgoingIdentityKeyError, UnregisteredUserError, -} from '../../textsecure/Errors.js'; -import { shouldSendToConversation } from './shouldSendToConversation.js'; +} from '../../textsecure/Errors.std.js'; +import { shouldSendToConversation } from './shouldSendToConversation.preload.js'; // Note: in regular scenarios, sender keys are sent as part of a group send. This job type // is only used in decryption error recovery scenarios. diff --git a/ts/jobs/helpers/sendStory.ts b/ts/jobs/helpers/sendStory.ts index 379e4a64cd..68d6d69801 100644 --- a/ts/jobs/helpers/sendStory.ts +++ b/ts/jobs/helpers/sendStory.ts @@ -4,51 +4,54 @@ import lodash from 'lodash'; import { ContentHint } from '@signalapp/libsignal-client'; -import type { UploadedAttachmentType } from '../../types/Attachment.js'; -import type { ConversationModel } from '../../models/conversations.js'; +import type { UploadedAttachmentType } from '../../types/Attachment.std.js'; +import type { ConversationModel } from '../../models/conversations.preload.js'; import type { ConversationQueueJobBundle, StoryJobData, -} from '../conversationJobQueue.js'; -import type { LoggerType } from '../../types/Logging.js'; -import type { MessageModel } from '../../models/messages.js'; +} from '../conversationJobQueue.preload.js'; +import type { LoggerType } from '../../types/Logging.std.js'; +import type { MessageModel } from '../../models/messages.preload.js'; import type { SendState, SendStateByConversationId, -} from '../../messages/MessageSendState.js'; +} from '../../messages/MessageSendState.std.js'; import { isSent, SendActionType, sendStateReducer, -} from '../../messages/MessageSendState.js'; -import type { ServiceIdString } from '../../types/ServiceId.js'; -import type { StoryDistributionIdString } from '../../types/StoryDistributionId.js'; -import * as Errors from '../../types/errors.js'; -import type { StoryMessageRecipientsType } from '../../types/Stories.js'; -import { DataReader } from '../../sql/Client.js'; -import { SignalService as Proto } from '../../protobuf/index.js'; -import { getMessagesById } from '../../messages/getMessagesById.js'; +} from '../../messages/MessageSendState.std.js'; +import type { ServiceIdString } from '../../types/ServiceId.std.js'; +import type { StoryDistributionIdString } from '../../types/StoryDistributionId.std.js'; +import * as Errors from '../../types/errors.std.js'; +import type { StoryMessageRecipientsType } from '../../types/Stories.std.js'; +import { DataReader } from '../../sql/Client.preload.js'; +import { SignalService as Proto } from '../../protobuf/index.std.js'; +import { getMessagesById } from '../../messages/getMessagesById.preload.js'; import { getSendOptions, getSendOptionsForRecipients, -} from '../../util/getSendOptions.js'; -import { loadPreviewData, loadAttachmentData } from '../../util/migrations.js'; -import { handleMessageSend } from '../../util/handleMessageSend.js'; -import { handleMultipleSendErrors } from './handleMultipleSendErrors.js'; -import { isGroupV2, isMe } from '../../util/whatTypeOfConversation.js'; -import { ourProfileKeyService } from '../../services/ourProfileKey.js'; -import { challengeHandler } from '../../services/challengeHandler.js'; -import { sendContentMessageToGroup } from '../../util/sendToGroup.js'; -import { distributionListToSendTarget } from '../../util/distributionListToSendTarget.js'; -import { uploadAttachment } from '../../util/uploadAttachment.js'; -import { SendMessageChallengeError } from '../../textsecure/Errors.js'; -import type { OutgoingTextAttachmentType } from '../../textsecure/SendMessage.js'; +} from '../../util/getSendOptions.preload.js'; +import { + loadPreviewData, + loadAttachmentData, +} from '../../util/migrations.preload.js'; +import { handleMessageSend } from '../../util/handleMessageSend.preload.js'; +import { handleMultipleSendErrors } from './handleMultipleSendErrors.std.js'; +import { isGroupV2, isMe } from '../../util/whatTypeOfConversation.dom.js'; +import { ourProfileKeyService } from '../../services/ourProfileKey.std.js'; +import { challengeHandler } from '../../services/challengeHandler.preload.js'; +import { sendContentMessageToGroup } from '../../util/sendToGroup.preload.js'; +import { distributionListToSendTarget } from '../../util/distributionListToSendTarget.preload.js'; +import { uploadAttachment } from '../../util/uploadAttachment.preload.js'; +import { SendMessageChallengeError } from '../../textsecure/Errors.std.js'; +import type { OutgoingTextAttachmentType } from '../../textsecure/SendMessage.preload.js'; import { markFailed, notifyStorySendFailed, saveErrorsOnMessage, -} from '../../test-node/util/messageFailures.js'; -import { send } from '../../messages/send.js'; +} from '../../test-node/util/messageFailures.preload.js'; +import { send } from '../../messages/send.preload.js'; const { isEqual } = lodash; diff --git a/ts/jobs/helpers/shouldSendToConversation.ts b/ts/jobs/helpers/shouldSendToConversation.ts index 899f454e8e..5d83497779 100644 --- a/ts/jobs/helpers/shouldSendToConversation.ts +++ b/ts/jobs/helpers/shouldSendToConversation.ts @@ -1,12 +1,12 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationModel } from '../../models/conversations.js'; -import type { LoggerType } from '../../types/Logging.js'; -import { getRecipients } from '../../util/getRecipients.js'; -import { isConversationAccepted } from '../../util/isConversationAccepted.js'; -import { isSignalConversation } from '../../util/isSignalConversation.js'; -import { getUntrustedConversationServiceIds } from './getUntrustedConversationServiceIds.js'; +import type { ConversationModel } from '../../models/conversations.preload.js'; +import type { LoggerType } from '../../types/Logging.std.js'; +import { getRecipients } from '../../util/getRecipients.dom.js'; +import { isConversationAccepted } from '../../util/isConversationAccepted.preload.js'; +import { isSignalConversation } from '../../util/isSignalConversation.dom.js'; +import { getUntrustedConversationServiceIds } from './getUntrustedConversationServiceIds.dom.js'; export function shouldSendToConversation( conversation: ConversationModel, diff --git a/ts/jobs/helpers/sleepForRateLimitRetryAfterTime.ts b/ts/jobs/helpers/sleepForRateLimitRetryAfterTime.ts index a55e27ac8b..5d1dd37664 100644 --- a/ts/jobs/helpers/sleepForRateLimitRetryAfterTime.ts +++ b/ts/jobs/helpers/sleepForRateLimitRetryAfterTime.ts @@ -1,9 +1,9 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LoggerType } from '../../types/Logging.js'; -import { sleeper } from '../../util/sleeper.js'; -import { findRetryAfterTimeFromError } from './findRetryAfterTimeFromError.js'; +import type { LoggerType } from '../../types/Logging.std.js'; +import { sleeper } from '../../util/sleeper.std.js'; +import { findRetryAfterTimeFromError } from './findRetryAfterTimeFromError.std.js'; export async function sleepForRateLimitRetryAfterTime({ err, diff --git a/ts/jobs/helpers/syncHelpers.ts b/ts/jobs/helpers/syncHelpers.ts index a276afbccd..0faf2f6153 100644 --- a/ts/jobs/helpers/syncHelpers.ts +++ b/ts/jobs/helpers/syncHelpers.ts @@ -2,23 +2,23 @@ // SPDX-License-Identifier: AGPL-3.0-only import lodash from 'lodash'; -import type { LoggerType } from '../../types/Logging.js'; -import type { AciString } from '../../types/ServiceId.js'; -import { normalizeAci } from '../../util/normalizeAci.js'; -import { getSendOptions } from '../../util/getSendOptions.js'; -import type { SendTypesType } from '../../util/handleMessageSend.js'; -import { handleMessageSend } from '../../util/handleMessageSend.js'; -import { isNotNil } from '../../util/isNotNil.js'; -import { strictAssert } from '../../util/assert.js'; -import { isRecord } from '../../util/isRecord.js'; +import type { LoggerType } from '../../types/Logging.std.js'; +import type { AciString } from '../../types/ServiceId.std.js'; +import { normalizeAci } from '../../util/normalizeAci.std.js'; +import { getSendOptions } from '../../util/getSendOptions.preload.js'; +import type { SendTypesType } from '../../util/handleMessageSend.preload.js'; +import { handleMessageSend } from '../../util/handleMessageSend.preload.js'; +import { isNotNil } from '../../util/isNotNil.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { isRecord } from '../../util/isRecord.std.js'; -import { commonShouldJobContinue } from './commonShouldJobContinue.js'; -import { handleCommonJobRequestError } from './handleCommonJobRequestError.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; +import { commonShouldJobContinue } from './commonShouldJobContinue.preload.js'; +import { handleCommonJobRequestError } from './handleCommonJobRequestError.std.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; import { type MessageSender, messageSender, -} from '../../textsecure/SendMessage.js'; +} from '../../textsecure/SendMessage.preload.js'; const { chunk } = lodash; diff --git a/ts/jobs/initializeAllJobQueues.ts b/ts/jobs/initializeAllJobQueues.ts index 376b4a354c..8587f1c16a 100644 --- a/ts/jobs/initializeAllJobQueues.ts +++ b/ts/jobs/initializeAllJobQueues.ts @@ -1,20 +1,20 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { reportMessage, isOnline } from '../textsecure/WebAPI.js'; -import { drop } from '../util/drop.js'; -import { CallLinkFinalizeDeleteManager } from './CallLinkFinalizeDeleteManager.js'; -import { chatFolderCleanupService } from '../services/expiring/chatFolderCleanupService.js'; -import { callLinkRefreshJobQueue } from './callLinkRefreshJobQueue.js'; -import { conversationJobQueue } from './conversationJobQueue.js'; -import { deleteDownloadsJobQueue } from './deleteDownloadsJobQueue.js'; -import { groupAvatarJobQueue } from './groupAvatarJobQueue.js'; -import { readSyncJobQueue } from './readSyncJobQueue.js'; -import { removeStorageKeyJobQueue } from './removeStorageKeyJobQueue.js'; -import { reportSpamJobQueue } from './reportSpamJobQueue.js'; -import { singleProtoJobQueue } from './singleProtoJobQueue.js'; -import { viewOnceOpenJobQueue } from './viewOnceOpenJobQueue.js'; -import { viewSyncJobQueue } from './viewSyncJobQueue.js'; +import type { reportMessage, isOnline } from '../textsecure/WebAPI.preload.js'; +import { drop } from '../util/drop.std.js'; +import { CallLinkFinalizeDeleteManager } from './CallLinkFinalizeDeleteManager.preload.js'; +import { chatFolderCleanupService } from '../services/expiring/chatFolderCleanupService.preload.js'; +import { callLinkRefreshJobQueue } from './callLinkRefreshJobQueue.preload.js'; +import { conversationJobQueue } from './conversationJobQueue.preload.js'; +import { deleteDownloadsJobQueue } from './deleteDownloadsJobQueue.preload.js'; +import { groupAvatarJobQueue } from './groupAvatarJobQueue.preload.js'; +import { readSyncJobQueue } from './readSyncJobQueue.preload.js'; +import { removeStorageKeyJobQueue } from './removeStorageKeyJobQueue.preload.js'; +import { reportSpamJobQueue } from './reportSpamJobQueue.preload.js'; +import { singleProtoJobQueue } from './singleProtoJobQueue.preload.js'; +import { viewOnceOpenJobQueue } from './viewOnceOpenJobQueue.preload.js'; +import { viewSyncJobQueue } from './viewSyncJobQueue.preload.js'; type ServerType = { reportMessage: typeof reportMessage; diff --git a/ts/jobs/readSyncJobQueue.ts b/ts/jobs/readSyncJobQueue.ts index b8c3d6e42c..9076361941 100644 --- a/ts/jobs/readSyncJobQueue.ts +++ b/ts/jobs/readSyncJobQueue.ts @@ -1,21 +1,21 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as durations from '../util/durations/index.js'; -import type { LoggerType } from '../types/Logging.js'; -import { exponentialBackoffMaxAttempts } from '../util/exponentialBackoff.js'; -import type { SyncType } from './helpers/syncHelpers.js'; +import * as durations from '../util/durations/index.std.js'; +import type { LoggerType } from '../types/Logging.std.js'; +import { exponentialBackoffMaxAttempts } from '../util/exponentialBackoff.std.js'; +import type { SyncType } from './helpers/syncHelpers.preload.js'; import { SyncTypeList, parseRawSyncDataArray, runSyncJob, -} from './helpers/syncHelpers.js'; -import { strictAssert } from '../util/assert.js'; -import { isRecord } from '../util/isRecord.js'; +} from './helpers/syncHelpers.preload.js'; +import { strictAssert } from '../util/assert.std.js'; +import { isRecord } from '../util/isRecord.std.js'; -import type { JOB_STATUS } from './JobQueue.js'; -import { JobQueue } from './JobQueue.js'; -import { jobQueueDatabaseStore } from './JobQueueDatabaseStore.js'; +import type { JOB_STATUS } from './JobQueue.std.js'; +import { JobQueue } from './JobQueue.std.js'; +import { jobQueueDatabaseStore } from './JobQueueDatabaseStore.preload.js'; const MAX_RETRY_TIME = durations.DAY; diff --git a/ts/jobs/removeStorageKeyJobQueue.ts b/ts/jobs/removeStorageKeyJobQueue.ts index a385a8b06a..6529dfabca 100644 --- a/ts/jobs/removeStorageKeyJobQueue.ts +++ b/ts/jobs/removeStorageKeyJobQueue.ts @@ -3,12 +3,12 @@ import { z } from 'zod'; -import type { JOB_STATUS } from './JobQueue.js'; -import { JobQueue } from './JobQueue.js'; +import type { JOB_STATUS } from './JobQueue.std.js'; +import { JobQueue } from './JobQueue.std.js'; -import { jobQueueDatabaseStore } from './JobQueueDatabaseStore.js'; -import { parseUnknown } from '../util/schemas.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import { jobQueueDatabaseStore } from './JobQueueDatabaseStore.preload.js'; +import { parseUnknown } from '../util/schemas.std.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const removeStorageKeyJobDataSchema = z.object({ key: z.enum([ diff --git a/ts/jobs/reportSpamJobQueue.ts b/ts/jobs/reportSpamJobQueue.ts index 35b1d4612a..0a11850ca8 100644 --- a/ts/jobs/reportSpamJobQueue.ts +++ b/ts/jobs/reportSpamJobQueue.ts @@ -2,23 +2,23 @@ // SPDX-License-Identifier: AGPL-3.0-only import * as z from 'zod'; -import * as durations from '../util/durations/index.js'; -import { strictAssert } from '../util/assert.js'; -import { waitForOnline } from '../util/waitForOnline.js'; -import { isDone as isDeviceLinked } from '../util/registration.js'; -import type { LoggerType } from '../types/Logging.js'; -import { aciSchema } from '../types/ServiceId.js'; -import { map } from '../util/iterables.js'; +import * as durations from '../util/durations/index.std.js'; +import { strictAssert } from '../util/assert.std.js'; +import { waitForOnline } from '../util/waitForOnline.dom.js'; +import { isDone as isDeviceLinked } from '../util/registration.preload.js'; +import type { LoggerType } from '../types/Logging.std.js'; +import { aciSchema } from '../types/ServiceId.std.js'; +import { map } from '../util/iterables.std.js'; -import type { JOB_STATUS } from './JobQueue.js'; -import { JobQueue } from './JobQueue.js'; -import { jobQueueDatabaseStore } from './JobQueueDatabaseStore.js'; -import { parseIntWithFallback } from '../util/parseIntWithFallback.js'; -import type { reportMessage, isOnline } from '../textsecure/WebAPI.js'; -import { HTTPError } from '../types/HTTPError.js'; -import { sleeper } from '../util/sleeper.js'; -import { parseUnknown } from '../util/schemas.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import type { JOB_STATUS } from './JobQueue.std.js'; +import { JobQueue } from './JobQueue.std.js'; +import { jobQueueDatabaseStore } from './JobQueueDatabaseStore.preload.js'; +import { parseIntWithFallback } from '../util/parseIntWithFallback.std.js'; +import type { reportMessage, isOnline } from '../textsecure/WebAPI.preload.js'; +import { HTTPError } from '../types/HTTPError.std.js'; +import { sleeper } from '../util/sleeper.std.js'; +import { parseUnknown } from '../util/schemas.std.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const RETRY_WAIT_TIME = durations.MINUTE; const RETRYABLE_4XX_FAILURE_STATUSES = new Set([ diff --git a/ts/jobs/singleProtoJobQueue.ts b/ts/jobs/singleProtoJobQueue.ts index d3a10fa1ac..b37b9f841d 100644 --- a/ts/jobs/singleProtoJobQueue.ts +++ b/ts/jobs/singleProtoJobQueue.ts @@ -4,30 +4,30 @@ import PQueue from 'p-queue'; import lodash from 'lodash'; -import * as Bytes from '../Bytes.js'; -import type { LoggerType } from '../types/Logging.js'; -import { exponentialBackoffMaxAttempts } from '../util/exponentialBackoff.js'; -import type { ParsedJob } from './types.js'; -import type { JOB_STATUS } from './JobQueue.js'; -import { JobQueue } from './JobQueue.js'; -import { jobQueueDatabaseStore } from './JobQueueDatabaseStore.js'; -import { DAY } from '../util/durations/index.js'; -import { commonShouldJobContinue } from './helpers/commonShouldJobContinue.js'; -import { SignalService as Proto } from '../protobuf/index.js'; -import { handleMessageSend } from '../util/handleMessageSend.js'; -import { getSendOptions } from '../util/getSendOptions.js'; -import type { SingleProtoJobData } from '../textsecure/SendMessage.js'; +import * as Bytes from '../Bytes.std.js'; +import type { LoggerType } from '../types/Logging.std.js'; +import { exponentialBackoffMaxAttempts } from '../util/exponentialBackoff.std.js'; +import type { ParsedJob } from './types.std.js'; +import type { JOB_STATUS } from './JobQueue.std.js'; +import { JobQueue } from './JobQueue.std.js'; +import { jobQueueDatabaseStore } from './JobQueueDatabaseStore.preload.js'; +import { DAY } from '../util/durations/index.std.js'; +import { commonShouldJobContinue } from './helpers/commonShouldJobContinue.preload.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; +import { handleMessageSend } from '../util/handleMessageSend.preload.js'; +import { getSendOptions } from '../util/getSendOptions.preload.js'; +import type { SingleProtoJobData } from '../textsecure/SendMessage.preload.js'; import { singleProtoJobDataSchema, messageSender, -} from '../textsecure/SendMessage.js'; +} from '../textsecure/SendMessage.preload.js'; import { handleMultipleSendErrors, maybeExpandErrors, -} from './helpers/handleMultipleSendErrors.js'; -import { isConversationUnregistered } from '../util/isConversationUnregistered.js'; -import { isConversationAccepted } from '../util/isConversationAccepted.js'; -import { parseUnknown } from '../util/schemas.js'; +} from './helpers/handleMultipleSendErrors.std.js'; +import { isConversationUnregistered } from '../util/isConversationUnregistered.dom.js'; +import { isConversationAccepted } from '../util/isConversationAccepted.preload.js'; +import { parseUnknown } from '../util/schemas.std.js'; const { isBoolean } = lodash; diff --git a/ts/jobs/viewOnceOpenJobQueue.ts b/ts/jobs/viewOnceOpenJobQueue.ts index 4d66259609..f2cf16d861 100644 --- a/ts/jobs/viewOnceOpenJobQueue.ts +++ b/ts/jobs/viewOnceOpenJobQueue.ts @@ -1,21 +1,21 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as durations from '../util/durations/index.js'; -import type { LoggerType } from '../types/Logging.js'; -import { exponentialBackoffMaxAttempts } from '../util/exponentialBackoff.js'; -import type { SyncType } from './helpers/syncHelpers.js'; +import * as durations from '../util/durations/index.std.js'; +import type { LoggerType } from '../types/Logging.std.js'; +import { exponentialBackoffMaxAttempts } from '../util/exponentialBackoff.std.js'; +import type { SyncType } from './helpers/syncHelpers.preload.js'; import { SyncTypeList, parseRawSyncDataArray, runSyncJob, -} from './helpers/syncHelpers.js'; -import { strictAssert } from '../util/assert.js'; -import { isRecord } from '../util/isRecord.js'; +} from './helpers/syncHelpers.preload.js'; +import { strictAssert } from '../util/assert.std.js'; +import { isRecord } from '../util/isRecord.std.js'; -import type { JOB_STATUS } from './JobQueue.js'; -import { JobQueue } from './JobQueue.js'; -import { jobQueueDatabaseStore } from './JobQueueDatabaseStore.js'; +import type { JOB_STATUS } from './JobQueue.std.js'; +import { JobQueue } from './JobQueue.std.js'; +import { jobQueueDatabaseStore } from './JobQueueDatabaseStore.preload.js'; const MAX_RETRY_TIME = durations.DAY; diff --git a/ts/jobs/viewSyncJobQueue.ts b/ts/jobs/viewSyncJobQueue.ts index 5ed11109b9..7800be17ca 100644 --- a/ts/jobs/viewSyncJobQueue.ts +++ b/ts/jobs/viewSyncJobQueue.ts @@ -1,21 +1,21 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as durations from '../util/durations/index.js'; -import type { LoggerType } from '../types/Logging.js'; -import { exponentialBackoffMaxAttempts } from '../util/exponentialBackoff.js'; -import type { SyncType } from './helpers/syncHelpers.js'; +import * as durations from '../util/durations/index.std.js'; +import type { LoggerType } from '../types/Logging.std.js'; +import { exponentialBackoffMaxAttempts } from '../util/exponentialBackoff.std.js'; +import type { SyncType } from './helpers/syncHelpers.preload.js'; import { SyncTypeList, parseRawSyncDataArray, runSyncJob, -} from './helpers/syncHelpers.js'; -import { strictAssert } from '../util/assert.js'; -import { isRecord } from '../util/isRecord.js'; +} from './helpers/syncHelpers.preload.js'; +import { strictAssert } from '../util/assert.std.js'; +import { isRecord } from '../util/isRecord.std.js'; -import type { JOB_STATUS } from './JobQueue.js'; -import { JobQueue } from './JobQueue.js'; -import { jobQueueDatabaseStore } from './JobQueueDatabaseStore.js'; +import type { JOB_STATUS } from './JobQueue.std.js'; +import { JobQueue } from './JobQueue.std.js'; +import { jobQueueDatabaseStore } from './JobQueueDatabaseStore.preload.js'; const MAX_RETRY_TIME = durations.DAY; diff --git a/ts/linkPreviews/linkPreviewFetch.ts b/ts/linkPreviews/linkPreviewFetch.ts index fcd1304c82..b656895e29 100644 --- a/ts/linkPreviews/linkPreviewFetch.ts +++ b/ts/linkPreviews/linkPreviewFetch.ts @@ -4,7 +4,7 @@ import type { RequestInit, Response } from 'node-fetch'; import { blobToArrayBuffer } from 'blob-util'; -import type { MIMEType } from '../types/MIME.js'; +import type { MIMEType } from '../types/MIME.std.js'; import { IMAGE_GIF, IMAGE_ICO, @@ -12,10 +12,10 @@ import { IMAGE_PNG, IMAGE_WEBP, stringToMIMEType, -} from '../types/MIME.js'; -import type { LoggerType } from '../types/Logging.js'; -import { scaleImageToLevel } from '../util/scaleImageToLevel.js'; -import { createLogger } from '../logging/log.js'; +} from '../types/MIME.std.js'; +import type { LoggerType } from '../types/Logging.std.js'; +import { scaleImageToLevel } from '../util/scaleImageToLevel.preload.js'; +import { createLogger } from '../logging/log.std.js'; const log = createLogger('linkPreviewFetch'); diff --git a/ts/linkPreviews/shouldUseFullSizeLinkPreviewImage.ts b/ts/linkPreviews/shouldUseFullSizeLinkPreviewImage.ts index bf5d1fc2c3..d4f69805e3 100644 --- a/ts/linkPreviews/shouldUseFullSizeLinkPreviewImage.ts +++ b/ts/linkPreviews/shouldUseFullSizeLinkPreviewImage.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LinkPreviewType } from '../types/message/LinkPreviews.js'; -import { isImageAttachment } from '../util/Attachment.js'; +import type { LinkPreviewType } from '../types/message/LinkPreviews.std.js'; +import { isImageAttachment } from '../util/Attachment.std.js'; const MINIMUM_FULL_SIZE_DIMENSION = 200; diff --git a/ts/logging/debuglogs.ts b/ts/logging/debuglogs.ts index 922a00da69..873d13e9cc 100644 --- a/ts/logging/debuglogs.ts +++ b/ts/logging/debuglogs.ts @@ -2,17 +2,17 @@ // SPDX-License-Identifier: AGPL-3.0-only import lodash from 'lodash'; -import { reallyJsonStringify } from '../util/reallyJsonStringify.js'; -import type { FetchLogIpcData, LogEntryType } from './shared.js'; +import { reallyJsonStringify } from '../util/reallyJsonStringify.std.js'; +import type { FetchLogIpcData, LogEntryType } from './shared.std.js'; import { LogLevel, getLogLevelString, isFetchLogIpcData, isLogEntry, levelMaxLength, -} from './shared.js'; -import { redactAll } from '../util/privacy.js'; -import { getEnvironment } from '../environment.js'; +} from './shared.std.js'; +import { redactAll } from '../util/privacy.node.js'; +import { getEnvironment } from '../environment.std.js'; const { memoize, sortBy } = lodash; diff --git a/ts/logging/log.ts b/ts/logging/log.ts index 9e9a880194..6940238fdf 100644 --- a/ts/logging/log.ts +++ b/ts/logging/log.ts @@ -4,10 +4,10 @@ import pino from 'pino'; import { LRUCache } from 'lru-cache'; -import type { LoggerType } from '../types/Logging.js'; -import { Environment, getEnvironment } from '../environment.js'; -import { reallyJsonStringify } from '../util/reallyJsonStringify.js'; -import { getLogLevelString, type LogLevel } from './shared.js'; +import type { LoggerType } from '../types/Logging.std.js'; +import { Environment, getEnvironment } from '../environment.std.js'; +import { reallyJsonStringify } from '../util/reallyJsonStringify.std.js'; +import { getLogLevelString, type LogLevel } from './shared.std.js'; // This file is imported by some components so we can't import `ts/util/privacy` let redactAll = (value: string) => value; diff --git a/ts/logging/main_process_logging.ts b/ts/logging/main_process_logging.ts index 5c7df6a1d3..cf31913e78 100644 --- a/ts/logging/main_process_logging.ts +++ b/ts/logging/main_process_logging.ts @@ -22,16 +22,16 @@ import { join } from 'node:path'; import { read as readLastLines } from 'read-last-lines'; import split2 from 'split2'; -import type { LoggerType } from '../types/Logging.js'; -import * as Errors from '../types/errors.js'; -import { createRotatingPinoDest } from '../util/rotatingPinoDest.js'; -import { redactAll } from '../util/privacy.js'; +import type { LoggerType } from '../types/Logging.std.js'; +import * as Errors from '../types/errors.std.js'; +import { createRotatingPinoDest } from '../util/rotatingPinoDest.node.js'; +import { redactAll } from '../util/privacy.node.js'; -import { setPinoDestination, log, setOnLogCallback } from './log.js'; +import { setPinoDestination, log, setOnLogCallback } from './log.std.js'; -import type { FetchLogIpcData, LogEntryType } from './shared.js'; -import { LogLevel, isLogEntry } from './shared.js'; -import { isProduction } from '../util/version.js'; +import type { FetchLogIpcData, LogEntryType } from './shared.std.js'; +import { LogLevel, isLogEntry } from './shared.std.js'; +import { isProduction } from '../util/version.std.js'; const { filter, flatten, map, pick, sortBy } = lodash; diff --git a/ts/logging/set_up_renderer_logging.ts b/ts/logging/set_up_renderer_logging.ts index 69cf5b030d..bed0d96449 100644 --- a/ts/logging/set_up_renderer_logging.ts +++ b/ts/logging/set_up_renderer_logging.ts @@ -11,10 +11,10 @@ import { LogLevel as SignalClientLogLevel, } from '@signalapp/libsignal-client'; -import { setPinoDestination, log } from './log.js'; -import * as Errors from '../types/errors.js'; -import { createRotatingPinoDest } from '../util/rotatingPinoDest.js'; -import { redactAll } from '../util/privacy.js'; +import { setPinoDestination, log } from './log.std.js'; +import * as Errors from '../types/errors.std.js'; +import { createRotatingPinoDest } from '../util/rotatingPinoDest.node.js'; +import { redactAll } from '../util/privacy.node.js'; let isInitialized = false; let shouldRestart = false; diff --git a/ts/logging/shared.ts b/ts/logging/shared.ts index 31dc3b74e7..61e1d8ac43 100644 --- a/ts/logging/shared.ts +++ b/ts/logging/shared.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import pino from 'pino'; -import { isRecord } from '../util/isRecord.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { LogLevel } from '../types/Logging.js'; +import { isRecord } from '../util/isRecord.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { LogLevel } from '../types/Logging.std.js'; export { LogLevel }; diff --git a/ts/logging/uploadDebugLog.ts b/ts/logging/uploadDebugLog.ts index 2b193b41e7..e116ebe768 100644 --- a/ts/logging/uploadDebugLog.ts +++ b/ts/logging/uploadDebugLog.ts @@ -7,11 +7,11 @@ import FormData from 'form-data'; import got from 'got'; import { gzip } from 'node:zlib'; import pify from 'pify'; -import { getUserAgent } from '../util/getUserAgent.js'; -import { maybeParseUrl } from '../util/url.js'; -import * as durations from '../util/durations/index.js'; -import type { LoggerType } from '../types/Logging.js'; -import { parseUnknown } from '../util/schemas.js'; +import { getUserAgent } from '../util/getUserAgent.node.js'; +import { maybeParseUrl } from '../util/url.std.js'; +import * as durations from '../util/durations/index.std.js'; +import type { LoggerType } from '../types/Logging.std.js'; +import { parseUnknown } from '../util/schemas.std.js'; const BASE_URL = 'https://debuglogs.org'; diff --git a/ts/main/challengeMain.ts b/ts/main/challengeMain.ts index 2469d3a33e..6f2b55f332 100644 --- a/ts/main/challengeMain.ts +++ b/ts/main/challengeMain.ts @@ -4,13 +4,13 @@ import type { IpcMainEvent } from 'electron'; import { ipcMain as ipc } from 'electron'; -import { createLogger } from '../logging/log.js'; +import { createLogger } from '../logging/log.std.js'; import type { IPCRequest, IPCResponse, ChallengeResponse, -} from '../challenge.js'; -import { getEnvironment, Environment } from '../environment.js'; +} from '../challenge.dom.js'; +import { getEnvironment, Environment } from '../environment.std.js'; const log = createLogger('challengeMain'); diff --git a/ts/main/settingsChannel.ts b/ts/main/settingsChannel.ts index 249c9fe8d0..a8bbf716c6 100644 --- a/ts/main/settingsChannel.ts +++ b/ts/main/settingsChannel.ts @@ -5,13 +5,13 @@ import type { BrowserWindow } from 'electron'; import { ipcMain as ipc, session } from 'electron'; import { EventEmitter } from 'node:events'; -import { createLogger } from '../logging/log.js'; -import { userConfig } from '../../app/user_config.js'; -import { ephemeralConfig } from '../../app/ephemeral_config.js'; -import { installPermissionsHandler } from '../../app/permissions.js'; -import { strictAssert } from '../util/assert.js'; +import { createLogger } from '../logging/log.std.js'; +import { userConfig } from '../../app/user_config.main.js'; +import { ephemeralConfig } from '../../app/ephemeral_config.main.js'; +import { installPermissionsHandler } from '../../app/permissions.std.js'; +import { strictAssert } from '../util/assert.std.js'; -import type { EphemeralSettings } from '../util/preload.js'; +import type { EphemeralSettings } from '../util/preload.preload.js'; const log = createLogger('settingsChannel'); diff --git a/ts/mediaEditor/MediaEditorFabricAnalogTimeSticker.ts b/ts/mediaEditor/MediaEditorFabricAnalogTimeSticker.ts index 894017cc09..c2f217dec5 100644 --- a/ts/mediaEditor/MediaEditorFabricAnalogTimeSticker.ts +++ b/ts/mediaEditor/MediaEditorFabricAnalogTimeSticker.ts @@ -3,10 +3,10 @@ import lodash from 'lodash'; import { fabric } from 'fabric'; -import { customFabricObjectControls } from './util/customFabricObjectControls.js'; -import { getAnalogTime } from '../util/getAnalogTime.js'; -import { strictAssert } from '../util/assert.js'; -import { moreStyles } from './util/moreStyles.js'; +import { customFabricObjectControls } from './util/customFabricObjectControls.dom.js'; +import { getAnalogTime } from '../util/getAnalogTime.std.js'; +import { strictAssert } from '../util/assert.std.js'; +import { moreStyles } from './util/moreStyles.dom.js'; const { get } = lodash; diff --git a/ts/mediaEditor/MediaEditorFabricCropRect.ts b/ts/mediaEditor/MediaEditorFabricCropRect.ts index 4adfd936b7..82f403b81c 100644 --- a/ts/mediaEditor/MediaEditorFabricCropRect.ts +++ b/ts/mediaEditor/MediaEditorFabricCropRect.ts @@ -3,7 +3,7 @@ import { fabric } from 'fabric'; import lodash from 'lodash'; -import { strictAssert } from '../util/assert.js'; +import { strictAssert } from '../util/assert.std.js'; const { clamp } = lodash; diff --git a/ts/mediaEditor/MediaEditorFabricDigitalTimeSticker.ts b/ts/mediaEditor/MediaEditorFabricDigitalTimeSticker.ts index d2c68bbdd4..3dc5f5be98 100644 --- a/ts/mediaEditor/MediaEditorFabricDigitalTimeSticker.ts +++ b/ts/mediaEditor/MediaEditorFabricDigitalTimeSticker.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { fabric } from 'fabric'; -import { customFabricObjectControls } from './util/customFabricObjectControls.js'; -import { moreStyles } from './util/moreStyles.js'; -import { getDateTimeFormatter } from '../util/formatTimestamp.js'; +import { customFabricObjectControls } from './util/customFabricObjectControls.dom.js'; +import { moreStyles } from './util/moreStyles.dom.js'; +import { getDateTimeFormatter } from '../util/formatTimestamp.dom.js'; export enum DigitalClockStickerStyle { White = 'White', diff --git a/ts/mediaEditor/MediaEditorFabricIText.ts b/ts/mediaEditor/MediaEditorFabricIText.ts index eb3e04d1a0..7361842034 100644 --- a/ts/mediaEditor/MediaEditorFabricIText.ts +++ b/ts/mediaEditor/MediaEditorFabricIText.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { fabric } from 'fabric'; -import { customFabricObjectControls } from './util/customFabricObjectControls.js'; +import { customFabricObjectControls } from './util/customFabricObjectControls.dom.js'; export class MediaEditorFabricIText extends fabric.IText { constructor(text: string, options: fabric.ITextOptions) { diff --git a/ts/mediaEditor/MediaEditorFabricPencilBrush.ts b/ts/mediaEditor/MediaEditorFabricPencilBrush.ts index d68d88dd13..a1282f90b2 100644 --- a/ts/mediaEditor/MediaEditorFabricPencilBrush.ts +++ b/ts/mediaEditor/MediaEditorFabricPencilBrush.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { fabric } from 'fabric'; -import { MediaEditorFabricPath } from './MediaEditorFabricPath.js'; +import { MediaEditorFabricPath } from './MediaEditorFabricPath.dom.js'; export class MediaEditorFabricPencilBrush extends fabric.PencilBrush { public strokeMiterLimit: undefined | number; diff --git a/ts/mediaEditor/MediaEditorFabricSticker.ts b/ts/mediaEditor/MediaEditorFabricSticker.ts index d7db7b5e9b..76b6756ab8 100644 --- a/ts/mediaEditor/MediaEditorFabricSticker.ts +++ b/ts/mediaEditor/MediaEditorFabricSticker.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import { fabric } from 'fabric'; -import { loadImage } from '../util/loadImage.js'; -import { customFabricObjectControls } from './util/customFabricObjectControls.js'; +import { loadImage } from '../util/loadImage.std.js'; +import { customFabricObjectControls } from './util/customFabricObjectControls.dom.js'; export class MediaEditorFabricSticker extends fabric.Image { constructor( diff --git a/ts/mediaEditor/useFabricHistory.ts b/ts/mediaEditor/useFabricHistory.ts index 2f539040eb..1c7145a988 100644 --- a/ts/mediaEditor/useFabricHistory.ts +++ b/ts/mediaEditor/useFabricHistory.ts @@ -4,16 +4,16 @@ import { useCallback, useEffect, useState } from 'react'; import { fabric } from 'fabric'; -import { createLogger } from '../logging/log.js'; +import { createLogger } from '../logging/log.std.js'; -import type { ImageStateType } from './ImageStateType.js'; -import { MediaEditorFabricAnalogTimeSticker } from './MediaEditorFabricAnalogTimeSticker.js'; -import { MediaEditorFabricDigitalTimeSticker } from './MediaEditorFabricDigitalTimeSticker.js'; -import { MediaEditorFabricIText } from './MediaEditorFabricIText.js'; -import { MediaEditorFabricPath } from './MediaEditorFabricPath.js'; -import { MediaEditorFabricSticker } from './MediaEditorFabricSticker.js'; -import { fabricEffectListener } from './fabricEffectListener.js'; -import { strictAssert } from '../util/assert.js'; +import type { ImageStateType } from './ImageStateType.std.js'; +import { MediaEditorFabricAnalogTimeSticker } from './MediaEditorFabricAnalogTimeSticker.dom.js'; +import { MediaEditorFabricDigitalTimeSticker } from './MediaEditorFabricDigitalTimeSticker.dom.js'; +import { MediaEditorFabricIText } from './MediaEditorFabricIText.dom.js'; +import { MediaEditorFabricPath } from './MediaEditorFabricPath.dom.js'; +import { MediaEditorFabricSticker } from './MediaEditorFabricSticker.dom.js'; +import { fabricEffectListener } from './fabricEffectListener.std.js'; +import { strictAssert } from '../util/assert.std.js'; const log = createLogger('useFabricHistory'); diff --git a/ts/mediaEditor/util/color.ts b/ts/mediaEditor/util/color.ts index fbfaac6e33..f536f9ae9f 100644 --- a/ts/mediaEditor/util/color.ts +++ b/ts/mediaEditor/util/color.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { hslToRGB } from '../../util/hslToRGB.js'; +import { hslToRGB } from '../../util/hslToRGB.std.js'; function getRatio(min: number, max: number, value: number) { return (value - min) / (max - min); diff --git a/ts/mediaEditor/util/getTextStyleAttributes.ts b/ts/mediaEditor/util/getTextStyleAttributes.ts index 2a0cb83994..23eb29e4cc 100644 --- a/ts/mediaEditor/util/getTextStyleAttributes.ts +++ b/ts/mediaEditor/util/getTextStyleAttributes.ts @@ -1,10 +1,10 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../../logging/log.js'; -import { getHSL } from './color.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; -import { toLogFormat } from '../../types/errors.js'; +import { createLogger } from '../../logging/log.std.js'; +import { getHSL } from './color.std.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; +import { toLogFormat } from '../../types/errors.std.js'; const log = createLogger('getTextStyleAttributes'); diff --git a/ts/messageModifiers/AttachmentDownloads.ts b/ts/messageModifiers/AttachmentDownloads.ts index 03672b0446..280cbf205c 100644 --- a/ts/messageModifiers/AttachmentDownloads.ts +++ b/ts/messageModifiers/AttachmentDownloads.ts @@ -1,21 +1,21 @@ // Copyright 2019 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import lodash from 'lodash'; -import { createLogger } from '../logging/log.js'; -import * as Bytes from '../Bytes.js'; -import type { MessageAttachmentType } from '../types/AttachmentDownload.js'; +import { createLogger } from '../logging/log.std.js'; +import * as Bytes from '../Bytes.std.js'; +import type { MessageAttachmentType } from '../types/AttachmentDownload.std.js'; -import type { AttachmentType } from '../types/Attachment.js'; +import type { AttachmentType } from '../types/Attachment.std.js'; import { doAttachmentsOnSameMessageMatch, isDownloaded, -} from '../util/Attachment.js'; +} from '../util/Attachment.std.js'; import { loadAttachmentData, deleteAttachmentData, -} from '../util/migrations.js'; -import { getMessageById } from '../messages/getMessageById.js'; -import { trimMessageWhitespace } from '../types/BodyRange.js'; +} from '../util/migrations.preload.js'; +import { getMessageById } from '../messages/getMessageById.preload.js'; +import { trimMessageWhitespace } from '../types/BodyRange.std.js'; const { omit } = lodash; diff --git a/ts/messageModifiers/Deletes.ts b/ts/messageModifiers/Deletes.ts index 173689d4f3..07c1ef185e 100644 --- a/ts/messageModifiers/Deletes.ts +++ b/ts/messageModifiers/Deletes.ts @@ -2,14 +2,14 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { MessageAttributesType } from '../model-types.d.ts'; -import { getAuthorId } from '../messages/sources.js'; -import { DataReader } from '../sql/Client.js'; -import { createLogger } from '../logging/log.js'; -import * as Errors from '../types/errors.js'; -import { deleteForEveryone } from '../util/deleteForEveryone.js'; -import { drop } from '../util/drop.js'; -import { getMessageSentTimestampSet } from '../util/getMessageSentTimestampSet.js'; -import { MessageModel } from '../models/messages.js'; +import { getAuthorId } from '../messages/sources.preload.js'; +import { DataReader } from '../sql/Client.preload.js'; +import { createLogger } from '../logging/log.std.js'; +import * as Errors from '../types/errors.std.js'; +import { deleteForEveryone } from '../util/deleteForEveryone.preload.js'; +import { drop } from '../util/drop.std.js'; +import { getMessageSentTimestampSet } from '../util/getMessageSentTimestampSet.std.js'; +import { MessageModel } from '../models/messages.preload.js'; const log = createLogger('Deletes'); diff --git a/ts/messageModifiers/DeletesForMe.ts b/ts/messageModifiers/DeletesForMe.ts index 398c76dbd4..4d5a9ee135 100644 --- a/ts/messageModifiers/DeletesForMe.ts +++ b/ts/messageModifiers/DeletesForMe.ts @@ -1,30 +1,30 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log.js'; -import * as Errors from '../types/errors.js'; -import { drop } from '../util/drop.js'; -import { getMessageSentTimestampSet } from '../util/getMessageSentTimestampSet.js'; +import { createLogger } from '../logging/log.std.js'; +import * as Errors from '../types/errors.std.js'; +import { drop } from '../util/drop.std.js'; +import { getMessageSentTimestampSet } from '../util/getMessageSentTimestampSet.std.js'; -import type { MessageAttributesType } from '../model-types.js'; +import type { MessageAttributesType } from '../model-types.d.ts'; import type { ConversationIdentifier, AddressableMessage, -} from '../textsecure/messageReceiverEvents.js'; +} from '../textsecure/messageReceiverEvents.std.js'; import { deleteAttachmentData, deleteDownloadData, -} from '../util/migrations.js'; +} from '../util/migrations.preload.js'; import { deleteAttachmentFromMessage, deleteMessage, -} from '../util/deleteForMe.js'; +} from '../util/deleteForMe.preload.js'; import { doesMessageMatch, getConversationFromTarget, getMessageQueryFromTarget, -} from '../util/syncIdentifiers.js'; -import { DataWriter } from '../sql/Client.js'; +} from '../util/syncIdentifiers.preload.js'; +import { DataWriter } from '../sql/Client.preload.js'; const log = createLogger('DeletesForMe'); diff --git a/ts/messageModifiers/Edits.ts b/ts/messageModifiers/Edits.ts index ee6b2e055c..cff66e685d 100644 --- a/ts/messageModifiers/Edits.ts +++ b/ts/messageModifiers/Edits.ts @@ -2,18 +2,18 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { MessageAttributesType } from '../model-types.d.ts'; -import * as Errors from '../types/errors.js'; -import { createLogger } from '../logging/log.js'; -import { DataReader } from '../sql/Client.js'; -import { drop } from '../util/drop.js'; -import { getAuthorId } from '../messages/sources.js'; -import { handleEditMessage } from '../util/handleEditMessage.js'; -import { getMessageSentTimestamp } from '../util/getMessageSentTimestamp.js'; +import * as Errors from '../types/errors.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { DataReader } from '../sql/Client.preload.js'; +import { drop } from '../util/drop.std.js'; +import { getAuthorId } from '../messages/sources.preload.js'; +import { handleEditMessage } from '../util/handleEditMessage.preload.js'; +import { getMessageSentTimestamp } from '../util/getMessageSentTimestamp.std.js'; import { isAttachmentDownloadQueueEmpty, registerQueueEmptyCallback, -} from '../util/attachmentDownloadQueue.js'; -import { MessageModel } from '../models/messages.js'; +} from '../util/attachmentDownloadQueue.preload.js'; +import { MessageModel } from '../models/messages.preload.js'; const log = createLogger('Edits'); diff --git a/ts/messageModifiers/MessageReceipts.ts b/ts/messageModifiers/MessageReceipts.ts index 85c6e031a7..f550c6fa2f 100644 --- a/ts/messageModifiers/MessageReceipts.ts +++ b/ts/messageModifiers/MessageReceipts.ts @@ -8,34 +8,34 @@ import type { MessageAttributesType, ReadonlyMessageAttributesType, } from '../model-types.d.ts'; -import type { SendStateByConversationId } from '../messages/MessageSendState.js'; -import { isOutgoing, isStory } from '../state/selectors/message.js'; -import { getOwn } from '../util/getOwn.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { createWaitBatcher } from '../util/waitBatcher.js'; -import { isServiceIdString } from '../types/ServiceId.js'; +import type { SendStateByConversationId } from '../messages/MessageSendState.std.js'; +import { isOutgoing, isStory } from '../state/selectors/message.preload.js'; +import { getOwn } from '../util/getOwn.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { createWaitBatcher } from '../util/waitBatcher.std.js'; +import { isServiceIdString } from '../types/ServiceId.std.js'; import { SendActionType, SendStatus, UNDELIVERED_SEND_STATUSES, sendStateReducer, -} from '../messages/MessageSendState.js'; -import { DataReader, DataWriter } from '../sql/Client.js'; -import type { DeleteSentProtoRecipientOptionsType } from '../sql/Interface.js'; -import { createLogger } from '../logging/log.js'; -import { getSourceServiceId } from '../messages/sources.js'; -import { getMessageSentTimestamp } from '../util/getMessageSentTimestamp.js'; -import { getMessageIdForLogging } from '../util/idForLogging.js'; -import { getPropForTimestamp } from '../util/editHelpers.js'; +} from '../messages/MessageSendState.std.js'; +import { DataReader, DataWriter } from '../sql/Client.preload.js'; +import type { DeleteSentProtoRecipientOptionsType } from '../sql/Interface.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { getSourceServiceId } from '../messages/sources.preload.js'; +import { getMessageSentTimestamp } from '../util/getMessageSentTimestamp.std.js'; +import { getMessageIdForLogging } from '../util/idForLogging.preload.js'; +import { getPropForTimestamp } from '../util/editHelpers.std.js'; import { DELETE_SENT_PROTO_BATCHER_WAIT_MS, RECEIPT_BATCHER_WAIT_MS, -} from '../types/Receipt.js'; -import { drop } from '../util/drop.js'; -import { getMessageById } from '../messages/getMessageById.js'; -import { MessageModel } from '../models/messages.js'; -import { areStoryViewReceiptsEnabled } from '../util/Settings.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from '../types/Receipt.std.js'; +import { drop } from '../util/drop.std.js'; +import { getMessageById } from '../messages/getMessageById.preload.js'; +import { MessageModel } from '../models/messages.preload.js'; +import { areStoryViewReceiptsEnabled } from '../util/Settings.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const { groupBy } = lodash; diff --git a/ts/messageModifiers/MessageRequests.ts b/ts/messageModifiers/MessageRequests.ts index 97ff432338..dba201ecea 100644 --- a/ts/messageModifiers/MessageRequests.ts +++ b/ts/messageModifiers/MessageRequests.ts @@ -1,13 +1,13 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AciString } from '../types/ServiceId.js'; -import type { ConversationModel } from '../models/conversations.js'; -import * as Errors from '../types/errors.js'; -import { createLogger } from '../logging/log.js'; -import { drop } from '../util/drop.js'; -import { getConversationIdForLogging } from '../util/idForLogging.js'; -import type { MessageRequestResponseSource } from '../types/MessageRequestResponseEvent.js'; +import type { AciString } from '../types/ServiceId.std.js'; +import type { ConversationModel } from '../models/conversations.preload.js'; +import * as Errors from '../types/errors.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { drop } from '../util/drop.std.js'; +import { getConversationIdForLogging } from '../util/idForLogging.preload.js'; +import type { MessageRequestResponseSource } from '../types/MessageRequestResponseEvent.std.js'; const log = createLogger('MessageRequests'); diff --git a/ts/messageModifiers/Polls.ts b/ts/messageModifiers/Polls.ts index a0e7a78161..c9df6ccb6b 100644 --- a/ts/messageModifiers/Polls.ts +++ b/ts/messageModifiers/Polls.ts @@ -1,25 +1,25 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AciString } from '../types/ServiceId.js'; +import type { AciString } from '../types/ServiceId.std.js'; import type { MessageAttributesType, ReadonlyMessageAttributesType, } from '../model-types.d.ts'; -import type { MessagePollVoteType } from '../types/Polls.js'; -import { MessageModel } from '../models/messages.js'; -import { DataReader } from '../sql/Client.js'; -import * as Errors from '../types/errors.js'; -import { createLogger } from '../logging/log.js'; -import { isIncoming, isOutgoing } from '../messages/helpers.js'; -import { getAuthor } from '../messages/sources.js'; +import type { MessagePollVoteType } from '../types/Polls.dom.js'; +import { MessageModel } from '../models/messages.preload.js'; +import { DataReader } from '../sql/Client.preload.js'; +import * as Errors from '../types/errors.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { isIncoming, isOutgoing } from '../messages/helpers.std.js'; +import { getAuthor } from '../messages/sources.preload.js'; -import { isSent } from '../messages/MessageSendState.js'; -import { getPropForTimestamp } from '../util/editHelpers.js'; -import { isMe } from '../util/whatTypeOfConversation.js'; +import { isSent } from '../messages/MessageSendState.std.js'; +import { getPropForTimestamp } from '../util/editHelpers.std.js'; +import { isMe } from '../util/whatTypeOfConversation.dom.js'; -import { strictAssert } from '../util/assert.js'; -import { getMessageIdForLogging } from '../util/idForLogging.js'; +import { strictAssert } from '../util/assert.std.js'; +import { getMessageIdForLogging } from '../util/idForLogging.preload.js'; const log = createLogger('Polls'); diff --git a/ts/messageModifiers/Reactions.ts b/ts/messageModifiers/Reactions.ts index 36a87c5f8b..2abef52e81 100644 --- a/ts/messageModifiers/Reactions.ts +++ b/ts/messageModifiers/Reactions.ts @@ -3,49 +3,52 @@ import lodash from 'lodash'; -import type { AciString } from '../types/ServiceId.js'; +import type { AciString } from '../types/ServiceId.std.js'; import type { MessageAttributesType, MessageReactionType, ReadonlyMessageAttributesType, } from '../model-types.d.ts'; -import { MessageModel } from '../models/messages.js'; -import { ReactionSource } from '../reactions/ReactionSource.js'; -import { DataReader, DataWriter } from '../sql/Client.js'; -import * as Errors from '../types/errors.js'; -import { createLogger } from '../logging/log.js'; +import { MessageModel } from '../models/messages.preload.js'; +import { ReactionSource } from '../reactions/ReactionSource.std.js'; +import { DataReader, DataWriter } from '../sql/Client.preload.js'; +import * as Errors from '../types/errors.std.js'; +import { createLogger } from '../logging/log.std.js'; import { isIncoming, isIncomingStory, isOutgoing, isOutgoingStory, -} from '../messages/helpers.js'; -import { getAuthor } from '../messages/sources.js'; -import { getMessageSentTimestampSet } from '../util/getMessageSentTimestampSet.js'; -import { isDirectConversation, isMe } from '../util/whatTypeOfConversation.js'; +} from '../messages/helpers.std.js'; +import { getAuthor } from '../messages/sources.preload.js'; +import { getMessageSentTimestampSet } from '../util/getMessageSentTimestampSet.std.js'; +import { + isDirectConversation, + isMe, +} from '../util/whatTypeOfConversation.dom.js'; import { getMessagePropStatus, hasErrors, isStory, -} from '../state/selectors/message.js'; -import { getPropForTimestamp } from '../util/editHelpers.js'; -import { isSent } from '../messages/MessageSendState.js'; -import { strictAssert } from '../util/assert.js'; -import { repeat, zipObject } from '../util/iterables.js'; -import { getMessageIdForLogging } from '../util/idForLogging.js'; -import { hydrateStoryContext } from '../util/hydrateStoryContext.js'; -import { drop } from '../util/drop.js'; -import * as reactionUtil from '../reactions/util.js'; -import { isNewReactionReplacingPrevious } from '../reactions/util.js'; -import { notificationService } from '../services/notifications.js'; -import { ReactionReadStatus } from '../types/Reactions.js'; -import type { ConversationQueueJobData } from '../jobs/conversationJobQueue.js'; +} from '../state/selectors/message.preload.js'; +import { getPropForTimestamp } from '../util/editHelpers.std.js'; +import { isSent } from '../messages/MessageSendState.std.js'; +import { strictAssert } from '../util/assert.std.js'; +import { repeat, zipObject } from '../util/iterables.std.js'; +import { getMessageIdForLogging } from '../util/idForLogging.preload.js'; +import { hydrateStoryContext } from '../util/hydrateStoryContext.preload.js'; +import { drop } from '../util/drop.std.js'; +import * as reactionUtil from '../reactions/util.std.js'; +import { isNewReactionReplacingPrevious } from '../reactions/util.std.js'; +import { notificationService } from '../services/notifications.preload.js'; +import { ReactionReadStatus } from '../types/Reactions.std.js'; +import type { ConversationQueueJobData } from '../jobs/conversationJobQueue.preload.js'; import { conversationJobQueue, conversationQueueJobEnum, -} from '../jobs/conversationJobQueue.js'; -import { maybeNotify } from '../messages/maybeNotify.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from '../jobs/conversationJobQueue.preload.js'; +import { maybeNotify } from '../messages/maybeNotify.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const { maxBy } = lodash; diff --git a/ts/messageModifiers/ReadSyncs.ts b/ts/messageModifiers/ReadSyncs.ts index d8a9d15a30..034bfbc1dc 100644 --- a/ts/messageModifiers/ReadSyncs.ts +++ b/ts/messageModifiers/ReadSyncs.ts @@ -4,22 +4,22 @@ import { z } from 'zod'; import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; -import * as Errors from '../types/errors.js'; -import { createLogger } from '../logging/log.js'; -import { StartupQueue } from '../util/StartupQueue.js'; -import { drop } from '../util/drop.js'; -import { getMessageIdForLogging } from '../util/idForLogging.js'; -import { getMessageSentTimestamp } from '../util/getMessageSentTimestamp.js'; -import { isIncoming } from '../state/selectors/message.js'; -import { isMessageUnread } from '../util/isMessageUnread.js'; -import { notificationService } from '../services/notifications.js'; -import { queueUpdateMessage } from '../util/messageBatcher.js'; -import { strictAssert } from '../util/assert.js'; -import { isAciString } from '../util/isAciString.js'; -import { DataReader, DataWriter } from '../sql/Client.js'; -import { markRead } from '../services/MessageUpdater.js'; -import { MessageModel } from '../models/messages.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import * as Errors from '../types/errors.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { StartupQueue } from '../util/StartupQueue.std.js'; +import { drop } from '../util/drop.std.js'; +import { getMessageIdForLogging } from '../util/idForLogging.preload.js'; +import { getMessageSentTimestamp } from '../util/getMessageSentTimestamp.std.js'; +import { isIncoming } from '../state/selectors/message.preload.js'; +import { isMessageUnread } from '../util/isMessageUnread.std.js'; +import { notificationService } from '../services/notifications.preload.js'; +import { queueUpdateMessage } from '../util/messageBatcher.preload.js'; +import { strictAssert } from '../util/assert.std.js'; +import { isAciString } from '../util/isAciString.std.js'; +import { DataReader, DataWriter } from '../sql/Client.preload.js'; +import { markRead } from '../services/MessageUpdater.preload.js'; +import { MessageModel } from '../models/messages.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const log = createLogger('ReadSyncs'); diff --git a/ts/messageModifiers/ViewOnceOpenSyncs.ts b/ts/messageModifiers/ViewOnceOpenSyncs.ts index 1b2f146542..f6ac3753a8 100644 --- a/ts/messageModifiers/ViewOnceOpenSyncs.ts +++ b/ts/messageModifiers/ViewOnceOpenSyncs.ts @@ -1,14 +1,14 @@ // Copyright 2019 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AciString } from '../types/ServiceId.js'; +import type { AciString } from '../types/ServiceId.std.js'; import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; -import { DataReader } from '../sql/Client.js'; -import * as Errors from '../types/errors.js'; -import { createLogger } from '../logging/log.js'; -import { getMessageIdForLogging } from '../util/idForLogging.js'; -import { markViewOnceMessageViewed } from '../services/MessageUpdater.js'; -import { MessageModel } from '../models/messages.js'; +import { DataReader } from '../sql/Client.preload.js'; +import * as Errors from '../types/errors.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { getMessageIdForLogging } from '../util/idForLogging.preload.js'; +import { markViewOnceMessageViewed } from '../services/MessageUpdater.preload.js'; +import { MessageModel } from '../models/messages.preload.js'; const log = createLogger('ViewOnceOpenSyncs'); diff --git a/ts/messageModifiers/ViewSyncs.ts b/ts/messageModifiers/ViewSyncs.ts index bad8f19cb0..25febf91b2 100644 --- a/ts/messageModifiers/ViewSyncs.ts +++ b/ts/messageModifiers/ViewSyncs.ts @@ -4,20 +4,20 @@ import { z } from 'zod'; import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; -import * as Errors from '../types/errors.js'; -import { createLogger } from '../logging/log.js'; -import { GiftBadgeStates } from '../types/GiftBadgeStates.js'; -import { ReadStatus } from '../messages/MessageReadStatus.js'; -import { getMessageIdForLogging } from '../util/idForLogging.js'; -import { getMessageSentTimestamp } from '../util/getMessageSentTimestamp.js'; -import { isIncoming } from '../state/selectors/message.js'; -import { markViewed } from '../services/MessageUpdater.js'; -import { notificationService } from '../services/notifications.js'; -import { queueUpdateMessage } from '../util/messageBatcher.js'; -import { isAciString } from '../util/isAciString.js'; -import { DataReader, DataWriter } from '../sql/Client.js'; -import { MessageModel } from '../models/messages.js'; -import { drop } from '../util/drop.js'; +import * as Errors from '../types/errors.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { GiftBadgeStates } from '../types/GiftBadgeStates.std.js'; +import { ReadStatus } from '../messages/MessageReadStatus.std.js'; +import { getMessageIdForLogging } from '../util/idForLogging.preload.js'; +import { getMessageSentTimestamp } from '../util/getMessageSentTimestamp.std.js'; +import { isIncoming } from '../state/selectors/message.preload.js'; +import { markViewed } from '../services/MessageUpdater.preload.js'; +import { notificationService } from '../services/notifications.preload.js'; +import { queueUpdateMessage } from '../util/messageBatcher.preload.js'; +import { isAciString } from '../util/isAciString.std.js'; +import { DataReader, DataWriter } from '../sql/Client.preload.js'; +import { MessageModel } from '../models/messages.preload.js'; +import { drop } from '../util/drop.std.js'; const log = createLogger('ViewSyncs'); diff --git a/ts/messages/MessageSendState.ts b/ts/messages/MessageSendState.ts index d5c8c80ca8..1a452ca50d 100644 --- a/ts/messages/MessageSendState.ts +++ b/ts/messages/MessageSendState.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import memoizee from 'memoizee'; -import { makeEnumParser } from '../util/enum.js'; +import { makeEnumParser } from '../util/enum.std.js'; /** * `SendStatus` represents the send status of a message to a single recipient. For diff --git a/ts/messages/copyQuote.ts b/ts/messages/copyQuote.ts index 80476d84c4..229da0b15a 100644 --- a/ts/messages/copyQuote.ts +++ b/ts/messages/copyQuote.ts @@ -3,20 +3,23 @@ import lodash from 'lodash'; -import { createLogger } from '../logging/log.js'; -import type { QuotedMessageType } from '../model-types.js'; -import { SignalService } from '../protobuf/index.js'; -import { isGiftBadge, isTapToView } from '../state/selectors/message.js'; -import type { ProcessedQuote } from '../textsecure/Types.js'; -import { IMAGE_JPEG } from '../types/MIME.js'; -import { VERSION_NEEDED_FOR_DISPLAY } from '../types/Message2.js'; -import { strictAssert } from '../util/assert.js'; -import { getQuoteBodyText } from '../util/getQuoteBodyText.js'; -import { isQuoteAMatch } from './quotes.js'; -import { messageHasPaymentEvent } from './payments.js'; -import * as Errors from '../types/errors.js'; -import type { MessageModel } from '../models/messages.js'; -import { isDownloadable } from '../util/Attachment.js'; +import { createLogger } from '../logging/log.std.js'; +import type { QuotedMessageType } from '../model-types.d.ts'; +import { SignalService } from '../protobuf/index.std.js'; +import { + isGiftBadge, + isTapToView, +} from '../state/selectors/message.preload.js'; +import type { ProcessedQuote } from '../textsecure/Types.d.ts'; +import { IMAGE_JPEG } from '../types/MIME.std.js'; +import { VERSION_NEEDED_FOR_DISPLAY } from '../types/Message2.preload.js'; +import { strictAssert } from '../util/assert.std.js'; +import { getQuoteBodyText } from '../util/getQuoteBodyText.std.js'; +import { isQuoteAMatch } from './quotes.preload.js'; +import { messageHasPaymentEvent } from './payments.std.js'; +import * as Errors from '../types/errors.std.js'; +import type { MessageModel } from '../models/messages.preload.js'; +import { isDownloadable } from '../util/Attachment.std.js'; const { omit } = lodash; diff --git a/ts/messages/getMessageById.ts b/ts/messages/getMessageById.ts index 1d9cb60988..9acdb68ba2 100644 --- a/ts/messages/getMessageById.ts +++ b/ts/messages/getMessageById.ts @@ -1,10 +1,10 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log.js'; -import * as Errors from '../types/errors.js'; -import { DataReader } from '../sql/Client.js'; -import { MessageModel } from '../models/messages.js'; +import { createLogger } from '../logging/log.std.js'; +import * as Errors from '../types/errors.std.js'; +import { DataReader } from '../sql/Client.preload.js'; +import { MessageModel } from '../models/messages.preload.js'; import type { MessageAttributesType } from '../model-types.d.ts'; const log = createLogger('getMessageById'); diff --git a/ts/messages/getMessagesById.ts b/ts/messages/getMessagesById.ts index 381b5e89b4..a5edd44655 100644 --- a/ts/messages/getMessagesById.ts +++ b/ts/messages/getMessagesById.ts @@ -1,11 +1,11 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log.js'; -import { DataReader } from '../sql/Client.js'; -import { MessageModel } from '../models/messages.js'; +import { createLogger } from '../logging/log.std.js'; +import { DataReader } from '../sql/Client.preload.js'; +import { MessageModel } from '../models/messages.preload.js'; import type { MessageAttributesType } from '../model-types.d.ts'; -import * as Errors from '../types/errors.js'; +import * as Errors from '../types/errors.std.js'; const log = createLogger('getMessagesById'); diff --git a/ts/messages/handleDataMessage.ts b/ts/messages/handleDataMessage.ts index 608c72c4c4..30d6599ba8 100644 --- a/ts/messages/handleDataMessage.ts +++ b/ts/messages/handleDataMessage.ts @@ -4,36 +4,39 @@ import lodash from 'lodash'; import type { z } from 'zod'; -import { createLogger } from '../logging/log.js'; -import * as Errors from '../types/errors.js'; -import * as LinkPreview from '../types/LinkPreview.js'; +import { createLogger } from '../logging/log.std.js'; +import * as Errors from '../types/errors.std.js'; +import * as LinkPreview from '../types/LinkPreview.std.js'; -import { isStory } from './helpers.js'; -import { getAuthor } from './sources.js'; -import { messageHasPaymentEvent } from './payments.js'; -import { getMessageIdForLogging } from '../util/idForLogging.js'; +import { isStory } from './helpers.std.js'; +import { getAuthor } from './sources.preload.js'; +import { messageHasPaymentEvent } from './payments.std.js'; +import { getMessageIdForLogging } from '../util/idForLogging.preload.js'; import { deliveryReceiptQueue, deliveryReceiptBatcher, -} from '../util/deliveryReceipt.js'; -import { getSenderIdentifier } from '../util/getSenderIdentifier.js'; -import { isNormalNumber } from '../util/isNormalNumber.js'; -import { upgradeMessageSchema } from '../util/migrations.js'; -import { getOwn } from '../util/getOwn.js'; +} from '../util/deliveryReceipt.preload.js'; +import { getSenderIdentifier } from '../util/getSenderIdentifier.dom.js'; +import { isNormalNumber } from '../util/isNormalNumber.std.js'; +import { upgradeMessageSchema } from '../util/migrations.preload.js'; +import { getOwn } from '../util/getOwn.std.js'; import { SendActionType, sendStateReducer, SendStatus, -} from './MessageSendState.js'; -import { DataReader, DataWriter } from '../sql/Client.js'; -import { eraseMessageContents } from '../util/cleanup.js'; +} from './MessageSendState.std.js'; +import { DataReader, DataWriter } from '../sql/Client.preload.js'; +import { eraseMessageContents } from '../util/cleanup.preload.js'; import { isDirectConversation, isGroup, isGroupV1, -} from '../util/whatTypeOfConversation.js'; -import { respondToGroupV2Migration, maybeUpdateGroup } from '../groups.js'; -import { generateMessageId } from '../util/generateMessageId.js'; +} from '../util/whatTypeOfConversation.dom.js'; +import { + respondToGroupV2Migration, + maybeUpdateGroup, +} from '../groups.preload.js'; +import { generateMessageId } from '../util/generateMessageId.node.js'; import { hasErrors, isEndSession, @@ -41,42 +44,42 @@ import { isGroupUpdate, isTapToView, isUnsupportedMessage, -} from '../state/selectors/message.js'; -import { drop } from '../util/drop.js'; -import { strictAssert } from '../util/assert.js'; -import { isAciString } from '../util/isAciString.js'; -import { copyFromQuotedMessage } from './copyQuote.js'; -import { findStoryMessages } from '../util/findStoryMessage.js'; -import { getRoomIdFromCallLink } from '../util/callLinksRingrtc.js'; -import { isNotNil } from '../util/isNotNil.js'; -import { normalizeServiceId } from '../types/ServiceId.js'; -import { BodyRange, trimMessageWhitespace } from '../types/BodyRange.js'; -import { hydrateStoryContext } from '../util/hydrateStoryContext.js'; -import { isMessageEmpty } from '../util/isMessageEmpty.js'; -import { isValidTapToView } from '../util/isValidTapToView.js'; -import { getNotificationTextForMessage } from '../util/getNotificationTextForMessage.js'; -import { getMessageAuthorText } from '../util/getMessageAuthorText.js'; -import { GiftBadgeStates } from '../types/GiftBadgeStates.js'; -import { parseBoostBadgeListFromServer } from '../badges/parseBadgesFromServer.js'; -import { SignalService as Proto } from '../protobuf/index.js'; +} from '../state/selectors/message.preload.js'; +import { drop } from '../util/drop.std.js'; +import { strictAssert } from '../util/assert.std.js'; +import { isAciString } from '../util/isAciString.std.js'; +import { copyFromQuotedMessage } from './copyQuote.preload.js'; +import { findStoryMessages } from '../util/findStoryMessage.preload.js'; +import { getRoomIdFromCallLink } from '../util/callLinksRingrtc.node.js'; +import { isNotNil } from '../util/isNotNil.std.js'; +import { normalizeServiceId } from '../types/ServiceId.std.js'; +import { BodyRange, trimMessageWhitespace } from '../types/BodyRange.std.js'; +import { hydrateStoryContext } from '../util/hydrateStoryContext.preload.js'; +import { isMessageEmpty } from '../util/isMessageEmpty.preload.js'; +import { isValidTapToView } from '../util/isValidTapToView.std.js'; +import { getNotificationTextForMessage } from '../util/getNotificationTextForMessage.preload.js'; +import { getMessageAuthorText } from '../util/getMessageAuthorText.preload.js'; +import { GiftBadgeStates } from '../types/GiftBadgeStates.std.js'; +import { parseBoostBadgeListFromServer } from '../badges/parseBadgesFromServer.std.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; import { modifyTargetMessage, ModifyTargetMessageResult, -} from '../util/modifyTargetMessage.js'; -import { saveAndNotify } from './saveAndNotify.js'; -import { MessageModel } from '../models/messages.js'; -import { safeParsePartial } from '../util/schemas.js'; -import { PollCreateSchema, isPollReceiveEnabled } from '../types/Polls.js'; +} from '../util/modifyTargetMessage.preload.js'; +import { saveAndNotify } from './saveAndNotify.preload.js'; +import { MessageModel } from '../models/messages.preload.js'; +import { safeParsePartial } from '../util/schemas.std.js'; +import { PollCreateSchema, isPollReceiveEnabled } from '../types/Polls.dom.js'; -import type { SentEventData } from '../textsecure/messageReceiverEvents.js'; +import type { SentEventData } from '../textsecure/messageReceiverEvents.std.js'; import type { ProcessedDataMessage, ProcessedUnidentifiedDeliveryStatus, -} from '../textsecure/Types.js'; -import type { ServiceIdString } from '../types/ServiceId.js'; -import type { LinkPreviewType } from '../types/message/LinkPreviews.js'; -import { getCachedSubscriptionConfiguration } from '../util/subscriptionConfiguration.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from '../textsecure/Types.d.ts'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; +import type { LinkPreviewType } from '../types/message/LinkPreviews.std.js'; +import { getCachedSubscriptionConfiguration } from '../util/subscriptionConfiguration.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const { isNumber } = lodash; diff --git a/ts/messages/helpers.ts b/ts/messages/helpers.ts index ddbd764252..d5ecf5d3c7 100644 --- a/ts/messages/helpers.ts +++ b/ts/messages/helpers.ts @@ -8,7 +8,7 @@ import type { ReadonlyMessageAttributesType, QuotedAttachmentType, } from '../model-types.d.ts'; -import type { AciString } from '../types/ServiceId.js'; +import type { AciString } from '../types/ServiceId.std.js'; export function isIncoming( message: Pick diff --git a/ts/messages/maybeNotify.ts b/ts/messages/maybeNotify.ts index 7bfc42ec0b..657b263c7f 100644 --- a/ts/messages/maybeNotify.ts +++ b/ts/messages/maybeNotify.ts @@ -1,26 +1,24 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log.js'; +import { createLogger } from '../logging/log.std.js'; -import { isIncoming, isOutgoing } from './helpers.js'; -import { getAuthor } from './sources.js'; +import { isIncoming, isOutgoing } from './helpers.std.js'; +import { getAuthor } from './sources.preload.js'; -import type { ConversationModel } from '../models/conversations.js'; -import { getActiveProfile } from '../state/selectors/notificationProfiles.js'; -import { shouldNotify as shouldNotifyDuringNotificationProfile } from '../types/NotificationProfile.js'; -import { isMessageUnread } from '../util/isMessageUnread.js'; -import { isDirectConversation } from '../util/whatTypeOfConversation.js'; -import { hasExpiration } from '../types/Message2.js'; -import { - notificationService, - NotificationType, -} from '../services/notifications.js'; -import { getNotificationTextForMessage } from '../util/getNotificationTextForMessage.js'; -import type { MessageAttributesType } from '../model-types.js'; -import type { ReactionAttributesType } from '../messageModifiers/Reactions.js'; -import { shouldStoryReplyNotifyUser } from '../util/shouldStoryReplyNotifyUser.js'; -import { ReactionSource } from '../reactions/ReactionSource.js'; +import type { ConversationModel } from '../models/conversations.preload.js'; +import { getActiveProfile } from '../state/selectors/notificationProfiles.dom.js'; +import { shouldNotify as shouldNotifyDuringNotificationProfile } from '../types/NotificationProfile.std.js'; +import { NotificationType } from '../types/notifications.std.js'; +import { isMessageUnread } from '../util/isMessageUnread.std.js'; +import { isDirectConversation } from '../util/whatTypeOfConversation.dom.js'; +import { hasExpiration } from '../types/Message2.preload.js'; +import { notificationService } from '../services/notifications.preload.js'; +import { getNotificationTextForMessage } from '../util/getNotificationTextForMessage.preload.js'; +import type { MessageAttributesType } from '../model-types.d.ts'; +import type { ReactionAttributesType } from '../messageModifiers/Reactions.preload.js'; +import { shouldStoryReplyNotifyUser } from '../util/shouldStoryReplyNotifyUser.preload.js'; +import { ReactionSource } from '../reactions/ReactionSource.std.js'; const log = createLogger('maybeNotify'); diff --git a/ts/messages/migrateLegacyReadStatus.ts b/ts/messages/migrateLegacyReadStatus.ts index 2ed488a798..432c2e71c2 100644 --- a/ts/messages/migrateLegacyReadStatus.ts +++ b/ts/messages/migrateLegacyReadStatus.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { MessageAttributesType } from '../model-types.d.ts'; -import { ReadStatus } from './MessageReadStatus.js'; +import { ReadStatus } from './MessageReadStatus.std.js'; export function migrateLegacyReadStatus( message: Readonly> diff --git a/ts/messages/migrateLegacySendAttributes.ts b/ts/messages/migrateLegacySendAttributes.ts index f731a73e94..5d48ffe892 100644 --- a/ts/messages/migrateLegacySendAttributes.ts +++ b/ts/messages/migrateLegacySendAttributes.ts @@ -2,19 +2,19 @@ // SPDX-License-Identifier: AGPL-3.0-only import lodash from 'lodash'; -import { getOwn } from '../util/getOwn.js'; -import { map, concat, repeat, zipObject } from '../util/iterables.js'; -import { isOutgoing } from '../state/selectors/message.js'; +import { getOwn } from '../util/getOwn.std.js'; +import { map, concat, repeat, zipObject } from '../util/iterables.std.js'; +import { isOutgoing } from '../state/selectors/message.preload.js'; import type { MessageAttributesType } from '../model-types.d.ts'; import type { SendState, SendStateByConversationId, -} from './MessageSendState.js'; +} from './MessageSendState.std.js'; import { SendActionType, sendStateReducer, SendStatus, -} from './MessageSendState.js'; +} from './MessageSendState.std.js'; const { get, isEmpty } = lodash; diff --git a/ts/messages/migrateMessageData.ts b/ts/messages/migrateMessageData.ts index b2fe8f8903..1ada5cd422 100644 --- a/ts/messages/migrateMessageData.ts +++ b/ts/messages/migrateMessageData.ts @@ -5,17 +5,17 @@ import lodash from 'lodash'; import pMap from 'p-map'; import PQueue from 'p-queue'; -import { CURRENT_SCHEMA_VERSION } from '../types/Message2.js'; -import { isNotNil } from '../util/isNotNil.js'; -import { MINUTE } from '../util/durations/index.js'; +import { CURRENT_SCHEMA_VERSION } from '../types/Message2.preload.js'; +import { isNotNil } from '../util/isNotNil.std.js'; +import { MINUTE } from '../util/durations/index.std.js'; import type { MessageAttributesType } from '../model-types.d.ts'; -import type { AciString } from '../types/ServiceId.js'; -import * as Errors from '../types/errors.js'; -import { DataReader, DataWriter } from '../sql/Client.js'; -import { postSaveUpdates } from '../util/cleanup.js'; -import { upgradeMessageSchema as doUpgradeMessageSchema } from '../util/migrations.js'; -import { createLogger } from '../logging/log.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import type { AciString } from '../types/ServiceId.std.js'; +import * as Errors from '../types/errors.std.js'; +import { DataReader, DataWriter } from '../sql/Client.preload.js'; +import { postSaveUpdates } from '../util/cleanup.preload.js'; +import { upgradeMessageSchema as doUpgradeMessageSchema } from '../util/migrations.preload.js'; +import { createLogger } from '../logging/log.std.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const { isFunction, isNumber } = lodash; diff --git a/ts/messages/payments.ts b/ts/messages/payments.ts index 446d2cf8b1..7cba16dbbb 100644 --- a/ts/messages/payments.ts +++ b/ts/messages/payments.ts @@ -3,11 +3,11 @@ import type { ReadonlyDeep } from 'type-fest'; -import { PaymentEventKind } from '../types/Payment.js'; -import type { AnyPaymentEvent } from '../types/Payment.js'; -import type { LocalizerType } from '../types/Util.js'; +import { PaymentEventKind } from '../types/Payment.std.js'; +import type { AnyPaymentEvent } from '../types/Payment.std.js'; +import type { LocalizerType } from '../types/Util.std.js'; import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; -import { missingCaseError } from '../util/missingCaseError.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; export type MessageAttributesWithPaymentEvent = ReadonlyMessageAttributesType & ReadonlyDeep<{ diff --git a/ts/messages/quotes.ts b/ts/messages/quotes.ts index 6d8f5ab996..4a45428f23 100644 --- a/ts/messages/quotes.ts +++ b/ts/messages/quotes.ts @@ -7,7 +7,7 @@ import type { ReadonlyMessageAttributesType, QuotedMessageType, } from '../model-types.d.ts'; -import { getSourceServiceId } from './sources.js'; +import { getSourceServiceId } from './sources.preload.js'; export function isQuoteAMatch( message: ReadonlyMessageAttributesType | null | undefined, diff --git a/ts/messages/saveAndNotify.ts b/ts/messages/saveAndNotify.ts index 23ae012218..99ecd06110 100644 --- a/ts/messages/saveAndNotify.ts +++ b/ts/messages/saveAndNotify.ts @@ -1,22 +1,22 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log.js'; +import { createLogger } from '../logging/log.std.js'; -import { explodePromise } from '../util/explodePromise.js'; +import { explodePromise } from '../util/explodePromise.std.js'; -import { saveNewMessageBatcher } from '../util/messageBatcher.js'; -import { handleAttachmentDownloadsForNewMessage } from '../util/queueAttachmentDownloads.js'; +import { saveNewMessageBatcher } from '../util/messageBatcher.preload.js'; +import { handleAttachmentDownloadsForNewMessage } from '../util/queueAttachmentDownloads.preload.js'; import { modifyTargetMessage, ModifyTargetMessageResult, -} from '../util/modifyTargetMessage.js'; -import { isStory } from './helpers.js'; -import { drop } from '../util/drop.js'; +} from '../util/modifyTargetMessage.preload.js'; +import { isStory } from './helpers.std.js'; +import { drop } from '../util/drop.std.js'; -import type { ConversationModel } from '../models/conversations.js'; -import type { MessageModel } from '../models/messages.js'; -import { maybeNotify } from './maybeNotify.js'; +import type { ConversationModel } from '../models/conversations.preload.js'; +import type { MessageModel } from '../models/messages.preload.js'; +import { maybeNotify } from './maybeNotify.preload.js'; const log = createLogger('saveAndNotify'); diff --git a/ts/messages/send.ts b/ts/messages/send.ts index 2129ff1576..de286950d4 100644 --- a/ts/messages/send.ts +++ b/ts/messages/send.ts @@ -3,36 +3,36 @@ import lodash from 'lodash'; -import { filter, map } from '../util/iterables.js'; -import { isNotNil } from '../util/isNotNil.js'; -import { SendMessageProtoError } from '../textsecure/Errors.js'; -import { getOwn } from '../util/getOwn.js'; -import { isGroup } from '../util/whatTypeOfConversation.js'; -import { handleMessageSend } from '../util/handleMessageSend.js'; -import { getSendOptions } from '../util/getSendOptions.js'; -import { createLogger } from '../logging/log.js'; +import { filter, map } from '../util/iterables.std.js'; +import { isNotNil } from '../util/isNotNil.std.js'; +import { SendMessageProtoError } from '../textsecure/Errors.std.js'; +import { getOwn } from '../util/getOwn.std.js'; +import { isGroup } from '../util/whatTypeOfConversation.dom.js'; +import { handleMessageSend } from '../util/handleMessageSend.preload.js'; +import { getSendOptions } from '../util/getSendOptions.preload.js'; +import { createLogger } from '../logging/log.std.js'; import { getPropForTimestamp, getChangesForPropAtTimestamp, -} from '../util/editHelpers.js'; -import { getMessageSentTimestamp } from '../util/getMessageSentTimestamp.js'; +} from '../util/editHelpers.std.js'; +import { getMessageSentTimestamp } from '../util/getMessageSentTimestamp.std.js'; import { notifyStorySendFailed, saveErrorsOnMessage, -} from '../test-node/util/messageFailures.js'; -import { isCustomError } from './helpers.js'; +} from '../test-node/util/messageFailures.preload.js'; +import { isCustomError } from './helpers.std.js'; import { SendActionType, isSent, sendStateReducer, -} from './MessageSendState.js'; +} from './MessageSendState.std.js'; import type { CustomError, MessageAttributesType } from '../model-types.d.ts'; import type { CallbackResultType } from '../textsecure/Types.d.ts'; -import { messageSender } from '../textsecure/SendMessage.js'; -import type { MessageModel } from '../models/messages.js'; -import type { ServiceIdString } from '../types/ServiceId.js'; -import type { SendStateByConversationId } from './MessageSendState.js'; +import { messageSender } from '../textsecure/SendMessage.preload.js'; +import type { MessageModel } from '../models/messages.preload.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; +import type { SendStateByConversationId } from './MessageSendState.std.js'; const { noop, union } = lodash; diff --git a/ts/messages/sources.ts b/ts/messages/sources.ts index f30ccd6d9d..069553e26e 100644 --- a/ts/messages/sources.ts +++ b/ts/messages/sources.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; -import { createLogger } from '../logging/log.js'; -import { itemStorage } from '../textsecure/Storage.js'; -import type { ConversationModel } from '../models/conversations.js'; -import type { ServiceIdString } from '../types/ServiceId.js'; -import { isIncoming, isOutgoing, isStory } from './helpers.js'; +import { createLogger } from '../logging/log.std.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; +import type { ConversationModel } from '../models/conversations.preload.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; +import { isIncoming, isOutgoing, isStory } from './helpers.std.js'; const log = createLogger('messages/sources'); diff --git a/ts/model-types.d.ts b/ts/model-types.d.ts index 8723994b92..2c0f55550c 100644 --- a/ts/model-types.d.ts +++ b/ts/model-types.d.ts @@ -3,42 +3,48 @@ import type { ReadonlyDeep } from 'type-fest'; -import type { GroupV2ChangeType } from './types/groups.ts'; -import type { DraftBodyRanges, RawBodyRange } from './types/BodyRange.js'; -import type { CustomColorType, ConversationColorType } from './types/Colors.js'; -import type { SendMessageChallengeData } from './textsecure/Errors.js'; -import type { ProfileNameChangeType } from './util/getStringForProfileChange.js'; +import type { GroupV2ChangeType } from './types/groups.std.js'; +import type { DraftBodyRanges, RawBodyRange } from './types/BodyRange.std.js'; +import type { + CustomColorType, + ConversationColorType, +} from './types/Colors.std.js'; +import type { SendMessageChallengeData } from './textsecure/Errors.std.js'; +import type { ProfileNameChangeType } from './util/getStringForProfileChange.std.js'; import type { CapabilitiesType } from './types/Capabilities.d.ts'; -import type { ReadStatus } from './messages/MessageReadStatus.js'; -import type { SendStateByConversationId } from './messages/MessageSendState.js'; -import type { GroupNameCollisionsWithIdsByTitle } from './util/groupMemberNameCollisions.js'; +import type { ReadStatus } from './messages/MessageReadStatus.std.js'; +import type { SendStateByConversationId } from './messages/MessageSendState.std.js'; +import type { GroupNameCollisionsWithIdsByTitle } from './util/groupMemberNameCollisions.std.js'; -import type { AttachmentDraftType, AttachmentType } from './util/Attachment.js'; -import type { EmbeddedContactType } from './types/EmbeddedContact.js'; -import { SignalService as Proto } from './protobuf/index.js'; -import type { AvatarDataType, ContactAvatarType } from './types/Avatar.js'; +import type { + AttachmentDraftType, + AttachmentType, +} from './util/Attachment.std.js'; +import type { EmbeddedContactType } from './types/EmbeddedContact.std.js'; +import { SignalService as Proto } from './protobuf/index.std.js'; +import type { AvatarDataType, ContactAvatarType } from './types/Avatar.std.js'; import type { AciString, PniString, ServiceIdString, -} from './types/ServiceId.js'; -import type { StoryDistributionIdString } from './types/StoryDistributionId.js'; -import type { SeenStatus } from './MessageSeenStatus.js'; -import type { GiftBadgeStates } from './types/GiftBadgeStates.js'; -import type { LinkPreviewType } from './types/message/LinkPreviews.js'; +} from './types/ServiceId.std.js'; +import type { StoryDistributionIdString } from './types/StoryDistributionId.std.js'; +import type { SeenStatus } from './MessageSeenStatus.std.js'; +import type { GiftBadgeStates } from './types/GiftBadgeStates.std.js'; +import type { LinkPreviewType } from './types/message/LinkPreviews.std.js'; -import type { StickerType } from './types/Stickers.js'; -import type { StorySendMode } from './types/Stories.js'; -import type { MIMEType } from './types/MIME.js'; -import type { DurationInSeconds } from './util/durations/index.js'; -import type { AnyPaymentEvent } from './types/Payment.js'; -import type { PollMessageAttribute } from './types/Polls.js'; +import type { StickerType } from './types/Stickers.preload.js'; +import type { StorySendMode } from './types/Stories.std.js'; +import type { MIMEType } from './types/MIME.std.js'; +import type { DurationInSeconds } from './util/durations/index.std.js'; +import type { AnyPaymentEvent } from './types/Payment.std.js'; +import type { PollMessageAttribute } from './types/Polls.dom.js'; import AccessRequiredEnum = Proto.AccessControl.AccessRequired; import MemberRoleEnum = Proto.Member.Role; -import type { MessageRequestResponseEvent } from './types/MessageRequestResponseEvent.js'; -import type { QuotedMessageForComposerType } from './state/ducks/composer.js'; -import type { SEALED_SENDER } from './types/SealedSender.js'; +import type { MessageRequestResponseEvent } from './types/MessageRequestResponseEvent.std.js'; +import type { QuotedMessageForComposerType } from './state/ducks/composer.preload.js'; +import type { SEALED_SENDER } from './types/SealedSender.std.js'; export type LastMessageStatus = | 'paused' diff --git a/ts/models/conversations.ts b/ts/models/conversations.ts index d2f00f49f0..7cc58e315b 100644 --- a/ts/models/conversations.ts +++ b/ts/models/conversations.ts @@ -15,8 +15,8 @@ import type { QuotedMessageType, SenderKeyInfoType, } from '../model-types.d.ts'; -import { DataReader, DataWriter } from '../sql/Client.js'; -import { getConversation } from '../util/getConversation.js'; +import { DataReader, DataWriter } from '../sql/Client.preload.js'; +import { getConversation } from '../util/getConversation.preload.js'; import { copyAttachmentIntoTempDirectory, deleteAttachmentData, @@ -26,47 +26,47 @@ import { readStickerData, upgradeMessageSchema, writeNewAttachmentData, -} from '../util/migrations.js'; -import { drop } from '../util/drop.js'; -import { isShallowEqual } from '../util/isShallowEqual.js'; -import { getInitials } from '../util/getInitials.js'; -import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.js'; -import { getMessageSentTimestamp } from '../util/getMessageSentTimestamp.js'; -import { getNotificationTextForMessage } from '../util/getNotificationTextForMessage.js'; -import { getNotificationDataForMessage } from '../util/getNotificationDataForMessage.js'; -import type { ProfileNameChangeType } from '../util/getStringForProfileChange.js'; -import type { AttachmentType, ThumbnailType } from '../types/Attachment.js'; -import { toDayMillis } from '../util/timestamp.js'; -import { areWeAdmin } from '../util/areWeAdmin.js'; -import { isBlocked } from '../util/isBlocked.js'; -import { getAboutText } from '../util/getAboutText.js'; +} from '../util/migrations.preload.js'; +import { drop } from '../util/drop.std.js'; +import { isShallowEqual } from '../util/isShallowEqual.std.js'; +import { getInitials } from '../util/getInitials.std.js'; +import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.std.js'; +import { getMessageSentTimestamp } from '../util/getMessageSentTimestamp.std.js'; +import { getNotificationTextForMessage } from '../util/getNotificationTextForMessage.preload.js'; +import { getNotificationDataForMessage } from '../util/getNotificationDataForMessage.preload.js'; +import type { ProfileNameChangeType } from '../util/getStringForProfileChange.std.js'; +import type { AttachmentType, ThumbnailType } from '../types/Attachment.std.js'; +import { toDayMillis } from '../util/timestamp.std.js'; +import { areWeAdmin } from '../util/areWeAdmin.preload.js'; +import { isBlocked } from '../util/isBlocked.preload.js'; +import { getAboutText } from '../util/getAboutText.dom.js'; import { getAvatar, getRawAvatarPath, getLocalAvatarUrl, -} from '../util/avatarUtils.js'; -import { getDraftPreview } from '../util/getDraftPreview.js'; -import { hasDraft } from '../util/hasDraft.js'; -import { hydrateStoryContext } from '../util/hydrateStoryContext.js'; -import * as Conversation from '../types/Conversation.js'; +} from '../util/avatarUtils.preload.js'; +import { getDraftPreview } from '../util/getDraftPreview.preload.js'; +import { hasDraft } from '../util/hasDraft.std.js'; +import { hydrateStoryContext } from '../util/hydrateStoryContext.preload.js'; +import * as Conversation from '../types/Conversation.node.js'; import type { StickerType, StickerWithHydratedData, -} from '../types/Stickers.js'; -import * as Stickers from '../types/Stickers.js'; -import { StorySendMode } from '../types/Stories.js'; -import type { EmbeddedContactWithHydratedAvatar } from '../types/EmbeddedContact.js'; +} from '../types/Stickers.preload.js'; +import * as Stickers from '../types/Stickers.preload.js'; +import { StorySendMode } from '../types/Stories.std.js'; +import type { EmbeddedContactWithHydratedAvatar } from '../types/EmbeddedContact.std.js'; import { type GroupV2InfoType, messageSender, -} from '../textsecure/SendMessage.js'; +} from '../textsecure/SendMessage.preload.js'; import { getAvatar as doGetAvatar, cdsLookup, checkAccountExistence, -} from '../textsecure/WebAPI.js'; -import createTaskWithTimeout from '../textsecure/TaskWithTimeout.js'; -import { MessageSender } from '../textsecure/SendMessage.js'; +} from '../textsecure/WebAPI.preload.js'; +import createTaskWithTimeout from '../textsecure/TaskWithTimeout.std.js'; +import { MessageSender } from '../textsecure/SendMessage.preload.js'; import type { CallbackResultType, PniSignatureMessageType, @@ -74,53 +74,53 @@ import type { import type { ConversationType, DraftPreviewType, -} from '../state/ducks/conversations.js'; +} from '../state/ducks/conversations.preload.js'; import type { AvatarColorType, ConversationColorType, CustomColorType, -} from '../types/Colors.js'; -import { strictAssert } from '../util/assert.js'; -import { isConversationMuted } from '../util/isConversationMuted.js'; -import { isConversationSMSOnly } from '../util/isConversationSMSOnly.js'; +} from '../types/Colors.std.js'; +import { strictAssert } from '../util/assert.std.js'; +import { isConversationMuted } from '../util/isConversationMuted.std.js'; +import { isConversationSMSOnly } from '../util/isConversationSMSOnly.std.js'; import { isConversationEverUnregistered, isConversationUnregistered, isConversationUnregisteredAndStale, -} from '../util/isConversationUnregistered.js'; -import { sniffImageMimeType } from '../util/sniffImageMimeType.js'; -import { isValidE164 } from '../util/isValidE164.js'; -import type { MIMEType } from '../types/MIME.js'; -import { IMAGE_JPEG, IMAGE_WEBP } from '../types/MIME.js'; +} from '../util/isConversationUnregistered.dom.js'; +import { sniffImageMimeType } from '../util/sniffImageMimeType.std.js'; +import { isValidE164 } from '../util/isValidE164.std.js'; +import type { MIMEType } from '../types/MIME.std.js'; +import { IMAGE_JPEG, IMAGE_WEBP } from '../types/MIME.std.js'; import type { AciString, PniString, ServiceIdString, -} from '../types/ServiceId.js'; +} from '../types/ServiceId.std.js'; import { ServiceIdKind, normalizeServiceId, normalizePni, -} from '../types/ServiceId.js'; -import { isAciString } from '../util/isAciString.js'; +} from '../types/ServiceId.std.js'; +import { isAciString } from '../util/isAciString.std.js'; import { constantTimeEqual, decryptProfile, decryptProfileName, hashProfileKey, -} from '../Crypto.js'; -import { decryptAttachmentV2 } from '../AttachmentCrypto.js'; -import * as Bytes from '../Bytes.js'; -import type { DraftBodyRanges } from '../types/BodyRange.js'; -import { migrateColor } from '../util/migrateColor.js'; -import { isNotNil } from '../util/isNotNil.js'; -import { signalProtocolStore } from '../SignalProtocolStore.js'; -import { shouldSaveNotificationAvatarToDisk } from '../services/notifications.js'; -import { storageServiceUploadJob } from '../services/storage.js'; -import { challengeHandler } from '../services/challengeHandler.js'; -import { getSendOptions } from '../util/getSendOptions.js'; -import type { IsConversationAcceptedOptionsType } from '../util/isConversationAccepted.js'; -import { isConversationAccepted } from '../util/isConversationAccepted.js'; +} from '../Crypto.node.js'; +import { decryptAttachmentV2 } from '../AttachmentCrypto.node.js'; +import * as Bytes from '../Bytes.std.js'; +import type { DraftBodyRanges } from '../types/BodyRange.std.js'; +import { migrateColor } from '../util/migrateColor.node.js'; +import { isNotNil } from '../util/isNotNil.std.js'; +import { signalProtocolStore } from '../SignalProtocolStore.preload.js'; +import { shouldSaveNotificationAvatarToDisk } from '../services/notifications.preload.js'; +import { storageServiceUploadJob } from '../services/storage.preload.js'; +import { challengeHandler } from '../services/challengeHandler.preload.js'; +import { getSendOptions } from '../util/getSendOptions.preload.js'; +import type { IsConversationAcceptedOptionsType } from '../util/isConversationAccepted.preload.js'; +import { isConversationAccepted } from '../util/isConversationAccepted.preload.js'; import { getNumber, getProfileName, @@ -129,96 +129,106 @@ import { hasNumberTitle, hasUsernameTitle, canHaveUsername, -} from '../util/getTitle.js'; -import { markConversationRead } from '../util/markConversationRead.js'; -import { handleMessageSend } from '../util/handleMessageSend.js'; -import { getConversationMembers } from '../util/getConversationMembers.js'; -import { updateConversationsWithUuidLookup } from '../updateConversationsWithUuidLookup.js'; -import { ReadStatus } from '../messages/MessageReadStatus.js'; -import { SendStatus } from '../messages/MessageSendState.js'; +} from '../util/getTitle.preload.js'; +import { markConversationRead } from '../util/markConversationRead.preload.js'; +import { handleMessageSend } from '../util/handleMessageSend.preload.js'; +import { getConversationMembers } from '../util/getConversationMembers.dom.js'; +import { updateConversationsWithUuidLookup } from '../updateConversationsWithUuidLookup.dom.js'; +import { ReadStatus } from '../messages/MessageReadStatus.std.js'; +import { SendStatus } from '../messages/MessageSendState.std.js'; import type { LinkPreviewType, LinkPreviewWithHydratedData, -} from '../types/message/LinkPreviews.js'; -import { MINUTE, SECOND, DurationInSeconds } from '../util/durations/index.js'; -import { concat, filter, map, repeat, zipObject } from '../util/iterables.js'; -import * as universalExpireTimer from '../util/universalExpireTimer.js'; -import type { GroupNameCollisionsWithIdsByTitle } from '../util/groupMemberNameCollisions.js'; +} from '../types/message/LinkPreviews.std.js'; +import { + MINUTE, + SECOND, + DurationInSeconds, +} from '../util/durations/index.std.js'; +import { + concat, + filter, + map, + repeat, + zipObject, +} from '../util/iterables.std.js'; +import * as universalExpireTimer from '../util/universalExpireTimer.preload.js'; +import type { GroupNameCollisionsWithIdsByTitle } from '../util/groupMemberNameCollisions.std.js'; import { isDirectConversation, isGroup, isGroupV1, isGroupV2, isMe, -} from '../util/whatTypeOfConversation.js'; -import { SignalService as Proto } from '../protobuf/index.js'; +} from '../util/whatTypeOfConversation.dom.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; import { getMessagePropStatus, hasErrors, isIncoming, isStory, -} from '../state/selectors/message.js'; -import { getPreloadedConversationId } from '../state/selectors/conversations.js'; +} from '../state/selectors/message.preload.js'; +import { getPreloadedConversationId } from '../state/selectors/conversations.dom.js'; import { conversationJobQueue, conversationQueueJobEnum, -} from '../jobs/conversationJobQueue.js'; -import { getProfile } from '../util/getProfile.js'; -import { SEALED_SENDER } from '../types/SealedSender.js'; -import { createIdenticon } from '../util/createIdenticon.js'; -import { createLogger } from '../logging/log.js'; -import * as Errors from '../types/errors.js'; -import { isMessageUnread } from '../util/isMessageUnread.js'; -import type { SenderKeyTargetType } from '../util/sendToGroup.js'; +} from '../jobs/conversationJobQueue.preload.js'; +import { getProfile } from '../util/getProfile.preload.js'; +import { SEALED_SENDER } from '../types/SealedSender.std.js'; +import { createIdenticon } from '../util/createIdenticon.preload.js'; +import { createLogger } from '../logging/log.std.js'; +import * as Errors from '../types/errors.std.js'; +import { isMessageUnread } from '../util/isMessageUnread.std.js'; +import type { SenderKeyTargetType } from '../util/sendToGroup.preload.js'; import { resetSenderKey, sendContentMessageToGroup, -} from '../util/sendToGroup.js'; -import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue.js'; -import { TimelineMessageLoadingState } from '../util/timelineUtil.js'; -import { SeenStatus } from '../MessageSeenStatus.js'; -import { getConversationIdForLogging } from '../util/idForLogging.js'; -import { getSendTarget } from '../util/getSendTarget.js'; -import { getRecipients } from '../util/getRecipients.js'; -import { validateConversation } from '../util/validateConversation.js'; -import { isSignalConversation } from '../util/isSignalConversation.js'; -import { removePendingMember } from '../util/removePendingMember.js'; +} from '../util/sendToGroup.preload.js'; +import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue.preload.js'; +import { TimelineMessageLoadingState } from '../util/timelineUtil.std.js'; +import { SeenStatus } from '../MessageSeenStatus.std.js'; +import { getConversationIdForLogging } from '../util/idForLogging.preload.js'; +import { getSendTarget } from '../util/getSendTarget.std.js'; +import { getRecipients } from '../util/getRecipients.dom.js'; +import { validateConversation } from '../util/validateConversation.dom.js'; +import { isSignalConversation } from '../util/isSignalConversation.dom.js'; +import { removePendingMember } from '../util/removePendingMember.preload.js'; import { isMember, isMemberAwaitingApproval, isMemberBanned, isMemberPending, isMemberRequestingToJoin, -} from '../util/groupMembershipUtils.js'; -import { imageToBlurHash } from '../util/imageToBlurHash.js'; -import { ReceiptType } from '../types/Receipt.js'; -import { getQuoteAttachment } from '../util/makeQuote.js'; +} from '../util/groupMembershipUtils.preload.js'; +import { imageToBlurHash } from '../util/imageToBlurHash.dom.js'; +import { ReceiptType } from '../types/Receipt.std.js'; +import { getQuoteAttachment } from '../util/makeQuote.preload.js'; import { deriveAccessKeyFromProfileKey, deriveProfileKeyVersion, -} from '../util/zkgroup.js'; -import { incrementMessageCounter } from '../util/incrementMessageCounter.js'; -import { generateMessageId } from '../util/generateMessageId.js'; -import { getMessageAuthorText } from '../util/getMessageAuthorText.js'; -import { downscaleOutgoingAttachment } from '../util/attachments.js'; +} from '../util/zkgroup.node.js'; +import { incrementMessageCounter } from '../util/incrementMessageCounter.preload.js'; +import { generateMessageId } from '../util/generateMessageId.node.js'; +import { getMessageAuthorText } from '../util/getMessageAuthorText.preload.js'; +import { downscaleOutgoingAttachment } from '../util/attachments.preload.js'; import { MessageRequestResponseSource, type MessageRequestResponseInfo, MessageRequestResponseEvent, -} from '../types/MessageRequestResponseEvent.js'; -import type { AddressableMessage } from '../textsecure/messageReceiverEvents.js'; +} from '../types/MessageRequestResponseEvent.std.js'; +import type { AddressableMessage } from '../textsecure/messageReceiverEvents.std.js'; import { getConversationIdentifier, getAddressableMessage, -} from '../util/syncIdentifiers.js'; -import { explodePromise } from '../util/explodePromise.js'; -import { getCallHistorySelector } from '../state/selectors/callHistory.js'; -import { migrateLegacyReadStatus } from '../messages/migrateLegacyReadStatus.js'; -import { migrateLegacySendAttributes } from '../messages/migrateLegacySendAttributes.js'; -import { getIsInitialContactSync } from '../services/contactSync.js'; -import { queueAttachmentDownloadsAndMaybeSaveMessage } from '../util/queueAttachmentDownloads.js'; -import { cleanupMessages } from '../util/cleanup.js'; -import { MessageModel } from './messages.js'; +} from '../util/syncIdentifiers.preload.js'; +import { explodePromise } from '../util/explodePromise.std.js'; +import { getCallHistorySelector } from '../state/selectors/callHistory.std.js'; +import { migrateLegacyReadStatus } from '../messages/migrateLegacyReadStatus.std.js'; +import { migrateLegacySendAttributes } from '../messages/migrateLegacySendAttributes.preload.js'; +import { getIsInitialContactSync } from '../services/contactSync.preload.js'; +import { queueAttachmentDownloadsAndMaybeSaveMessage } from '../util/queueAttachmentDownloads.preload.js'; +import { cleanupMessages } from '../util/cleanup.preload.js'; +import { MessageModel } from './messages.preload.js'; import { applyNewAvatar, buildAccessControlAddFromInviteLinkChange, @@ -242,14 +252,14 @@ import { modifyGroupV2, waitThenMaybeUpdateGroup, waitThenRespondToGroupV2Migration, -} from '../groups.js'; -import { safeSetTimeout } from '../util/timeout.js'; -import { getTypingIndicatorSetting } from '../util/Settings.js'; -import { INITIAL_EXPIRE_TIMER_VERSION } from '../util/expirationTimer.js'; -import { maybeNotify } from '../messages/maybeNotify.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import * as Message from '../types/Message2.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from '../groups.preload.js'; +import { safeSetTimeout } from '../util/timeout.std.js'; +import { getTypingIndicatorSetting } from '../util/Settings.preload.js'; +import { INITIAL_EXPIRE_TIMER_VERSION } from '../util/expirationTimer.std.js'; +import { maybeNotify } from '../messages/maybeNotify.preload.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import * as Message from '../types/Message2.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const { compact, isNumber, throttle, debounce } = lodash; diff --git a/ts/models/messages.ts b/ts/models/messages.ts index ffb1cd5fa6..9a770c115f 100644 --- a/ts/models/messages.ts +++ b/ts/models/messages.ts @@ -3,8 +3,8 @@ import type { MessageAttributesType } from '../model-types.d.ts'; import type { CallbackResultType } from '../textsecure/Types.d.ts'; -import { initializeSchemaVersion } from '../types/Message2.js'; -import { createLogger } from '../logging/log.js'; +import { initializeSchemaVersion } from '../types/Message2.preload.js'; +import { createLogger } from '../logging/log.std.js'; const log = createLogger('messages'); diff --git a/ts/protobuf/index.ts b/ts/protobuf/index.ts index 6c99dbc25b..05b5d638e3 100644 --- a/ts/protobuf/index.ts +++ b/ts/protobuf/index.ts @@ -1,7 +1,7 @@ // Copyright 2018 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import './wrap.js'; +import './wrap.node.js'; import { signal as Signal, diff --git a/ts/quill/auto-substitute-ascii-emojis/index.tsx b/ts/quill/auto-substitute-ascii-emojis/index.tsx index ef40fe6366..9218b31159 100644 --- a/ts/quill/auto-substitute-ascii-emojis/index.tsx +++ b/ts/quill/auto-substitute-ascii-emojis/index.tsx @@ -5,13 +5,13 @@ import { Delta } from '@signalapp/quill-cjs'; import Emitter from '@signalapp/quill-cjs/core/emitter.js'; import type Quill from '@signalapp/quill-cjs'; -import { createLogger } from '../../logging/log.js'; -import type { EmojiParentKey } from '../../components/fun/data/emojis.js'; +import { createLogger } from '../../logging/log.std.js'; +import type { EmojiParentKey } from '../../components/fun/data/emojis.std.js'; import { EMOJI_PARENT_KEY_CONSTANTS, EmojiSkinTone, getEmojiVariantByParentKeyAndSkinTone, -} from '../../components/fun/data/emojis.js'; +} from '../../components/fun/data/emojis.std.js'; const log = createLogger('index'); diff --git a/ts/quill/emoji/blot.tsx b/ts/quill/emoji/blot.tsx index 481cec9673..ece6fc3da4 100644 --- a/ts/quill/emoji/blot.tsx +++ b/ts/quill/emoji/blot.tsx @@ -2,16 +2,16 @@ // SPDX-License-Identifier: AGPL-3.0-only import EmbedBlot from '@signalapp/quill-cjs/blots/embed.js'; -import { strictAssert } from '../../util/assert.js'; +import { strictAssert } from '../../util/assert.std.js'; import { getEmojiVariantByKey, getEmojiVariantKeyByValue, isEmojiVariantValue, -} from '../../components/fun/data/emojis.js'; +} from '../../components/fun/data/emojis.std.js'; import { createStaticEmojiBlot, FUN_STATIC_EMOJI_CLASS, -} from '../../components/fun/FunEmoji.js'; +} from '../../components/fun/FunEmoji.dom.js'; // the DOM structure of this EmojiBlot should match the other emoji implementations: // ts/components/fun/FunEmoji.tsx diff --git a/ts/quill/emoji/completion.tsx b/ts/quill/emoji/completion.tsx index f16b089961..e43387a322 100644 --- a/ts/quill/emoji/completion.tsx +++ b/ts/quill/emoji/completion.tsx @@ -10,22 +10,22 @@ import { Popper } from 'react-popper'; import classNames from 'classnames'; import { createPortal } from 'react-dom'; import type { VirtualElement } from '@popperjs/core'; -import { getBlotTextPartitions, matchBlotTextPartitions } from '../util.js'; -import { handleOutsideClick } from '../../util/handleOutsideClick.js'; -import { createLogger } from '../../logging/log.js'; -import { FunStaticEmoji } from '../../components/fun/FunEmoji.js'; -import type { EmojiParentKey } from '../../components/fun/data/emojis.js'; +import { getBlotTextPartitions, matchBlotTextPartitions } from '../util.dom.js'; +import { handleOutsideClick } from '../../util/handleOutsideClick.dom.js'; +import { createLogger } from '../../logging/log.std.js'; +import { FunStaticEmoji } from '../../components/fun/FunEmoji.dom.js'; +import type { EmojiParentKey } from '../../components/fun/data/emojis.std.js'; import { EmojiSkinTone, getEmojiVariantByParentKeyAndSkinTone, normalizeShortNameCompletionDisplay, -} from '../../components/fun/data/emojis.js'; +} from '../../components/fun/data/emojis.std.js'; import type { FunEmojiSearchResult, FunEmojiSearch, -} from '../../components/fun/useFunEmojiSearch.js'; -import { type FunEmojiLocalizer } from '../../components/fun/useFunEmojiLocalizer.js'; -import type { FunEmojiSelection } from '../../components/fun/panels/FunPanelEmojis.js'; +} from '../../components/fun/useFunEmojiSearch.dom.js'; +import { type FunEmojiLocalizer } from '../../components/fun/useFunEmojiLocalizer.dom.js'; +import type { FunEmojiSelection } from '../../components/fun/panels/FunPanelEmojis.dom.js'; const { isNumber, debounce } = lodash; diff --git a/ts/quill/emoji/index.tsx b/ts/quill/emoji/index.tsx index a2b117f205..452dd9ca92 100644 --- a/ts/quill/emoji/index.tsx +++ b/ts/quill/emoji/index.tsx @@ -1,5 +1,5 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -export { EmojiBlot } from './blot.js'; -export { EmojiCompletion } from './completion.js'; +export { EmojiBlot } from './blot.dom.js'; +export { EmojiCompletion } from './completion.dom.js'; diff --git a/ts/quill/emoji/matchers.ts b/ts/quill/emoji/matchers.ts index b334277500..9293d32e87 100644 --- a/ts/quill/emoji/matchers.ts +++ b/ts/quill/emoji/matchers.ts @@ -3,12 +3,12 @@ import { Delta } from '@signalapp/quill-cjs'; -import { insertEmojiOps } from '../util.js'; -import type { Matcher } from '../util.js'; +import { insertEmojiOps } from '../util.dom.js'; +import type { Matcher } from '../util.dom.js'; import { FUN_INLINE_EMOJI_CLASS, FUN_STATIC_EMOJI_CLASS, -} from '../../components/fun/FunEmoji.js'; +} from '../../components/fun/FunEmoji.dom.js'; export const matchEmojiImage: Matcher = ( node, diff --git a/ts/quill/formatting/matchers.ts b/ts/quill/formatting/matchers.ts index d0e50feda3..f1529f1b11 100644 --- a/ts/quill/formatting/matchers.ts +++ b/ts/quill/formatting/matchers.ts @@ -4,8 +4,8 @@ import { Delta } from '@signalapp/quill-cjs'; import type { AttributeMap } from '@signalapp/quill-cjs'; -import { QuillFormattingStyle } from './menu.js'; -import type { Matcher } from '../util.js'; +import { QuillFormattingStyle } from './menu.dom.js'; +import type { Matcher } from '../util.dom.js'; function applyStyleToOps( delta: Delta, diff --git a/ts/quill/formatting/menu.tsx b/ts/quill/formatting/menu.tsx index 10078deaf2..e8438804bb 100644 --- a/ts/quill/formatting/menu.tsx +++ b/ts/quill/formatting/menu.tsx @@ -12,10 +12,10 @@ import type { Op } from '@signalapp/quill-cjs'; import type { Context as KeyboardContext } from '@signalapp/quill-cjs/modules/keyboard.js'; import type { VirtualElement } from '@popperjs/core'; -import { createLogger } from '../../logging/log.js'; -import * as Errors from '../../types/errors.js'; -import type { LocalizerType } from '../../types/Util.js'; -import { handleOutsideClick } from '../../util/handleOutsideClick.js'; +import { createLogger } from '../../logging/log.std.js'; +import * as Errors from '../../types/errors.std.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import { handleOutsideClick } from '../../util/handleOutsideClick.dom.js'; const { isString } = lodash; diff --git a/ts/quill/memberRepository.ts b/ts/quill/memberRepository.ts index 98e894122e..696f675056 100644 --- a/ts/quill/memberRepository.ts +++ b/ts/quill/memberRepository.ts @@ -4,12 +4,12 @@ import Fuse from 'fuse.js'; import lodash from 'lodash'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import type { AciString } from '../types/ServiceId.js'; -import { isAciString } from '../util/isAciString.js'; -import { filter, map } from '../util/iterables.js'; -import { removeDiacritics } from '../util/removeDiacritics.js'; -import { isNotNil } from '../util/isNotNil.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import type { AciString } from '../types/ServiceId.std.js'; +import { isAciString } from '../util/isAciString.std.js'; +import { filter, map } from '../util/iterables.std.js'; +import { removeDiacritics } from '../util/removeDiacritics.std.js'; +import { isNotNil } from '../util/isNotNil.std.js'; const { get } = lodash; diff --git a/ts/quill/mentions/blot.tsx b/ts/quill/mentions/blot.tsx index 54f2c90ff7..3d5c1762db 100644 --- a/ts/quill/mentions/blot.tsx +++ b/ts/quill/mentions/blot.tsx @@ -5,11 +5,11 @@ import React, { StrictMode } from 'react'; import EmbedBlot from '@signalapp/quill-cjs/blots/embed.js'; import { createRoot } from 'react-dom/client'; -import { Emojify } from '../../components/conversation/Emojify.js'; -import { normalizeAci } from '../../util/normalizeAci.js'; -import type { MentionBlotValue } from '../util.js'; -import { FunEmojiLocalizationProvider } from '../../components/fun/FunEmojiLocalizationProvider.js'; -import { AxoProvider } from '../../axo/AxoProvider.js'; +import { Emojify } from '../../components/conversation/Emojify.dom.js'; +import { normalizeAci } from '../../util/normalizeAci.std.js'; +import type { MentionBlotValue } from '../util.dom.js'; +import { FunEmojiLocalizationProvider } from '../../components/fun/FunEmojiLocalizationProvider.dom.js'; +import { AxoProvider } from '../../axo/AxoProvider.dom.js'; const { i18n } = window.SignalContext; diff --git a/ts/quill/mentions/completion.tsx b/ts/quill/mentions/completion.tsx index 67af88be8a..a86b59b658 100644 --- a/ts/quill/mentions/completion.tsx +++ b/ts/quill/mentions/completion.tsx @@ -11,15 +11,15 @@ import { Popper } from 'react-popper'; import classNames from 'classnames'; import { createPortal } from 'react-dom'; -import { Avatar, AvatarSize } from '../../components/Avatar.js'; -import type { LocalizerType, ThemeType } from '../../types/Util.js'; -import type { MemberType, MemberRepository } from '../memberRepository.js'; -import type { PreferredBadgeSelectorType } from '../../state/selectors/badges.js'; -import { matchBlotTextPartitions } from '../util.js'; -import type { MentionBlotValue } from '../util.js'; -import { handleOutsideClick } from '../../util/handleOutsideClick.js'; -import { sameWidthModifier } from '../../util/popperUtil.js'; -import { UserText } from '../../components/UserText.js'; +import { Avatar, AvatarSize } from '../../components/Avatar.dom.js'; +import type { LocalizerType, ThemeType } from '../../types/Util.std.js'; +import type { MemberType, MemberRepository } from '../memberRepository.std.js'; +import type { PreferredBadgeSelectorType } from '../../state/selectors/badges.preload.js'; +import { matchBlotTextPartitions } from '../util.dom.js'; +import type { MentionBlotValue } from '../util.dom.js'; +import { handleOutsideClick } from '../../util/handleOutsideClick.dom.js'; +import { sameWidthModifier } from '../../util/popperUtil.std.js'; +import { UserText } from '../../components/UserText.dom.js'; export type MentionCompletionOptions = { getPreferredBadge: PreferredBadgeSelectorType; diff --git a/ts/quill/mentions/matchers.ts b/ts/quill/mentions/matchers.ts index 64fddeb9f9..751c95597f 100644 --- a/ts/quill/mentions/matchers.ts +++ b/ts/quill/mentions/matchers.ts @@ -4,10 +4,10 @@ import { Delta } from '@signalapp/quill-cjs'; import type { RefObject } from 'react'; -import { assertDev } from '../../util/assert.js'; -import { isAciString } from '../../util/isAciString.js'; -import type { MemberRepository } from '../memberRepository.js'; -import type { Matcher } from '../util.js'; +import { assertDev } from '../../util/assert.std.js'; +import { isAciString } from '../../util/isAciString.std.js'; +import type { MemberRepository } from '../memberRepository.std.js'; +import type { Matcher } from '../util.dom.js'; export const matchMention: ( memberRepositoryRef: RefObject diff --git a/ts/quill/signal-clipboard/index.ts b/ts/quill/signal-clipboard/index.ts index ec95d6d997..ed62a50c32 100644 --- a/ts/quill/signal-clipboard/index.ts +++ b/ts/quill/signal-clipboard/index.ts @@ -5,9 +5,12 @@ import type Quill from '@signalapp/quill-cjs'; import { Delta } from '@signalapp/quill-cjs'; import { deleteRange } from '@signalapp/quill-cjs/modules/keyboard.js'; -import { FormattingMenu, QuillFormattingStyle } from '../formatting/menu.js'; -import { insertEmojiOps } from '../util.js'; -import { createEventHandler } from './util.js'; +import { + FormattingMenu, + QuillFormattingStyle, +} from '../formatting/menu.dom.js'; +import { insertEmojiOps } from '../util.dom.js'; +import { createEventHandler } from './util.dom.js'; type ClipboardOptions = Readonly<{ isDisabled: boolean; diff --git a/ts/quill/signal-clipboard/util.ts b/ts/quill/signal-clipboard/util.ts index 096a28c5e1..5bf8fb566d 100644 --- a/ts/quill/signal-clipboard/util.ts +++ b/ts/quill/signal-clipboard/util.ts @@ -4,7 +4,7 @@ import { FUN_INLINE_EMOJI_CLASS, FUN_STATIC_EMOJI_CLASS, -} from '../../components/fun/FunEmoji.js'; +} from '../../components/fun/FunEmoji.dom.js'; const QUILL_EMBED_GUARD = '\uFEFF'; diff --git a/ts/quill/util.ts b/ts/quill/util.ts index 2579e6f441..68908da79f 100644 --- a/ts/quill/util.ts +++ b/ts/quill/util.ts @@ -9,18 +9,21 @@ import type { DisplayNode, DraftBodyRange, DraftBodyRanges, -} from '../types/BodyRange.js'; -import { BodyRange } from '../types/BodyRange.js'; -import type { MentionBlot } from './mentions/blot.js'; -import type { EmojiBlot } from './emoji/blot.js'; -import { isNewlineOnlyOp, QuillFormattingStyle } from './formatting/menu.js'; -import { isNotNil } from '../util/isNotNil.js'; -import type { AciString } from '../types/ServiceId.js'; +} from '../types/BodyRange.std.js'; +import { BodyRange } from '../types/BodyRange.std.js'; +import type { MentionBlot } from './mentions/blot.dom.js'; +import type { EmojiBlot } from './emoji/blot.dom.js'; +import { + isNewlineOnlyOp, + QuillFormattingStyle, +} from './formatting/menu.dom.js'; +import { isNotNil } from '../util/isNotNil.std.js'; +import type { AciString } from '../types/ServiceId.std.js'; import { getEmojiVariantByKey, getEmojiVariantKeyByValue, isEmojiVariantValue, -} from '../components/fun/data/emojis.js'; +} from '../components/fun/data/emojis.std.js'; export type Matcher = ( node: HTMLElement, diff --git a/ts/reactions/constants.ts b/ts/reactions/constants.ts index edca4dd5e7..cd80643866 100644 --- a/ts/reactions/constants.ts +++ b/ts/reactions/constants.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { EMOJI_PARENT_KEY_CONSTANTS } from '../components/fun/data/emojis.js'; +import { EMOJI_PARENT_KEY_CONSTANTS } from '../components/fun/data/emojis.std.js'; export const DEFAULT_PREFERRED_REACTION_EMOJI_PARENT_KEYS = [ EMOJI_PARENT_KEY_CONSTANTS.RED_HEART, diff --git a/ts/reactions/enqueueReactionForSend.ts b/ts/reactions/enqueueReactionForSend.ts index 1c876cfe9f..078234388a 100644 --- a/ts/reactions/enqueueReactionForSend.ts +++ b/ts/reactions/enqueueReactionForSend.ts @@ -4,26 +4,26 @@ import noop from 'lodash/noop.js'; import { v7 as generateUuid } from 'uuid'; -import { DataWriter } from '../sql/Client.js'; -import { MessageModel } from '../models/messages.js'; +import { DataWriter } from '../sql/Client.preload.js'; +import { MessageModel } from '../models/messages.preload.js'; import { handleReaction, type ReactionAttributesType, -} from '../messageModifiers/Reactions.js'; -import { ReactionSource } from './ReactionSource.js'; -import { getMessageById } from '../messages/getMessageById.js'; -import { getSourceServiceId } from '../messages/sources.js'; -import { isStory } from '../messages/helpers.js'; -import { strictAssert } from '../util/assert.js'; -import { isDirectConversation } from '../util/whatTypeOfConversation.js'; -import { incrementMessageCounter } from '../util/incrementMessageCounter.js'; -import { generateMessageId } from '../util/generateMessageId.js'; -import { repeat, zipObject } from '../util/iterables.js'; -import { getMessageSentTimestamp } from '../util/getMessageSentTimestamp.js'; -import { isAciString } from '../util/isAciString.js'; -import { SendStatus } from '../messages/MessageSendState.js'; -import { createLogger } from '../logging/log.js'; -import { getMessageIdForLogging } from '../util/idForLogging.js'; +} from '../messageModifiers/Reactions.preload.js'; +import { ReactionSource } from './ReactionSource.std.js'; +import { getMessageById } from '../messages/getMessageById.preload.js'; +import { getSourceServiceId } from '../messages/sources.preload.js'; +import { isStory } from '../messages/helpers.std.js'; +import { strictAssert } from '../util/assert.std.js'; +import { isDirectConversation } from '../util/whatTypeOfConversation.dom.js'; +import { incrementMessageCounter } from '../util/incrementMessageCounter.preload.js'; +import { generateMessageId } from '../util/generateMessageId.node.js'; +import { repeat, zipObject } from '../util/iterables.std.js'; +import { getMessageSentTimestamp } from '../util/getMessageSentTimestamp.std.js'; +import { isAciString } from '../util/isAciString.std.js'; +import { SendStatus } from '../messages/MessageSendState.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { getMessageIdForLogging } from '../util/idForLogging.preload.js'; const log = createLogger('enqueueReactionForSend'); diff --git a/ts/reactions/isValidReactionEmoji.ts b/ts/reactions/isValidReactionEmoji.ts index e26795e965..a149a23331 100644 --- a/ts/reactions/isValidReactionEmoji.ts +++ b/ts/reactions/isValidReactionEmoji.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import emojiRegex from 'emoji-regex'; -import { getGraphemes } from '../util/grapheme.js'; -import { take, size } from '../util/iterables.js'; +import { getGraphemes } from '../util/grapheme.std.js'; +import { take, size } from '../util/iterables.std.js'; export function isValidReactionEmoji(value: unknown): value is string { if (typeof value !== 'string') { diff --git a/ts/reactions/preferredReactionEmoji.ts b/ts/reactions/preferredReactionEmoji.ts index 8e03213136..b7f1eec29f 100644 --- a/ts/reactions/preferredReactionEmoji.ts +++ b/ts/reactions/preferredReactionEmoji.ts @@ -2,13 +2,13 @@ // SPDX-License-Identifier: AGPL-3.0-only import lodash from 'lodash'; -import { createLogger } from '../logging/log.js'; -import { DEFAULT_PREFERRED_REACTION_EMOJI_PARENT_KEYS } from './constants.js'; -import { isValidReactionEmoji } from './isValidReactionEmoji.js'; +import { createLogger } from '../logging/log.std.js'; +import { DEFAULT_PREFERRED_REACTION_EMOJI_PARENT_KEYS } from './constants.std.js'; +import { isValidReactionEmoji } from './isValidReactionEmoji.std.js'; import { getEmojiVariantByParentKeyAndSkinTone, type EmojiSkinTone, -} from '../components/fun/data/emojis.js'; +} from '../components/fun/data/emojis.std.js'; const { times } = lodash; diff --git a/ts/reactions/util.ts b/ts/reactions/util.ts index 89dc8bed9c..3df0847a7d 100644 --- a/ts/reactions/util.ts +++ b/ts/reactions/util.ts @@ -3,7 +3,7 @@ import lodash from 'lodash'; import type { MessageReactionType } from '../model-types.d.ts'; -import { areObjectEntriesEqual } from '../util/areObjectEntriesEqual.js'; +import { areObjectEntriesEqual } from '../util/areObjectEntriesEqual.std.js'; const { findLastIndex, has, identity, omit, negate } = lodash; diff --git a/ts/routineProfileRefresh.ts b/ts/routineProfileRefresh.ts index 4319978b3e..90fcbaa631 100644 --- a/ts/routineProfileRefresh.ts +++ b/ts/routineProfileRefresh.ts @@ -4,18 +4,18 @@ import lodash from 'lodash'; import PQueue from 'p-queue'; -import { createLogger } from './logging/log.js'; -import { assertDev } from './util/assert.js'; -import { sleep } from './util/sleep.js'; -import { isNormalNumber } from './util/isNormalNumber.js'; -import { take } from './util/iterables.js'; -import type { ConversationModel } from './models/conversations.js'; +import { createLogger } from './logging/log.std.js'; +import { assertDev } from './util/assert.std.js'; +import { sleep } from './util/sleep.std.js'; +import { isNormalNumber } from './util/isNormalNumber.std.js'; +import { take } from './util/iterables.std.js'; +import type { ConversationModel } from './models/conversations.preload.js'; import type { StorageInterface } from './types/Storage.d.ts'; -import * as Errors from './types/errors.js'; -import { getProfile } from './util/getProfile.js'; -import { drop } from './util/drop.js'; -import { MINUTE, HOUR, DAY, WEEK } from './util/durations/index.js'; -import { isDirectConversation } from './util/whatTypeOfConversation.js'; +import * as Errors from './types/errors.std.js'; +import { getProfile } from './util/getProfile.preload.js'; +import { drop } from './util/drop.std.js'; +import { MINUTE, HOUR, DAY, WEEK } from './util/durations/index.std.js'; +import { isDirectConversation } from './util/whatTypeOfConversation.dom.js'; const { isNil, sortBy } = lodash; diff --git a/ts/scripts/after-all-artifact-build.ts b/ts/scripts/after-all-artifact-build.ts index 7eb0894e76..2ab0c9930f 100644 --- a/ts/scripts/after-all-artifact-build.ts +++ b/ts/scripts/after-all-artifact-build.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { BuildResult } from 'electron-builder'; -import { afterAllArtifactBuild as notarizeUniversalDMG } from './notarize-universal-dmg.js'; +import { afterAllArtifactBuild as notarizeUniversalDMG } from './notarize-universal-dmg.node.js'; export async function afterAllArtifactBuild( result: BuildResult diff --git a/ts/scripts/after-pack.ts b/ts/scripts/after-pack.ts index 37de4e1ddd..18d78e9de0 100644 --- a/ts/scripts/after-pack.ts +++ b/ts/scripts/after-pack.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { AfterPackContext } from 'electron-builder'; -import { afterPack as fuseElectron } from './fuse-electron.js'; -import { afterPack as copyPacks } from './copy-language-packs.js'; -import { afterPack as pruneMacOSRelease } from './prune-macos-release.js'; -import { afterPack as ensureLinuxFilePermissions } from './ensure-linux-file-permissions.js'; +import { afterPack as fuseElectron } from './fuse-electron.node.js'; +import { afterPack as copyPacks } from './copy-language-packs.node.js'; +import { afterPack as pruneMacOSRelease } from './prune-macos-release.node.js'; +import { afterPack as ensureLinuxFilePermissions } from './ensure-linux-file-permissions.node.js'; export async function afterPack(context: AfterPackContext): Promise { await pruneMacOSRelease(context); diff --git a/ts/scripts/after-sign.ts b/ts/scripts/after-sign.ts index d9fba7950e..0353bce888 100644 --- a/ts/scripts/after-sign.ts +++ b/ts/scripts/after-sign.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { AfterPackContext } from 'electron-builder'; -import { afterSign as notarize } from './notarize.js'; +import { afterSign as notarize } from './notarize.node.js'; // NOTE: It is AfterPackContext here even though it is afterSign. // See: https://www.electron.build/configuration/configuration.html#aftersign diff --git a/ts/scripts/build-localized-display-names.ts b/ts/scripts/build-localized-display-names.ts index cb84c36e66..8730bd8925 100644 --- a/ts/scripts/build-localized-display-names.ts +++ b/ts/scripts/build-localized-display-names.ts @@ -4,8 +4,8 @@ import { parse } from 'csv-parse'; import fs from 'node:fs/promises'; import { z } from 'zod'; -import { _getAvailableLocales } from '../../app/locale.js'; -import { parseUnknown } from '../util/schemas.js'; +import { _getAvailableLocales } from '../../app/locale.main.js'; +import { parseUnknown } from '../util/schemas.std.js'; const type = process.argv[2]; if (type !== 'countries' && type !== 'locales') { diff --git a/ts/scripts/check-min-os-version.ts b/ts/scripts/check-min-os-version.ts index 610a07a283..7e5d6acd02 100644 --- a/ts/scripts/check-min-os-version.ts +++ b/ts/scripts/check-min-os-version.ts @@ -11,8 +11,8 @@ import { gte } from 'semver'; // Note: because we don't run under electron - this is a path to binary import ELECTRON_BINARY from 'electron'; -import { drop } from '../util/drop.js'; -import packageJson from '../util/packageJson.js'; +import { drop } from '../util/drop.std.js'; +import packageJson from '../util/packageJson.node.js'; const execFile = promisify(execFileCb); diff --git a/ts/scripts/compile-stories-icu-lookup.ts b/ts/scripts/compile-stories-icu-lookup.ts index 3b87aff1cd..d53f07aa45 100644 --- a/ts/scripts/compile-stories-icu-lookup.ts +++ b/ts/scripts/compile-stories-icu-lookup.ts @@ -5,7 +5,7 @@ import { readFile, writeFile, readdir, readlink } from 'node:fs/promises'; import { join, basename } from 'node:path'; import pMap from 'p-map'; -import { drop } from '../util/drop.js'; +import { drop } from '../util/drop.std.js'; async function main(): Promise { const source = process.argv[2]; diff --git a/ts/scripts/dd-installer-size.ts b/ts/scripts/dd-installer-size.ts index 59d5408c94..0d9a00b5a7 100644 --- a/ts/scripts/dd-installer-size.ts +++ b/ts/scripts/dd-installer-size.ts @@ -4,7 +4,7 @@ import { stat } from 'node:fs/promises'; import { join } from 'node:path'; -import { name as NAME, version as VERSION } from '../util/packageJson.js'; +import { name as NAME, version as VERSION } from '../util/packageJson.node.js'; const SUPPORT_CONFIG = new Set([ 'linux', diff --git a/ts/scripts/gen-nsis-script.ts b/ts/scripts/gen-nsis-script.ts index bcec5facf9..efe3193e35 100644 --- a/ts/scripts/gen-nsis-script.ts +++ b/ts/scripts/gen-nsis-script.ts @@ -11,7 +11,7 @@ import fs from 'node:fs'; // // Make sure to sync up the values in `util/nsis` with upstream // `app-builder-lib`. -import { REQUIRED_LANGUAGES, LCID } from '../util/nsis.js'; +import { REQUIRED_LANGUAGES, LCID } from '../util/nsis.std.js'; const STRING_VARS = new Map([ [ diff --git a/ts/scripts/generate-compact-locales.ts b/ts/scripts/generate-compact-locales.ts index 472577996c..c09aba2253 100644 --- a/ts/scripts/generate-compact-locales.ts +++ b/ts/scripts/generate-compact-locales.ts @@ -4,7 +4,7 @@ import { readdir, mkdir, readFile, writeFile } from 'node:fs/promises'; import { join, dirname } from 'node:path'; import pMap from 'p-map'; -import { isLocaleMessageType } from '../util/setupI18nMain.js'; +import { isLocaleMessageType } from '../util/setupI18nMain.std.js'; async function compact({ sourceDir, diff --git a/ts/scripts/generate-dns-fallback.ts b/ts/scripts/generate-dns-fallback.ts index 55f82033c2..a1efd725fb 100644 --- a/ts/scripts/generate-dns-fallback.ts +++ b/ts/scripts/generate-dns-fallback.ts @@ -6,7 +6,7 @@ import { writeFile } from 'node:fs/promises'; import { join } from 'node:path'; import { promisify } from 'node:util'; -import { isNotNil } from '../util/isNotNil.js'; +import { isNotNil } from '../util/isNotNil.std.js'; const resolve4 = promisify(resolve4Cb); const resolve6 = promisify(resolve6Cb); diff --git a/ts/scripts/generate-icu-types.ts b/ts/scripts/generate-icu-types.ts index 085b39defc..85f5cf33e5 100644 --- a/ts/scripts/generate-icu-types.ts +++ b/ts/scripts/generate-icu-types.ts @@ -7,12 +7,12 @@ import path from 'node:path'; import ts from 'typescript'; import prettier from 'prettier'; -import { getICUMessageParams } from '../util/getICUMessageParams.js'; -import type { ICUMessageParamType } from '../util/getICUMessageParams.js'; -import { missingCaseError } from '../util/missingCaseError.js'; +import { getICUMessageParams } from '../util/getICUMessageParams.std.js'; +import type { ICUMessageParamType } from '../util/getICUMessageParams.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; import globalMessages from '../../_locales/en/messages.json'; -import { DELETED_REGEXP } from './constants.js'; +import { DELETED_REGEXP } from './constants.std.js'; function translateParamType( param: ICUMessageParamType, diff --git a/ts/scripts/generate-preload-cache.ts b/ts/scripts/generate-preload-cache.ts index bef851578c..a3d58050a9 100644 --- a/ts/scripts/generate-preload-cache.ts +++ b/ts/scripts/generate-preload-cache.ts @@ -8,8 +8,8 @@ import { mkdir, mkdtemp, rm, rename } from 'node:fs/promises'; import pTimeout from 'p-timeout'; import ELECTRON_BIN from 'electron'; -import { MINUTE } from '../util/durations/index.js'; -import { explodePromise } from '../util/explodePromise.js'; +import { MINUTE } from '../util/durations/index.std.js'; +import { explodePromise } from '../util/explodePromise.std.js'; const ROOT_DIR = join(__dirname, '..', '..'); diff --git a/ts/scripts/generate-tray-icons.ts b/ts/scripts/generate-tray-icons.ts index 16b27dce07..eb21314b4c 100644 --- a/ts/scripts/generate-tray-icons.ts +++ b/ts/scripts/generate-tray-icons.ts @@ -4,7 +4,7 @@ import { createCanvas, GlobalFonts, loadImage } from '@napi-rs/canvas'; import { join } from 'node:path'; import { mkdir, rm, writeFile } from 'node:fs/promises'; -import { strictAssert } from '../util/assert.js'; +import { strictAssert } from '../util/assert.std.js'; const cwd = __dirname; const fontsDir = join(cwd, '..', '..', 'fonts'); diff --git a/ts/scripts/get-emoji-locales.ts b/ts/scripts/get-emoji-locales.ts index e802930661..b22ab19cee 100644 --- a/ts/scripts/get-emoji-locales.ts +++ b/ts/scripts/get-emoji-locales.ts @@ -7,9 +7,9 @@ import { join } from 'node:path'; import z from 'zod'; import prettier from 'prettier'; -import type { OptionalResourceType } from '../types/OptionalResource.js'; -import { OptionalResourcesDictSchema } from '../types/OptionalResource.js'; -import { parseUnknown } from '../util/schemas.js'; +import type { OptionalResourceType } from '../types/OptionalResource.std.js'; +import { OptionalResourcesDictSchema } from '../types/OptionalResource.std.js'; +import { parseUnknown } from '../util/schemas.std.js'; const MANIFEST_URL = 'https://updates.signal.org/dynamic/android/emoji/search/manifest.json'; diff --git a/ts/scripts/get-expire-time.ts b/ts/scripts/get-expire-time.ts index d6f6cc8616..7938f74d37 100644 --- a/ts/scripts/get-expire-time.ts +++ b/ts/scripts/get-expire-time.ts @@ -5,9 +5,9 @@ import { join } from 'node:path'; import { execSync } from 'node:child_process'; import { writeFileSync } from 'node:fs'; -import { DAY } from '../util/durations/index.js'; -import { version } from '../util/packageJson.js'; -import { isNotUpdatable } from '../util/version.js'; +import { DAY } from '../util/durations/index.std.js'; +import { version } from '../util/packageJson.node.js'; +import { isNotUpdatable } from '../util/version.std.js'; const unixTimestamp = parseInt( process.env.SOURCE_DATE_EPOCH || diff --git a/ts/scripts/get-jumbomoji.ts b/ts/scripts/get-jumbomoji.ts index ad7f6412bf..f128253ccb 100644 --- a/ts/scripts/get-jumbomoji.ts +++ b/ts/scripts/get-jumbomoji.ts @@ -8,10 +8,10 @@ import { Buffer } from 'node:buffer'; import z from 'zod'; import prettier from 'prettier'; -import type { OptionalResourceType } from '../types/OptionalResource.js'; -import { OptionalResourcesDictSchema } from '../types/OptionalResource.js'; -import { parseUnknown } from '../util/schemas.js'; -import { utf16ToEmoji } from '../util/utf16ToEmoji.js'; +import type { OptionalResourceType } from '../types/OptionalResource.std.js'; +import { OptionalResourcesDictSchema } from '../types/OptionalResource.std.js'; +import { parseUnknown } from '../util/schemas.std.js'; +import { utf16ToEmoji } from '../util/utf16ToEmoji.node.js'; const VERSION = 12; diff --git a/ts/scripts/get-strings.ts b/ts/scripts/get-strings.ts index 7ed4320807..29835733ce 100644 --- a/ts/scripts/get-strings.ts +++ b/ts/scripts/get-strings.ts @@ -8,7 +8,7 @@ import prettier from 'prettier'; import pMap from 'p-map'; import z from 'zod'; -import { authenticate, API_BASE, PROJECT_ID } from '../util/smartling.js'; +import { authenticate, API_BASE, PROJECT_ID } from '../util/smartling.node.js'; const { SMARTLING_USER, SMARTLING_SECRET } = process.env; diff --git a/ts/scripts/mark-unused-strings-deleted.ts b/ts/scripts/mark-unused-strings-deleted.ts index 827c606749..a38eba298f 100644 --- a/ts/scripts/mark-unused-strings-deleted.ts +++ b/ts/scripts/mark-unused-strings-deleted.ts @@ -3,7 +3,7 @@ import { spawnSync } from 'node:child_process'; import path from 'node:path'; import { readFileSync, writeFileSync } from 'node:fs'; -import { DELETED_REGEXP } from './constants.js'; +import { DELETED_REGEXP } from './constants.std.js'; const rootDir = path.resolve(__dirname, '..', '..'); const messagesPath = path.join(rootDir, '_locales/en/messages.json'); diff --git a/ts/scripts/notarize-universal-dmg.ts b/ts/scripts/notarize-universal-dmg.ts index b96600e404..5c6856b7ef 100644 --- a/ts/scripts/notarize-universal-dmg.ts +++ b/ts/scripts/notarize-universal-dmg.ts @@ -5,7 +5,7 @@ import type { BuildResult } from 'electron-builder'; import { notarize } from '@electron/notarize'; -import { build } from '../util/packageJson.js'; +import { build } from '../util/packageJson.node.js'; export async function afterAllArtifactBuild({ platformToTargets, diff --git a/ts/scripts/notarize.ts b/ts/scripts/notarize.ts index 733522b614..a9e686040e 100644 --- a/ts/scripts/notarize.ts +++ b/ts/scripts/notarize.ts @@ -6,7 +6,7 @@ import type { AfterPackContext } from 'electron-builder'; import { notarize } from '@electron/notarize'; -import { build } from '../util/packageJson.js'; +import { build } from '../util/packageJson.node.js'; export async function afterSign({ appOutDir, diff --git a/ts/scripts/push-strings.ts b/ts/scripts/push-strings.ts index 73fab70448..ad9e29d71e 100644 --- a/ts/scripts/push-strings.ts +++ b/ts/scripts/push-strings.ts @@ -4,7 +4,7 @@ import { randomBytes } from 'node:crypto'; import { readFile } from 'node:fs/promises'; -import { API_BASE, PROJECT_ID, authenticate } from '../util/smartling.js'; +import { API_BASE, PROJECT_ID, authenticate } from '../util/smartling.node.js'; const { SMARTLING_USER, SMARTLING_SECRET } = process.env; diff --git a/ts/scripts/remove-strings.ts b/ts/scripts/remove-strings.ts index 3a7f0f4862..46ba85cdc4 100644 --- a/ts/scripts/remove-strings.ts +++ b/ts/scripts/remove-strings.ts @@ -7,9 +7,9 @@ import fs from 'node:fs/promises'; import pLimit from 'p-limit'; import path from 'node:path'; -import { MONTH } from '../util/durations/index.js'; -import { isOlderThan } from '../util/timestamp.js'; -import { DELETED_REGEXP } from './constants.js'; +import { MONTH } from '../util/durations/index.std.js'; +import { isOlderThan } from '../util/timestamp.std.js'; +import { DELETED_REGEXP } from './constants.std.js'; const ROOT_DIR = path.join(__dirname, '..', '..'); const MESSAGES_FILE = path.join(ROOT_DIR, '_locales', 'en', 'messages.json'); diff --git a/ts/scripts/test-electron.ts b/ts/scripts/test-electron.ts index cd3ed8d24e..ed4f649ea2 100644 --- a/ts/scripts/test-electron.ts +++ b/ts/scripts/test-electron.ts @@ -11,10 +11,10 @@ import z from 'zod'; import split2 from 'split2'; import logSymbols from 'log-symbols'; -import { explodePromise } from '../util/explodePromise.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { SECOND } from '../util/durations/index.js'; -import { parseUnknown } from '../util/schemas.js'; +import { explodePromise } from '../util/explodePromise.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { SECOND } from '../util/durations/index.std.js'; +import { parseUnknown } from '../util/schemas.std.js'; const ROOT_DIR = join(__dirname, '..', '..'); diff --git a/ts/scripts/test-release.ts b/ts/scripts/test-release.ts index 49ebb498e3..7a10304afd 100644 --- a/ts/scripts/test-release.ts +++ b/ts/scripts/test-release.ts @@ -6,7 +6,7 @@ import assert from 'node:assert'; import { join } from 'node:path'; import { _electron as electron } from 'playwright'; -import { productName, name } from '../util/packageJson.js'; +import { productName, name } from '../util/packageJson.node.js'; const ENVIRONMENT = 'production'; const RELEASE_DIR = join(__dirname, '..', '..', 'release'); diff --git a/ts/scripts/update-gha.ts b/ts/scripts/update-gha.ts index 65594229f1..9079b0b4b7 100644 --- a/ts/scripts/update-gha.ts +++ b/ts/scripts/update-gha.ts @@ -6,8 +6,8 @@ import { readFile, readdir, writeFile } from 'node:fs/promises'; import z from 'zod'; import semver from 'semver'; -import { drop } from '../util/drop.js'; -import { strictAssert } from '../util/assert.js'; +import { drop } from '../util/drop.std.js'; +import { strictAssert } from '../util/assert.std.js'; const { GITHUB_TOKEN } = process.env; diff --git a/ts/services/ActiveWindowService.ts b/ts/services/ActiveWindowService.ts index a1c06ddeff..06dd02d83f 100644 --- a/ts/services/ActiveWindowService.ts +++ b/ts/services/ActiveWindowService.ts @@ -1,7 +1,7 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { throttle } from '../util/throttle.js'; +import { throttle } from '../util/throttle.std.js'; // Idle timer - you're active for ACTIVE_TIMEOUT after one of these events const ACTIVE_TIMEOUT = 15 * 1000; diff --git a/ts/services/BeforeNavigate.ts b/ts/services/BeforeNavigate.ts index 2c5134d2bf..0d95b5261f 100644 --- a/ts/services/BeforeNavigate.ts +++ b/ts/services/BeforeNavigate.ts @@ -1,12 +1,12 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log.js'; +import { createLogger } from '../logging/log.std.js'; -import { SECOND } from '../util/durations/index.js'; -import { sleep } from '../util/sleep.js'; +import { SECOND } from '../util/durations/index.std.js'; +import { sleep } from '../util/sleep.std.js'; -import type { Location } from '../types/Nav.js'; +import type { Location } from '../types/Nav.std.js'; const log = createLogger('BeforeNavigate'); diff --git a/ts/services/LinkPreview.ts b/ts/services/LinkPreview.ts index 44ceec6b37..c8ea4780f3 100644 --- a/ts/services/LinkPreview.ts +++ b/ts/services/LinkPreview.ts @@ -4,50 +4,50 @@ import lodash from 'lodash'; import { CallLinkRootKey, CallLinkEpoch } from '@signalapp/ringrtc'; -import type { LinkPreviewWithHydratedData } from '../types/message/LinkPreviews.js'; +import type { LinkPreviewWithHydratedData } from '../types/message/LinkPreviews.std.js'; import type { LinkPreviewImage, LinkPreviewResult, LinkPreviewSourceType, MaybeGrabLinkPreviewOptionsType, AddLinkPreviewOptionsType, -} from '../types/LinkPreview.js'; -import type { LinkPreviewImage as LinkPreviewFetchImage } from '../linkPreviews/linkPreviewFetch.js'; -import * as Errors from '../types/errors.js'; -import type { StickerPackType as StickerPackDBType } from '../sql/Interface.js'; -import type { MIMEType } from '../types/MIME.js'; -import * as Bytes from '../Bytes.js'; -import { sha256 } from '../Crypto.js'; -import * as LinkPreview from '../types/LinkPreview.js'; -import { getLinkPreviewSetting } from '../util/Settings.js'; -import { readTempData, readStickerData } from '../util/migrations.js'; -import * as Stickers from '../types/Stickers.js'; -import * as VisualAttachment from '../types/VisualAttachment.js'; -import { createLogger } from '../logging/log.js'; +} from '../types/LinkPreview.std.js'; +import type { LinkPreviewImage as LinkPreviewFetchImage } from '../linkPreviews/linkPreviewFetch.preload.js'; +import * as Errors from '../types/errors.std.js'; +import type { StickerPackType as StickerPackDBType } from '../sql/Interface.std.js'; +import type { MIMEType } from '../types/MIME.std.js'; +import * as Bytes from '../Bytes.std.js'; +import { sha256 } from '../Crypto.node.js'; +import * as LinkPreview from '../types/LinkPreview.std.js'; +import { getLinkPreviewSetting } from '../util/Settings.preload.js'; +import { readTempData, readStickerData } from '../util/migrations.preload.js'; +import * as Stickers from '../types/Stickers.preload.js'; +import * as VisualAttachment from '../types/VisualAttachment.dom.js'; +import { createLogger } from '../logging/log.std.js'; import { parseGroupLink, deriveGroupFields, getPreJoinGroupInfo, decryptGroupTitle, decryptGroupAvatar, -} from '../groups.js'; -import { IMAGE_JPEG, IMAGE_WEBP, stringToMIMEType } from '../types/MIME.js'; -import { SECOND } from '../util/durations/index.js'; -import { autoScale } from '../util/handleImageAttachment.js'; -import { dropNull } from '../util/dropNull.js'; -import { fileToBytes } from '../util/fileToBytes.js'; -import { imageToBlurHash } from '../util/imageToBlurHash.js'; -import { maybeParseUrl } from '../util/url.js'; -import { sniffImageMimeType } from '../util/sniffImageMimeType.js'; -import { drop } from '../util/drop.js'; -import { calling } from './calling.js'; -import { getKeyAndEpochFromCallLink } from '../util/callLinks.js'; -import { getRoomIdFromCallLink } from '../util/callLinksRingrtc.js'; +} from '../groups.preload.js'; +import { IMAGE_JPEG, IMAGE_WEBP, stringToMIMEType } from '../types/MIME.std.js'; +import { SECOND } from '../util/durations/index.std.js'; +import { autoScale } from '../util/handleImageAttachment.preload.js'; +import { dropNull } from '../util/dropNull.std.js'; +import { fileToBytes } from '../util/fileToBytes.std.js'; +import { imageToBlurHash } from '../util/imageToBlurHash.dom.js'; +import { maybeParseUrl } from '../util/url.std.js'; +import { sniffImageMimeType } from '../util/sniffImageMimeType.std.js'; +import { drop } from '../util/drop.std.js'; +import { calling } from './calling.preload.js'; +import { getKeyAndEpochFromCallLink } from '../util/callLinks.std.js'; +import { getRoomIdFromCallLink } from '../util/callLinksRingrtc.node.js'; import { fetchLinkPreviewImage, fetchLinkPreviewMetadata, -} from '../textsecure/WebAPI.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from '../textsecure/WebAPI.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const { debounce, omit } = lodash; diff --git a/ts/services/MessageCache.ts b/ts/services/MessageCache.ts index c32e9c7ec3..3912f03da4 100644 --- a/ts/services/MessageCache.ts +++ b/ts/services/MessageCache.ts @@ -4,21 +4,21 @@ import lodash from 'lodash'; import { LRUCache } from 'lru-cache'; -import { createLogger } from '../logging/log.js'; -import { MessageModel } from '../models/messages.js'; -import { DataReader, DataWriter } from '../sql/Client.js'; -import { getMessageConversation } from '../util/getMessageConversation.js'; -import { getSenderIdentifier } from '../util/getSenderIdentifier.js'; -import { upgradeMessageSchema } from '../util/migrations.js'; -import { isNotNil } from '../util/isNotNil.js'; -import { isStory } from '../messages/helpers.js'; -import { getStoryDataFromMessageAttributes } from './storyLoader.js'; -import { postSaveUpdates } from '../util/cleanup.js'; +import { createLogger } from '../logging/log.std.js'; +import { MessageModel } from '../models/messages.preload.js'; +import { DataReader, DataWriter } from '../sql/Client.preload.js'; +import { getMessageConversation } from '../util/getMessageConversation.dom.js'; +import { getSenderIdentifier } from '../util/getSenderIdentifier.dom.js'; +import { upgradeMessageSchema } from '../util/migrations.preload.js'; +import { isNotNil } from '../util/isNotNil.std.js'; +import { isStory } from '../messages/helpers.std.js'; +import { getStoryDataFromMessageAttributes } from './storyLoader.preload.js'; +import { postSaveUpdates } from '../util/cleanup.preload.js'; import type { MessageAttributesType } from '../model-types.d.ts'; -import type { SendStateByConversationId } from '../messages/MessageSendState.js'; -import type { StoredJob } from '../jobs/types.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import type { SendStateByConversationId } from '../messages/MessageSendState.std.js'; +import type { StoredJob } from '../jobs/types.std.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const { throttle } = lodash; diff --git a/ts/services/MessageUpdater.ts b/ts/services/MessageUpdater.ts index 79a079f154..fde4f74e55 100644 --- a/ts/services/MessageUpdater.ts +++ b/ts/services/MessageUpdater.ts @@ -2,20 +2,23 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { MessageAttributesType } from '../model-types.d.ts'; -import type { MessageModel } from '../models/messages.js'; -import { ReadStatus, maxReadStatus } from '../messages/MessageReadStatus.js'; -import { notificationService } from './notifications.js'; -import { SeenStatus } from '../MessageSeenStatus.js'; -import { queueUpdateMessage } from '../util/messageBatcher.js'; -import * as Errors from '../types/errors.js'; -import { createLogger } from '../logging/log.js'; -import { isValidTapToView } from '../util/isValidTapToView.js'; -import { getMessageIdForLogging } from '../util/idForLogging.js'; -import { eraseMessageContents } from '../util/cleanup.js'; -import { getSource, getSourceServiceId } from '../messages/sources.js'; -import { isAciString } from '../util/isAciString.js'; -import { viewOnceOpenJobQueue } from '../jobs/viewOnceOpenJobQueue.js'; -import { drop } from '../util/drop.js'; +import type { MessageModel } from '../models/messages.preload.js'; +import { + ReadStatus, + maxReadStatus, +} from '../messages/MessageReadStatus.std.js'; +import { notificationService } from './notifications.preload.js'; +import { SeenStatus } from '../MessageSeenStatus.std.js'; +import { queueUpdateMessage } from '../util/messageBatcher.preload.js'; +import * as Errors from '../types/errors.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { isValidTapToView } from '../util/isValidTapToView.std.js'; +import { getMessageIdForLogging } from '../util/idForLogging.preload.js'; +import { eraseMessageContents } from '../util/cleanup.preload.js'; +import { getSource, getSourceServiceId } from '../messages/sources.preload.js'; +import { isAciString } from '../util/isAciString.std.js'; +import { viewOnceOpenJobQueue } from '../jobs/viewOnceOpenJobQueue.preload.js'; +import { drop } from '../util/drop.std.js'; const log = createLogger('MessageUpdater'); diff --git a/ts/services/ZoomFactorService.ts b/ts/services/ZoomFactorService.ts index 0da760057f..e20ca3896b 100644 --- a/ts/services/ZoomFactorService.ts +++ b/ts/services/ZoomFactorService.ts @@ -4,7 +4,7 @@ import type { BrowserWindow } from 'electron'; import { ipcMain } from 'electron'; import EventEmitter from 'node:events'; -import { createLogger } from '../logging/log.js'; +import { createLogger } from '../logging/log.std.js'; const log = createLogger('ZoomFactorService'); diff --git a/ts/services/addGlobalKeyboardShortcuts.ts b/ts/services/addGlobalKeyboardShortcuts.ts index ac9c4c5363..8574ad94e3 100644 --- a/ts/services/addGlobalKeyboardShortcuts.ts +++ b/ts/services/addGlobalKeyboardShortcuts.ts @@ -1,15 +1,15 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as KeyboardLayout from './keyboardLayout.js'; -import { createLogger } from '../logging/log.js'; -import { PanelType } from '../types/Panels.js'; -import { clearConversationDraftAttachments } from '../util/clearConversationDraftAttachments.js'; -import { drop } from '../util/drop.js'; -import { matchOrQueryFocusable } from '../util/focusableSelectors.js'; -import { getQuotedMessageSelector } from '../state/selectors/composer.js'; -import { removeLinkPreview } from './LinkPreview.js'; -import { ForwardMessagesModalType } from '../components/ForwardMessagesModal.js'; +import * as KeyboardLayout from './keyboardLayout.dom.js'; +import { createLogger } from '../logging/log.std.js'; +import { PanelType } from '../types/Panels.std.js'; +import { clearConversationDraftAttachments } from '../util/clearConversationDraftAttachments.preload.js'; +import { drop } from '../util/drop.std.js'; +import { matchOrQueryFocusable } from '../util/focusableSelectors.std.js'; +import { getQuotedMessageSelector } from '../state/selectors/composer.preload.js'; +import { removeLinkPreview } from './LinkPreview.preload.js'; +import { ForwardMessagesModalType } from '../components/ForwardMessagesModal.dom.js'; const log = createLogger('addGlobalKeyboardShortcuts'); diff --git a/ts/services/allLoaders.ts b/ts/services/allLoaders.ts index 89752e6a78..fd0c972727 100644 --- a/ts/services/allLoaders.ts +++ b/ts/services/allLoaders.ts @@ -2,45 +2,48 @@ // SPDX-License-Identifier: AGPL-3.0-only // loader services -import { getBadgesForRedux, loadBadges } from './badgeLoader.js'; +import { getBadgesForRedux, loadBadges } from './badgeLoader.preload.js'; import { getCallsHistoryForRedux, getCallsHistoryUnreadCountForRedux, loadCallHistory, -} from './callHistoryLoader.js'; -import { getCallLinksForRedux, loadCallLinks } from './callLinksLoader.js'; +} from './callHistoryLoader.preload.js'; +import { + getCallLinksForRedux, + loadCallLinks, +} from './callLinksLoader.preload.js'; import { getDistributionListsForRedux, loadDistributionLists, -} from './distributionListLoader.js'; +} from './distributionListLoader.preload.js'; import { getDonationsForRedux, loadDonationReceipts, -} from './donationsLoader.js'; -import { getStoriesForRedux, loadStories } from './storyLoader.js'; -import { getUserDataForRedux, loadUserData } from './userLoader.js'; +} from './donationsLoader.preload.js'; +import { getStoriesForRedux, loadStories } from './storyLoader.preload.js'; +import { getUserDataForRedux, loadUserData } from './userLoader.dom.js'; import { loadCachedProfiles as loadNotificationProfiles, getCachedProfiles as getNotificationProfiles, -} from './notificationProfilesService.js'; +} from './notificationProfilesService.preload.js'; // old-style loaders import { getEmojiReducerState, loadRecentEmojis, -} from '../util/loadRecentEmojis.js'; +} from '../util/loadRecentEmojis.preload.js'; import { load as loadStickers, getInitialState as getStickersReduxState, -} from '../types/Stickers.js'; +} from '../types/Stickers.preload.js'; -import { type ReduxInitData } from '../state/initializeRedux.js'; -import { reinitializeRedux } from '../state/reinitializeRedux.js'; -import { getGifsStateForRedux, loadGifsState } from './gifsLoader.js'; +import { type ReduxInitData } from '../state/initializeRedux.preload.js'; +import { reinitializeRedux } from '../state/reinitializeRedux.preload.js'; +import { getGifsStateForRedux, loadGifsState } from './gifsLoader.preload.js'; import { getChatFoldersForRedux, loadChatFolders, -} from './chatFoldersLoader.js'; +} from './chatFoldersLoader.preload.js'; export async function loadAll(): Promise { await Promise.all([ diff --git a/ts/services/areWeASubscriber.ts b/ts/services/areWeASubscriber.ts index 26a948bfa2..cc7d1a3d52 100644 --- a/ts/services/areWeASubscriber.ts +++ b/ts/services/areWeASubscriber.ts @@ -2,9 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { StorageInterface } from '../types/Storage.d.ts'; -import type { getHasSubscription, isOnline } from '../textsecure/WebAPI.js'; -import { LatestQueue } from '../util/LatestQueue.js'; -import { waitForOnline } from '../util/waitForOnline.js'; +import type { + getHasSubscription, + isOnline, +} from '../textsecure/WebAPI.preload.js'; +import { LatestQueue } from '../util/LatestQueue.std.js'; +import { waitForOnline } from '../util/waitForOnline.dom.js'; // This is only exported for testing. export class AreWeASubscriberService { diff --git a/ts/services/audioRecorder.ts b/ts/services/audioRecorder.ts index d70c43bb96..3a636b793c 100644 --- a/ts/services/audioRecorder.ts +++ b/ts/services/audioRecorder.ts @@ -1,10 +1,10 @@ // Copyright 2016 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log.js'; -import * as Errors from '../types/errors.js'; -import { requestMicrophonePermissions } from '../util/requestMicrophonePermissions.js'; -import { WebAudioRecorder } from '../WebAudioRecorder.js'; +import { createLogger } from '../logging/log.std.js'; +import * as Errors from '../types/errors.std.js'; +import { requestMicrophonePermissions } from '../util/requestMicrophonePermissions.dom.js'; +import { WebAudioRecorder } from '../WebAudioRecorder.std.js'; const log = createLogger('audioRecorder'); diff --git a/ts/services/backups/api.ts b/ts/services/backups/api.ts index 540d142419..0dbbe30c98 100644 --- a/ts/services/backups/api.ts +++ b/ts/services/backups/api.ts @@ -15,7 +15,7 @@ import { getSubscription, getTransferArchive as doGetTransferArchive, refreshBackup, -} from '../../textsecure/WebAPI.js'; +} from '../../textsecure/WebAPI.preload.js'; import type { AttachmentUploadFormResponseType, GetBackupInfoResponseType, @@ -24,18 +24,18 @@ import type { BackupListMediaResponseType, TransferArchiveType, SubscriptionResponseType, -} from '../../textsecure/WebAPI.js'; -import type { BackupCredentials } from './credentials.js'; +} from '../../textsecure/WebAPI.preload.js'; +import type { BackupCredentials } from './credentials.preload.js'; import { BackupCredentialType, type BackupsSubscriptionType, type SubscriptionCostType, -} from '../../types/backups.js'; -import { uploadFile } from '../../util/uploadAttachment.js'; -import { HTTPError } from '../../types/HTTPError.js'; -import { createLogger } from '../../logging/log.js'; -import { toLogFormat } from '../../types/errors.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +} from '../../types/backups.node.js'; +import { uploadFile } from '../../util/uploadAttachment.preload.js'; +import { HTTPError } from '../../types/HTTPError.std.js'; +import { createLogger } from '../../logging/log.std.js'; +import { toLogFormat } from '../../types/errors.std.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; const log = createLogger('api'); diff --git a/ts/services/backups/constants.ts b/ts/services/backups/constants.ts index 83270b19f6..9a8bcd4936 100644 --- a/ts/services/backups/constants.ts +++ b/ts/services/backups/constants.ts @@ -1,8 +1,8 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { Backups } from '../../protobuf/index.js'; -import type { ConversationColorType } from '../../types/Colors.js'; +import { Backups } from '../../protobuf/index.std.js'; +import type { ConversationColorType } from '../../types/Colors.std.js'; export const BACKUP_VERSION = 1; diff --git a/ts/services/backups/credentials.ts b/ts/services/backups/credentials.ts index 9b2ceec656..e9d0659cc6 100644 --- a/ts/services/backups/credentials.ts +++ b/ts/services/backups/credentials.ts @@ -12,50 +12,50 @@ import { import { type BackupKey } from '@signalapp/libsignal-client/dist/AccountKeys.js'; import lodashFp from 'lodash/fp.js'; -import * as Bytes from '../../Bytes.js'; -import { createLogger } from '../../logging/log.js'; -import { strictAssert } from '../../util/assert.js'; -import { drop } from '../../util/drop.js'; -import { isMoreRecentThan, toDayMillis } from '../../util/timestamp.js'; +import * as Bytes from '../../Bytes.std.js'; +import { createLogger } from '../../logging/log.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { drop } from '../../util/drop.std.js'; +import { isMoreRecentThan, toDayMillis } from '../../util/timestamp.std.js'; import { DAY, DurationInSeconds, HOUR, MINUTE, -} from '../../util/durations/index.js'; -import { BackOff, FIBONACCI_TIMEOUTS } from '../../util/BackOff.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; +} from '../../util/durations/index.std.js'; +import { BackOff, FIBONACCI_TIMEOUTS } from '../../util/BackOff.std.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; import { type BackupCdnReadCredentialType, type BackupCredentialWrapperType, type BackupPresentationHeadersType, type BackupSignedPresentationType, BackupCredentialType, -} from '../../types/backups.js'; -import { toLogFormat } from '../../types/errors.js'; -import { HTTPError } from '../../types/HTTPError.js'; +} from '../../types/backups.node.js'; +import { toLogFormat } from '../../types/errors.std.js'; +import { HTTPError } from '../../types/HTTPError.std.js'; import type { GetBackupCredentialsResponseType, GetBackupCDNCredentialsResponseType, -} from '../../textsecure/WebAPI.js'; +} from '../../textsecure/WebAPI.preload.js'; import { setBackupSignatureKey, getBackupCDNCredentials, getBackupCredentials, setBackupId, -} from '../../textsecure/WebAPI.js'; +} from '../../textsecure/WebAPI.preload.js'; import { getBackupKey, getBackupMediaRootKey, getBackupSignatureKey, getBackupMediaSignatureKey, -} from './crypto.js'; -import { isTestOrMockEnvironment } from '../../environment.js'; +} from './crypto.preload.js'; +import { isTestOrMockEnvironment } from '../../environment.std.js'; import { areRemoteBackupsTurnedOn, canAttemptRemoteBackupDownload, -} from '../../util/isBackupEnabled.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +} from '../../util/isBackupEnabled.preload.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; const { throttle } = lodashFp; diff --git a/ts/services/backups/crypto.ts b/ts/services/backups/crypto.ts index bb7dd5c129..18884f72ca 100644 --- a/ts/services/backups/crypto.ts +++ b/ts/services/backups/crypto.ts @@ -9,10 +9,10 @@ import { } from '@signalapp/libsignal-client/dist/AccountKeys.js'; import { MessageBackupKey } from '@signalapp/libsignal-client/dist/MessageBackup.js'; -import { strictAssert } from '../../util/assert.js'; -import type { AciString } from '../../types/ServiceId.js'; -import { toAciObject } from '../../util/ServiceId.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +import { strictAssert } from '../../util/assert.std.js'; +import type { AciString } from '../../types/ServiceId.std.js'; +import { toAciObject } from '../../util/ServiceId.node.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; const getMemoizedBackupKey = memoizee((accountEntropyPool: string) => { return AccountEntropyPool.deriveBackupKey(accountEntropyPool); diff --git a/ts/services/backups/errors.ts b/ts/services/backups/errors.ts index 38cac2566a..bebbef54b9 100644 --- a/ts/services/backups/errors.ts +++ b/ts/services/backups/errors.ts @@ -4,7 +4,7 @@ import type Long from 'long'; -import { InstallScreenBackupError } from '../../types/InstallScreen.js'; +import { InstallScreenBackupError } from '../../types/InstallScreen.std.js'; export class BackupInstallerError extends Error { constructor( diff --git a/ts/services/backups/export.ts b/ts/services/backups/export.ts index 90b3979e3e..fb536c87a5 100644 --- a/ts/services/backups/export.ts +++ b/ts/services/backups/export.ts @@ -11,64 +11,64 @@ import { Readable } from 'node:stream'; import lodash from 'lodash'; import { CallLinkRootKey } from '@signalapp/ringrtc'; -import { Backups, SignalService } from '../../protobuf/index.js'; +import { Backups, SignalService } from '../../protobuf/index.std.js'; import { DataReader, DataWriter, pauseWriteAccess, resumeWriteAccess, -} from '../../sql/Client.js'; +} from '../../sql/Client.preload.js'; import type { PageMessagesCursorType, IdentityKeyType, -} from '../../sql/Interface.js'; -import { createLogger } from '../../logging/log.js'; -import { GiftBadgeStates } from '../../types/GiftBadgeStates.js'; -import { type CustomColorType } from '../../types/Colors.js'; -import { StorySendMode, MY_STORY_ID } from '../../types/Stories.js'; -import { getStickerPacksForBackup } from '../../types/Stickers.js'; +} from '../../sql/Interface.std.js'; +import { createLogger } from '../../logging/log.std.js'; +import { GiftBadgeStates } from '../../types/GiftBadgeStates.std.js'; +import { type CustomColorType } from '../../types/Colors.std.js'; +import { StorySendMode, MY_STORY_ID } from '../../types/Stories.std.js'; +import { getStickerPacksForBackup } from '../../types/Stickers.preload.js'; import { isPniString, isServiceIdString, type AciString, type ServiceIdString, -} from '../../types/ServiceId.js'; -import type { RawBodyRange } from '../../types/BodyRange.js'; -import { PaymentEventKind } from '../../types/Payment.js'; -import { MessageRequestResponseEvent } from '../../types/MessageRequestResponseEvent.js'; +} from '../../types/ServiceId.std.js'; +import type { RawBodyRange } from '../../types/BodyRange.std.js'; +import { PaymentEventKind } from '../../types/Payment.std.js'; +import { MessageRequestResponseEvent } from '../../types/MessageRequestResponseEvent.std.js'; import type { ConversationAttributesType, MessageAttributesType, QuotedAttachmentType, } from '../../model-types.d.ts'; -import { drop } from '../../util/drop.js'; -import { isNotNil } from '../../util/isNotNil.js'; -import { explodePromise } from '../../util/explodePromise.js'; +import { drop } from '../../util/drop.std.js'; +import { isNotNil } from '../../util/isNotNil.std.js'; +import { explodePromise } from '../../util/explodePromise.std.js'; import { isDirectConversation, isGroup, isGroupV1, isGroupV2, isMe, -} from '../../util/whatTypeOfConversation.js'; -import { uuidToBytes } from '../../util/uuidToBytes.js'; -import { strictAssert } from '../../util/assert.js'; -import { getSafeLongFromTimestamp } from '../../util/timestampLongUtils.js'; +} from '../../util/whatTypeOfConversation.dom.js'; +import { uuidToBytes } from '../../util/uuidToBytes.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { getSafeLongFromTimestamp } from '../../util/timestampLongUtils.std.js'; import { DAY, MINUTE, SECOND, DurationInSeconds, -} from '../../util/durations/index.js'; +} from '../../util/durations/index.std.js'; import { PhoneNumberDiscoverability, parsePhoneNumberDiscoverability, -} from '../../util/phoneNumberDiscoverability.js'; +} from '../../util/phoneNumberDiscoverability.std.js'; import { PhoneNumberSharingMode, parsePhoneNumberSharingMode, -} from '../../types/PhoneNumberSharingMode.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; +} from '../../types/PhoneNumberSharingMode.std.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; import { isCallHistory, isChatSessionRefreshed, @@ -93,20 +93,20 @@ import { isJoinedSignalNotification, isTitleTransitionNotification, isMessageRequestResponse, -} from '../../state/selectors/message.js'; -import * as Bytes from '../../Bytes.js'; -import { canBeSynced as canPreferredReactionEmojiBeSynced } from '../../reactions/preferredReactionEmoji.js'; -import { SendStatus } from '../../messages/MessageSendState.js'; -import { BACKUP_VERSION } from './constants.js'; +} from '../../state/selectors/message.preload.js'; +import * as Bytes from '../../Bytes.std.js'; +import { canBeSynced as canPreferredReactionEmojiBeSynced } from '../../reactions/preferredReactionEmoji.std.js'; +import { SendStatus } from '../../messages/MessageSendState.std.js'; +import { BACKUP_VERSION } from './constants.std.js'; import { getMessageIdForLogging, getConversationIdForLogging, -} from '../../util/idForLogging.js'; -import { makeLookup } from '../../util/makeLookup.js'; +} from '../../util/idForLogging.preload.js'; +import { makeLookup } from '../../util/makeLookup.std.js'; import type { CallHistoryDetails, CallStatus, -} from '../../types/CallDisposition.js'; +} from '../../types/CallDisposition.std.js'; import { CallMode, CallDirection, @@ -114,62 +114,65 @@ import { DirectCallStatus, GroupCallStatus, AdhocCallStatus, -} from '../../types/CallDisposition.js'; -import { isAciString } from '../../util/isAciString.js'; -import { hslToRGBInt } from '../../util/hslToRGB.js'; -import type { AboutMe, LocalChatStyle } from './types.js'; -import { BackupType } from './types.js'; -import { messageHasPaymentEvent } from '../../messages/payments.js'; +} from '../../types/CallDisposition.std.js'; +import { isAciString } from '../../util/isAciString.std.js'; +import { hslToRGBInt } from '../../util/hslToRGB.std.js'; +import type { AboutMe, LocalChatStyle } from './types.std.js'; +import { BackupType } from './types.std.js'; +import { messageHasPaymentEvent } from '../../messages/payments.std.js'; import { numberToAddressType, numberToPhoneType, -} from '../../types/EmbeddedContact.js'; -import { toLogFormat } from '../../types/errors.js'; -import type { AttachmentType } from '../../types/Attachment.js'; +} from '../../types/EmbeddedContact.std.js'; +import { toLogFormat } from '../../types/errors.std.js'; +import type { AttachmentType } from '../../types/Attachment.std.js'; import { isGIF, isDownloaded, hasRequiredInformationForBackup, -} from '../../util/Attachment.js'; -import { getFilePointerForAttachment } from './util/filePointers.js'; -import { getBackupMediaRootKey } from './crypto.js'; +} from '../../util/Attachment.std.js'; +import { getFilePointerForAttachment } from './util/filePointers.preload.js'; +import { getBackupMediaRootKey } from './crypto.preload.js'; import type { CoreAttachmentBackupJobType, PartialAttachmentLocalBackupJobType, -} from '../../types/AttachmentBackup.js'; -import { AttachmentBackupManager } from '../../jobs/AttachmentBackupManager.js'; -import { AttachmentLocalBackupManager } from '../../jobs/AttachmentLocalBackupManager.js'; -import { getBackupCdnInfo, getMediaNameForAttachment } from './util/mediaId.js'; -import { calculateExpirationTimestamp } from '../../util/expirationTimer.js'; -import { ReadStatus } from '../../messages/MessageReadStatus.js'; -import { CallLinkRestrictions } from '../../types/CallLink.js'; +} from '../../types/AttachmentBackup.std.js'; +import { AttachmentBackupManager } from '../../jobs/AttachmentBackupManager.preload.js'; +import { AttachmentLocalBackupManager } from '../../jobs/AttachmentLocalBackupManager.preload.js'; +import { + getBackupCdnInfo, + getMediaNameForAttachment, +} from './util/mediaId.preload.js'; +import { calculateExpirationTimestamp } from '../../util/expirationTimer.std.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.std.js'; +import { CallLinkRestrictions } from '../../types/CallLink.std.js'; import { isCallHistoryForUnusedCallLink, toAdminKeyBytes, -} from '../../util/callLinks.js'; +} from '../../util/callLinks.std.js'; import { getRoomIdFromRootKey, toEpochBytes, -} from '../../util/callLinksRingrtc.js'; -import { SeenStatus } from '../../MessageSeenStatus.js'; -import { migrateAllMessages } from '../../messages/migrateMessageData.js'; -import { isBodyTooLong, trimBody } from '../../util/longAttachment.js'; -import { generateBackupsSubscriberData } from '../../util/backupSubscriptionData.js'; +} from '../../util/callLinksRingrtc.node.js'; +import { SeenStatus } from '../../MessageSeenStatus.std.js'; +import { migrateAllMessages } from '../../messages/migrateMessageData.preload.js'; +import { isBodyTooLong, trimBody } from '../../util/longAttachment.std.js'; +import { generateBackupsSubscriberData } from '../../util/backupSubscriptionData.preload.js'; import { getEnvironment, isTestEnvironment, isTestOrMockEnvironment, -} from '../../environment.js'; -import { calculateLightness } from '../../util/getHSL.js'; -import { isSignalServiceId } from '../../util/isSignalConversation.js'; -import { isValidE164 } from '../../util/isValidE164.js'; -import { toDayOfWeekArray } from '../../types/NotificationProfile.js'; +} from '../../environment.std.js'; +import { calculateLightness } from '../../util/getHSL.std.js'; +import { isSignalServiceId } from '../../util/isSignalConversation.dom.js'; +import { isValidE164 } from '../../util/isValidE164.std.js'; +import { toDayOfWeekArray } from '../../types/NotificationProfile.std.js'; import { getLinkPreviewSetting, getTypingIndicatorSetting, -} from '../../util/Settings.js'; -import { KIBIBYTE } from '../../types/AttachmentSize.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +} from '../../util/Settings.preload.js'; +import { KIBIBYTE } from '../../types/AttachmentSize.std.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; const { isNumber } = lodash; diff --git a/ts/services/backups/import.ts b/ts/services/backups/import.ts index e6f44813de..513a49952d 100644 --- a/ts/services/backups/import.ts +++ b/ts/services/backups/import.ts @@ -13,44 +13,44 @@ import lodash from 'lodash'; import { CallLinkRootKey } from '@signalapp/ringrtc'; import type Long from 'long'; -import { Backups, SignalService } from '../../protobuf/index.js'; -import { DataReader, DataWriter } from '../../sql/Client.js'; +import { Backups, SignalService } from '../../protobuf/index.std.js'; +import { DataReader, DataWriter } from '../../sql/Client.preload.js'; import { AttachmentDownloadSource, type StoryDistributionWithMembersType, type IdentityKeyType, -} from '../../sql/Interface.js'; -import { createLogger } from '../../logging/log.js'; -import { GiftBadgeStates } from '../../types/GiftBadgeStates.js'; -import { StorySendMode, MY_STORY_ID } from '../../types/Stories.js'; -import type { AciString, ServiceIdString } from '../../types/ServiceId.js'; -import * as LinkPreview from '../../types/LinkPreview.js'; +} from '../../sql/Interface.std.js'; +import { createLogger } from '../../logging/log.std.js'; +import { GiftBadgeStates } from '../../types/GiftBadgeStates.std.js'; +import { StorySendMode, MY_STORY_ID } from '../../types/Stories.std.js'; +import type { AciString, ServiceIdString } from '../../types/ServiceId.std.js'; +import * as LinkPreview from '../../types/LinkPreview.std.js'; import { fromAciObject, fromPniObject, fromServiceIdObject, -} from '../../types/ServiceId.js'; -import { isStoryDistributionId } from '../../types/StoryDistributionId.js'; -import * as Errors from '../../types/errors.js'; -import { PaymentEventKind } from '../../types/Payment.js'; -import { MessageRequestResponseEvent } from '../../types/MessageRequestResponseEvent.js'; +} from '../../types/ServiceId.std.js'; +import { isStoryDistributionId } from '../../types/StoryDistributionId.std.js'; +import * as Errors from '../../types/errors.std.js'; +import { PaymentEventKind } from '../../types/Payment.std.js'; +import { MessageRequestResponseEvent } from '../../types/MessageRequestResponseEvent.std.js'; import { ContactFormType, AddressType as ContactAddressType, -} from '../../types/EmbeddedContact.js'; +} from '../../types/EmbeddedContact.std.js'; import { STICKERPACK_ID_BYTE_LEN, STICKERPACK_KEY_BYTE_LEN, createPacksFromBackup, type StickerPackPointerType, -} from '../../types/Stickers.js'; +} from '../../types/Stickers.preload.js'; import type { ConversationColorType, CustomColorsItemType, CustomColorType, CustomColorDataType, -} from '../../types/Colors.js'; -import { SEALED_SENDER } from '../../types/SealedSender.js'; +} from '../../types/Colors.std.js'; +import { SEALED_SENDER } from '../../types/SealedSender.std.js'; import type { ConversationAttributesType, CustomError, @@ -59,61 +59,61 @@ import type { EditHistoryType, QuotedMessageType, } from '../../model-types.d.ts'; -import { assertDev, strictAssert } from '../../util/assert.js'; -import { upgradeMessageSchema } from '../../util/migrations.js'; +import { assertDev, strictAssert } from '../../util/assert.std.js'; +import { upgradeMessageSchema } from '../../util/migrations.preload.js'; import { getCheckedTimestampFromLong, getCheckedTimestampOrUndefinedFromLong, getTimestampOrUndefinedFromLong, -} from '../../util/timestampLongUtils.js'; -import { MAX_SAFE_DATE } from '../../util/timestamp.js'; -import { DurationInSeconds, SECOND } from '../../util/durations/index.js'; -import { calculateExpirationTimestamp } from '../../util/expirationTimer.js'; -import { dropNull } from '../../util/dropNull.js'; +} from '../../util/timestampLongUtils.std.js'; +import { MAX_SAFE_DATE } from '../../util/timestamp.std.js'; +import { DurationInSeconds, SECOND } from '../../util/durations/index.std.js'; +import { calculateExpirationTimestamp } from '../../util/expirationTimer.std.js'; +import { dropNull } from '../../util/dropNull.std.js'; import { deriveGroupID, deriveGroupSecretParams, deriveGroupPublicParams, deriveAccessKeyFromProfileKey, -} from '../../util/zkgroup.js'; -import { incrementMessageCounter } from '../../util/incrementMessageCounter.js'; -import { generateMessageId } from '../../util/generateMessageId.js'; -import { isAciString } from '../../util/isAciString.js'; -import { PhoneNumberDiscoverability } from '../../util/phoneNumberDiscoverability.js'; -import { PhoneNumberSharingMode } from '../../types/PhoneNumberSharingMode.js'; -import { bytesToUuid } from '../../util/uuidToBytes.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; -import { ReadStatus } from '../../messages/MessageReadStatus.js'; -import { SendStatus } from '../../messages/MessageSendState.js'; -import type { SendStateByConversationId } from '../../messages/MessageSendState.js'; -import { SeenStatus } from '../../MessageSeenStatus.js'; -import { constantTimeEqual } from '../../Crypto.js'; -import { signalProtocolStore } from '../../SignalProtocolStore.js'; -import * as Bytes from '../../Bytes.js'; -import { BACKUP_VERSION, WALLPAPER_TO_BUBBLE_COLOR } from './constants.js'; -import { UnsupportedBackupVersion } from './errors.js'; -import type { AboutMe, LocalChatStyle } from './types.js'; -import { BackupType } from './types.js'; -import { getBackupMediaRootKey } from './crypto.js'; -import type { GroupV2ChangeDetailType } from '../../types/groups.ts'; -import { queueAttachmentDownloads } from '../../util/queueAttachmentDownloads.js'; -import { isNotNil } from '../../util/isNotNil.js'; -import { isGroup } from '../../util/whatTypeOfConversation.js'; -import { rgbIntToHSL } from '../../util/rgbToHSL.js'; +} from '../../util/zkgroup.node.js'; +import { incrementMessageCounter } from '../../util/incrementMessageCounter.preload.js'; +import { generateMessageId } from '../../util/generateMessageId.node.js'; +import { isAciString } from '../../util/isAciString.std.js'; +import { PhoneNumberDiscoverability } from '../../util/phoneNumberDiscoverability.std.js'; +import { PhoneNumberSharingMode } from '../../types/PhoneNumberSharingMode.std.js'; +import { bytesToUuid } from '../../util/uuidToBytes.std.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.std.js'; +import { SendStatus } from '../../messages/MessageSendState.std.js'; +import type { SendStateByConversationId } from '../../messages/MessageSendState.std.js'; +import { SeenStatus } from '../../MessageSeenStatus.std.js'; +import { constantTimeEqual } from '../../Crypto.node.js'; +import { signalProtocolStore } from '../../SignalProtocolStore.preload.js'; +import * as Bytes from '../../Bytes.std.js'; +import { BACKUP_VERSION, WALLPAPER_TO_BUBBLE_COLOR } from './constants.std.js'; +import { UnsupportedBackupVersion } from './errors.std.js'; +import type { AboutMe, LocalChatStyle } from './types.std.js'; +import { BackupType } from './types.std.js'; +import { getBackupMediaRootKey } from './crypto.preload.js'; +import type { GroupV2ChangeDetailType } from '../../types/groups.std.js'; +import { queueAttachmentDownloads } from '../../util/queueAttachmentDownloads.preload.js'; +import { isNotNil } from '../../util/isNotNil.std.js'; +import { isGroup } from '../../util/whatTypeOfConversation.dom.js'; +import { rgbIntToHSL } from '../../util/rgbToHSL.std.js'; import { convertBackupMessageAttachmentToAttachment, convertFilePointerToAttachment, -} from './util/filePointers.js'; +} from './util/filePointers.preload.js'; import { filterAndClean, trimMessageWhitespace, -} from '../../types/BodyRange.js'; +} from '../../types/BodyRange.std.js'; import { APPLICATION_OCTET_STREAM, stringToMIMEType, -} from '../../types/MIME.js'; -import { groupAvatarJobQueue } from '../../jobs/groupAvatarJobQueue.js'; -import { AttachmentDownloadManager } from '../../jobs/AttachmentDownloadManager.js'; +} from '../../types/MIME.std.js'; +import { groupAvatarJobQueue } from '../../jobs/groupAvatarJobQueue.preload.js'; +import { AttachmentDownloadManager } from '../../jobs/AttachmentDownloadManager.preload.js'; import { AdhocCallStatus, CallDirection, @@ -121,45 +121,48 @@ import { CallType, DirectCallStatus, GroupCallStatus, -} from '../../types/CallDisposition.js'; -import type { CallHistoryDetails } from '../../types/CallDisposition.js'; -import { CallLinkRestrictions, isCallLinkAdmin } from '../../types/CallLink.js'; -import type { CallLinkType } from '../../types/CallLink.js'; -import type { RawBodyRange } from '../../types/BodyRange.js'; +} from '../../types/CallDisposition.std.js'; +import type { CallHistoryDetails } from '../../types/CallDisposition.std.js'; +import { + CallLinkRestrictions, + isCallLinkAdmin, +} from '../../types/CallLink.std.js'; +import type { CallLinkType } from '../../types/CallLink.std.js'; +import type { RawBodyRange } from '../../types/BodyRange.std.js'; import { fromAdminKeyBytes, toCallHistoryFromUnusedCallLink, -} from '../../util/callLinks.js'; +} from '../../util/callLinks.std.js'; import { getRoomIdFromRootKey, fromEpochBytes, -} from '../../util/callLinksRingrtc.js'; -import { loadAllAndReinitializeRedux } from '../allLoaders.js'; +} from '../../util/callLinksRingrtc.node.js'; +import { loadAllAndReinitializeRedux } from '../allLoaders.preload.js'; import { startBackupMediaDownload, resetBackupMediaDownloadStats, -} from '../../util/backupMediaDownload.js'; +} from '../../util/backupMediaDownload.preload.js'; import { getEnvironment, isTestEnvironment, isTestOrMockEnvironment, -} from '../../environment.js'; -import { hasAttachmentDownloads } from '../../util/hasAttachmentDownloads.js'; -import { isAdhoc, isNightly } from '../../util/version.js'; -import { ToastType } from '../../types/Toast.js'; -import { isConversationAccepted } from '../../util/isConversationAccepted.js'; -import { saveBackupsSubscriberData } from '../../util/backupSubscriptionData.js'; -import { postSaveUpdates } from '../../util/cleanup.js'; -import type { LinkPreviewType } from '../../types/message/LinkPreviews.js'; -import { MessageModel } from '../../models/messages.js'; +} from '../../environment.std.js'; +import { hasAttachmentDownloads } from '../../util/hasAttachmentDownloads.std.js'; +import { isAdhoc, isNightly } from '../../util/version.std.js'; +import { ToastType } from '../../types/Toast.dom.js'; +import { isConversationAccepted } from '../../util/isConversationAccepted.preload.js'; +import { saveBackupsSubscriberData } from '../../util/backupSubscriptionData.preload.js'; +import { postSaveUpdates } from '../../util/cleanup.preload.js'; +import type { LinkPreviewType } from '../../types/message/LinkPreviews.std.js'; +import { MessageModel } from '../../models/messages.preload.js'; import { DEFAULT_PROFILE_COLOR, fromDayOfWeekArray, type NotificationProfileType, -} from '../../types/NotificationProfile.js'; -import { normalizeNotificationProfileId } from '../../types/NotificationProfile-node.js'; -import { updateBackupMediaDownloadProgress } from '../../util/updateBackupMediaDownloadProgress.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +} from '../../types/NotificationProfile.std.js'; +import { normalizeNotificationProfileId } from '../../types/NotificationProfile-node.node.js'; +import { updateBackupMediaDownloadProgress } from '../../util/updateBackupMediaDownloadProgress.preload.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; const { isNumber } = lodash; diff --git a/ts/services/backups/index.ts b/ts/services/backups/index.ts index 4312b9ee53..ee294c2fcd 100644 --- a/ts/services/backups/index.ts +++ b/ts/services/backups/index.ts @@ -16,84 +16,84 @@ import { BackupKey } from '@signalapp/libsignal-client/dist/AccountKeys.js'; import lodashFp from 'lodash/fp.js'; import { ipcRenderer } from 'electron'; -import { DataReader, DataWriter } from '../../sql/Client.js'; -import { createLogger } from '../../logging/log.js'; -import * as Bytes from '../../Bytes.js'; -import { strictAssert } from '../../util/assert.js'; -import { drop } from '../../util/drop.js'; -import { TEMP_PATH } from '../../util/basePaths.js'; +import { DataReader, DataWriter } from '../../sql/Client.preload.js'; +import { createLogger } from '../../logging/log.std.js'; +import * as Bytes from '../../Bytes.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { drop } from '../../util/drop.std.js'; +import { TEMP_PATH } from '../../util/basePaths.preload.js'; import { getAbsoluteDownloadsPath, saveAttachmentToDisk, -} from '../../util/migrations.js'; -import { waitForAllBatchers } from '../../util/batcher.js'; -import { flushAllWaitBatchers } from '../../util/waitBatcher.js'; -import { DelimitedStream } from '../../util/DelimitedStream.js'; -import { appendPaddingStream } from '../../util/logPadding.js'; -import { prependStream } from '../../util/prependStream.js'; -import { appendMacStream } from '../../util/appendMacStream.js'; -import { getMacAndUpdateHmac } from '../../util/getMacAndUpdateHmac.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; -import { HOUR, SECOND } from '../../util/durations/index.js'; -import type { ExplodePromiseResultType } from '../../util/explodePromise.js'; -import { explodePromise } from '../../util/explodePromise.js'; -import type { RetryBackupImportValue } from '../../state/ducks/installer.js'; -import { CipherType, HashType } from '../../types/Crypto.js'; +} from '../../util/migrations.preload.js'; +import { waitForAllBatchers } from '../../util/batcher.std.js'; +import { flushAllWaitBatchers } from '../../util/waitBatcher.std.js'; +import { DelimitedStream } from '../../util/DelimitedStream.node.js'; +import { appendPaddingStream } from '../../util/logPadding.node.js'; +import { prependStream } from '../../util/prependStream.node.js'; +import { appendMacStream } from '../../util/appendMacStream.node.js'; +import { getMacAndUpdateHmac } from '../../util/getMacAndUpdateHmac.node.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; +import { HOUR, SECOND } from '../../util/durations/index.std.js'; +import type { ExplodePromiseResultType } from '../../util/explodePromise.std.js'; +import { explodePromise } from '../../util/explodePromise.std.js'; +import type { RetryBackupImportValue } from '../../state/ducks/installer.preload.js'; +import { CipherType, HashType } from '../../types/Crypto.std.js'; import { InstallScreenBackupStep, InstallScreenBackupError, -} from '../../types/InstallScreen.js'; -import * as Errors from '../../types/errors.js'; +} from '../../types/InstallScreen.std.js'; +import * as Errors from '../../types/errors.std.js'; import { BackupCredentialType, type BackupsSubscriptionType, type BackupStatusType, -} from '../../types/backups.js'; -import { HTTPError } from '../../types/HTTPError.js'; -import { constantTimeEqual } from '../../Crypto.js'; -import { measureSize } from '../../AttachmentCrypto.js'; -import { signalProtocolStore } from '../../SignalProtocolStore.js'; -import { isTestOrMockEnvironment } from '../../environment.js'; -import { runStorageServiceSyncJob } from '../storage.js'; -import { BackupExportStream, type StatsType } from './export.js'; -import { BackupImportStream } from './import.js'; +} from '../../types/backups.node.js'; +import { HTTPError } from '../../types/HTTPError.std.js'; +import { constantTimeEqual } from '../../Crypto.node.js'; +import { measureSize } from '../../AttachmentCrypto.node.js'; +import { signalProtocolStore } from '../../SignalProtocolStore.preload.js'; +import { isTestOrMockEnvironment } from '../../environment.std.js'; +import { runStorageServiceSyncJob } from '../storage.preload.js'; +import { BackupExportStream, type StatsType } from './export.preload.js'; +import { BackupImportStream } from './import.preload.js'; import { getBackupId, getKeyMaterial, getLocalBackupMetadataKey, -} from './crypto.js'; -import { BackupCredentials } from './credentials.js'; -import { BackupAPI } from './api.js'; +} from './crypto.preload.js'; +import { BackupCredentials } from './credentials.preload.js'; +import { BackupAPI } from './api.preload.js'; import { validateBackup, validateBackupStream, ValidationType, -} from './validator.js'; -import { BackupType } from './types.js'; +} from './validator.preload.js'; +import { BackupType } from './types.std.js'; import { BackupInstallerError, BackupDownloadFailedError, BackupImportCanceledError, BackupProcessingError, RelinkRequestedError, -} from './errors.js'; -import { FileStream } from './util/FileStream.js'; -import { ToastType } from '../../types/Toast.js'; -import { isAdhoc, isNightly } from '../../util/version.js'; -import { isLocalBackupsEnabled } from '../../util/isLocalBackupsEnabled.js'; -import type { ValidateLocalBackupStructureResultType } from './util/localBackup.js'; +} from './errors.std.js'; +import { FileStream } from './util/FileStream.node.js'; +import { ToastType } from '../../types/Toast.dom.js'; +import { isAdhoc, isNightly } from '../../util/version.std.js'; +import { isLocalBackupsEnabled } from '../../util/isLocalBackupsEnabled.dom.js'; +import type { ValidateLocalBackupStructureResultType } from './util/localBackup.node.js'; import { writeLocalBackupMetadata, verifyLocalBackupMetadata, writeLocalBackupFilesList, readLocalBackupFilesList, validateLocalBackupStructure, -} from './util/localBackup.js'; -import { AttachmentLocalBackupManager } from '../../jobs/AttachmentLocalBackupManager.js'; -import { decipherWithAesKey } from '../../util/decipherWithAesKey.js'; -import { areRemoteBackupsTurnedOn } from '../../util/isBackupEnabled.js'; -import { unlink as unlinkAccount } from '../../textsecure/WebAPI.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +} from './util/localBackup.node.js'; +import { AttachmentLocalBackupManager } from '../../jobs/AttachmentLocalBackupManager.preload.js'; +import { decipherWithAesKey } from '../../util/decipherWithAesKey.node.js'; +import { areRemoteBackupsTurnedOn } from '../../util/isBackupEnabled.preload.js'; +import { unlink as unlinkAccount } from '../../textsecure/WebAPI.preload.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; const { ensureFile } = fsExtra; diff --git a/ts/services/backups/types.ts b/ts/services/backups/types.ts index 4dca0ca261..33a5746c14 100644 --- a/ts/services/backups/types.ts +++ b/ts/services/backups/types.ts @@ -1,8 +1,8 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AciString, PniString } from '../../types/ServiceId.js'; -import type { ConversationColorType } from '../../types/Colors.js'; +import type { AciString, PniString } from '../../types/ServiceId.std.js'; +import type { ConversationColorType } from '../../types/Colors.std.js'; // Duplicated here to allow loading it in a non-node environment export enum BackupLevel { diff --git a/ts/services/backups/util/filePointers.ts b/ts/services/backups/util/filePointers.ts index 80afa31a6e..e71de2c516 100644 --- a/ts/services/backups/util/filePointers.ts +++ b/ts/services/backups/util/filePointers.ts @@ -6,40 +6,40 @@ import { BackupLevel } from '@signalapp/libsignal-client/zkgroup.js'; import { APPLICATION_OCTET_STREAM, stringToMIMEType, -} from '../../../types/MIME.js'; -import { createLogger } from '../../../logging/log.js'; -import type { AttachmentType } from '../../../types/Attachment.js'; -import { getAbsoluteAttachmentPath } from '../../../util/migrations.js'; +} from '../../../types/MIME.std.js'; +import { createLogger } from '../../../logging/log.std.js'; +import type { AttachmentType } from '../../../types/Attachment.std.js'; +import { getAbsoluteAttachmentPath } from '../../../util/migrations.preload.js'; import { hasRequiredInformationForBackup, hasRequiredInformationToDownloadFromTransitTier, -} from '../../../util/Attachment.js'; -import { Backups, SignalService } from '../../../protobuf/index.js'; -import * as Bytes from '../../../Bytes.js'; +} from '../../../util/Attachment.std.js'; +import { Backups, SignalService } from '../../../protobuf/index.std.js'; +import * as Bytes from '../../../Bytes.std.js'; import { getSafeLongFromTimestamp, getTimestampFromLong, -} from '../../../util/timestampLongUtils.js'; -import { strictAssert } from '../../../util/assert.js'; +} from '../../../util/timestampLongUtils.std.js'; +import { strictAssert } from '../../../util/assert.std.js'; import type { CoreAttachmentBackupJobType, PartialAttachmentLocalBackupJobType, -} from '../../../types/AttachmentBackup.js'; +} from '../../../types/AttachmentBackup.std.js'; import { type GetBackupCdnInfoType, getMediaIdFromMediaName, getMediaName, -} from './mediaId.js'; -import { missingCaseError } from '../../../util/missingCaseError.js'; -import { bytesToUuid } from '../../../util/uuidToBytes.js'; -import { createName } from '../../../util/attachmentPath.js'; -import { generateAttachmentKeys } from '../../../AttachmentCrypto.js'; -import { getAttachmentLocalBackupPathFromSnapshotDir } from './localBackup.js'; +} from './mediaId.preload.js'; +import { missingCaseError } from '../../../util/missingCaseError.std.js'; +import { bytesToUuid } from '../../../util/uuidToBytes.std.js'; +import { createName } from '../../../util/attachmentPath.node.js'; +import { generateAttachmentKeys } from '../../../AttachmentCrypto.node.js'; +import { getAttachmentLocalBackupPathFromSnapshotDir } from './localBackup.node.js'; import { isValidAttachmentKey, isValidPlaintextHash, -} from '../../../types/Crypto.js'; -import { isTestOrMockEnvironment } from '../../../environment.js'; +} from '../../../types/Crypto.std.js'; +import { isTestOrMockEnvironment } from '../../../environment.std.js'; const log = createLogger('filePointers'); diff --git a/ts/services/backups/util/localBackup.ts b/ts/services/backups/util/localBackup.ts index 1b6952831f..dffe97c03a 100644 --- a/ts/services/backups/util/localBackup.ts +++ b/ts/services/backups/util/localBackup.ts @@ -7,19 +7,19 @@ import { readFile, stat, writeFile } from 'node:fs/promises'; import { createReadStream, createWriteStream } from 'node:fs'; import { Transform } from 'node:stream'; import { pipeline } from 'node:stream/promises'; -import { createLogger } from '../../../logging/log.js'; -import * as Bytes from '../../../Bytes.js'; -import * as Errors from '../../../types/errors.js'; -import { Signal } from '../../../protobuf/index.js'; -import protobuf from '../../../protobuf/wrap.js'; -import { strictAssert } from '../../../util/assert.js'; -import { decryptAesCtr, encryptAesCtr } from '../../../Crypto.js'; -import type { LocalBackupMetadataVerificationType } from '../../../types/backups.js'; +import { createLogger } from '../../../logging/log.std.js'; +import * as Bytes from '../../../Bytes.std.js'; +import * as Errors from '../../../types/errors.std.js'; +import { Signal } from '../../../protobuf/index.std.js'; +import protobuf from '../../../protobuf/wrap.node.js'; +import { strictAssert } from '../../../util/assert.std.js'; +import { decryptAesCtr, encryptAesCtr } from '../../../Crypto.node.js'; +import type { LocalBackupMetadataVerificationType } from '../../../types/backups.node.js'; import { LOCAL_BACKUP_VERSION, LOCAL_BACKUP_BACKUP_ID_IV_LENGTH, -} from '../constants.js'; -import { explodePromise } from '../../../util/explodePromise.js'; +} from '../constants.std.js'; +import { explodePromise } from '../../../util/explodePromise.std.js'; const log = createLogger('localBackup'); diff --git a/ts/services/backups/util/mediaId.ts b/ts/services/backups/util/mediaId.ts index 426b95a0fd..cf323b637b 100644 --- a/ts/services/backups/util/mediaId.ts +++ b/ts/services/backups/util/mediaId.ts @@ -1,10 +1,10 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { DataReader } from '../../../sql/Client.js'; -import * as Bytes from '../../../Bytes.js'; -import { getBackupMediaRootKey } from '../crypto.js'; -import type { BackupableAttachmentType } from '../../../types/Attachment.js'; +import { DataReader } from '../../../sql/Client.preload.js'; +import * as Bytes from '../../../Bytes.std.js'; +import { getBackupMediaRootKey } from '../crypto.preload.js'; +import type { BackupableAttachmentType } from '../../../types/Attachment.std.js'; export function getMediaIdFromMediaName(mediaName: string): { string: string; diff --git a/ts/services/backups/validator.ts b/ts/services/backups/validator.ts index 663fd54692..c6653a1802 100644 --- a/ts/services/backups/validator.ts +++ b/ts/services/backups/validator.ts @@ -7,10 +7,10 @@ import * as libsignal from '@signalapp/libsignal-client/dist/MessageBackup.js'; import type { InputStream } from '@signalapp/libsignal-client/dist/io.js'; import protobufjs from 'protobufjs'; -import { strictAssert } from '../../util/assert.js'; -import { toAciObject } from '../../util/ServiceId.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { toAciObject } from '../../util/ServiceId.node.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; const { Reader } = protobufjs; diff --git a/ts/services/badgeLoader.ts b/ts/services/badgeLoader.ts index c9c6eeb023..f6066acc32 100644 --- a/ts/services/badgeLoader.ts +++ b/ts/services/badgeLoader.ts @@ -1,12 +1,12 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { DataReader } from '../sql/Client.js'; -import { strictAssert } from '../util/assert.js'; -import { makeLookup } from '../util/makeLookup.js'; +import { DataReader } from '../sql/Client.preload.js'; +import { strictAssert } from '../util/assert.std.js'; +import { makeLookup } from '../util/makeLookup.std.js'; -import type { BadgeType } from '../badges/types.js'; -import type { BadgesStateType } from '../state/ducks/badges.js'; +import type { BadgeType } from '../badges/types.std.js'; +import type { BadgesStateType } from '../state/ducks/badges.preload.js'; let badges: Array | undefined; diff --git a/ts/services/buildExpiration.ts b/ts/services/buildExpiration.ts index e9ad296d52..6fc0e42515 100644 --- a/ts/services/buildExpiration.ts +++ b/ts/services/buildExpiration.ts @@ -6,10 +6,10 @@ import EventEmitter from 'node:events'; import { hasBuildExpired, getBuildExpirationTimestamp, -} from '../util/buildExpiration.js'; -import { LongTimeout } from '../util/timeout.js'; -import { createLogger } from '../logging/log.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from '../util/buildExpiration.std.js'; +import { LongTimeout } from '../util/timeout.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const log = createLogger('buildExpiration'); diff --git a/ts/services/callHistoryLoader.ts b/ts/services/callHistoryLoader.ts index 69ebd36de2..9b69a9224d 100644 --- a/ts/services/callHistoryLoader.ts +++ b/ts/services/callHistoryLoader.ts @@ -1,9 +1,9 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { DataReader, DataWriter } from '../sql/Client.js'; -import type { CallHistoryDetails } from '../types/CallDisposition.js'; -import { strictAssert } from '../util/assert.js'; +import { DataReader, DataWriter } from '../sql/Client.preload.js'; +import type { CallHistoryDetails } from '../types/CallDisposition.std.js'; +import { strictAssert } from '../util/assert.std.js'; let callsHistoryData: ReadonlyArray; let callsHistoryUnreadCount: number; diff --git a/ts/services/callLinksLoader.ts b/ts/services/callLinksLoader.ts index eaec1b4329..0693ef7a65 100644 --- a/ts/services/callLinksLoader.ts +++ b/ts/services/callLinksLoader.ts @@ -1,9 +1,9 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { DataReader } from '../sql/Client.js'; -import type { CallLinkType } from '../types/CallLink.js'; -import { strictAssert } from '../util/assert.js'; +import { DataReader } from '../sql/Client.preload.js'; +import type { CallLinkType } from '../types/CallLink.std.js'; +import { strictAssert } from '../util/assert.std.js'; let callLinksData: ReadonlyArray; diff --git a/ts/services/calling.ts b/ts/services/calling.ts index 9bb6777322..63557037d5 100644 --- a/ts/services/calling.ts +++ b/ts/services/calling.ts @@ -53,17 +53,17 @@ import { Aci } from '@signalapp/libsignal-client'; import { CanvasVideoRenderer, GumVideoCapturer, -} from '../calling/VideoSupport.js'; -import type { GumVideoCaptureOptions } from '../calling/VideoSupport.js'; +} from '../calling/VideoSupport.preload.js'; +import type { GumVideoCaptureOptions } from '../calling/VideoSupport.preload.js'; import type { ActionsType as CallingReduxActionsType, GroupCallParticipantInfoType, GroupCallPeekInfoType, -} from '../state/ducks/calling.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import { getConversationCallMode } from '../state/ducks/conversations.js'; -import { isMe } from '../util/whatTypeOfConversation.js'; -import { getAbsoluteTempPath } from '../util/migrations.js'; +} from '../state/ducks/calling.preload.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import { getConversationCallMode } from '../state/ducks/conversations.preload.js'; +import { isMe } from '../util/whatTypeOfConversation.dom.js'; +import { getAbsoluteTempPath } from '../util/migrations.preload.js'; import type { AvailableIODevicesType, CallEndedReason, @@ -71,39 +71,39 @@ import type { IceServerCacheType, MediaDeviceSettings, PresentedSource, -} from '../types/Calling.js'; +} from '../types/Calling.std.js'; import { GroupCallConnectionState, GroupCallJoinState, ScreenShareStatus, -} from '../types/Calling.js'; -import { CallMode, LocalCallEvent } from '../types/CallDisposition.js'; +} from '../types/Calling.std.js'; +import { CallMode, LocalCallEvent } from '../types/CallDisposition.std.js'; import { findBestMatchingAudioDeviceIndex, findBestMatchingCameraId, -} from '../calling/findBestMatchingDevice.js'; -import { normalizeAci } from '../util/normalizeAci.js'; -import { isAciString } from '../util/isAciString.js'; -import * as Errors from '../types/errors.js'; -import type { ConversationModel } from '../models/conversations.js'; -import * as Bytes from '../Bytes.js'; -import { uuidToBytes, bytesToUuid } from '../util/uuidToBytes.js'; -import { drop } from '../util/drop.js'; -import { dropNull } from '../util/dropNull.js'; -import { getOwn } from '../util/getOwn.js'; -import * as durations from '../util/durations/index.js'; -import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.js'; -import { fetchMembershipProof, getMembershipList } from '../groups.js'; +} from '../calling/findBestMatchingDevice.std.js'; +import { normalizeAci } from '../util/normalizeAci.std.js'; +import { isAciString } from '../util/isAciString.std.js'; +import * as Errors from '../types/errors.std.js'; +import type { ConversationModel } from '../models/conversations.preload.js'; +import * as Bytes from '../Bytes.std.js'; +import { uuidToBytes, bytesToUuid } from '../util/uuidToBytes.std.js'; +import { drop } from '../util/drop.std.js'; +import { dropNull } from '../util/dropNull.std.js'; +import { getOwn } from '../util/getOwn.std.js'; +import * as durations from '../util/durations/index.std.js'; +import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.std.js'; +import { fetchMembershipProof, getMembershipList } from '../groups.preload.js'; import type { ProcessedEnvelope } from '../textsecure/Types.d.ts'; -import type { GetIceServersResultType } from '../textsecure/WebAPI.js'; +import type { GetIceServersResultType } from '../textsecure/WebAPI.preload.js'; import { callLinkCreateAuth, getIceServers, makeSfuRequest, -} from '../textsecure/WebAPI.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { normalizeGroupCallTimestamp } from '../util/ringrtc/normalizeGroupCallTimestamp.js'; -import { requestCameraPermissions } from '../util/callingPermissions.js'; +} from '../textsecure/WebAPI.preload.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { normalizeGroupCallTimestamp } from '../util/ringrtc/normalizeGroupCallTimestamp.std.js'; +import { requestCameraPermissions } from '../util/callingPermissions.dom.js'; import { AUDIO_LEVEL_INTERVAL_MS, REQUESTED_VIDEO_WIDTH, @@ -114,20 +114,19 @@ import { REQUESTED_SCREEN_SHARE_WIDTH, REQUESTED_SCREEN_SHARE_HEIGHT, REQUESTED_SCREEN_SHARE_FRAMERATE, -} from '../calling/constants.js'; -import { callingMessageToProto } from '../util/callingMessageToProto.js'; -import { requestMicrophonePermissions } from '../util/requestMicrophonePermissions.js'; -import { SignalService as Proto } from '../protobuf/index.js'; -import { DataReader, DataWriter } from '../sql/Client.js'; +} from '../calling/constants.std.js'; +import { callingMessageToProto } from '../util/callingMessageToProto.node.js'; +import { requestMicrophonePermissions } from '../util/requestMicrophonePermissions.dom.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; +import { DataReader, DataWriter } from '../sql/Client.preload.js'; import { notificationService, NotificationSetting, FALLBACK_NOTIFICATION_TITLE, - NotificationType, shouldSaveNotificationAvatarToDisk, -} from './notifications.js'; -import { createLogger } from '../logging/log.js'; -import { assertDev, strictAssert } from '../util/assert.js'; +} from './notifications.preload.js'; +import { createLogger } from '../logging/log.std.js'; +import { assertDev, strictAssert } from '../util/assert.std.js'; import { formatLocalDeviceState, formatPeekInfo, @@ -147,32 +146,33 @@ import { updateAdhocCallHistory, getCallIdFromEra, getCallDetailsForAdhocCall, -} from '../util/callDisposition.js'; -import { isNormalNumber } from '../util/isNormalNumber.js'; -import type { AciString, ServiceIdString } from '../types/ServiceId.js'; -import { isServiceIdString, isPniString } from '../types/ServiceId.js'; -import { isSignalConnection } from '../util/getSignalConnections.js'; -import { toAdminKeyBytes } from '../util/callLinks.js'; +} from '../util/callDisposition.preload.js'; +import { isNormalNumber } from '../util/isNormalNumber.std.js'; +import type { AciString, ServiceIdString } from '../types/ServiceId.std.js'; +import { isServiceIdString, isPniString } from '../types/ServiceId.std.js'; +import { NotificationType } from '../types/notifications.std.js'; +import { isSignalConnection } from '../util/getSignalConnections.preload.js'; +import { toAdminKeyBytes } from '../util/callLinks.std.js'; import { getRoomIdFromRootKey, callLinkRestrictionsToRingRTC, callLinkStateFromRingRTC, -} from '../util/callLinksRingrtc.js'; -import { getCallLinkAuthCredentialPresentation } from '../util/callLinks/zkgroup.js'; +} from '../util/callLinksRingrtc.node.js'; +import { getCallLinkAuthCredentialPresentation } from '../util/callLinks/zkgroup.preload.js'; import { conversationJobQueue, conversationQueueJobEnum, -} from '../jobs/conversationJobQueue.js'; -import type { CallLinkType, CallLinkStateType } from '../types/CallLink.js'; -import { CallLinkRestrictions } from '../types/CallLink.js'; -import { getConversationIdForLogging } from '../util/idForLogging.js'; -import { sendCallLinkUpdateSync } from '../util/sendCallLinkUpdateSync.js'; -import { createIdenticon } from '../util/createIdenticon.js'; -import { getColorForCallLink } from '../util/getColorForCallLink.js'; -import OS from '../util/os/osMain.js'; -import { sleep } from '../util/sleep.js'; -import { signalProtocolStore } from '../SignalProtocolStore.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from '../jobs/conversationJobQueue.preload.js'; +import type { CallLinkType, CallLinkStateType } from '../types/CallLink.std.js'; +import { CallLinkRestrictions } from '../types/CallLink.std.js'; +import { getConversationIdForLogging } from '../util/idForLogging.preload.js'; +import { sendCallLinkUpdateSync } from '../util/sendCallLinkUpdateSync.preload.js'; +import { createIdenticon } from '../util/createIdenticon.preload.js'; +import { getColorForCallLink } from '../util/getColorForCallLink.std.js'; +import OS from '../util/os/osMain.node.js'; +import { sleep } from '../util/sleep.std.js'; +import { signalProtocolStore } from '../SignalProtocolStore.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const { i18n } = window.SignalContext; diff --git a/ts/services/challengeHandler.ts b/ts/services/challengeHandler.ts index f41308a7f0..7bade2c24a 100644 --- a/ts/services/challengeHandler.ts +++ b/ts/services/challengeHandler.ts @@ -1,11 +1,11 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { ChallengeHandler } from '../challenge.js'; -import { itemStorage } from '../textsecure/Storage.js'; -import { sendChallengeResponse as doSendChallengeResponse } from '../textsecure/WebAPI.js'; -import { conversationJobQueue } from '../jobs/conversationJobQueue.js'; -import { ToastType } from '../types/Toast.js'; +import { ChallengeHandler } from '../challenge.dom.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; +import { sendChallengeResponse as doSendChallengeResponse } from '../textsecure/WebAPI.preload.js'; +import { conversationJobQueue } from '../jobs/conversationJobQueue.preload.js'; +import { ToastType } from '../types/Toast.dom.js'; export const challengeHandler = new ChallengeHandler({ storage: itemStorage, diff --git a/ts/services/chatFoldersLoader.ts b/ts/services/chatFoldersLoader.ts index 59157c6fd9..a576c96b98 100644 --- a/ts/services/chatFoldersLoader.ts +++ b/ts/services/chatFoldersLoader.ts @@ -1,9 +1,9 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { DataReader } from '../sql/Client.js'; -import type { CurrentChatFolder } from '../types/CurrentChatFolders.js'; -import { strictAssert } from '../util/assert.js'; +import { DataReader } from '../sql/Client.preload.js'; +import type { CurrentChatFolder } from '../types/CurrentChatFolders.std.js'; +import { strictAssert } from '../util/assert.std.js'; let chatFolders: ReadonlyArray; diff --git a/ts/services/contactSync.ts b/ts/services/contactSync.ts index 30187641d1..8112106159 100644 --- a/ts/services/contactSync.ts +++ b/ts/services/contactSync.ts @@ -4,38 +4,41 @@ import PQueue from 'p-queue'; import lodash from 'lodash'; -import { DataWriter } from '../sql/Client.js'; -import type { ContactSyncEvent } from '../textsecure/messageReceiverEvents.js'; +import { DataWriter } from '../sql/Client.preload.js'; +import type { ContactSyncEvent } from '../textsecure/messageReceiverEvents.std.js'; import { parseContactsV2, type ContactDetailsWithAvatar, -} from '../textsecure/ContactsParser.js'; +} from '../textsecure/ContactsParser.preload.js'; import { isOnline, getAttachment, getAttachmentFromBackupTier, -} from '../textsecure/WebAPI.js'; -import * as Conversation from '../types/Conversation.js'; -import * as Errors from '../types/errors.js'; +} from '../textsecure/WebAPI.preload.js'; +import * as Conversation from '../types/Conversation.node.js'; +import * as Errors from '../types/errors.std.js'; import type { ValidateConversationType } from '../model-types.d.ts'; -import type { ConversationModel } from '../models/conversations.js'; -import { validateConversation } from '../util/validateConversation.js'; +import type { ConversationModel } from '../models/conversations.preload.js'; +import { validateConversation } from '../util/validateConversation.dom.js'; import { writeNewAttachmentData, deleteAttachmentData, doesAttachmentExist, -} from '../util/migrations.js'; -import { isDirectConversation, isMe } from '../util/whatTypeOfConversation.js'; -import { createLogger } from '../logging/log.js'; -import { dropNull } from '../util/dropNull.js'; -import type { ProcessedAttachment } from '../textsecure/Types.js'; -import { downloadAttachment } from '../textsecure/downloadAttachment.js'; -import type { ReencryptedAttachmentV2 } from '../AttachmentCrypto.js'; -import { SECOND } from '../util/durations/index.js'; -import { AttachmentVariant } from '../types/Attachment.js'; -import { MediaTier } from '../types/AttachmentDownload.js'; -import { waitForOnline } from '../util/waitForOnline.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from '../util/migrations.preload.js'; +import { + isDirectConversation, + isMe, +} from '../util/whatTypeOfConversation.dom.js'; +import { createLogger } from '../logging/log.std.js'; +import { dropNull } from '../util/dropNull.std.js'; +import type { ProcessedAttachment } from '../textsecure/Types.d.ts'; +import { downloadAttachment } from '../textsecure/downloadAttachment.preload.js'; +import type { ReencryptedAttachmentV2 } from '../AttachmentCrypto.node.js'; +import { SECOND } from '../util/durations/index.std.js'; +import { AttachmentVariant } from '../types/Attachment.std.js'; +import { MediaTier } from '../types/AttachmentDownload.std.js'; +import { waitForOnline } from '../util/waitForOnline.dom.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const { noop } = lodash; diff --git a/ts/services/distributionListLoader.ts b/ts/services/distributionListLoader.ts index dcef4b4ca6..0d88d8ca39 100644 --- a/ts/services/distributionListLoader.ts +++ b/ts/services/distributionListLoader.ts @@ -1,10 +1,10 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { DataReader } from '../sql/Client.js'; -import type { StoryDistributionWithMembersType } from '../sql/Interface.js'; -import type { StoryDistributionListDataType } from '../state/ducks/storyDistributionLists.js'; -import { strictAssert } from '../util/assert.js'; +import { DataReader } from '../sql/Client.preload.js'; +import type { StoryDistributionWithMembersType } from '../sql/Interface.std.js'; +import type { StoryDistributionListDataType } from '../state/ducks/storyDistributionLists.preload.js'; +import { strictAssert } from '../util/assert.std.js'; let distributionLists: Array | undefined; diff --git a/ts/services/donations.ts b/ts/services/donations.ts index dd9e5da762..992f6e1ea9 100644 --- a/ts/services/donations.ts +++ b/ts/services/donations.ts @@ -14,25 +14,25 @@ import { } from '@signalapp/libsignal-client/zkgroup.js'; import * as countryCodes from 'country-codes-list'; -import * as Bytes from '../Bytes.js'; -import * as Errors from '../types/errors.js'; -import { getRandomBytes, sha256 } from '../Crypto.js'; -import { DataWriter } from '../sql/Client.js'; -import { createLogger } from '../logging/log.js'; -import { getProfile } from '../util/getProfile.js'; -import { donationValidationCompleteRoute } from '../util/signalRoutes.js'; -import { safeParseStrict, safeParseUnknown } from '../util/schemas.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { exponentialBackoffSleepTime } from '../util/exponentialBackoff.js'; -import { sleeper } from '../util/sleeper.js'; -import { isInPast, isOlderThan } from '../util/timestamp.js'; -import { DAY, DurationInSeconds } from '../util/durations/index.js'; -import { waitForOnline } from '../util/waitForOnline.js'; +import * as Bytes from '../Bytes.std.js'; +import * as Errors from '../types/errors.std.js'; +import { getRandomBytes, sha256 } from '../Crypto.node.js'; +import { DataWriter } from '../sql/Client.preload.js'; +import { createLogger } from '../logging/log.std.js'; +import { getProfile } from '../util/getProfile.preload.js'; +import { donationValidationCompleteRoute } from '../util/signalRoutes.std.js'; +import { safeParseStrict, safeParseUnknown } from '../util/schemas.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { exponentialBackoffSleepTime } from '../util/exponentialBackoff.std.js'; +import { sleeper } from '../util/sleeper.std.js'; +import { isInPast, isOlderThan } from '../util/timestamp.std.js'; +import { DAY, DurationInSeconds } from '../util/durations/index.std.js'; +import { waitForOnline } from '../util/waitForOnline.dom.js'; import { donationErrorTypeSchema, donationStateSchema, donationWorkflowSchema, -} from '../types/Donations.js'; +} from '../types/Donations.std.js'; import type { CardDetail, @@ -41,10 +41,10 @@ import type { DonationWorkflow, ReceiptContext, StripeDonationAmount, -} from '../types/Donations.js'; -import { ToastType } from '../types/Toast.js'; -import { NavTab, SettingsPage } from '../types/Nav.js'; -import { getRegionCodeForNumber } from '../util/libphonenumberUtil.js'; +} from '../types/Donations.std.js'; +import { ToastType } from '../types/Toast.dom.js'; +import { NavTab, SettingsPage } from '../types/Nav.std.js'; +import { getRegionCodeForNumber } from '../util/libphonenumberUtil.std.js'; import { createBoostPaymentIntent, createPaymentMethodWithStripe, @@ -52,8 +52,8 @@ import { createBoostReceiptCredentials, redeemReceipt, isOnline, -} from '../textsecure/WebAPI.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from '../textsecure/WebAPI.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const { createDonationReceipt } = DataWriter; diff --git a/ts/services/donationsLoader.ts b/ts/services/donationsLoader.ts index fefb050a06..fea043c2ff 100644 --- a/ts/services/donationsLoader.ts +++ b/ts/services/donationsLoader.ts @@ -1,13 +1,13 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { DataReader } from '../sql/Client.js'; -import { strictAssert } from '../util/assert.js'; +import { DataReader } from '../sql/Client.preload.js'; +import { strictAssert } from '../util/assert.std.js'; -import { _getWorkflowFromStorage } from './donations.js'; +import { _getWorkflowFromStorage } from './donations.preload.js'; -import type { DonationReceipt } from '../types/Donations.js'; -import type { DonationsStateType } from '../state/ducks/donations.js'; +import type { DonationReceipt } from '../types/Donations.std.js'; +import type { DonationsStateType } from '../state/ducks/donations.preload.js'; let donationReceipts: Array | undefined; diff --git a/ts/services/expiring/chatFolderCleanupService.ts b/ts/services/expiring/chatFolderCleanupService.ts index 03fcf71c5f..416aed2b4f 100644 --- a/ts/services/expiring/chatFolderCleanupService.ts +++ b/ts/services/expiring/chatFolderCleanupService.ts @@ -1,9 +1,9 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { DataReader, DataWriter } from '../../sql/Client.js'; -import { getMessageQueueTime } from '../../util/getMessageQueueTime.js'; -import { createExpiringEntityCleanupService } from './createExpiringEntityCleanupService.js'; -import * as RemoteConfig from '../../RemoteConfig.js'; +import { DataReader, DataWriter } from '../../sql/Client.preload.js'; +import { getMessageQueueTime } from '../../util/getMessageQueueTime.dom.js'; +import { createExpiringEntityCleanupService } from './createExpiringEntityCleanupService.std.js'; +import * as RemoteConfig from '../../RemoteConfig.dom.js'; export const chatFolderCleanupService = createExpiringEntityCleanupService({ logPrefix: 'ChatFolders', diff --git a/ts/services/expiring/createExpiringEntityCleanupService.ts b/ts/services/expiring/createExpiringEntityCleanupService.ts index ab7968a4b6..504648579e 100644 --- a/ts/services/expiring/createExpiringEntityCleanupService.ts +++ b/ts/services/expiring/createExpiringEntityCleanupService.ts @@ -1,12 +1,12 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { getEnvironment, isTestEnvironment } from '../../environment.js'; -import { createLogger } from '../../logging/log.js'; -import * as Errors from '../../types/errors.js'; -import { strictAssert } from '../../util/assert.js'; -import { drop } from '../../util/drop.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; -import { longTimeoutAsync } from '../../util/timeout.js'; +import { getEnvironment, isTestEnvironment } from '../../environment.std.js'; +import { createLogger } from '../../logging/log.std.js'; +import * as Errors from '../../types/errors.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { drop } from '../../util/drop.std.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; +import { longTimeoutAsync } from '../../util/timeout.std.js'; const parentLog = createLogger('ExpiringEntityCleanupService'); diff --git a/ts/services/expiringMessagesDeletion.ts b/ts/services/expiringMessagesDeletion.ts index 41a1a23cad..ff86370a61 100644 --- a/ts/services/expiringMessagesDeletion.ts +++ b/ts/services/expiringMessagesDeletion.ts @@ -4,15 +4,15 @@ import { batch } from 'react-redux'; import lodash from 'lodash'; -import * as Errors from '../types/errors.js'; -import { createLogger } from '../logging/log.js'; -import { DataReader, DataWriter } from '../sql/Client.js'; -import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.js'; -import { sleep } from '../util/sleep.js'; -import { SECOND } from '../util/durations/index.js'; -import { MessageModel } from '../models/messages.js'; -import { cleanupMessages } from '../util/cleanup.js'; -import { drop } from '../util/drop.js'; +import * as Errors from '../types/errors.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { DataReader, DataWriter } from '../sql/Client.preload.js'; +import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.std.js'; +import { sleep } from '../util/sleep.std.js'; +import { SECOND } from '../util/durations/index.std.js'; +import { MessageModel } from '../models/messages.preload.js'; +import { cleanupMessages } from '../util/cleanup.preload.js'; +import { drop } from '../util/drop.std.js'; const { debounce } = lodash; diff --git a/ts/services/gifsLoader.ts b/ts/services/gifsLoader.ts index 7c4fda44ac..68277ad1f3 100644 --- a/ts/services/gifsLoader.ts +++ b/ts/services/gifsLoader.ts @@ -1,9 +1,9 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { DataReader } from '../sql/Client.js'; -import type { GifsStateType } from '../state/ducks/gifs.js'; -import { MAX_RECENT_GIFS } from '../state/ducks/gifs.js'; -import { strictAssert } from '../util/assert.js'; +import { DataReader } from '../sql/Client.preload.js'; +import type { GifsStateType } from '../state/ducks/gifs.preload.js'; +import { MAX_RECENT_GIFS } from '../state/ducks/gifs.preload.js'; +import { strictAssert } from '../util/assert.std.js'; let state: GifsStateType; diff --git a/ts/services/globalMessageAudio.ts b/ts/services/globalMessageAudio.ts index 041b642d25..358b8718b5 100644 --- a/ts/services/globalMessageAudio.ts +++ b/ts/services/globalMessageAudio.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import lodash from 'lodash'; -import { isAbortError } from '../util/isAbortError.js'; +import { isAbortError } from '../util/isAbortError.std.js'; const { noop } = lodash; diff --git a/ts/services/groupCredentialFetcher.ts b/ts/services/groupCredentialFetcher.ts index bb3aeed643..6684d417bc 100644 --- a/ts/services/groupCredentialFetcher.ts +++ b/ts/services/groupCredentialFetcher.ts @@ -8,20 +8,20 @@ import { GenericServerPublicParams, } from '@signalapp/libsignal-client/zkgroup.js'; -import { getClientZkAuthOperations } from '../util/zkgroup.js'; +import { getClientZkAuthOperations } from '../util/zkgroup.node.js'; -import type { GroupCredentialType } from '../textsecure/WebAPI.js'; -import { getGroupCredentials } from '../textsecure/WebAPI.js'; -import { strictAssert } from '../util/assert.js'; -import * as durations from '../util/durations/index.js'; -import { BackOff } from '../util/BackOff.js'; -import { sleep } from '../util/sleep.js'; -import { toDayMillis } from '../util/timestamp.js'; -import { toTaggedPni } from '../types/ServiceId.js'; -import { toPniObject, toAciObject } from '../util/ServiceId.js'; -import { createLogger } from '../logging/log.js'; -import * as Bytes from '../Bytes.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import type { GroupCredentialType } from '../textsecure/WebAPI.preload.js'; +import { getGroupCredentials } from '../textsecure/WebAPI.preload.js'; +import { strictAssert } from '../util/assert.std.js'; +import * as durations from '../util/durations/index.std.js'; +import { BackOff } from '../util/BackOff.std.js'; +import { sleep } from '../util/sleep.std.js'; +import { toDayMillis } from '../util/timestamp.std.js'; +import { toTaggedPni } from '../types/ServiceId.std.js'; +import { toPniObject, toAciObject } from '../util/ServiceId.node.js'; +import { createLogger } from '../logging/log.std.js'; +import * as Bytes from '../Bytes.std.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const { first, last, sortBy } = lodash; diff --git a/ts/services/keyboardLayout.ts b/ts/services/keyboardLayout.ts index d18105e7c5..39709b817e 100644 --- a/ts/services/keyboardLayout.ts +++ b/ts/services/keyboardLayout.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { strictAssert } from '../util/assert.js'; +import { strictAssert } from '../util/assert.std.js'; type LayoutMapType = { get(code: string): string | undefined }; diff --git a/ts/services/messageStateCleanup.ts b/ts/services/messageStateCleanup.ts index 4bb6bdfcd1..10ef76e236 100644 --- a/ts/services/messageStateCleanup.ts +++ b/ts/services/messageStateCleanup.ts @@ -1,9 +1,9 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as durations from '../util/durations/index.js'; -import { isEnabled } from '../RemoteConfig.js'; -import { MessageCache } from './MessageCache.js'; +import * as durations from '../util/durations/index.std.js'; +import { isEnabled } from '../RemoteConfig.dom.js'; +import { MessageCache } from './MessageCache.preload.js'; const TEN_MINUTES = 10 * durations.MINUTE; diff --git a/ts/services/networkObserver.ts b/ts/services/networkObserver.ts index 4fb1a3a7c9..7651ba4615 100644 --- a/ts/services/networkObserver.ts +++ b/ts/services/networkObserver.ts @@ -4,12 +4,12 @@ import type { SetNetworkStatusPayloadType, NetworkActionType, -} from '../state/ducks/network.js'; -import { createLogger } from '../logging/log.js'; -import { SECOND } from '../util/durations/index.js'; -import { electronLookup } from '../util/dns.js'; -import { drop } from '../util/drop.js'; -import { SocketStatus } from '../types/SocketStatus.js'; +} from '../state/ducks/network.dom.js'; +import { createLogger } from '../logging/log.std.js'; +import { SECOND } from '../util/durations/index.std.js'; +import { electronLookup } from '../util/dns.node.js'; +import { drop } from '../util/drop.std.js'; +import { SocketStatus } from '../types/SocketStatus.std.js'; const log = createLogger('networkObserver'); diff --git a/ts/services/notificationProfilesService.ts b/ts/services/notificationProfilesService.ts index 881012c941..351292f8ab 100644 --- a/ts/services/notificationProfilesService.ts +++ b/ts/services/notificationProfilesService.ts @@ -3,32 +3,32 @@ import lodash from 'lodash'; -import { createLogger } from '../logging/log.js'; +import { createLogger } from '../logging/log.std.js'; -import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.js'; -import { isInPast, isMoreRecentThan } from '../util/timestamp.js'; -import { getMessageQueueTime } from '../util/getMessageQueueTime.js'; -import { drop } from '../util/drop.js'; -import { DataReader, DataWriter } from '../sql/Client.js'; +import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.std.js'; +import { isInPast, isMoreRecentThan } from '../util/timestamp.std.js'; +import { getMessageQueueTime } from '../util/getMessageQueueTime.dom.js'; +import { drop } from '../util/drop.std.js'; +import { DataReader, DataWriter } from '../sql/Client.preload.js'; import { findNextProfileEvent, redactNotificationProfileId, -} from '../types/NotificationProfile.js'; +} from '../types/NotificationProfile.std.js'; import { getActiveProfile, getCurrentState, getDeletedProfiles, getOverride, getProfiles, -} from '../state/selectors/notificationProfiles.js'; -import { safeSetTimeout } from '../util/timeout.js'; -import { ToastType } from '../types/Toast.js'; -import { toLogFormat } from '../types/errors.js'; +} from '../state/selectors/notificationProfiles.dom.js'; +import { safeSetTimeout } from '../util/timeout.std.js'; +import { ToastType } from '../types/Toast.dom.js'; +import { toLogFormat } from '../types/errors.std.js'; import type { NextProfileEvent, NotificationProfileType, -} from '../types/NotificationProfile.js'; +} from '../types/NotificationProfile.std.js'; const { debounce, isEqual, isNumber } = lodash; diff --git a/ts/services/notifications.ts b/ts/services/notifications.ts index 7f79d8e6ef..4c4995bf55 100644 --- a/ts/services/notifications.ts +++ b/ts/services/notifications.ts @@ -6,17 +6,18 @@ import lodash from 'lodash'; import EventEmitter from 'node:events'; import { v4 as getGuid } from 'uuid'; -import { Sound, SoundType } from '../util/Sound.js'; -import { shouldHideExpiringMessageBody } from '../types/Settings.js'; -import { itemStorage as fallbackStorage } from '../textsecure/Storage.js'; -import OS from '../util/os/osMain.js'; -import { createLogger } from '../logging/log.js'; -import { makeEnumParser } from '../util/enum.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { toLogFormat } from '../types/errors.js'; +import { Sound, SoundType } from '../util/Sound.std.js'; +import { shouldHideExpiringMessageBody } from '../types/Settings.std.js'; +import { itemStorage as fallbackStorage } from '../textsecure/Storage.preload.js'; +import OS from '../util/os/osMain.node.js'; +import { createLogger } from '../logging/log.std.js'; +import { makeEnumParser } from '../util/enum.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { toLogFormat } from '../types/errors.std.js'; import type { StorageInterface } from '../types/Storage.d.ts'; -import type { LocalizerType } from '../types/Util.js'; -import { drop } from '../util/drop.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { NotificationType } from '../types/notifications.std.js'; +import { drop } from '../util/drop.std.js'; const { debounce } = lodash; @@ -54,13 +55,6 @@ export type WindowsNotificationData = { token: string; type: NotificationType; }; -export enum NotificationType { - IncomingCall = 'IncomingCall', - IncomingGroupCall = 'IncomingGroupCall', - IsPresenting = 'IsPresenting', - Message = 'Message', - Reaction = 'Reaction', -} // The keys and values don't match here. This is because the values correspond to old // setting names. In the future, we may wish to migrate these to match. diff --git a/ts/services/ourProfileKey.ts b/ts/services/ourProfileKey.ts index eba7062a19..d747f72481 100644 --- a/ts/services/ourProfileKey.ts +++ b/ts/services/ourProfileKey.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { assertDev, strictAssert } from '../util/assert.js'; -import { createLogger } from '../logging/log.js'; +import { assertDev, strictAssert } from '../util/assert.std.js'; +import { createLogger } from '../logging/log.std.js'; import type { StorageInterface } from '../types/Storage.d.ts'; diff --git a/ts/services/profiles.ts b/ts/services/profiles.ts index 4925c7f352..9196c69909 100644 --- a/ts/services/profiles.ts +++ b/ts/services/profiles.ts @@ -9,49 +9,53 @@ import PQueue from 'p-queue'; import { IdentityChange } from '@signalapp/libsignal-client'; import type { ReadonlyDeep } from 'type-fest'; -import type { ConversationModel } from '../models/conversations.js'; +import type { ConversationModel } from '../models/conversations.preload.js'; import type { CapabilitiesType } from '../types/Capabilities.d.ts'; -import type { ProfileType } from '../textsecure/WebAPI.js'; +import type { ProfileType } from '../textsecure/WebAPI.preload.js'; import { checkAccountExistence, getProfile, getProfileUnauth, -} from '../textsecure/WebAPI.js'; -import { MessageSender } from '../textsecure/SendMessage.js'; -import type { ServiceIdString } from '../types/ServiceId.js'; -import { DataWriter } from '../sql/Client.js'; -import { createLogger } from '../logging/log.js'; -import * as Errors from '../types/errors.js'; -import * as Bytes from '../Bytes.js'; -import { explodePromise } from '../util/explodePromise.js'; -import { isRecord } from '../util/isRecord.js'; -import { sleep } from '../util/sleep.js'; -import { MINUTE, SECOND } from '../util/durations/index.js'; +} from '../textsecure/WebAPI.preload.js'; +import { MessageSender } from '../textsecure/SendMessage.preload.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; +import { DataWriter } from '../sql/Client.preload.js'; +import { createLogger } from '../logging/log.std.js'; +import * as Errors from '../types/errors.std.js'; +import * as Bytes from '../Bytes.std.js'; +import { explodePromise } from '../util/explodePromise.std.js'; +import { isRecord } from '../util/isRecord.std.js'; +import { sleep } from '../util/sleep.std.js'; +import { MINUTE, SECOND } from '../util/durations/index.std.js'; import { generateProfileKeyCredentialRequest, getClientZkProfileOperations, handleProfileKeyCredential, -} from '../util/zkgroup.js'; -import { isMe } from '../util/whatTypeOfConversation.js'; -import { parseBadgesFromServer } from '../badges/parseBadgesFromServer.js'; -import { strictAssert } from '../util/assert.js'; -import { drop } from '../util/drop.js'; -import { findRetryAfterTimeFromError } from '../jobs/helpers/findRetryAfterTimeFromError.js'; -import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue.js'; -import { SEALED_SENDER } from '../types/SealedSender.js'; -import { HTTPError } from '../types/HTTPError.js'; -import { Address } from '../types/Address.js'; -import { QualifiedAddress } from '../types/QualifiedAddress.js'; -import { trimForDisplay, verifyAccessKey, decryptProfile } from '../Crypto.js'; -import type { ConversationLastProfileType } from '../model-types.js'; -import type { GroupSendToken } from '../types/GroupSendEndorsements.js'; +} from '../util/zkgroup.node.js'; +import { isMe } from '../util/whatTypeOfConversation.dom.js'; +import { parseBadgesFromServer } from '../badges/parseBadgesFromServer.std.js'; +import { strictAssert } from '../util/assert.std.js'; +import { drop } from '../util/drop.std.js'; +import { findRetryAfterTimeFromError } from '../jobs/helpers/findRetryAfterTimeFromError.std.js'; +import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue.preload.js'; +import { SEALED_SENDER } from '../types/SealedSender.std.js'; +import { HTTPError } from '../types/HTTPError.std.js'; +import { Address } from '../types/Address.std.js'; +import { QualifiedAddress } from '../types/QualifiedAddress.std.js'; +import { + trimForDisplay, + verifyAccessKey, + decryptProfile, +} from '../Crypto.node.js'; +import type { ConversationLastProfileType } from '../model-types.d.ts'; +import type { GroupSendToken } from '../types/GroupSendEndorsements.std.js'; import { maybeCreateGroupSendEndorsementState, onFailedToSendWithEndorsements, -} from '../util/groupSendEndorsements.js'; -import { ProfileDecryptError } from '../types/errors.js'; -import { signalProtocolStore } from '../SignalProtocolStore.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from '../util/groupSendEndorsements.preload.js'; +import { ProfileDecryptError } from '../types/errors.std.js'; +import { signalProtocolStore } from '../SignalProtocolStore.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const log = createLogger('profiles'); diff --git a/ts/services/releaseNotesFetcher.ts b/ts/services/releaseNotesFetcher.ts index b191f777d2..e6cec99c31 100644 --- a/ts/services/releaseNotesFetcher.ts +++ b/ts/services/releaseNotesFetcher.ts @@ -4,26 +4,26 @@ import semver from 'semver'; import lodash from 'lodash'; -import * as durations from '../util/durations/index.js'; -import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.js'; -import * as Registration from '../util/registration.js'; -import { createLogger } from '../logging/log.js'; -import * as Errors from '../types/errors.js'; -import { HTTPError } from '../types/HTTPError.js'; -import { drop } from '../util/drop.js'; +import * as durations from '../util/durations/index.std.js'; +import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.std.js'; +import * as Registration from '../util/registration.preload.js'; +import { createLogger } from '../logging/log.std.js'; +import * as Errors from '../types/errors.std.js'; +import { HTTPError } from '../types/HTTPError.std.js'; +import { drop } from '../util/drop.std.js'; import { writeNewAttachmentData, processNewAttachment, -} from '../util/migrations.js'; -import { strictAssert } from '../util/assert.js'; -import type { MessageAttributesType } from '../model-types.js'; -import { ReadStatus } from '../messages/MessageReadStatus.js'; -import { incrementMessageCounter } from '../util/incrementMessageCounter.js'; -import { SeenStatus } from '../MessageSeenStatus.js'; -import { saveNewMessageBatcher } from '../util/messageBatcher.js'; -import { generateMessageId } from '../util/generateMessageId.js'; -import type { RawBodyRange } from '../types/BodyRange.js'; -import { BodyRange } from '../types/BodyRange.js'; +} from '../util/migrations.preload.js'; +import { strictAssert } from '../util/assert.std.js'; +import type { MessageAttributesType } from '../model-types.d.ts'; +import { ReadStatus } from '../messages/MessageReadStatus.std.js'; +import { incrementMessageCounter } from '../util/incrementMessageCounter.preload.js'; +import { SeenStatus } from '../MessageSeenStatus.std.js'; +import { saveNewMessageBatcher } from '../util/messageBatcher.preload.js'; +import { generateMessageId } from '../util/generateMessageId.node.js'; +import type { RawBodyRange } from '../types/BodyRange.std.js'; +import { BodyRange } from '../types/BodyRange.std.js'; import type { ReleaseNotesManifestResponseType, ReleaseNoteResponseType, @@ -33,12 +33,12 @@ import type { getReleaseNoteImageAttachment as doGetReleaseNoteImageAttachment, getReleaseNotesManifest as doGetReleaseNotesManifest, getReleaseNotesManifestHash as doGetReleaseNotesManifestHash, -} from '../textsecure/WebAPI.js'; -import type { WithRequiredProperties } from '../types/Util.js'; -import { MessageModel } from '../models/messages.js'; -import { stringToMIMEType } from '../types/MIME.js'; -import { isNotNil } from '../util/isNotNil.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from '../textsecure/WebAPI.preload.js'; +import type { WithRequiredProperties } from '../types/Util.std.js'; +import { MessageModel } from '../models/messages.preload.js'; +import { stringToMIMEType } from '../types/MIME.std.js'; +import { isNotNil } from '../util/isNotNil.std.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const { last } = lodash; diff --git a/ts/services/retryPlaceholders.ts b/ts/services/retryPlaceholders.ts index a3360f72a4..a7a253f56c 100644 --- a/ts/services/retryPlaceholders.ts +++ b/ts/services/retryPlaceholders.ts @@ -3,10 +3,10 @@ import { z } from 'zod'; import lodash from 'lodash'; -import { createLogger } from '../logging/log.js'; -import { aciSchema } from '../types/ServiceId.js'; -import { safeParseStrict } from '../util/schemas.js'; -import { HOUR } from '../util/durations/index.js'; +import { createLogger } from '../logging/log.std.js'; +import { aciSchema } from '../types/ServiceId.std.js'; +import { safeParseStrict } from '../util/schemas.std.js'; +import { HOUR } from '../util/durations/index.std.js'; import type { StorageInterface } from '../types/Storage.d.ts'; const { groupBy } = lodash; diff --git a/ts/services/senderCertificate.ts b/ts/services/senderCertificate.ts index 456fd4934e..190395ec24 100644 --- a/ts/services/senderCertificate.ts +++ b/ts/services/senderCertificate.ts @@ -3,22 +3,25 @@ import { SenderCertificate } from '@signalapp/libsignal-client'; -import type { SerializedCertificateType } from '../textsecure/OutgoingMessage.js'; +import type { SerializedCertificateType } from '../textsecure/OutgoingMessage.preload.js'; import { SenderCertificateMode, serializedCertificateSchema, -} from '../textsecure/OutgoingMessage.js'; -import * as Bytes from '../Bytes.js'; -import { assertDev } from '../util/assert.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { waitForOnline } from '../util/waitForOnline.js'; -import { createLogger } from '../logging/log.js'; +} from '../textsecure/OutgoingMessage.preload.js'; +import * as Bytes from '../Bytes.std.js'; +import { assertDev } from '../util/assert.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { waitForOnline } from '../util/waitForOnline.dom.js'; +import { createLogger } from '../logging/log.std.js'; import type { StorageInterface } from '../types/Storage.d.ts'; -import * as Errors from '../types/errors.js'; -import type { isOnline, getSenderCertificate } from '../textsecure/WebAPI.js'; -import { safeParseUnknown } from '../util/schemas.js'; -import { isInFuture } from '../util/timestamp.js'; -import { HOUR } from '../util/durations/constants.js'; +import * as Errors from '../types/errors.std.js'; +import type { + isOnline, + getSenderCertificate, +} from '../textsecure/WebAPI.preload.js'; +import { safeParseUnknown } from '../util/schemas.std.js'; +import { isInFuture } from '../util/timestamp.std.js'; +import { HOUR } from '../util/durations/constants.std.js'; const log = createLogger('senderCertificate'); diff --git a/ts/services/singleServePromise.ts b/ts/services/singleServePromise.ts index 61af5f31b6..fef05df19f 100644 --- a/ts/services/singleServePromise.ts +++ b/ts/services/singleServePromise.ts @@ -3,7 +3,7 @@ import { v4 as generateUuid } from 'uuid'; -import type { ExplodePromiseResultType } from '../util/explodePromise.js'; +import type { ExplodePromiseResultType } from '../util/explodePromise.std.js'; export type SingleServePromiseIdString = string & { __single_serve: never }; diff --git a/ts/services/storage.ts b/ts/services/storage.ts index c4de252e7e..ab8dd910d8 100644 --- a/ts/services/storage.ts +++ b/ts/services/storage.ts @@ -5,8 +5,8 @@ import lodash from 'lodash'; import pMap from 'p-map'; import Long from 'long'; -import { DataReader, DataWriter } from '../sql/Client.js'; -import * as Bytes from '../Bytes.js'; +import { DataReader, DataWriter } from '../sql/Client.preload.js'; +import * as Bytes from '../Bytes.std.js'; import { getRandomBytes, deriveStorageItemKey, @@ -15,7 +15,7 @@ import { decryptProfile, deriveMasterKeyFromGroupV1, deriveStorageServiceKey, -} from '../Crypto.js'; +} from '../Crypto.node.js'; import { mergeAccountRecord, mergeContactRecord, @@ -36,30 +36,30 @@ import { toChatFolderRecord, mergeChatFolderRecord, mergeNotificationProfileRecord, -} from './storageRecordOps.js'; -import type { MergeResultType } from './storageRecordOps.js'; -import { MAX_READ_KEYS } from './storageConstants.js'; -import type { ConversationModel } from '../models/conversations.js'; -import { strictAssert } from '../util/assert.js'; -import { drop } from '../util/drop.js'; -import { dropNull } from '../util/dropNull.js'; -import * as durations from '../util/durations/index.js'; -import { BackOff } from '../util/BackOff.js'; -import { storageJobQueue } from '../util/JobQueue.js'; -import { sleep } from '../util/sleep.js'; -import { isMoreRecentThan, isOlderThan } from '../util/timestamp.js'; -import { map, filter } from '../util/iterables.js'; -import { getMessageQueueTime } from '../util/getMessageQueueTime.js'; -import { ourProfileKeyService } from './ourProfileKey.js'; +} from './storageRecordOps.preload.js'; +import type { MergeResultType } from './storageRecordOps.preload.js'; +import { MAX_READ_KEYS } from './storageConstants.std.js'; +import type { ConversationModel } from '../models/conversations.preload.js'; +import { strictAssert } from '../util/assert.std.js'; +import { drop } from '../util/drop.std.js'; +import { dropNull } from '../util/dropNull.std.js'; +import * as durations from '../util/durations/index.std.js'; +import { BackOff } from '../util/BackOff.std.js'; +import { storageJobQueue } from '../util/JobQueue.std.js'; +import { sleep } from '../util/sleep.std.js'; +import { isMoreRecentThan, isOlderThan } from '../util/timestamp.std.js'; +import { map, filter } from '../util/iterables.std.js'; +import { getMessageQueueTime } from '../util/getMessageQueueTime.dom.js'; +import { ourProfileKeyService } from './ourProfileKey.std.js'; import { ConversationTypes, isDirectConversation, typeofConversation, -} from '../util/whatTypeOfConversation.js'; -import { SignalService as Proto } from '../protobuf/index.js'; -import { createLogger } from '../logging/log.js'; -import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue.js'; -import * as Errors from '../types/errors.js'; +} from '../util/whatTypeOfConversation.dom.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue.preload.js'; +import * as Errors from '../types/errors.std.js'; import type { ExtendedStorageID, RemoteRecord, @@ -70,36 +70,39 @@ import { getStorageCredentials, getStorageManifest, getStorageRecords, -} from '../textsecure/WebAPI.js'; -import { MessageSender } from '../textsecure/SendMessage.js'; +} from '../textsecure/WebAPI.preload.js'; +import { MessageSender } from '../textsecure/SendMessage.preload.js'; import type { StoryDistributionWithMembersType, StorageServiceFieldsType, StickerPackType, UninstalledStickerPackType, -} from '../sql/Interface.js'; -import { MY_STORY_ID } from '../types/Stories.js'; -import { isNotNil } from '../util/isNotNil.js'; -import { isSignalConversation } from '../util/isSignalConversation.js'; -import { redactExtendedStorageID, redactStorageID } from '../util/privacy.js'; +} from '../sql/Interface.std.js'; +import { MY_STORY_ID } from '../types/Stories.std.js'; +import { isNotNil } from '../util/isNotNil.std.js'; +import { isSignalConversation } from '../util/isSignalConversation.dom.js'; +import { + redactExtendedStorageID, + redactStorageID, +} from '../util/privacy.node.js'; import type { CallLinkRecord, DefunctCallLinkType, PendingCallLinkType, -} from '../types/CallLink.js'; +} from '../types/CallLink.std.js'; import { callLinkFromRecord, getRoomIdFromRootKeyString, -} from '../util/callLinksRingrtc.js'; -import { fromPniUuidBytesOrUntaggedString } from '../util/ServiceId.js'; -import { isDone as isRegistrationDone } from '../util/registration.js'; -import { callLinkRefreshJobQueue } from '../jobs/callLinkRefreshJobQueue.js'; -import { isMockEnvironment } from '../environment.js'; -import { validateConversation } from '../util/validateConversation.js'; -import type { ChatFolder } from '../types/ChatFolder.js'; -import { isCurrentAllChatFolder } from '../types/CurrentChatFolders.js'; -import type { NotificationProfileType } from '../types/NotificationProfile.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from '../util/callLinksRingrtc.node.js'; +import { fromPniUuidBytesOrUntaggedString } from '../util/ServiceId.node.js'; +import { isDone as isRegistrationDone } from '../util/registration.preload.js'; +import { callLinkRefreshJobQueue } from '../jobs/callLinkRefreshJobQueue.preload.js'; +import { isMockEnvironment } from '../environment.std.js'; +import { validateConversation } from '../util/validateConversation.dom.js'; +import type { ChatFolder } from '../types/ChatFolder.std.js'; +import { isCurrentAllChatFolder } from '../types/CurrentChatFolders.std.js'; +import type { NotificationProfileType } from '../types/NotificationProfile.std.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const { debounce, isNumber, chunk } = lodash; diff --git a/ts/services/storageRecordOps.ts b/ts/services/storageRecordOps.ts index 644fb4a146..cf93029583 100644 --- a/ts/services/storageRecordOps.ts +++ b/ts/services/storageRecordOps.ts @@ -5,72 +5,72 @@ import lodash, { omit, partition, without } from 'lodash'; import Long from 'long'; import { ServiceId } from '@signalapp/libsignal-client'; -import { uuidToBytes, bytesToUuid } from '../util/uuidToBytes.js'; -import { deriveMasterKeyFromGroupV1 } from '../Crypto.js'; -import * as Bytes from '../Bytes.js'; +import { uuidToBytes, bytesToUuid } from '../util/uuidToBytes.std.js'; +import { deriveMasterKeyFromGroupV1 } from '../Crypto.node.js'; +import * as Bytes from '../Bytes.std.js'; import { deriveGroupFields, waitThenMaybeUpdateGroup, waitThenRespondToGroupV2Migration, -} from '../groups.js'; -import { assertDev, strictAssert } from '../util/assert.js'; -import { dropNull } from '../util/dropNull.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { isNotNil } from '../util/isNotNil.js'; +} from '../groups.preload.js'; +import { assertDev, strictAssert } from '../util/assert.std.js'; +import { dropNull } from '../util/dropNull.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { isNotNil } from '../util/isNotNil.std.js'; import { PhoneNumberSharingMode, parsePhoneNumberSharingMode, -} from '../types/PhoneNumberSharingMode.js'; +} from '../types/PhoneNumberSharingMode.std.js'; import { PhoneNumberDiscoverability, parsePhoneNumberDiscoverability, -} from '../util/phoneNumberDiscoverability.js'; -import { arePinnedConversationsEqual } from '../util/arePinnedConversationsEqual.js'; -import type { ConversationModel } from '../models/conversations.js'; +} from '../util/phoneNumberDiscoverability.std.js'; +import { arePinnedConversationsEqual } from '../util/arePinnedConversationsEqual.node.js'; +import type { ConversationModel } from '../models/conversations.preload.js'; import { getSafeLongFromTimestamp, getTimestampFromLong, -} from '../util/timestampLongUtils.js'; -import { canHaveUsername } from '../util/getTitle.js'; +} from '../util/timestampLongUtils.std.js'; +import { canHaveUsername } from '../util/getTitle.preload.js'; import { get as getUniversalExpireTimer, set as setUniversalExpireTimer, -} from '../util/universalExpireTimer.js'; -import { ourProfileKeyService } from './ourProfileKey.js'; +} from '../util/universalExpireTimer.preload.js'; +import { ourProfileKeyService } from './ourProfileKey.std.js'; import { isDirectConversation, isGroupV1, isGroupV2, -} from '../util/whatTypeOfConversation.js'; -import { DurationInSeconds } from '../util/durations/index.js'; -import * as preferredReactionEmoji from '../reactions/preferredReactionEmoji.js'; -import { SignalService as Proto } from '../protobuf/index.js'; -import { createLogger } from '../logging/log.js'; -import { normalizeStoryDistributionId } from '../types/StoryDistributionId.js'; -import type { StoryDistributionIdString } from '../types/StoryDistributionId.js'; -import type { ServiceIdString } from '../types/ServiceId.js'; +} from '../util/whatTypeOfConversation.dom.js'; +import { DurationInSeconds } from '../util/durations/index.std.js'; +import * as preferredReactionEmoji from '../reactions/preferredReactionEmoji.std.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { normalizeStoryDistributionId } from '../types/StoryDistributionId.std.js'; +import type { StoryDistributionIdString } from '../types/StoryDistributionId.std.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; import { ServiceIdKind, normalizeServiceId, toUntaggedPni, -} from '../types/ServiceId.js'; -import { isAciString } from '../util/isAciString.js'; -import * as Stickers from '../types/Stickers.js'; +} from '../types/ServiceId.std.js'; +import { isAciString } from '../util/isAciString.std.js'; +import * as Stickers from '../types/Stickers.preload.js'; import type { StoryDistributionWithMembersType, StickerPackInfoType, -} from '../sql/Interface.js'; -import { DataReader, DataWriter } from '../sql/Client.js'; -import { MY_STORY_ID, StorySendMode } from '../types/Stories.js'; -import { findAndDeleteOnboardingStoryIfExists } from '../util/findAndDeleteOnboardingStoryIfExists.js'; -import { downloadOnboardingStory } from '../util/downloadOnboardingStory.js'; -import { drop } from '../util/drop.js'; -import { redactExtendedStorageID } from '../util/privacy.js'; +} from '../sql/Interface.std.js'; +import { DataReader, DataWriter } from '../sql/Client.preload.js'; +import { MY_STORY_ID, StorySendMode } from '../types/Stories.std.js'; +import { findAndDeleteOnboardingStoryIfExists } from '../util/findAndDeleteOnboardingStoryIfExists.preload.js'; +import { downloadOnboardingStory } from '../util/downloadOnboardingStory.preload.js'; +import { drop } from '../util/drop.std.js'; +import { redactExtendedStorageID } from '../util/privacy.node.js'; import type { CallLinkRecord, DefunctCallLinkType, PendingCallLinkType, -} from '../types/CallLink.js'; +} from '../types/CallLink.std.js'; import { callLinkFromRecord, fromEpochBytes, @@ -78,16 +78,16 @@ import { getRoomIdFromRootKeyString, toRootKeyBytes, toEpochBytes, -} from '../util/callLinksRingrtc.js'; -import { fromAdminKeyBytes, toAdminKeyBytes } from '../util/callLinks.js'; -import { isOlderThan } from '../util/timestamp.js'; -import { getMessageQueueTime } from '../util/getMessageQueueTime.js'; -import { callLinkRefreshJobQueue } from '../jobs/callLinkRefreshJobQueue.js'; +} from '../util/callLinksRingrtc.node.js'; +import { fromAdminKeyBytes, toAdminKeyBytes } from '../util/callLinks.std.js'; +import { isOlderThan } from '../util/timestamp.std.js'; +import { getMessageQueueTime } from '../util/getMessageQueueTime.dom.js'; +import { callLinkRefreshJobQueue } from '../jobs/callLinkRefreshJobQueue.preload.js'; import { generateBackupsSubscriberData, saveBackupsSubscriberData, saveBackupTier, -} from '../util/backupSubscriptionData.js'; +} from '../util/backupSubscriptionData.preload.js'; import { toAciObject, toPniObject, @@ -95,39 +95,42 @@ import { fromServiceIdBinaryOrString, fromAciUuidBytesOrString, fromPniUuidBytesOrUntaggedString, -} from '../util/ServiceId.js'; -import { isProtoBinaryEncodingEnabled } from '../util/isProtoBinaryEncodingEnabled.js'; +} from '../util/ServiceId.node.js'; +import { isProtoBinaryEncodingEnabled } from '../util/isProtoBinaryEncodingEnabled.std.js'; import { getLinkPreviewSetting, getReadReceiptSetting, getSealedSenderIndicatorSetting, getTypingIndicatorSetting, -} from '../util/Settings.js'; -import { MessageRequestResponseSource } from '../types/MessageRequestResponseEvent.js'; -import type { ChatFolder, ChatFolderId } from '../types/ChatFolder.js'; +} from '../util/Settings.preload.js'; +import { MessageRequestResponseSource } from '../types/MessageRequestResponseEvent.std.js'; +import type { ChatFolder, ChatFolderId } from '../types/ChatFolder.std.js'; import { CHAT_FOLDER_DELETED_POSITION, ChatFolderType, -} from '../types/ChatFolder.js'; -import { deriveGroupID, deriveGroupSecretParams } from '../util/zkgroup.js'; -import { chatFolderCleanupService } from './expiring/chatFolderCleanupService.js'; -import { signalProtocolStore } from '../SignalProtocolStore.js'; +} from '../types/ChatFolder.std.js'; +import { + deriveGroupID, + deriveGroupSecretParams, +} from '../util/zkgroup.node.js'; +import { chatFolderCleanupService } from './expiring/chatFolderCleanupService.preload.js'; +import { signalProtocolStore } from '../SignalProtocolStore.preload.js'; import type { NotificationProfileOverride, NotificationProfileType, -} from '../types/NotificationProfile.js'; +} from '../types/NotificationProfile.std.js'; import { DEFAULT_PROFILE_COLOR, fromDayOfWeekArray, redactNotificationProfileId, toDayOfWeekArray, -} from '../types/NotificationProfile.js'; +} from '../types/NotificationProfile.std.js'; import { generateNotificationProfileId, normalizeNotificationProfileId, -} from '../types/NotificationProfile-node.js'; -import { itemStorage } from '../textsecure/Storage.js'; -import { onHasStoriesDisabledChange } from '../textsecure/WebAPI.js'; +} from '../types/NotificationProfile-node.node.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; +import { onHasStoriesDisabledChange } from '../textsecure/WebAPI.preload.js'; const { isEqual } = lodash; diff --git a/ts/services/storyLoader.ts b/ts/services/storyLoader.ts index 6ea3cae32d..e0d1ca327f 100644 --- a/ts/services/storyLoader.ts +++ b/ts/services/storyLoader.ts @@ -3,22 +3,22 @@ import lodash from 'lodash'; import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; -import type { StoryDataType } from '../state/ducks/stories.js'; -import * as durations from '../util/durations/index.js'; -import { createLogger } from '../logging/log.js'; -import { DataReader } from '../sql/Client.js'; -import type { GetAllStoriesResultType } from '../sql/Interface.js'; +import type { StoryDataType } from '../state/ducks/stories.preload.js'; +import * as durations from '../util/durations/index.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { DataReader } from '../sql/Client.preload.js'; +import type { GetAllStoriesResultType } from '../sql/Interface.std.js'; import { getAttachmentsForMessage, getPropsForAttachment, -} from '../state/selectors/message.js'; -import type { LinkPreviewType } from '../types/message/LinkPreviews.js'; -import { isNotNil } from '../util/isNotNil.js'; -import { strictAssert } from '../util/assert.js'; -import { dropNull } from '../util/dropNull.js'; -import { DurationInSeconds } from '../util/durations/index.js'; -import { SIGNAL_ACI } from '../types/SignalConversation.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from '../state/selectors/message.preload.js'; +import type { LinkPreviewType } from '../types/message/LinkPreviews.std.js'; +import { isNotNil } from '../util/isNotNil.std.js'; +import { strictAssert } from '../util/assert.std.js'; +import { dropNull } from '../util/dropNull.std.js'; +import { DurationInSeconds } from '../util/durations/index.std.js'; +import { SIGNAL_ACI } from '../types/SignalConversation.std.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const { pick } = lodash; diff --git a/ts/services/tapToViewMessagesDeletionService.ts b/ts/services/tapToViewMessagesDeletionService.ts index 7b70e2b681..bae104738d 100644 --- a/ts/services/tapToViewMessagesDeletionService.ts +++ b/ts/services/tapToViewMessagesDeletionService.ts @@ -2,17 +2,17 @@ // SPDX-License-Identifier: AGPL-3.0-only import lodash from 'lodash'; -import { DataReader } from '../sql/Client.js'; -import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.js'; -import { getMessageQueueTime } from '../util/getMessageQueueTime.js'; -import * as Errors from '../types/errors.js'; -import { strictAssert } from '../util/assert.js'; -import { toBoundedDate } from '../util/timestamp.js'; -import { getMessageIdForLogging } from '../util/idForLogging.js'; -import { eraseMessageContents } from '../util/cleanup.js'; -import { drop } from '../util/drop.js'; -import { MessageModel } from '../models/messages.js'; -import { createLogger } from '../logging/log.js'; +import { DataReader } from '../sql/Client.preload.js'; +import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.std.js'; +import { getMessageQueueTime } from '../util/getMessageQueueTime.dom.js'; +import * as Errors from '../types/errors.std.js'; +import { strictAssert } from '../util/assert.std.js'; +import { toBoundedDate } from '../util/timestamp.std.js'; +import { getMessageIdForLogging } from '../util/idForLogging.preload.js'; +import { eraseMessageContents } from '../util/cleanup.preload.js'; +import { drop } from '../util/drop.std.js'; +import { MessageModel } from '../models/messages.preload.js'; +import { createLogger } from '../logging/log.std.js'; const { debounce } = lodash; diff --git a/ts/services/updateListener.ts b/ts/services/updateListener.ts index 442ec1c652..41143b8e9e 100644 --- a/ts/services/updateListener.ts +++ b/ts/services/updateListener.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import { ipcRenderer } from 'electron'; -import type { DialogType } from '../types/Dialogs.js'; +import type { DialogType } from '../types/Dialogs.std.js'; import type { UpdateDialogOptionsType, ShowUpdateDialogActionType, -} from '../state/ducks/updates.js'; +} from '../state/ducks/updates.preload.js'; type UpdatesActions = { showUpdateDialog: ( diff --git a/ts/services/userLoader.ts b/ts/services/userLoader.ts index de3c1d896e..5bfdc91373 100644 --- a/ts/services/userLoader.ts +++ b/ts/services/userLoader.ts @@ -1,12 +1,12 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { strictAssert } from '../util/assert.js'; -import { getThemeType } from '../util/getThemeType.js'; +import { strictAssert } from '../util/assert.std.js'; +import { getThemeType } from '../util/getThemeType.dom.js'; -import type { MenuOptionsType } from '../types/menu.js'; -import type { MainWindowStatsType } from '../windows/context.js'; -import type { ThemeType } from '../types/Util.js'; +import type { MenuOptionsType } from '../types/menu.std.js'; +import type { MainWindowStatsType } from '../windows/context.preload.js'; +import type { ThemeType } from '../types/Util.std.js'; let mainWindowStats: MainWindowStatsType | undefined; let menuOptions: MenuOptionsType | undefined; diff --git a/ts/services/username.ts b/ts/services/username.ts index 0cf843805d..1f97419347 100644 --- a/ts/services/username.ts +++ b/ts/services/username.ts @@ -7,34 +7,34 @@ import { ErrorCode, } from '@signalapp/libsignal-client'; -import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue.js'; -import { strictAssert } from '../util/assert.js'; -import { sleep } from '../util/sleep.js'; -import { getMinNickname, getMaxNickname } from '../util/Username.js'; -import { bytesToUuid, uuidToBytes } from '../util/uuidToBytes.js'; -import type { UsernameReservationType } from '../types/Username.js'; +import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue.preload.js'; +import { strictAssert } from '../util/assert.std.js'; +import { sleep } from '../util/sleep.std.js'; +import { getMinNickname, getMaxNickname } from '../util/Username.dom.js'; +import { bytesToUuid, uuidToBytes } from '../util/uuidToBytes.std.js'; +import type { UsernameReservationType } from '../types/Username.std.js'; import { ReserveUsernameError, ConfirmUsernameResult, getNickname, getDiscriminator, isCaseChange, -} from '../types/Username.js'; -import * as Errors from '../types/errors.js'; -import { createLogger } from '../logging/log.js'; -import { MessageSender } from '../textsecure/SendMessage.js'; +} from '../types/Username.std.js'; +import * as Errors from '../types/errors.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { MessageSender } from '../textsecure/SendMessage.preload.js'; import { reserveUsername as doReserveUsername, replaceUsernameLink, confirmUsername as doConfirmUsername, deleteUsername as doDeleteUsername, resolveUsernameLink, -} from '../textsecure/WebAPI.js'; -import { HTTPError } from '../types/HTTPError.js'; -import { findRetryAfterTimeFromError } from '../jobs/helpers/findRetryAfterTimeFromError.js'; -import * as Bytes from '../Bytes.js'; -import { storageServiceUploadJob } from './storage.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from '../textsecure/WebAPI.preload.js'; +import { HTTPError } from '../types/HTTPError.std.js'; +import { findRetryAfterTimeFromError } from '../jobs/helpers/findRetryAfterTimeFromError.std.js'; +import * as Bytes from '../Bytes.std.js'; +import { storageServiceUploadJob } from './storage.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const log = createLogger('username'); diff --git a/ts/services/usernameIntegrity.ts b/ts/services/usernameIntegrity.ts index 5403f7f867..65c8b01b7a 100644 --- a/ts/services/usernameIntegrity.ts +++ b/ts/services/usernameIntegrity.ts @@ -4,23 +4,23 @@ import pTimeout from 'p-timeout'; import { usernames } from '@signalapp/libsignal-client'; -import * as Errors from '../types/errors.js'; -import { whoami } from '../textsecure/WebAPI.js'; -import { isDone as isRegistrationDone } from '../util/registration.js'; -import { getConversation } from '../util/getConversation.js'; -import { MINUTE, DAY } from '../util/durations/index.js'; -import { drop } from '../util/drop.js'; -import { explodePromise } from '../util/explodePromise.js'; -import { BackOff, FIBONACCI_TIMEOUTS } from '../util/BackOff.js'; -import { storageJobQueue } from '../util/JobQueue.js'; -import { getProfile } from '../util/getProfile.js'; -import { isSharingPhoneNumberWithEverybody } from '../util/phoneNumberSharingMode.js'; -import { bytesToUuid } from '../util/uuidToBytes.js'; -import { createLogger } from '../logging/log.js'; -import * as Bytes from '../Bytes.js'; -import { runStorageServiceSyncJob } from './storage.js'; -import { writeProfile } from './writeProfile.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import * as Errors from '../types/errors.std.js'; +import { whoami } from '../textsecure/WebAPI.preload.js'; +import { isDone as isRegistrationDone } from '../util/registration.preload.js'; +import { getConversation } from '../util/getConversation.preload.js'; +import { MINUTE, DAY } from '../util/durations/index.std.js'; +import { drop } from '../util/drop.std.js'; +import { explodePromise } from '../util/explodePromise.std.js'; +import { BackOff, FIBONACCI_TIMEOUTS } from '../util/BackOff.std.js'; +import { storageJobQueue } from '../util/JobQueue.std.js'; +import { getProfile } from '../util/getProfile.preload.js'; +import { isSharingPhoneNumberWithEverybody } from '../util/phoneNumberSharingMode.preload.js'; +import { bytesToUuid } from '../util/uuidToBytes.std.js'; +import { createLogger } from '../logging/log.std.js'; +import * as Bytes from '../Bytes.std.js'; +import { runStorageServiceSyncJob } from './storage.preload.js'; +import { writeProfile } from './writeProfile.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const log = createLogger('usernameIntegrity'); diff --git a/ts/services/writeProfile.ts b/ts/services/writeProfile.ts index 71e874e464..d660719272 100644 --- a/ts/services/writeProfile.ts +++ b/ts/services/writeProfile.ts @@ -1,29 +1,29 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { DataWriter } from '../sql/Client.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import { putProfile, uploadAvatar } from '../textsecure/WebAPI.js'; -import * as Errors from '../types/errors.js'; -import { createLogger } from '../logging/log.js'; -import { computeHash } from '../Crypto.js'; -import { encryptProfileData } from '../util/encryptProfileData.js'; -import { getProfile } from '../util/getProfile.js'; -import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue.js'; -import { strictAssert } from '../util/assert.js'; +import { DataWriter } from '../sql/Client.preload.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import { putProfile, uploadAvatar } from '../textsecure/WebAPI.preload.js'; +import * as Errors from '../types/errors.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { computeHash } from '../Crypto.node.js'; +import { encryptProfileData } from '../util/encryptProfileData.preload.js'; +import { getProfile } from '../util/getProfile.preload.js'; +import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue.preload.js'; +import { strictAssert } from '../util/assert.std.js'; import { writeNewAttachmentData, deleteAttachmentData, -} from '../util/migrations.js'; -import { isWhitespace } from '../util/whitespaceStringUtil.js'; -import { imagePathToBytes } from '../util/imagePathToBytes.js'; -import { getLocalAvatarUrl } from '../util/avatarUtils.js'; +} from '../util/migrations.preload.js'; +import { isWhitespace } from '../util/whitespaceStringUtil.std.js'; +import { imagePathToBytes } from '../util/imagePathToBytes.dom.js'; +import { getLocalAvatarUrl } from '../util/avatarUtils.preload.js'; import type { AvatarUpdateOptionsType, AvatarUpdateType, -} from '../types/Avatar.js'; -import { MessageSender } from '../textsecure/SendMessage.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from '../types/Avatar.std.js'; +import { MessageSender } from '../textsecure/SendMessage.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const log = createLogger('writeProfile'); diff --git a/ts/setAppLoadingScreenMessage.ts b/ts/setAppLoadingScreenMessage.ts index 515bd81aba..f22d6715aa 100644 --- a/ts/setAppLoadingScreenMessage.ts +++ b/ts/setAppLoadingScreenMessage.ts @@ -1,7 +1,7 @@ // Copyright 2018 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LocalizerType } from './types/Util.js'; +import type { LocalizerType } from './types/Util.std.js'; const DISPLAY_THRESHOLD = 3000; // milliseconds const SELECTOR = '.app-loading-screen .message'; diff --git a/ts/shims/deleteAllData.ts b/ts/shims/deleteAllData.ts index 478ac6711c..d4831db496 100644 --- a/ts/shims/deleteAllData.ts +++ b/ts/shims/deleteAllData.ts @@ -1,11 +1,11 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log.js'; -import { DataWriter } from '../sql/Client.js'; -import { deleteAllLogs } from '../util/deleteAllLogs.js'; -import * as Errors from '../types/errors.js'; -import { unlink } from '../textsecure/WebAPI.js'; +import { createLogger } from '../logging/log.std.js'; +import { DataWriter } from '../sql/Client.preload.js'; +import { deleteAllLogs } from '../util/deleteAllLogs.preload.js'; +import * as Errors from '../types/errors.std.js'; +import { unlink } from '../textsecure/WebAPI.preload.js'; const log = createLogger('deleteAllData'); diff --git a/ts/shims/dispatchItemsMiddleware.ts b/ts/shims/dispatchItemsMiddleware.ts index 54a683fe6a..9891e20ca8 100644 --- a/ts/shims/dispatchItemsMiddleware.ts +++ b/ts/shims/dispatchItemsMiddleware.ts @@ -8,7 +8,7 @@ import { COLORS_CHANGED, COLOR_SELECTED, SET_VOICE_NOTE_PLAYBACK_RATE, -} from '../state/ducks/conversations.js'; +} from '../state/ducks/conversations.preload.js'; export const dispatchItemsMiddleware: Middleware = ({ getState }) => diff --git a/ts/shims/events.ts b/ts/shims/events.ts index 739413dc49..8c0be29b9e 100644 --- a/ts/shims/events.ts +++ b/ts/shims/events.ts @@ -1,9 +1,9 @@ // Copyright 2019 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import createTaskWithTimeout from '../textsecure/TaskWithTimeout.js'; -import { MINUTE } from '../util/durations/index.js'; -import { explodePromise } from '../util/explodePromise.js'; +import createTaskWithTimeout from '../textsecure/TaskWithTimeout.std.js'; +import { MINUTE } from '../util/durations/index.std.js'; +import { explodePromise } from '../util/explodePromise.std.js'; // Matching Whisper.events.trigger API // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/ts/shims/getUserTheme.ts b/ts/shims/getUserTheme.ts index 77f14129a5..5bb99d8a11 100644 --- a/ts/shims/getUserTheme.ts +++ b/ts/shims/getUserTheme.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ThemeType } from '../types/Util.js'; -import { getTheme } from '../state/selectors/user.js'; +import type { ThemeType } from '../types/Util.std.js'; +import { getTheme } from '../state/selectors/user.std.js'; export function getUserTheme(): ThemeType { return getTheme(window.reduxStore.getState()); diff --git a/ts/shims/renderClearingDataView.tsx b/ts/shims/renderClearingDataView.tsx index bbc43e0928..e838c43a33 100644 --- a/ts/shims/renderClearingDataView.tsx +++ b/ts/shims/renderClearingDataView.tsx @@ -4,11 +4,11 @@ import React, { StrictMode } from 'react'; import { createRoot } from 'react-dom/client'; -import { ClearingData } from '../components/ClearingData.js'; -import { strictAssert } from '../util/assert.js'; -import { deleteAllData } from './deleteAllData.js'; -import { FunDefaultEnglishEmojiLocalizationProvider } from '../components/fun/FunEmojiLocalizationProvider.js'; -import { AxoProvider } from '../axo/AxoProvider.js'; +import { ClearingData } from '../components/ClearingData.dom.js'; +import { strictAssert } from '../util/assert.std.js'; +import { deleteAllData } from './deleteAllData.preload.js'; +import { FunDefaultEnglishEmojiLocalizationProvider } from '../components/fun/FunEmojiLocalizationProvider.dom.js'; +import { AxoProvider } from '../axo/AxoProvider.dom.js'; export function renderClearingDataView(): void { const appContainer = document.getElementById('app-container'); diff --git a/ts/shims/storage.ts b/ts/shims/storage.ts index 2050fc292b..2f1f9d1cfd 100644 --- a/ts/shims/storage.ts +++ b/ts/shims/storage.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { StorageAccessType } from '../types/Storage.d.ts'; -import { itemStorage } from '../textsecure/Storage.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; // Matching storage.put API export async function put( diff --git a/ts/shims/textsecure.ts b/ts/shims/textsecure.ts index 83b08cd22b..d13ff3203f 100644 --- a/ts/shims/textsecure.ts +++ b/ts/shims/textsecure.ts @@ -1,10 +1,10 @@ // Copyright 2019 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log.js'; -import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue.js'; -import * as Errors from '../types/errors.js'; -import { MessageSender } from '../textsecure/SendMessage.js'; +import { createLogger } from '../logging/log.std.js'; +import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue.preload.js'; +import * as Errors from '../types/errors.std.js'; +import { MessageSender } from '../textsecure/SendMessage.preload.js'; const log = createLogger('textsecure'); diff --git a/ts/shims/themeChanged.ts b/ts/shims/themeChanged.ts index d4e54eda45..5496123a1c 100644 --- a/ts/shims/themeChanged.ts +++ b/ts/shims/themeChanged.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { getThemeType } from '../util/getThemeType.js'; +import { getThemeType } from '../util/getThemeType.dom.js'; export async function themeChanged(): Promise { if (window.reduxActions && window.reduxActions.user) { diff --git a/ts/signal.ts b/ts/signal.ts index 3a1402859d..2fed91d80d 100644 --- a/ts/signal.ts +++ b/ts/signal.ts @@ -3,15 +3,15 @@ // The idea with this file is to make it webpackable for the style guide -import OS from './util/os/osMain.js'; -import { isProduction } from './util/version.js'; -import { DataReader, DataWriter } from './sql/Client.js'; +import OS from './util/os/osMain.node.js'; +import { isProduction } from './util/version.std.js'; +import { DataReader, DataWriter } from './sql/Client.preload.js'; // Processes / Services -import { calling } from './services/calling.js'; -import * as storage from './services/storage.js'; -import { backupsService } from './services/backups/index.js'; -import * as donations from './services/donations.js'; +import { calling } from './services/calling.preload.js'; +import * as storage from './services/storage.preload.js'; +import { backupsService } from './services/backups/index.preload.js'; +import * as donations from './services/donations.preload.js'; import type { SignalCoreType } from './window.d.ts'; diff --git a/ts/sql/Client.ts b/ts/sql/Client.ts index 96323d3827..59d1bed6be 100644 --- a/ts/sql/Client.ts +++ b/ts/sql/Client.ts @@ -9,28 +9,33 @@ import type { ReadonlyDeep } from 'type-fest'; // Note: nothing imported here can come back and require Client.ts, and that includes // their imports too. That circularity causes problems. Anything that would do that needs // to be passed in, like cleanupMessages below. -import * as Bytes from '../Bytes.js'; -import { createLogger } from '../logging/log.js'; -import * as Errors from '../types/errors.js'; +import * as Bytes from '../Bytes.std.js'; +import { createLogger } from '../logging/log.std.js'; +import * as Errors from '../types/errors.std.js'; -import { deleteExternalFiles } from '../types/Conversation.js'; -import { createBatcher } from '../util/batcher.js'; -import { assertDev, softAssert } from '../util/assert.js'; -import { mapObjectWithSpec } from '../util/mapObjectWithSpec.js'; -import { deleteAttachmentData } from '../util/migrations.js'; -import { cleanDataForIpc } from './cleanDataForIpc.js'; -import createTaskWithTimeout from '../textsecure/TaskWithTimeout.js'; -import { isValidUuid, isValidUuidV7 } from '../util/isValidUuid.js'; -import { formatJobForInsert } from '../jobs/formatJobForInsert.js'; -import { AccessType, ipcInvoke, doShutdown, removeDB } from './channels.js'; -import { getMessageIdForLogging } from '../util/idForLogging.js'; -import { incrementMessageCounter } from '../util/incrementMessageCounter.js'; -import { generateSnippetAroundMention } from '../util/search.js'; -import { drop } from '../util/drop.js'; +import { deleteExternalFiles } from '../types/Conversation.node.js'; +import { createBatcher } from '../util/batcher.std.js'; +import { assertDev, softAssert } from '../util/assert.std.js'; +import { mapObjectWithSpec } from '../util/mapObjectWithSpec.std.js'; +import { deleteAttachmentData } from '../util/migrations.preload.js'; +import { cleanDataForIpc } from './cleanDataForIpc.std.js'; +import createTaskWithTimeout from '../textsecure/TaskWithTimeout.std.js'; +import { isValidUuid, isValidUuidV7 } from '../util/isValidUuid.std.js'; +import { formatJobForInsert } from '../jobs/formatJobForInsert.std.js'; +import { + AccessType, + ipcInvoke, + doShutdown, + removeDB, +} from './channels.preload.js'; +import { getMessageIdForLogging } from '../util/idForLogging.preload.js'; +import { incrementMessageCounter } from '../util/incrementMessageCounter.preload.js'; +import { generateSnippetAroundMention } from '../util/search.std.js'; +import { drop } from '../util/drop.std.js'; -import type { ObjectMappingSpecType } from '../util/mapObjectWithSpec.js'; -import type { AciString, ServiceIdString } from '../types/ServiceId.js'; -import type { StoredJob } from '../jobs/types.js'; +import type { ObjectMappingSpecType } from '../util/mapObjectWithSpec.std.js'; +import type { AciString, ServiceIdString } from '../types/ServiceId.std.js'; +import type { StoredJob } from '../jobs/types.std.js'; import type { ClientInterfaceWrap, AdjacentMessagesByConversationOptionsType, @@ -61,14 +66,14 @@ import type { StoredKyberPreKeyType, ClientOnlyReadableInterface, ClientOnlyWritableInterface, -} from './Interface.js'; -import { AttachmentDownloadSource } from './Interface.js'; -import type { MessageAttributesType } from '../model-types.js'; -import type { AttachmentDownloadJobType } from '../types/AttachmentDownload.js'; +} from './Interface.std.js'; +import { AttachmentDownloadSource } from './Interface.std.js'; +import type { MessageAttributesType } from '../model-types.d.ts'; +import type { AttachmentDownloadJobType } from '../types/AttachmentDownload.std.js'; import { throttledUpdateBackupMediaDownloadProgress, updateBackupMediaDownloadProgress, -} from '../util/updateBackupMediaDownloadProgress.js'; +} from '../util/updateBackupMediaDownloadProgress.preload.js'; const { groupBy, isTypedArray, last, map, omit } = lodash; diff --git a/ts/sql/Interface.ts b/ts/sql/Interface.ts index c11c5e6c5a..b02d229e7c 100644 --- a/ts/sql/Interface.ts +++ b/ts/sql/Interface.ts @@ -4,63 +4,66 @@ import type { Database, RowType } from '@signalapp/sqlcipher'; import type { ReadonlyDeep } from 'type-fest'; -import { strictAssert } from '../util/assert.js'; +import { strictAssert } from '../util/assert.std.js'; import type { ConversationAttributesType, MessageAttributesType, SenderKeyInfoType, } from '../model-types.d.ts'; -import type { StoredJob } from '../jobs/types.js'; -import type { ReactionType, ReactionReadStatus } from '../types/Reactions.js'; +import type { StoredJob } from '../jobs/types.std.js'; +import type { + ReactionType, + ReactionReadStatus, +} from '../types/Reactions.std.js'; import type { ConversationColorType, CustomColorType, -} from '../types/Colors.js'; +} from '../types/Colors.std.js'; import type { StorageAccessType } from '../types/Storage.d.ts'; -import type { BytesToStrings } from '../types/Util.js'; -import type { QualifiedAddressStringType } from '../types/QualifiedAddress.js'; -import type { StoryDistributionIdString } from '../types/StoryDistributionId.js'; +import type { BytesToStrings } from '../types/Util.std.js'; +import type { QualifiedAddressStringType } from '../types/QualifiedAddress.std.js'; +import type { StoryDistributionIdString } from '../types/StoryDistributionId.std.js'; import type { AciString, PniString, ServiceIdString, -} from '../types/ServiceId.js'; -import type { BadgeType } from '../badges/types.js'; -import type { ReadStatus } from '../messages/MessageReadStatus.js'; -import type { RawBodyRange } from '../types/BodyRange.js'; -import type { MessageTimestamps } from '../state/ducks/conversations.js'; +} from '../types/ServiceId.std.js'; +import type { BadgeType } from '../badges/types.std.js'; +import type { ReadStatus } from '../messages/MessageReadStatus.std.js'; +import type { RawBodyRange } from '../types/BodyRange.std.js'; +import type { MessageTimestamps } from '../state/ducks/conversations.preload.js'; import type { CallHistoryDetails, CallHistoryFilter, CallHistoryGroup, CallHistoryPagination, CallLogEventTarget, -} from '../types/CallDisposition.js'; +} from '../types/CallDisposition.std.js'; import type { CallLinkRecord, CallLinkStateType, CallLinkType, DefunctCallLinkType, -} from '../types/CallLink.js'; +} from '../types/CallLink.std.js'; import type { AttachmentDownloadJobType, MessageAttachmentType, -} from '../types/AttachmentDownload.js'; +} from '../types/AttachmentDownload.std.js'; import type { GroupSendEndorsementsData, GroupSendMemberEndorsementRecord, -} from '../types/GroupSendEndorsements.js'; -import type { SyncTaskType } from '../util/syncTasks.js'; -import type { AttachmentBackupJobType } from '../types/AttachmentBackup.js'; -import type { AttachmentType } from '../types/Attachment.js'; -import type { MediaItemMessageType } from '../types/MediaItem.js'; -import type { GifType } from '../components/fun/panels/FunPanelGifs.js'; -import type { NotificationProfileType } from '../types/NotificationProfile.js'; -import type { DonationReceipt } from '../types/Donations.js'; -import type { InsertOrUpdateCallLinkFromSyncResult } from './server/callLinks.js'; -import type { ChatFolderId, ChatFolder } from '../types/ChatFolder.js'; -import type { CurrentChatFolder } from '../types/CurrentChatFolders.js'; +} from '../types/GroupSendEndorsements.std.js'; +import type { SyncTaskType } from '../util/syncTasks.preload.js'; +import type { AttachmentBackupJobType } from '../types/AttachmentBackup.std.js'; +import type { AttachmentType } from '../types/Attachment.std.js'; +import type { MediaItemMessageType } from '../types/MediaItem.std.js'; +import type { GifType } from '../components/fun/panels/FunPanelGifs.dom.js'; +import type { NotificationProfileType } from '../types/NotificationProfile.std.js'; +import type { DonationReceipt } from '../types/Donations.std.js'; +import type { InsertOrUpdateCallLinkFromSyncResult } from './server/callLinks.node.js'; +import type { ChatFolderId, ChatFolder } from '../types/ChatFolder.std.js'; +import type { CurrentChatFolder } from '../types/CurrentChatFolders.std.js'; export type ReadableDB = Database & { __readable_db: never }; export type WritableDB = ReadableDB & { __writable_db: never }; diff --git a/ts/sql/Server.ts b/ts/sql/Server.ts index a9aca67617..9957c2996e 100644 --- a/ts/sql/Server.ts +++ b/ts/sql/Server.ts @@ -15,41 +15,41 @@ import { z } from 'zod'; import type { Dictionary } from 'lodash'; import lodash from 'lodash'; -import { parseBadgeCategory } from '../badges/BadgeCategory.js'; +import { parseBadgeCategory } from '../badges/BadgeCategory.std.js'; import { parseBadgeImageTheme, type BadgeImageTheme, -} from '../badges/BadgeImageTheme.js'; -import type { BadgeImageType, BadgeType } from '../badges/types.js'; -import type { StoredJob } from '../jobs/types.js'; -import { formatCountForLogging } from '../logging/formatCountForLogging.js'; -import { ReadStatus } from '../messages/MessageReadStatus.js'; +} from '../badges/BadgeImageTheme.std.js'; +import type { BadgeImageType, BadgeType } from '../badges/types.std.js'; +import type { StoredJob } from '../jobs/types.std.js'; +import { formatCountForLogging } from '../logging/formatCountForLogging.std.js'; +import { ReadStatus } from '../messages/MessageReadStatus.std.js'; import type { GroupV2MemberType, MessageAttributesType, } from '../model-types.d.ts'; -import type { ReactionType } from '../types/Reactions.js'; -import { ReactionReadStatus } from '../types/Reactions.js'; -import type { AciString, ServiceIdString } from '../types/ServiceId.js'; -import { isServiceIdString } from '../types/ServiceId.js'; -import { STORAGE_UI_KEYS } from '../types/StorageUIKeys.js'; -import type { StoryDistributionIdString } from '../types/StoryDistributionId.js'; -import * as Errors from '../types/errors.js'; -import { assertDev, strictAssert } from '../util/assert.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { combineNames } from '../util/combineNames.js'; -import { consoleLogger } from '../util/consoleLogger.js'; +import type { ReactionType } from '../types/Reactions.std.js'; +import { ReactionReadStatus } from '../types/Reactions.std.js'; +import type { AciString, ServiceIdString } from '../types/ServiceId.std.js'; +import { isServiceIdString } from '../types/ServiceId.std.js'; +import { STORAGE_UI_KEYS } from '../types/StorageUIKeys.std.js'; +import type { StoryDistributionIdString } from '../types/StoryDistributionId.std.js'; +import * as Errors from '../types/errors.std.js'; +import { assertDev, strictAssert } from '../util/assert.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { combineNames } from '../util/combineNames.std.js'; +import { consoleLogger } from '../util/consoleLogger.std.js'; import { dropNull, shallowConvertUndefinedToNull, type ShallowNullToUndefined, type ShallowUndefinedToNull, -} from '../util/dropNull.js'; -import { isNormalNumber } from '../util/isNormalNumber.js'; -import { isNotNil } from '../util/isNotNil.js'; -import { parseIntOrThrow } from '../util/parseIntOrThrow.js'; -import { updateSchema } from './migrations/index.js'; -import type { JSONRows } from './util.js'; +} from '../util/dropNull.std.js'; +import { isNormalNumber } from '../util/isNormalNumber.std.js'; +import { isNotNil } from '../util/isNotNil.std.js'; +import { parseIntOrThrow } from '../util/parseIntOrThrow.std.js'; +import { updateSchema } from './migrations/index.node.js'; +import type { JSONRows } from './util.std.js'; import { batchMultiVarQuery, bulkAdd, @@ -70,32 +70,32 @@ import { sqlJoin, QueryFragment, convertOptionalBooleanToInteger, -} from './util.js'; +} from './util.std.js'; import { hydrateMessage, hydrateMessages, convertAttachmentDBFieldsToAttachmentType, getAttachmentReferencesForMessages, ROOT_MESSAGE_ATTACHMENT_EDIT_HISTORY_INDEX, -} from './hydration.js'; +} from './hydration.std.js'; -import { SeenStatus } from '../MessageSeenStatus.js'; +import { SeenStatus } from '../MessageSeenStatus.std.js'; import { attachmentBackupJobSchema, type AttachmentBackupJobType, -} from '../types/AttachmentBackup.js'; +} from '../types/AttachmentBackup.std.js'; import { attachmentDownloadJobSchema, type MessageAttachmentType, type AttachmentDownloadJobType, -} from '../types/AttachmentDownload.js'; +} from '../types/AttachmentDownload.std.js'; import type { CallHistoryDetails, CallHistoryFilter, CallHistoryGroup, CallHistoryPagination, CallLogEventTarget, -} from '../types/CallDisposition.js'; +} from '../types/CallDisposition.std.js'; import { CallDirection, CallHistoryFilterStatus, @@ -106,21 +106,21 @@ import { GroupCallStatus, callHistoryDetailsSchema, callHistoryGroupSchema, -} from '../types/CallDisposition.js'; -import { redactGenericText } from '../util/privacy.js'; +} from '../types/CallDisposition.std.js'; +import { redactGenericText } from '../util/privacy.node.js'; import { parseLoose, parseStrict, parseUnknown, safeParseUnknown, -} from '../util/schemas.js'; +} from '../util/schemas.std.js'; import { SNIPPET_LEFT_PLACEHOLDER, SNIPPET_RIGHT_PLACEHOLDER, SNIPPET_TRUNCATION_PLACEHOLDER, -} from '../util/search.js'; -import type { SyncTaskType } from '../util/syncTasks.js'; -import { MAX_SYNC_TASK_ATTEMPTS } from '../util/syncTasks.types.js'; +} from '../util/search.std.js'; +import type { SyncTaskType } from '../util/syncTasks.preload.js'; +import { MAX_SYNC_TASK_ATTEMPTS } from '../util/syncTasks.types.std.js'; import type { AdjacentMessagesByConversationOptionsType, BackupCdnMediaObjectType, @@ -191,13 +191,13 @@ import type { BackupAttachmentDownloadProgress, GetMessagesBetweenOptions, MaybeStaleCallHistory, -} from './Interface.js'; +} from './Interface.std.js'; import { AttachmentDownloadSource, MESSAGE_COLUMNS, MESSAGE_ATTACHMENT_COLUMNS, MESSAGE_NON_PRIMARY_KEY_COLUMNS, -} from './Interface.js'; +} from './Interface.std.js'; import { _removeAllCallLinks, beginDeleteAllCallLinks, @@ -222,21 +222,21 @@ import { updateCallLinkState, updateCallLinkStateAndEpoch, updateDefunctCallLink, -} from './server/callLinks.js'; +} from './server/callLinks.node.js'; import { _deleteAllDonationReceipts, createDonationReceipt, deleteDonationReceiptById, getAllDonationReceipts, getDonationReceiptById, -} from './server/donationReceipts.js'; +} from './server/donationReceipts.std.js'; import { deleteAllEndorsementsForGroup, getGroupSendCombinedEndorsementExpiration, getGroupSendEndorsementsData, getGroupSendMemberEndorsement, replaceAllEndorsementsForGroup, -} from './server/groupSendEndorsements.js'; +} from './server/groupSendEndorsements.std.js'; import { getAllChatFolders, getCurrentChatFolders, @@ -251,21 +251,21 @@ import { updateChatFolderPositions, updateChatFolderDeletedAtTimestampMsFromSync, deleteExpiredChatFolders, -} from './server/chatFolders.js'; -import { INITIAL_EXPIRE_TIMER_VERSION } from '../util/expirationTimer.js'; -import type { GifType } from '../components/fun/panels/FunPanelGifs.js'; -import type { NotificationProfileType } from '../types/NotificationProfile.js'; -import * as durations from '../util/durations/index.js'; -import type { AttachmentType } from '../types/Attachment.js'; -import { isFile, isVisualMedia } from '../util/Attachment.js'; -import { generateMessageId } from '../util/generateMessageId.js'; +} from './server/chatFolders.std.js'; +import { INITIAL_EXPIRE_TIMER_VERSION } from '../util/expirationTimer.std.js'; +import type { GifType } from '../components/fun/panels/FunPanelGifs.dom.js'; +import type { NotificationProfileType } from '../types/NotificationProfile.std.js'; +import * as durations from '../util/durations/index.std.js'; +import type { AttachmentType } from '../types/Attachment.std.js'; +import { isFile, isVisualMedia } from '../util/Attachment.std.js'; +import { generateMessageId } from '../util/generateMessageId.node.js'; import type { ConversationColorType, CustomColorType, -} from '../types/Colors.js'; -import { sqlLogger } from './sqlLogger.js'; -import { permissiveMessageAttachmentSchema } from './server/messageAttachments.js'; -import { getFilePathsOwnedByMessage } from '../util/messageFilePaths.js'; +} from '../types/Colors.std.js'; +import { sqlLogger } from './sqlLogger.node.js'; +import { permissiveMessageAttachmentSchema } from './server/messageAttachments.std.js'; +import { getFilePathsOwnedByMessage } from '../util/messageFilePaths.std.js'; const { forEach, diff --git a/ts/sql/channels.ts b/ts/sql/channels.ts index e3f85f4679..b3a4fbb48c 100644 --- a/ts/sql/channels.ts +++ b/ts/sql/channels.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import { ipcRenderer } from 'electron'; -import { createLogger } from '../logging/log.js'; -import createTaskWithTimeout from '../textsecure/TaskWithTimeout.js'; -import { explodePromise } from '../util/explodePromise.js'; -import { missingCaseError } from '../util/missingCaseError.js'; +import { createLogger } from '../logging/log.std.js'; +import createTaskWithTimeout from '../textsecure/TaskWithTimeout.std.js'; +import { explodePromise } from '../util/explodePromise.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; const log = createLogger('channels'); diff --git a/ts/sql/cleanDataForIpc.ts b/ts/sql/cleanDataForIpc.ts index 7f65cbc2cf..bf11c51f34 100644 --- a/ts/sql/cleanDataForIpc.ts +++ b/ts/sql/cleanDataForIpc.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import lodash from 'lodash'; -import { createLogger } from '../logging/log.js'; +import { createLogger } from '../logging/log.std.js'; -import { isIterable } from '../util/iterables.js'; +import { isIterable } from '../util/iterables.std.js'; const { isPlainObject } = lodash; diff --git a/ts/sql/hydration.ts b/ts/sql/hydration.ts index 14b955a11b..e1c33c6075 100644 --- a/ts/sql/hydration.ts +++ b/ts/sql/hydration.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import lodash from 'lodash'; -import type { ReadStatus } from '../messages/MessageReadStatus.js'; -import type { SeenStatus } from '../MessageSeenStatus.js'; -import type { ServiceIdString } from '../types/ServiceId.js'; -import { dropNull, shallowDropNull } from '../util/dropNull.js'; +import type { ReadStatus } from '../messages/MessageReadStatus.std.js'; +import type { SeenStatus } from '../MessageSeenStatus.std.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; +import { dropNull, shallowDropNull } from '../util/dropNull.std.js'; /* eslint-disable camelcase */ @@ -15,24 +15,24 @@ import type { MESSAGE_COLUMNS, ReadableDB, MessageAttachmentDBType, -} from './Interface.js'; +} from './Interface.std.js'; import { batchMultiVarQuery, convertOptionalIntegerToBoolean, jsonToObject, sql, sqlJoin, -} from './util.js'; -import type { AttachmentType } from '../types/Attachment.js'; +} from './util.std.js'; +import type { AttachmentType } from '../types/Attachment.std.js'; import { APPLICATION_OCTET_STREAM, IMAGE_JPEG, IMAGE_PNG, stringToMIMEType, -} from '../types/MIME.js'; -import { strictAssert } from '../util/assert.js'; -import type { MessageAttributesType } from '../model-types.js'; -import { createLogger } from '../logging/log.js'; +} from '../types/MIME.std.js'; +import { strictAssert } from '../util/assert.std.js'; +import type { MessageAttributesType } from '../model-types.d.ts'; +import { createLogger } from '../logging/log.std.js'; const { groupBy } = lodash; diff --git a/ts/sql/main.ts b/ts/sql/main.ts index 56b526811a..cf9562c9fc 100644 --- a/ts/sql/main.ts +++ b/ts/sql/main.ts @@ -6,15 +6,15 @@ import { Worker } from 'node:worker_threads'; import { format } from 'node:util'; import { app } from 'electron'; -import { strictAssert } from '../util/assert.js'; -import { explodePromise } from '../util/explodePromise.js'; -import type { LoggerType } from '../types/Logging.js'; -import * as Errors from '../types/errors.js'; -import { SqliteErrorKind } from './errors.js'; +import { strictAssert } from '../util/assert.std.js'; +import { explodePromise } from '../util/explodePromise.std.js'; +import type { LoggerType } from '../types/Logging.std.js'; +import * as Errors from '../types/errors.std.js'; +import { SqliteErrorKind } from './errors.std.js'; import type { ServerReadableDirectInterface, ServerWritableDirectInterface, -} from './Interface.js'; +} from './Interface.std.js'; const MIN_TRACE_DURATION = 40; diff --git a/ts/sql/mainWorker.ts b/ts/sql/mainWorker.ts index 8e71573927..73f046bc4c 100644 --- a/ts/sql/mainWorker.ts +++ b/ts/sql/mainWorker.ts @@ -3,11 +3,14 @@ import { parentPort } from 'node:worker_threads'; -import type { WrappedWorkerRequest, WrappedWorkerResponse } from './main.js'; -import type { WritableDB } from './Interface.js'; -import { initialize, DataReader, DataWriter, removeDB } from './Server.js'; -import { SqliteErrorKind, parseSqliteError } from './errors.js'; -import { sqlLogger as logger } from './sqlLogger.js'; +import type { + WrappedWorkerRequest, + WrappedWorkerResponse, +} from './main.main.js'; +import type { WritableDB } from './Interface.std.js'; +import { initialize, DataReader, DataWriter, removeDB } from './Server.node.js'; +import { SqliteErrorKind, parseSqliteError } from './errors.std.js'; +import { sqlLogger as logger } from './sqlLogger.node.js'; if (!parentPort) { throw new Error('Must run as a worker thread'); diff --git a/ts/sql/migrations/1000-mark-unread-call-history-messages-as-unseen.ts b/ts/sql/migrations/1000-mark-unread-call-history-messages-as-unseen.ts index 432c841d25..55f0b82286 100644 --- a/ts/sql/migrations/1000-mark-unread-call-history-messages-as-unseen.ts +++ b/ts/sql/migrations/1000-mark-unread-call-history-messages-as-unseen.ts @@ -3,10 +3,10 @@ import type { Database } from '@signalapp/sqlcipher'; -import { ReadStatus } from '../../messages/MessageReadStatus.js'; -import { SeenStatus } from '../../MessageSeenStatus.js'; -import { strictAssert } from '../../util/assert.js'; -import { sql, sqlConstant } from '../util.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.std.js'; +import { SeenStatus } from '../../MessageSeenStatus.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { sql, sqlConstant } from '../util.std.js'; const READ_STATUS_UNREAD = sqlConstant(ReadStatus.Unread); const READ_STATUS_READ = sqlConstant(ReadStatus.Read); diff --git a/ts/sql/migrations/1010-call-links-table.ts b/ts/sql/migrations/1010-call-links-table.ts index 58566ce0b9..56aa4643c9 100644 --- a/ts/sql/migrations/1010-call-links-table.ts +++ b/ts/sql/migrations/1010-call-links-table.ts @@ -3,7 +3,7 @@ import type { Database } from '@signalapp/sqlcipher'; -import { sql } from '../util.js'; +import { sql } from '../util.std.js'; export default function updateToSchemaVersion1010(db: Database): void { const [createTable] = sql` diff --git a/ts/sql/migrations/1020-self-merges.ts b/ts/sql/migrations/1020-self-merges.ts index 0be2cf91e6..1edd13a8eb 100644 --- a/ts/sql/migrations/1020-self-merges.ts +++ b/ts/sql/migrations/1020-self-merges.ts @@ -1,10 +1,10 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LoggerType } from '../../types/Logging.js'; -import { sql } from '../util.js'; -import type { WritableDB } from '../Interface.js'; -import { getOurUuid } from './41-uuid-keys.js'; +import type { LoggerType } from '../../types/Logging.std.js'; +import { sql } from '../util.std.js'; +import type { WritableDB } from '../Interface.std.js'; +import { getOurUuid } from './41-uuid-keys.std.js'; export default function updateToSchemaVersion1020( db: WritableDB, diff --git a/ts/sql/migrations/1030-unblock-event.ts b/ts/sql/migrations/1030-unblock-event.ts index 1bacca336d..334d103523 100644 --- a/ts/sql/migrations/1030-unblock-event.ts +++ b/ts/sql/migrations/1030-unblock-event.ts @@ -3,7 +3,7 @@ import type { Database } from '@signalapp/sqlcipher'; -import { sql, sqlFragment } from '../util.js'; +import { sql, sqlFragment } from '../util.std.js'; export default function updateToSchemaVersion1030(db: Database): void { // From migration 81 diff --git a/ts/sql/migrations/1040-undownloaded-backed-up-media.ts b/ts/sql/migrations/1040-undownloaded-backed-up-media.ts index 61dcc94770..d054479a17 100644 --- a/ts/sql/migrations/1040-undownloaded-backed-up-media.ts +++ b/ts/sql/migrations/1040-undownloaded-backed-up-media.ts @@ -4,21 +4,21 @@ import type { Database } from '@signalapp/sqlcipher'; import * as z from 'zod'; -import type { LoggerType } from '../../types/Logging.js'; +import type { LoggerType } from '../../types/Logging.std.js'; import { messageAttachmentTypeSchema, type AttachmentDownloadJobType, type MessageAttachmentType, -} from '../../types/AttachmentDownload.js'; -import type { AttachmentType } from '../../types/Attachment.js'; -import { jsonToObject, objectToJSON, sql } from '../util.js'; -import { AttachmentDownloadSource } from '../Interface.js'; -import { parsePartial } from '../../util/schemas.js'; -import { MIMETypeSchema } from '../../types/MIME.js'; +} from '../../types/AttachmentDownload.std.js'; +import type { AttachmentType } from '../../types/Attachment.std.js'; +import { jsonToObject, objectToJSON, sql } from '../util.std.js'; +import { AttachmentDownloadSource } from '../Interface.std.js'; +import { parsePartial } from '../../util/schemas.std.js'; +import { MIMETypeSchema } from '../../types/MIME.std.js'; import { jobManagerJobSchema, type JobManagerJobType, -} from '../../jobs/JobManager.js'; +} from '../../jobs/JobManager.std.js'; export type _AttachmentDownloadJobTypeV1030 = { attachment: AttachmentType; diff --git a/ts/sql/migrations/1050-group-send-endorsements.ts b/ts/sql/migrations/1050-group-send-endorsements.ts index ed7760b4ed..f0ad853fa9 100644 --- a/ts/sql/migrations/1050-group-send-endorsements.ts +++ b/ts/sql/migrations/1050-group-send-endorsements.ts @@ -3,7 +3,7 @@ import type { Database } from '@signalapp/sqlcipher'; -import { sql } from '../util.js'; +import { sql } from '../util.std.js'; export default function updateToSchemaVersion1050(db: Database): void { const [createTables] = sql` diff --git a/ts/sql/migrations/1100-optimize-mark-call-history-read-in-conversation.ts b/ts/sql/migrations/1100-optimize-mark-call-history-read-in-conversation.ts index 25b6e5854c..8718d769a7 100644 --- a/ts/sql/migrations/1100-optimize-mark-call-history-read-in-conversation.ts +++ b/ts/sql/migrations/1100-optimize-mark-call-history-read-in-conversation.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { Database } from '@signalapp/sqlcipher'; -import { sql } from '../util.js'; +import { sql } from '../util.std.js'; export default function updateToSchemaVersion1100(db: Database): void { const [query] = sql` diff --git a/ts/sql/migrations/1160-optimize-calls-unread-count.ts b/ts/sql/migrations/1160-optimize-calls-unread-count.ts index 32d8325884..55167045fb 100644 --- a/ts/sql/migrations/1160-optimize-calls-unread-count.ts +++ b/ts/sql/migrations/1160-optimize-calls-unread-count.ts @@ -1,8 +1,11 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import type { Database } from '@signalapp/sqlcipher'; -import { sql, sqlConstant } from '../util.js'; -import { CallDirection, CallStatusValue } from '../../types/CallDisposition.js'; +import { sql, sqlConstant } from '../util.std.js'; +import { + CallDirection, + CallStatusValue, +} from '../../types/CallDisposition.std.js'; const CALL_STATUS_MISSED = sqlConstant(CallStatusValue.Missed); const CALL_DIRECTION_INCOMING = sqlConstant(CallDirection.Incoming); diff --git a/ts/sql/migrations/1170-update-call-history-unread-index.ts b/ts/sql/migrations/1170-update-call-history-unread-index.ts index 1382e12622..64d7ba8283 100644 --- a/ts/sql/migrations/1170-update-call-history-unread-index.ts +++ b/ts/sql/migrations/1170-update-call-history-unread-index.ts @@ -1,7 +1,7 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import type { Database } from '@signalapp/sqlcipher'; -import { sql } from '../util.js'; +import { sql } from '../util.std.js'; export default function updateToSchemaVersion1170(db: Database): void { const [query] = sql` diff --git a/ts/sql/migrations/1180-add-attachment-download-source.ts b/ts/sql/migrations/1180-add-attachment-download-source.ts index eab54216fd..1f6f44f28e 100644 --- a/ts/sql/migrations/1180-add-attachment-download-source.ts +++ b/ts/sql/migrations/1180-add-attachment-download-source.ts @@ -1,7 +1,7 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import type { Database } from '@signalapp/sqlcipher'; -import { AttachmentDownloadSource } from '../Interface.js'; +import { AttachmentDownloadSource } from '../Interface.std.js'; export default function updateToSchemaVersion1180(db: Database): void { db.exec(` diff --git a/ts/sql/migrations/1220-blob-sessions.ts b/ts/sql/migrations/1220-blob-sessions.ts index ea5a9b9c80..75e1f8c457 100644 --- a/ts/sql/migrations/1220-blob-sessions.ts +++ b/ts/sql/migrations/1220-blob-sessions.ts @@ -3,14 +3,14 @@ import assert from 'node:assert'; import z from 'zod'; import type { Database } from '@signalapp/sqlcipher'; -import type { LoggerType } from '../../types/Logging.js'; -import * as Errors from '../../types/errors.js'; +import type { LoggerType } from '../../types/Logging.std.js'; +import * as Errors from '../../types/errors.std.js'; import { sessionRecordToProtobuf, sessionStructureToBytes, -} from '../../util/sessionTranslation.js'; -import { getOwn } from '../../util/getOwn.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; +} from '../../util/sessionTranslation.node.js'; +import { getOwn } from '../../util/getOwn.std.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; export const version = 1220; diff --git a/ts/sql/migrations/1240-defunct-call-links-table.ts b/ts/sql/migrations/1240-defunct-call-links-table.ts index 643bb40e1c..7f02ab9a16 100644 --- a/ts/sql/migrations/1240-defunct-call-links-table.ts +++ b/ts/sql/migrations/1240-defunct-call-links-table.ts @@ -3,7 +3,7 @@ import type { Database } from '@signalapp/sqlcipher'; -import { sql } from '../util.js'; +import { sql } from '../util.std.js'; export default function updateToSchemaVersion1240(db: Database): void { const [createTable] = sql` diff --git a/ts/sql/migrations/1260-sync-tasks-rowid.ts b/ts/sql/migrations/1260-sync-tasks-rowid.ts index 42dde75c95..ed944487f2 100644 --- a/ts/sql/migrations/1260-sync-tasks-rowid.ts +++ b/ts/sql/migrations/1260-sync-tasks-rowid.ts @@ -1,7 +1,7 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import type { Database } from '@signalapp/sqlcipher'; -import { sql } from '../util.js'; +import { sql } from '../util.std.js'; export default function updateToSchemaVersion1260(db: Database): void { const [query] = sql` diff --git a/ts/sql/migrations/1270-normalize-messages.ts b/ts/sql/migrations/1270-normalize-messages.ts index 770f362905..b8f4bac229 100644 --- a/ts/sql/migrations/1270-normalize-messages.ts +++ b/ts/sql/migrations/1270-normalize-messages.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import type { Database } from '@signalapp/sqlcipher'; -import { sql } from '../util.js'; +import { sql } from '../util.std.js'; export default function updateToSchemaVersion1270(db: Database): void { const [query] = sql` diff --git a/ts/sql/migrations/1280-blob-unprocessed.ts b/ts/sql/migrations/1280-blob-unprocessed.ts index 615d15ef86..0eae1557aa 100644 --- a/ts/sql/migrations/1280-blob-unprocessed.ts +++ b/ts/sql/migrations/1280-blob-unprocessed.ts @@ -2,17 +2,17 @@ // SPDX-License-Identifier: AGPL-3.0-only import { v7 as getGuid } from 'uuid'; -import type { LoggerType } from '../../types/Logging.js'; +import type { LoggerType } from '../../types/Logging.std.js'; import { normalizePni, normalizeServiceId, toTaggedPni, isUntaggedPniString, -} from '../../types/ServiceId.js'; -import { Migrations as Proto } from '../../protobuf/index.js'; -import { sql } from '../util.js'; -import type { WritableDB } from '../Interface.js'; -import { getOurUuid } from './41-uuid-keys.js'; +} from '../../types/ServiceId.std.js'; +import { Migrations as Proto } from '../../protobuf/index.std.js'; +import { sql } from '../util.std.js'; +import type { WritableDB } from '../Interface.std.js'; +import { getOurUuid } from './41-uuid-keys.std.js'; export default function updateToSchemaVersion1280( db: WritableDB, diff --git a/ts/sql/migrations/1290-int-unprocessed-source-device.ts b/ts/sql/migrations/1290-int-unprocessed-source-device.ts index 567dd63b66..7d0641dfde 100644 --- a/ts/sql/migrations/1290-int-unprocessed-source-device.ts +++ b/ts/sql/migrations/1290-int-unprocessed-source-device.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { sql } from '../util.js'; -import type { WritableDB } from '../Interface.js'; +import { sql } from '../util.std.js'; +import type { WritableDB } from '../Interface.std.js'; export default function updateToSchemaVersion1290(db: WritableDB): void { const [query] = sql` diff --git a/ts/sql/migrations/1300-sticker-pack-refs.ts b/ts/sql/migrations/1300-sticker-pack-refs.ts index 44d8c3cc0b..6b5c1da2a3 100644 --- a/ts/sql/migrations/1300-sticker-pack-refs.ts +++ b/ts/sql/migrations/1300-sticker-pack-refs.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { sql } from '../util.js'; -import type { WritableDB } from '../Interface.js'; +import { sql } from '../util.std.js'; +import type { WritableDB } from '../Interface.std.js'; export default function updateToSchemaVersion1300(db: WritableDB): void { const [query] = sql` diff --git a/ts/sql/migrations/1310-muted-fixup.ts b/ts/sql/migrations/1310-muted-fixup.ts index 3b385b7a37..0e827136bd 100644 --- a/ts/sql/migrations/1310-muted-fixup.ts +++ b/ts/sql/migrations/1310-muted-fixup.ts @@ -1,8 +1,8 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LoggerType } from '../../types/Logging.js'; -import { sql } from '../util.js'; -import type { WritableDB } from '../Interface.js'; +import type { LoggerType } from '../../types/Logging.std.js'; +import { sql } from '../util.std.js'; +import type { WritableDB } from '../Interface.std.js'; // Value from ts/util/timestamp.ts at the time of creation of this migration const MAX_SAFE_DATE = 8640000000000000; diff --git a/ts/sql/migrations/1320-unprocessed-received-at-date.ts b/ts/sql/migrations/1320-unprocessed-received-at-date.ts index bbab852a3b..56cec9bd98 100644 --- a/ts/sql/migrations/1320-unprocessed-received-at-date.ts +++ b/ts/sql/migrations/1320-unprocessed-received-at-date.ts @@ -1,8 +1,8 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { sql } from '../util.js'; -import type { WritableDB } from '../Interface.js'; +import { sql } from '../util.std.js'; +import type { WritableDB } from '../Interface.std.js'; export default function updateToSchemaVersion1320(db: WritableDB): void { const [query] = sql` diff --git a/ts/sql/migrations/1330-sync-tasks-type-index.ts b/ts/sql/migrations/1330-sync-tasks-type-index.ts index 4219460679..3d3fc5cb6b 100644 --- a/ts/sql/migrations/1330-sync-tasks-type-index.ts +++ b/ts/sql/migrations/1330-sync-tasks-type-index.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import type { Database } from '@signalapp/sqlcipher'; -import { sql } from '../util.js'; +import { sql } from '../util.std.js'; export default function updateToSchemaVersion1330(db: Database): void { const [query] = sql` diff --git a/ts/sql/migrations/1340-recent-gifs.ts b/ts/sql/migrations/1340-recent-gifs.ts index 528795bb8b..1d550b91b0 100644 --- a/ts/sql/migrations/1340-recent-gifs.ts +++ b/ts/sql/migrations/1340-recent-gifs.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import type { Database } from '@signalapp/sqlcipher'; -import { sql } from '../util.js'; +import { sql } from '../util.std.js'; export default function updateToSchemaVersion1340(db: Database): void { const [query] = sql` diff --git a/ts/sql/migrations/1350-notification-profiles.ts b/ts/sql/migrations/1350-notification-profiles.ts index c333ee04dc..c19dd04318 100644 --- a/ts/sql/migrations/1350-notification-profiles.ts +++ b/ts/sql/migrations/1350-notification-profiles.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import type { Database } from '@signalapp/sqlcipher'; -import { sql } from '../util.js'; +import { sql } from '../util.std.js'; export default function updateToSchemaVersion1350(db: Database): void { const [query] = sql` diff --git a/ts/sql/migrations/1360-attachments.ts b/ts/sql/migrations/1360-attachments.ts index c51102b5c9..0aebc143e3 100644 --- a/ts/sql/migrations/1360-attachments.ts +++ b/ts/sql/migrations/1360-attachments.ts @@ -1,7 +1,7 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { WritableDB } from '../Interface.js'; +import type { WritableDB } from '../Interface.std.js'; export default function updateToSchemaVersion1360(db: WritableDB): void { db.exec(` diff --git a/ts/sql/migrations/1370-message-attachment-indexes.ts b/ts/sql/migrations/1370-message-attachment-indexes.ts index e21040964b..d6646144d3 100644 --- a/ts/sql/migrations/1370-message-attachment-indexes.ts +++ b/ts/sql/migrations/1370-message-attachment-indexes.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { WritableDB } from '../Interface.js'; +import type { WritableDB } from '../Interface.std.js'; export default function updateToSchemaVersion1370(db: WritableDB): void { db.exec(` diff --git a/ts/sql/migrations/1380-donation-receipts.ts b/ts/sql/migrations/1380-donation-receipts.ts index 452e9de043..facbd3289d 100644 --- a/ts/sql/migrations/1380-donation-receipts.ts +++ b/ts/sql/migrations/1380-donation-receipts.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { WritableDB } from '../Interface.js'; +import type { WritableDB } from '../Interface.std.js'; export default function updateToSchemaVersion1380(db: WritableDB): void { db.exec(` diff --git a/ts/sql/migrations/1390-attachment-download-keys.ts b/ts/sql/migrations/1390-attachment-download-keys.ts index 24f8acf42c..3b5a946bf2 100644 --- a/ts/sql/migrations/1390-attachment-download-keys.ts +++ b/ts/sql/migrations/1390-attachment-download-keys.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { type WritableDB } from '../Interface.js'; +import { type WritableDB } from '../Interface.std.js'; export default function updateToSchemaVersion1390(db: WritableDB): void { // TODO: DESKTOP-8879 Digest column is only used for deduplication purposes; here we diff --git a/ts/sql/migrations/1400-simplify-receipts.ts b/ts/sql/migrations/1400-simplify-receipts.ts index 82c95bcb56..286ae5e936 100644 --- a/ts/sql/migrations/1400-simplify-receipts.ts +++ b/ts/sql/migrations/1400-simplify-receipts.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { WritableDB } from '../Interface.js'; +import type { WritableDB } from '../Interface.std.js'; export default function updateToSchemaVersion1400(db: WritableDB): void { db.exec(` diff --git a/ts/sql/migrations/1410-remove-wallpaper.ts b/ts/sql/migrations/1410-remove-wallpaper.ts index 37b239e665..446d298969 100644 --- a/ts/sql/migrations/1410-remove-wallpaper.ts +++ b/ts/sql/migrations/1410-remove-wallpaper.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { type WritableDB } from '../Interface.js'; +import { type WritableDB } from '../Interface.std.js'; export default function updateToSchemaVersion1410(db: WritableDB): void { db.exec(` diff --git a/ts/sql/migrations/1420-backup-downloads.ts b/ts/sql/migrations/1420-backup-downloads.ts index 59c5367b2e..7e5846572d 100644 --- a/ts/sql/migrations/1420-backup-downloads.ts +++ b/ts/sql/migrations/1420-backup-downloads.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { AttachmentDownloadSource, type WritableDB } from '../Interface.js'; +import { AttachmentDownloadSource, type WritableDB } from '../Interface.std.js'; export default function updateToSchemaVersion1420(db: WritableDB): void { db.exec(` diff --git a/ts/sql/migrations/1430-call-links-epoch-id.ts b/ts/sql/migrations/1430-call-links-epoch-id.ts index f0e5357504..6fe2733a73 100644 --- a/ts/sql/migrations/1430-call-links-epoch-id.ts +++ b/ts/sql/migrations/1430-call-links-epoch-id.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { type WritableDB } from '../Interface.js'; +import { type WritableDB } from '../Interface.std.js'; export default function updateToSchemaVersion1430(db: WritableDB): void { db.exec(` diff --git a/ts/sql/migrations/1440-chat-folders.ts b/ts/sql/migrations/1440-chat-folders.ts index 8b71140c0c..43e84efb4b 100644 --- a/ts/sql/migrations/1440-chat-folders.ts +++ b/ts/sql/migrations/1440-chat-folders.ts @@ -1,7 +1,7 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { WritableDB } from '../Interface.js'; -import { sql } from '../util.js'; +import type { WritableDB } from '../Interface.std.js'; +import { sql } from '../util.std.js'; export default function updateToSchemaVersion1440(db: WritableDB): void { const [query] = sql` diff --git a/ts/sql/migrations/1450-all-media.ts b/ts/sql/migrations/1450-all-media.ts index 506f8eba0c..7ecb67e0a2 100644 --- a/ts/sql/migrations/1450-all-media.ts +++ b/ts/sql/migrations/1450-all-media.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { WritableDB } from '../Interface.js'; +import type { WritableDB } from '../Interface.std.js'; export default function updateToSchemaVersion1450(db: WritableDB): void { db.exec(` diff --git a/ts/sql/migrations/1460-attachment-duration.ts b/ts/sql/migrations/1460-attachment-duration.ts index bdb01ce761..d06a905fd6 100644 --- a/ts/sql/migrations/1460-attachment-duration.ts +++ b/ts/sql/migrations/1460-attachment-duration.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { WritableDB } from '../Interface.js'; +import type { WritableDB } from '../Interface.std.js'; export default function updateToSchemaVersion1460(db: WritableDB): void { db.exec(` diff --git a/ts/sql/migrations/1470-kyber-triple.ts b/ts/sql/migrations/1470-kyber-triple.ts index 9bfb07aa79..f616988bf6 100644 --- a/ts/sql/migrations/1470-kyber-triple.ts +++ b/ts/sql/migrations/1470-kyber-triple.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { WritableDB } from '../Interface.js'; +import type { WritableDB } from '../Interface.std.js'; export default function updateToSchemaVersion1460(db: WritableDB): void { db.exec(` diff --git a/ts/sql/migrations/1480-chat-folders-remove-duplicates.ts b/ts/sql/migrations/1480-chat-folders-remove-duplicates.ts index ef2e8319f4..39c7aaf3e3 100644 --- a/ts/sql/migrations/1480-chat-folders-remove-duplicates.ts +++ b/ts/sql/migrations/1480-chat-folders-remove-duplicates.ts @@ -1,9 +1,9 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LoggerType } from '../../types/Logging.js'; -import type { WritableDB } from '../Interface.js'; -import { sql } from '../util.js'; +import type { LoggerType } from '../../types/Logging.std.js'; +import type { WritableDB } from '../Interface.std.js'; +import { sql } from '../util.std.js'; export default function updateToSchemaVersion1480( db: WritableDB, diff --git a/ts/sql/migrations/41-uuid-keys.ts b/ts/sql/migrations/41-uuid-keys.ts index f61e9a6667..cd6b00b3df 100644 --- a/ts/sql/migrations/41-uuid-keys.ts +++ b/ts/sql/migrations/41-uuid-keys.ts @@ -1,11 +1,11 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LoggerType } from '../../types/Logging.js'; -import { isValidUuid } from '../../util/isValidUuid.js'; -import Helpers from '../../textsecure/Helpers.js'; -import { createOrUpdate, getById, removeById } from '../util.js'; -import type { ItemKeyType, ReadableDB, WritableDB } from '../Interface.js'; +import type { LoggerType } from '../../types/Logging.std.js'; +import { isValidUuid } from '../../util/isValidUuid.std.js'; +import Helpers from '../../textsecure/Helpers.std.js'; +import { createOrUpdate, getById, removeById } from '../util.std.js'; +import type { ItemKeyType, ReadableDB, WritableDB } from '../Interface.std.js'; export function getOurUuid(db: ReadableDB): string | undefined { const UUID_ID: ItemKeyType = 'uuid_id'; diff --git a/ts/sql/migrations/42-stale-reactions.ts b/ts/sql/migrations/42-stale-reactions.ts index 394a00dbd7..92301d0df2 100644 --- a/ts/sql/migrations/42-stale-reactions.ts +++ b/ts/sql/migrations/42-stale-reactions.ts @@ -1,9 +1,9 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { batchMultiVarQuery } from '../util.js'; -import type { WritableDB } from '../Interface.js'; -import type { LoggerType } from '../../types/Logging.js'; +import { batchMultiVarQuery } from '../util.std.js'; +import type { WritableDB } from '../Interface.std.js'; +import type { LoggerType } from '../../types/Logging.std.js'; export default function updateToSchemaVersion42( db: WritableDB, diff --git a/ts/sql/migrations/43-gv2-uuid.ts b/ts/sql/migrations/43-gv2-uuid.ts index 1f9be56f5e..1bafd45753 100644 --- a/ts/sql/migrations/43-gv2-uuid.ts +++ b/ts/sql/migrations/43-gv2-uuid.ts @@ -3,18 +3,18 @@ import lodash from 'lodash'; -import type { LoggerType } from '../../types/Logging.js'; -import type { AciString, ServiceIdString } from '../../types/ServiceId.js'; -import { normalizeAci } from '../../util/normalizeAci.js'; -import { isNotNil } from '../../util/isNotNil.js'; -import { assertDev } from '../../util/assert.js'; +import type { LoggerType } from '../../types/Logging.std.js'; +import type { AciString, ServiceIdString } from '../../types/ServiceId.std.js'; +import { normalizeAci } from '../../util/normalizeAci.std.js'; +import { isNotNil } from '../../util/isNotNil.std.js'; +import { assertDev } from '../../util/assert.std.js'; import { TableIterator, getCountFromTable, jsonToObject, objectToJSON, -} from '../util.js'; -import type { WritableDB } from '../Interface.js'; +} from '../util.std.js'; +import type { WritableDB } from '../Interface.std.js'; const { omit } = lodash; diff --git a/ts/sql/migrations/47-further-optimize.ts b/ts/sql/migrations/47-further-optimize.ts index 11e6cf1f47..5acafe7090 100644 --- a/ts/sql/migrations/47-further-optimize.ts +++ b/ts/sql/migrations/47-further-optimize.ts @@ -1,9 +1,9 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { getOurUuid } from './41-uuid-keys.js'; -import type { LoggerType } from '../../types/Logging.js'; -import type { WritableDB } from '../Interface.js'; +import { getOurUuid } from './41-uuid-keys.std.js'; +import type { LoggerType } from '../../types/Logging.std.js'; +import type { WritableDB } from '../Interface.std.js'; export default function updateToSchemaVersion47( db: WritableDB, diff --git a/ts/sql/migrations/51-centralize-conversation-jobs.ts b/ts/sql/migrations/51-centralize-conversation-jobs.ts index 8def084cd1..7b8ca8268f 100644 --- a/ts/sql/migrations/51-centralize-conversation-jobs.ts +++ b/ts/sql/migrations/51-centralize-conversation-jobs.ts @@ -1,10 +1,10 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LoggerType } from '../../types/Logging.js'; -import { isRecord } from '../../util/isRecord.js'; -import type { WritableDB } from '../Interface.js'; -import { getJobsInQueue, insertJob } from '../Server.js'; +import type { LoggerType } from '../../types/Logging.std.js'; +import { isRecord } from '../../util/isRecord.std.js'; +import type { WritableDB } from '../Interface.std.js'; +import { getJobsInQueue, insertJob } from '../Server.node.js'; export default function updateToSchemaVersion51( db: WritableDB, diff --git a/ts/sql/migrations/53-gv2-banned-members.ts b/ts/sql/migrations/53-gv2-banned-members.ts index 042b8d7cdb..0244966783 100644 --- a/ts/sql/migrations/53-gv2-banned-members.ts +++ b/ts/sql/migrations/53-gv2-banned-members.ts @@ -3,8 +3,8 @@ import type { Database } from '@signalapp/sqlcipher'; -import type { LoggerType } from '../../types/Logging.js'; -import { jsonToObject } from '../util.js'; +import type { LoggerType } from '../../types/Logging.std.js'; +import { jsonToObject } from '../util.std.js'; export default function updateToSchemaVersion53( db: Database, diff --git a/ts/sql/migrations/55-report-message-aci.ts b/ts/sql/migrations/55-report-message-aci.ts index 60c3fbef81..5b8e84bcec 100644 --- a/ts/sql/migrations/55-report-message-aci.ts +++ b/ts/sql/migrations/55-report-message-aci.ts @@ -1,11 +1,11 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LoggerType } from '../../types/Logging.js'; -import { getJobsInQueue, insertJob } from '../Server.js'; -import type { WritableDB } from '../Interface.js'; -import { isRecord } from '../../util/isRecord.js'; -import { isIterable } from '../../util/iterables.js'; +import type { LoggerType } from '../../types/Logging.std.js'; +import { getJobsInQueue, insertJob } from '../Server.node.js'; +import type { WritableDB } from '../Interface.std.js'; +import { isRecord } from '../../util/isRecord.std.js'; +import { isIterable } from '../../util/iterables.std.js'; export default function updateToSchemaVersion55( db: WritableDB, diff --git a/ts/sql/migrations/56-add-unseen-to-message.ts b/ts/sql/migrations/56-add-unseen-to-message.ts index 3a19b819be..b687f53faa 100644 --- a/ts/sql/migrations/56-add-unseen-to-message.ts +++ b/ts/sql/migrations/56-add-unseen-to-message.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { Database } from '@signalapp/sqlcipher'; -import { ReadStatus } from '../../messages/MessageReadStatus.js'; -import { SeenStatus } from '../../MessageSeenStatus.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.std.js'; +import { SeenStatus } from '../../MessageSeenStatus.std.js'; export default function updateToSchemaVersion56(db: Database): void { db.exec( diff --git a/ts/sql/migrations/58-update-unread.ts b/ts/sql/migrations/58-update-unread.ts index c01335d61d..3790c73f85 100644 --- a/ts/sql/migrations/58-update-unread.ts +++ b/ts/sql/migrations/58-update-unread.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { Database } from '@signalapp/sqlcipher'; -import { ReadStatus } from '../../messages/MessageReadStatus.js'; -import { SeenStatus } from '../../MessageSeenStatus.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.std.js'; +import { SeenStatus } from '../../MessageSeenStatus.std.js'; export default function updateToSchemaVersion58(db: Database): void { db.exec( diff --git a/ts/sql/migrations/78-merge-receipt-jobs.ts b/ts/sql/migrations/78-merge-receipt-jobs.ts index 60b10d8667..5a398c7957 100644 --- a/ts/sql/migrations/78-merge-receipt-jobs.ts +++ b/ts/sql/migrations/78-merge-receipt-jobs.ts @@ -1,10 +1,10 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LoggerType } from '../../types/Logging.js'; -import { isRecord } from '../../util/isRecord.js'; -import type { WritableDB } from '../Interface.js'; -import { getJobsInQueue, insertJob } from '../Server.js'; +import type { LoggerType } from '../../types/Logging.std.js'; +import { isRecord } from '../../util/isRecord.std.js'; +import type { WritableDB } from '../Interface.std.js'; +import { getJobsInQueue, insertJob } from '../Server.node.js'; export default function updateToSchemaVersion78( db: WritableDB, diff --git a/ts/sql/migrations/87-cleanup.ts b/ts/sql/migrations/87-cleanup.ts index d5b31fff37..d586d3ab84 100644 --- a/ts/sql/migrations/87-cleanup.ts +++ b/ts/sql/migrations/87-cleanup.ts @@ -3,9 +3,9 @@ import type { Database } from '@signalapp/sqlcipher'; -import { cleanKeys } from './920-clean-more-keys.js'; -import type { LoggerType } from '../../types/Logging.js'; -import { sqlFragment } from '../util.js'; +import { cleanKeys } from './920-clean-more-keys.std.js'; +import type { LoggerType } from '../../types/Logging.std.js'; +import { sqlFragment } from '../util.std.js'; // Note: for many users, this is not what ran for them as migration 87. You can see that // migration here: https://github.com/signalapp/Signal-Desktop/commit/671e16ae1f869627f355113d6397ccb62d5461d2 diff --git a/ts/sql/migrations/88-service-ids.ts b/ts/sql/migrations/88-service-ids.ts index c737b83fb9..68b1090792 100644 --- a/ts/sql/migrations/88-service-ids.ts +++ b/ts/sql/migrations/88-service-ids.ts @@ -4,16 +4,16 @@ import type { Database } from '@signalapp/sqlcipher'; import lodash from 'lodash'; -import type { LoggerType } from '../../types/Logging.js'; +import type { LoggerType } from '../../types/Logging.std.js'; import type { ServiceIdString, AciString, PniString, -} from '../../types/ServiceId.js'; -import { normalizeServiceId, normalizePni } from '../../types/ServiceId.js'; -import { normalizeAci } from '../../util/normalizeAci.js'; -import type { JSONWithUnknownFields } from '../../types/Util.js'; -import { isNotNil } from '../../util/isNotNil.js'; +} from '../../types/ServiceId.std.js'; +import { normalizeServiceId, normalizePni } from '../../types/ServiceId.std.js'; +import { normalizeAci } from '../../util/normalizeAci.std.js'; +import type { JSONWithUnknownFields } from '../../types/Util.std.js'; +import { isNotNil } from '../../util/isNotNil.std.js'; const { omit } = lodash; diff --git a/ts/sql/migrations/89-call-history.ts b/ts/sql/migrations/89-call-history.ts index cbf17e611c..f7a2896028 100644 --- a/ts/sql/migrations/89-call-history.ts +++ b/ts/sql/migrations/89-call-history.ts @@ -7,10 +7,10 @@ import { v4 as generateUuid } from 'uuid'; import lodash from 'lodash'; import type { SetOptional } from 'type-fest'; -import type { LoggerType } from '../../types/Logging.js'; -import { jsonToObject, sql } from '../util.js'; -import { getOurUuid } from './41-uuid-keys.js'; -import type { CallHistoryDetails } from '../../types/CallDisposition.js'; +import type { LoggerType } from '../../types/Logging.std.js'; +import { jsonToObject, sql } from '../util.std.js'; +import { getOurUuid } from './41-uuid-keys.std.js'; +import type { CallHistoryDetails } from '../../types/CallDisposition.std.js'; import { DirectCallStatus, CallDirection, @@ -18,16 +18,16 @@ import { GroupCallStatus, callHistoryDetailsSchema, CallMode, -} from '../../types/CallDisposition.js'; +} from '../../types/CallDisposition.std.js'; import type { WritableDB, MessageType, ConversationType, -} from '../Interface.js'; -import { strictAssert } from '../../util/assert.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; -import { isAciString } from '../../util/isAciString.js'; -import { safeParseStrict } from '../../util/schemas.js'; +} from '../Interface.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; +import { isAciString } from '../../util/isAciString.std.js'; +import { safeParseStrict } from '../../util/schemas.std.js'; const { isObject } = lodash; diff --git a/ts/sql/migrations/90-delete-story-reply-screenshot.ts b/ts/sql/migrations/90-delete-story-reply-screenshot.ts index 3bd6a3b2b2..e8c91d4d41 100644 --- a/ts/sql/migrations/90-delete-story-reply-screenshot.ts +++ b/ts/sql/migrations/90-delete-story-reply-screenshot.ts @@ -3,8 +3,8 @@ import type { Database } from '@signalapp/sqlcipher'; -import type { LoggerType } from '../../types/Logging.js'; -import { sql } from '../util.js'; +import type { LoggerType } from '../../types/Logging.std.js'; +import { sql } from '../util.std.js'; export default function updateToSchemaVersion90( db: Database, diff --git a/ts/sql/migrations/91-clean-keys.ts b/ts/sql/migrations/91-clean-keys.ts index aa604adde2..c891d1296b 100644 --- a/ts/sql/migrations/91-clean-keys.ts +++ b/ts/sql/migrations/91-clean-keys.ts @@ -3,11 +3,11 @@ import type { Database, RunResult } from '@signalapp/sqlcipher'; -import type { LoggerType } from '../../types/Logging.js'; -import { sql } from '../util.js'; -import type { PniString } from '../../types/ServiceId.js'; -import { normalizePni } from '../../types/ServiceId.js'; -import * as Errors from '../../types/errors.js'; +import type { LoggerType } from '../../types/Logging.std.js'; +import { sql } from '../util.std.js'; +import type { PniString } from '../../types/ServiceId.std.js'; +import { normalizePni } from '../../types/ServiceId.std.js'; +import * as Errors from '../../types/errors.std.js'; export default function updateToSchemaVersion91( db: Database, diff --git a/ts/sql/migrations/920-clean-more-keys.ts b/ts/sql/migrations/920-clean-more-keys.ts index 5568aafdce..6a3e545089 100644 --- a/ts/sql/migrations/920-clean-more-keys.ts +++ b/ts/sql/migrations/920-clean-more-keys.ts @@ -3,13 +3,13 @@ import type { Database, RunResult } from '@signalapp/sqlcipher'; -import type { LoggerType } from '../../types/Logging.js'; -import type { QueryFragment } from '../util.js'; -import type { PniString } from '../../types/ServiceId.js'; +import type { LoggerType } from '../../types/Logging.std.js'; +import type { QueryFragment } from '../util.std.js'; +import type { PniString } from '../../types/ServiceId.std.js'; -import { sql, sqlFragment } from '../util.js'; -import { normalizePni } from '../../types/ServiceId.js'; -import * as Errors from '../../types/errors.js'; +import { sql, sqlFragment } from '../util.std.js'; +import { normalizePni } from '../../types/ServiceId.std.js'; +import * as Errors from '../../types/errors.std.js'; export default function updateToSchemaVersion920( db: Database, diff --git a/ts/sql/migrations/960-untag-pni.ts b/ts/sql/migrations/960-untag-pni.ts index 5da3a7f846..e4ee2a5d81 100644 --- a/ts/sql/migrations/960-untag-pni.ts +++ b/ts/sql/migrations/960-untag-pni.ts @@ -3,15 +3,15 @@ import type { Database } from '@signalapp/sqlcipher'; -import type { LoggerType } from '../../types/Logging.js'; +import type { LoggerType } from '../../types/Logging.std.js'; import type { ServiceIdString, AciString, PniString, -} from '../../types/ServiceId.js'; -import { normalizePni } from '../../types/ServiceId.js'; -import { normalizeAci } from '../../util/normalizeAci.js'; -import type { JSONWithUnknownFields } from '../../types/Util.js'; +} from '../../types/ServiceId.std.js'; +import { normalizePni } from '../../types/ServiceId.std.js'; +import { normalizeAci } from '../../util/normalizeAci.std.js'; +import type { JSONWithUnknownFields } from '../../types/Util.std.js'; export default function updateToSchemaVersion960( db: Database, diff --git a/ts/sql/migrations/index.ts b/ts/sql/migrations/index.ts index 9231dddb97..51b90cd1c7 100644 --- a/ts/sql/migrations/index.ts +++ b/ts/sql/migrations/index.ts @@ -5,7 +5,7 @@ import type { Database } from '@signalapp/sqlcipher'; import lodash from 'lodash'; import { v4 as generateUuid } from 'uuid'; -import type { LoggerType } from '../../types/Logging.js'; +import type { LoggerType } from '../../types/Logging.std.js'; import { getSchemaVersion, getUserVersion, @@ -13,119 +13,119 @@ import { getSQLiteVersion, objectToJSON, jsonToObject, -} from '../util.js'; -import type { WritableDB } from '../Interface.js'; +} from '../util.std.js'; +import type { WritableDB } from '../Interface.std.js'; -import updateToSchemaVersion41 from './41-uuid-keys.js'; -import updateToSchemaVersion42 from './42-stale-reactions.js'; -import updateToSchemaVersion43 from './43-gv2-uuid.js'; -import updateToSchemaVersion44 from './44-badges.js'; -import updateToSchemaVersion45 from './45-stories.js'; -import updateToSchemaVersion46 from './46-optimize-stories.js'; -import updateToSchemaVersion47 from './47-further-optimize.js'; -import updateToSchemaVersion48 from './48-fix-user-initiated-index.js'; -import updateToSchemaVersion49 from './49-fix-preview-index.js'; -import updateToSchemaVersion50 from './50-fix-messages-unread-index.js'; -import updateToSchemaVersion51 from './51-centralize-conversation-jobs.js'; -import updateToSchemaVersion52 from './52-optimize-stories.js'; -import updateToSchemaVersion53 from './53-gv2-banned-members.js'; -import updateToSchemaVersion54 from './54-unprocessed-received-at-counter.js'; -import updateToSchemaVersion55 from './55-report-message-aci.js'; -import updateToSchemaVersion56 from './56-add-unseen-to-message.js'; -import updateToSchemaVersion57 from './57-rm-message-history-unsynced.js'; -import updateToSchemaVersion58 from './58-update-unread.js'; -import updateToSchemaVersion59 from './59-unprocessed-received-at-counter-index.js'; -import updateToSchemaVersion60 from './60-update-expiring-index.js'; -import updateToSchemaVersion61 from './61-distribution-list-storage.js'; -import updateToSchemaVersion62 from './62-add-urgent-to-send-log.js'; -import updateToSchemaVersion63 from './63-add-urgent-to-unprocessed.js'; -import updateToSchemaVersion64 from './64-uuid-column-for-pre-keys.js'; -import updateToSchemaVersion65 from './65-add-storage-id-to-stickers.js'; -import updateToSchemaVersion66 from './66-add-pni-signature-to-sent-protos.js'; -import updateToSchemaVersion67 from './67-add-story-to-unprocessed.js'; -import updateToSchemaVersion68 from './68-drop-deprecated-columns.js'; -import updateToSchemaVersion69 from './69-group-call-ring-cancellations.js'; -import updateToSchemaVersion70 from './70-story-reply-index.js'; -import updateToSchemaVersion71 from './71-merge-notifications.js'; -import updateToSchemaVersion72 from './72-optimize-call-id-message-lookup.js'; -import updateToSchemaVersion73 from './73-remove-phone-number-discovery.js'; -import updateToSchemaVersion74 from './74-optimize-convo-open.js'; -import updateToSchemaVersion75 from './75-noop.js'; -import updateToSchemaVersion76 from './76-optimize-convo-open-2.js'; -import updateToSchemaVersion77 from './77-signal-tokenizer.js'; -import updateToSchemaVersion78 from './78-merge-receipt-jobs.js'; -import updateToSchemaVersion79 from './79-paging-lightbox.js'; -import updateToSchemaVersion80 from './80-edited-messages.js'; -import updateToSchemaVersion81 from './81-contact-removed-notification.js'; -import updateToSchemaVersion82 from './82-edited-messages-read-index.js'; -import updateToSchemaVersion83 from './83-mentions.js'; -import updateToSchemaVersion84 from './84-all-mentions.js'; -import updateToSchemaVersion85 from './85-add-kyber-keys.js'; -import updateToSchemaVersion86 from './86-story-replies-index.js'; -import updateToSchemaVersion87 from './87-cleanup.js'; -import updateToSchemaVersion88 from './88-service-ids.js'; -import updateToSchemaVersion89 from './89-call-history.js'; -import updateToSchemaVersion90 from './90-delete-story-reply-screenshot.js'; -import updateToSchemaVersion91 from './91-clean-keys.js'; -import updateToSchemaVersion920 from './920-clean-more-keys.js'; -import updateToSchemaVersion930 from './930-fts5-secure-delete.js'; -import updateToSchemaVersion940 from './940-fts5-revert.js'; -import updateToSchemaVersion950 from './950-fts5-secure-delete.js'; -import updateToSchemaVersion960 from './960-untag-pni.js'; -import updateToSchemaVersion970 from './970-fts5-optimize.js'; -import updateToSchemaVersion980 from './980-reaction-timestamp.js'; -import updateToSchemaVersion990 from './990-phone-number-sharing.js'; -import updateToSchemaVersion1000 from './1000-mark-unread-call-history-messages-as-unseen.js'; -import updateToSchemaVersion1010 from './1010-call-links-table.js'; -import updateToSchemaVersion1020 from './1020-self-merges.js'; -import updateToSchemaVersion1030 from './1030-unblock-event.js'; -import updateToSchemaVersion1040 from './1040-undownloaded-backed-up-media.js'; -import updateToSchemaVersion1050 from './1050-group-send-endorsements.js'; -import updateToSchemaVersion1060 from './1060-addressable-messages-and-sync-tasks.js'; -import updateToSchemaVersion1070 from './1070-attachment-backup.js'; -import updateToSchemaVersion1080 from './1080-nondisappearing-addressable.js'; -import updateToSchemaVersion1090 from './1090-message-delete-indexes.js'; -import updateToSchemaVersion1100 from './1100-optimize-mark-call-history-read-in-conversation.js'; -import updateToSchemaVersion1110 from './1110-sticker-local-key.js'; -import updateToSchemaVersion1120 from './1120-messages-foreign-keys-indexes.js'; -import updateToSchemaVersion1130 from './1130-isStory-index.js'; -import updateToSchemaVersion1140 from './1140-call-links-deleted-column.js'; -import updateToSchemaVersion1150 from './1150-expire-timer-version.js'; -import updateToSchemaVersion1160 from './1160-optimize-calls-unread-count.js'; -import updateToSchemaVersion1170 from './1170-update-call-history-unread-index.js'; -import updateToSchemaVersion1180 from './1180-add-attachment-download-source.js'; -import updateToSchemaVersion1190 from './1190-call-links-storage.js'; -import updateToSchemaVersion1200 from './1200-attachment-download-source-index.js'; -import updateToSchemaVersion1210 from './1210-call-history-started-id.js'; -import updateToSchemaVersion1220 from './1220-blob-sessions.js'; -import updateToSchemaVersion1230 from './1230-call-links-admin-key-index.js'; -import updateToSchemaVersion1240 from './1240-defunct-call-links-table.js'; -import updateToSchemaVersion1250 from './1250-defunct-call-links-storage.js'; -import updateToSchemaVersion1260 from './1260-sync-tasks-rowid.js'; -import updateToSchemaVersion1270 from './1270-normalize-messages.js'; -import updateToSchemaVersion1280 from './1280-blob-unprocessed.js'; -import updateToSchemaVersion1290 from './1290-int-unprocessed-source-device.js'; -import updateToSchemaVersion1300 from './1300-sticker-pack-refs.js'; -import updateToSchemaVersion1310 from './1310-muted-fixup.js'; -import updateToSchemaVersion1320 from './1320-unprocessed-received-at-date.js'; -import updateToSchemaVersion1330 from './1330-sync-tasks-type-index.js'; -import updateToSchemaVersion1340 from './1340-recent-gifs.js'; -import updateToSchemaVersion1350 from './1350-notification-profiles.js'; -import updateToSchemaVersion1360 from './1360-attachments.js'; -import updateToSchemaVersion1370 from './1370-message-attachment-indexes.js'; -import updateToSchemaVersion1380 from './1380-donation-receipts.js'; -import updateToSchemaVersion1390 from './1390-attachment-download-keys.js'; -import updateToSchemaVersion1400 from './1400-simplify-receipts.js'; -import updateToSchemaVersion1410 from './1410-remove-wallpaper.js'; -import updateToSchemaVersion1420 from './1420-backup-downloads.js'; -import updateToSchemaVersion1430 from './1430-call-links-epoch-id.js'; -import updateToSchemaVersion1440 from './1440-chat-folders.js'; -import updateToSchemaVersion1450 from './1450-all-media.js'; -import updateToSchemaVersion1460 from './1460-attachment-duration.js'; -import updateToSchemaVersion1470 from './1470-kyber-triple.js'; -import updateToSchemaVersion1480 from './1480-chat-folders-remove-duplicates.js'; +import updateToSchemaVersion41 from './41-uuid-keys.std.js'; +import updateToSchemaVersion42 from './42-stale-reactions.std.js'; +import updateToSchemaVersion43 from './43-gv2-uuid.std.js'; +import updateToSchemaVersion44 from './44-badges.std.js'; +import updateToSchemaVersion45 from './45-stories.std.js'; +import updateToSchemaVersion46 from './46-optimize-stories.std.js'; +import updateToSchemaVersion47 from './47-further-optimize.std.js'; +import updateToSchemaVersion48 from './48-fix-user-initiated-index.std.js'; +import updateToSchemaVersion49 from './49-fix-preview-index.std.js'; +import updateToSchemaVersion50 from './50-fix-messages-unread-index.std.js'; +import updateToSchemaVersion51 from './51-centralize-conversation-jobs.node.js'; +import updateToSchemaVersion52 from './52-optimize-stories.std.js'; +import updateToSchemaVersion53 from './53-gv2-banned-members.std.js'; +import updateToSchemaVersion54 from './54-unprocessed-received-at-counter.std.js'; +import updateToSchemaVersion55 from './55-report-message-aci.node.js'; +import updateToSchemaVersion56 from './56-add-unseen-to-message.std.js'; +import updateToSchemaVersion57 from './57-rm-message-history-unsynced.std.js'; +import updateToSchemaVersion58 from './58-update-unread.std.js'; +import updateToSchemaVersion59 from './59-unprocessed-received-at-counter-index.std.js'; +import updateToSchemaVersion60 from './60-update-expiring-index.std.js'; +import updateToSchemaVersion61 from './61-distribution-list-storage.std.js'; +import updateToSchemaVersion62 from './62-add-urgent-to-send-log.std.js'; +import updateToSchemaVersion63 from './63-add-urgent-to-unprocessed.std.js'; +import updateToSchemaVersion64 from './64-uuid-column-for-pre-keys.std.js'; +import updateToSchemaVersion65 from './65-add-storage-id-to-stickers.std.js'; +import updateToSchemaVersion66 from './66-add-pni-signature-to-sent-protos.std.js'; +import updateToSchemaVersion67 from './67-add-story-to-unprocessed.std.js'; +import updateToSchemaVersion68 from './68-drop-deprecated-columns.std.js'; +import updateToSchemaVersion69 from './69-group-call-ring-cancellations.std.js'; +import updateToSchemaVersion70 from './70-story-reply-index.std.js'; +import updateToSchemaVersion71 from './71-merge-notifications.std.js'; +import updateToSchemaVersion72 from './72-optimize-call-id-message-lookup.std.js'; +import updateToSchemaVersion73 from './73-remove-phone-number-discovery.std.js'; +import updateToSchemaVersion74 from './74-optimize-convo-open.std.js'; +import updateToSchemaVersion75 from './75-noop.std.js'; +import updateToSchemaVersion76 from './76-optimize-convo-open-2.std.js'; +import updateToSchemaVersion77 from './77-signal-tokenizer.std.js'; +import updateToSchemaVersion78 from './78-merge-receipt-jobs.node.js'; +import updateToSchemaVersion79 from './79-paging-lightbox.std.js'; +import updateToSchemaVersion80 from './80-edited-messages.std.js'; +import updateToSchemaVersion81 from './81-contact-removed-notification.std.js'; +import updateToSchemaVersion82 from './82-edited-messages-read-index.std.js'; +import updateToSchemaVersion83 from './83-mentions.std.js'; +import updateToSchemaVersion84 from './84-all-mentions.std.js'; +import updateToSchemaVersion85 from './85-add-kyber-keys.std.js'; +import updateToSchemaVersion86 from './86-story-replies-index.std.js'; +import updateToSchemaVersion87 from './87-cleanup.std.js'; +import updateToSchemaVersion88 from './88-service-ids.std.js'; +import updateToSchemaVersion89 from './89-call-history.node.js'; +import updateToSchemaVersion90 from './90-delete-story-reply-screenshot.std.js'; +import updateToSchemaVersion91 from './91-clean-keys.std.js'; +import updateToSchemaVersion920 from './920-clean-more-keys.std.js'; +import updateToSchemaVersion930 from './930-fts5-secure-delete.std.js'; +import updateToSchemaVersion940 from './940-fts5-revert.std.js'; +import updateToSchemaVersion950 from './950-fts5-secure-delete.std.js'; +import updateToSchemaVersion960 from './960-untag-pni.std.js'; +import updateToSchemaVersion970 from './970-fts5-optimize.std.js'; +import updateToSchemaVersion980 from './980-reaction-timestamp.std.js'; +import updateToSchemaVersion990 from './990-phone-number-sharing.std.js'; +import updateToSchemaVersion1000 from './1000-mark-unread-call-history-messages-as-unseen.std.js'; +import updateToSchemaVersion1010 from './1010-call-links-table.std.js'; +import updateToSchemaVersion1020 from './1020-self-merges.std.js'; +import updateToSchemaVersion1030 from './1030-unblock-event.std.js'; +import updateToSchemaVersion1040 from './1040-undownloaded-backed-up-media.std.js'; +import updateToSchemaVersion1050 from './1050-group-send-endorsements.std.js'; +import updateToSchemaVersion1060 from './1060-addressable-messages-and-sync-tasks.std.js'; +import updateToSchemaVersion1070 from './1070-attachment-backup.std.js'; +import updateToSchemaVersion1080 from './1080-nondisappearing-addressable.std.js'; +import updateToSchemaVersion1090 from './1090-message-delete-indexes.std.js'; +import updateToSchemaVersion1100 from './1100-optimize-mark-call-history-read-in-conversation.std.js'; +import updateToSchemaVersion1110 from './1110-sticker-local-key.std.js'; +import updateToSchemaVersion1120 from './1120-messages-foreign-keys-indexes.std.js'; +import updateToSchemaVersion1130 from './1130-isStory-index.std.js'; +import updateToSchemaVersion1140 from './1140-call-links-deleted-column.std.js'; +import updateToSchemaVersion1150 from './1150-expire-timer-version.std.js'; +import updateToSchemaVersion1160 from './1160-optimize-calls-unread-count.std.js'; +import updateToSchemaVersion1170 from './1170-update-call-history-unread-index.std.js'; +import updateToSchemaVersion1180 from './1180-add-attachment-download-source.std.js'; +import updateToSchemaVersion1190 from './1190-call-links-storage.std.js'; +import updateToSchemaVersion1200 from './1200-attachment-download-source-index.std.js'; +import updateToSchemaVersion1210 from './1210-call-history-started-id.std.js'; +import updateToSchemaVersion1220 from './1220-blob-sessions.node.js'; +import updateToSchemaVersion1230 from './1230-call-links-admin-key-index.std.js'; +import updateToSchemaVersion1240 from './1240-defunct-call-links-table.std.js'; +import updateToSchemaVersion1250 from './1250-defunct-call-links-storage.std.js'; +import updateToSchemaVersion1260 from './1260-sync-tasks-rowid.std.js'; +import updateToSchemaVersion1270 from './1270-normalize-messages.std.js'; +import updateToSchemaVersion1280 from './1280-blob-unprocessed.std.js'; +import updateToSchemaVersion1290 from './1290-int-unprocessed-source-device.std.js'; +import updateToSchemaVersion1300 from './1300-sticker-pack-refs.std.js'; +import updateToSchemaVersion1310 from './1310-muted-fixup.std.js'; +import updateToSchemaVersion1320 from './1320-unprocessed-received-at-date.std.js'; +import updateToSchemaVersion1330 from './1330-sync-tasks-type-index.std.js'; +import updateToSchemaVersion1340 from './1340-recent-gifs.std.js'; +import updateToSchemaVersion1350 from './1350-notification-profiles.std.js'; +import updateToSchemaVersion1360 from './1360-attachments.std.js'; +import updateToSchemaVersion1370 from './1370-message-attachment-indexes.std.js'; +import updateToSchemaVersion1380 from './1380-donation-receipts.std.js'; +import updateToSchemaVersion1390 from './1390-attachment-download-keys.std.js'; +import updateToSchemaVersion1400 from './1400-simplify-receipts.std.js'; +import updateToSchemaVersion1410 from './1410-remove-wallpaper.std.js'; +import updateToSchemaVersion1420 from './1420-backup-downloads.std.js'; +import updateToSchemaVersion1430 from './1430-call-links-epoch-id.std.js'; +import updateToSchemaVersion1440 from './1440-chat-folders.std.js'; +import updateToSchemaVersion1450 from './1450-all-media.std.js'; +import updateToSchemaVersion1460 from './1460-attachment-duration.std.js'; +import updateToSchemaVersion1470 from './1470-kyber-triple.std.js'; +import updateToSchemaVersion1480 from './1480-chat-folders-remove-duplicates.std.js'; -import { DataWriter } from '../Server.js'; +import { DataWriter } from '../Server.node.js'; const { keyBy } = lodash; diff --git a/ts/sql/server/callLinks.ts b/ts/sql/server/callLinks.ts index b45bc3448d..05297980e3 100644 --- a/ts/sql/server/callLinks.ts +++ b/ts/sql/server/callLinks.ts @@ -2,34 +2,34 @@ // SPDX-License-Identifier: AGPL-3.0-only import { CallLinkRootKey } from '@signalapp/ringrtc'; -import * as Bytes from '../../Bytes.js'; +import * as Bytes from '../../Bytes.std.js'; import type { CallLinkRecord, CallLinkStateType, CallLinkType, DefunctCallLinkType, -} from '../../types/CallLink.js'; +} from '../../types/CallLink.std.js'; import { callLinkRestrictionsSchema, callLinkRecordSchema, defunctCallLinkRecordSchema, -} from '../../types/CallLink.js'; -import { toAdminKeyBytes } from '../../util/callLinks.js'; +} from '../../types/CallLink.std.js'; +import { toAdminKeyBytes } from '../../util/callLinks.std.js'; import { callLinkToRecord, callLinkFromRecord, defunctCallLinkToRecord, defunctCallLinkFromRecord, toEpochBytes, -} from '../../util/callLinksRingrtc.js'; -import type { ReadableDB, WritableDB } from '../Interface.js'; -import { sql } from '../util.js'; -import { strictAssert } from '../../util/assert.js'; +} from '../../util/callLinksRingrtc.node.js'; +import type { ReadableDB, WritableDB } from '../Interface.std.js'; +import { sql } from '../util.std.js'; +import { strictAssert } from '../../util/assert.std.js'; import { CallStatusValue, DirectCallStatus, -} from '../../types/CallDisposition.js'; -import { parseStrict, parseUnknown } from '../../util/schemas.js'; +} from '../../types/CallDisposition.std.js'; +import { parseStrict, parseUnknown } from '../../util/schemas.std.js'; export function callLinkExists(db: ReadableDB, roomId: string): boolean { const [query, params] = sql` diff --git a/ts/sql/server/chatFolders.ts b/ts/sql/server/chatFolders.ts index 9fe97bfa0a..882cb08795 100644 --- a/ts/sql/server/chatFolders.ts +++ b/ts/sql/server/chatFolders.ts @@ -7,12 +7,12 @@ import { CHAT_FOLDER_DELETED_POSITION, CHAT_FOLDER_DEFAULTS, ChatFolderType, -} from '../../types/ChatFolder.js'; -import type { ReadableDB, WritableDB } from '../Interface.js'; -import { sql } from '../util.js'; -import { strictAssert } from '../../util/assert.js'; -import type { CurrentChatFolder } from '../../types/CurrentChatFolders.js'; -import { isCurrentChatFolder } from '../../types/CurrentChatFolders.js'; +} from '../../types/ChatFolder.std.js'; +import type { ReadableDB, WritableDB } from '../Interface.std.js'; +import { sql } from '../util.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import type { CurrentChatFolder } from '../../types/CurrentChatFolders.std.js'; +import { isCurrentChatFolder } from '../../types/CurrentChatFolders.std.js'; export type ChatFolderRow = Readonly< Omit< diff --git a/ts/sql/server/donationReceipts.ts b/ts/sql/server/donationReceipts.ts index 869cee903f..d978643c66 100644 --- a/ts/sql/server/donationReceipts.ts +++ b/ts/sql/server/donationReceipts.ts @@ -1,10 +1,10 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { sql } from '../util.js'; +import { sql } from '../util.std.js'; -import type { DonationReceipt } from '../../types/Donations.js'; -import type { ReadableDB, WritableDB } from '../Interface.js'; +import type { DonationReceipt } from '../../types/Donations.std.js'; +import type { ReadableDB, WritableDB } from '../Interface.std.js'; export function getAllDonationReceipts(db: ReadableDB): Array { const donationReceipts = db diff --git a/ts/sql/server/groupSendEndorsements.ts b/ts/sql/server/groupSendEndorsements.ts index 84f7080cb7..4b704ed241 100644 --- a/ts/sql/server/groupSendEndorsements.ts +++ b/ts/sql/server/groupSendEndorsements.ts @@ -5,17 +5,17 @@ import type { GroupSendCombinedEndorsementRecord, GroupSendEndorsementsData, GroupSendMemberEndorsementRecord, -} from '../../types/GroupSendEndorsements.js'; +} from '../../types/GroupSendEndorsements.std.js'; import { groupSendEndorsementExpirationSchema, groupSendMemberEndorsementSchema, groupSendEndorsementsDataSchema, -} from '../../types/GroupSendEndorsements.js'; -import type { ReadableDB, WritableDB } from '../Interface.js'; -import { sql } from '../util.js'; -import type { AciString } from '../../types/ServiceId.js'; -import { strictAssert } from '../../util/assert.js'; -import { parseLoose, parseUnknown } from '../../util/schemas.js'; +} from '../../types/GroupSendEndorsements.std.js'; +import type { ReadableDB, WritableDB } from '../Interface.std.js'; +import { sql } from '../util.std.js'; +import type { AciString } from '../../types/ServiceId.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { parseLoose, parseUnknown } from '../../util/schemas.std.js'; /** * We don't need to store more than one endorsement per group or per member. diff --git a/ts/sql/server/messageAttachments.ts b/ts/sql/server/messageAttachments.ts index bf4dd226a4..bce8ac377f 100644 --- a/ts/sql/server/messageAttachments.ts +++ b/ts/sql/server/messageAttachments.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import { z } from 'zod'; -import { convertUndefinedToNull } from '../../util/dropNull.js'; -import { messageAttachmentTypeSchema } from '../../types/AttachmentDownload.js'; -import { APPLICATION_OCTET_STREAM } from '../../types/MIME.js'; -import type { MessageAttachmentDBType } from '../Interface.js'; +import { convertUndefinedToNull } from '../../util/dropNull.std.js'; +import { messageAttachmentTypeSchema } from '../../types/AttachmentDownload.std.js'; +import { APPLICATION_OCTET_STREAM } from '../../types/MIME.std.js'; +import type { MessageAttachmentDBType } from '../Interface.std.js'; const permissiveStringOrNull = z .string() diff --git a/ts/sql/sqlLogger.ts b/ts/sql/sqlLogger.ts index f65a89595a..2fa519f708 100644 --- a/ts/sql/sqlLogger.ts +++ b/ts/sql/sqlLogger.ts @@ -3,10 +3,13 @@ import { parentPort } from 'node:worker_threads'; import { format } from 'node:util'; -import type { LoggerType } from '../types/Logging.js'; -import type { WrappedWorkerLogEntry, WrappedWorkerResponse } from './main.js'; -import { consoleLogger } from '../util/consoleLogger.js'; -import { strictAssert } from '../util/assert.js'; +import type { LoggerType } from '../types/Logging.std.js'; +import type { + WrappedWorkerLogEntry, + WrappedWorkerResponse, +} from './main.main.js'; +import { consoleLogger } from '../util/consoleLogger.std.js'; +import { strictAssert } from '../util/assert.std.js'; class SQLLogger { #msgPrefix: string; diff --git a/ts/sql/util.ts b/ts/sql/util.ts index 6ef9f7b87e..2194389aca 100644 --- a/ts/sql/util.ts +++ b/ts/sql/util.ts @@ -4,8 +4,8 @@ import lodash from 'lodash'; -import type { ReadableDB, WritableDB } from './Interface.js'; -import type { LoggerType } from '../types/Logging.js'; +import type { ReadableDB, WritableDB } from './Interface.std.js'; +import type { LoggerType } from '../types/Logging.std.js'; const { isNumber, last } = lodash; diff --git a/ts/state/actions.ts b/ts/state/actions.ts index c440823857..63c8d098aa 100644 --- a/ts/state/actions.ts +++ b/ts/state/actions.ts @@ -1,41 +1,41 @@ // Copyright 2019 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { actions as accounts } from './ducks/accounts.js'; -import { actions as app } from './ducks/app.js'; -import { actions as audioPlayer } from './ducks/audioPlayer.js'; -import { actions as audioRecorder } from './ducks/audioRecorder.js'; -import { actions as badges } from './ducks/badges.js'; -import { actions as callHistory } from './ducks/callHistory.js'; -import { actions as calling } from './ducks/calling.js'; -import { actions as chatFolders } from './ducks/chatFolders.js'; -import { actions as composer } from './ducks/composer.js'; -import { actions as conversations } from './ducks/conversations.js'; -import { actions as crashReports } from './ducks/crashReports.js'; -import { actions as donations } from './ducks/donations.js'; -import { actions as emojis } from './ducks/emojis.js'; -import { actions as expiration } from './ducks/expiration.js'; -import { actions as gifs } from './ducks/gifs.js'; -import { actions as globalModals } from './ducks/globalModals.js'; -import { actions as inbox } from './ducks/inbox.js'; -import { actions as installer } from './ducks/installer.js'; -import { actions as items } from './ducks/items.js'; -import { actions as lightbox } from './ducks/lightbox.js'; -import { actions as linkPreviews } from './ducks/linkPreviews.js'; -import { actions as mediaGallery } from './ducks/mediaGallery.js'; -import { actions as nav } from './ducks/nav.js'; -import { actions as network } from './ducks/network.js'; -import { actions as notificationProfiles } from './ducks/notificationProfiles.js'; -import { actions as safetyNumber } from './ducks/safetyNumber.js'; -import { actions as search } from './ducks/search.js'; -import { actions as stickers } from './ducks/stickers.js'; -import { actions as stories } from './ducks/stories.js'; -import { actions as storyDistributionLists } from './ducks/storyDistributionLists.js'; -import { actions as toast } from './ducks/toast.js'; -import { actions as updates } from './ducks/updates.js'; -import { actions as user } from './ducks/user.js'; -import { actions as username } from './ducks/username.js'; -import type { ReduxActions } from './types.js'; +import { actions as accounts } from './ducks/accounts.preload.js'; +import { actions as app } from './ducks/app.preload.js'; +import { actions as audioPlayer } from './ducks/audioPlayer.preload.js'; +import { actions as audioRecorder } from './ducks/audioRecorder.preload.js'; +import { actions as badges } from './ducks/badges.preload.js'; +import { actions as callHistory } from './ducks/callHistory.preload.js'; +import { actions as calling } from './ducks/calling.preload.js'; +import { actions as chatFolders } from './ducks/chatFolders.preload.js'; +import { actions as composer } from './ducks/composer.preload.js'; +import { actions as conversations } from './ducks/conversations.preload.js'; +import { actions as crashReports } from './ducks/crashReports.preload.js'; +import { actions as donations } from './ducks/donations.preload.js'; +import { actions as emojis } from './ducks/emojis.preload.js'; +import { actions as expiration } from './ducks/expiration.std.js'; +import { actions as gifs } from './ducks/gifs.preload.js'; +import { actions as globalModals } from './ducks/globalModals.preload.js'; +import { actions as inbox } from './ducks/inbox.std.js'; +import { actions as installer } from './ducks/installer.preload.js'; +import { actions as items } from './ducks/items.preload.js'; +import { actions as lightbox } from './ducks/lightbox.preload.js'; +import { actions as linkPreviews } from './ducks/linkPreviews.preload.js'; +import { actions as mediaGallery } from './ducks/mediaGallery.preload.js'; +import { actions as nav } from './ducks/nav.std.js'; +import { actions as network } from './ducks/network.dom.js'; +import { actions as notificationProfiles } from './ducks/notificationProfiles.preload.js'; +import { actions as safetyNumber } from './ducks/safetyNumber.preload.js'; +import { actions as search } from './ducks/search.preload.js'; +import { actions as stickers } from './ducks/stickers.preload.js'; +import { actions as stories } from './ducks/stories.preload.js'; +import { actions as storyDistributionLists } from './ducks/storyDistributionLists.preload.js'; +import { actions as toast } from './ducks/toast.preload.js'; +import { actions as updates } from './ducks/updates.preload.js'; +import { actions as user } from './ducks/user.preload.js'; +import { actions as username } from './ducks/username.preload.js'; +import type { ReduxActions } from './types.std.js'; export const actionCreators: ReduxActions = { accounts, diff --git a/ts/state/createStore.ts b/ts/state/createStore.ts index 815d0fa9ca..e3f3821d8a 100644 --- a/ts/state/createStore.ts +++ b/ts/state/createStore.ts @@ -8,13 +8,13 @@ import promise from 'redux-promise-middleware'; import { thunk } from 'redux-thunk'; import { createLogger as createReduxLogger } from 'redux-logger'; -import { createLogger } from '../logging/log.js'; -import type { StateType } from './reducer.js'; -import { reducer } from './reducer.js'; -import { dispatchItemsMiddleware } from '../shims/dispatchItemsMiddleware.js'; -import { isOlderThan } from '../util/timestamp.js'; -import { SECOND } from '../util/durations/index.js'; -import { getEnvironment } from '../environment.js'; +import { createLogger } from '../logging/log.std.js'; +import type { StateType } from './reducer.preload.js'; +import { reducer } from './reducer.preload.js'; +import { dispatchItemsMiddleware } from '../shims/dispatchItemsMiddleware.preload.js'; +import { isOlderThan } from '../util/timestamp.std.js'; +import { SECOND } from '../util/durations/index.std.js'; +import { getEnvironment } from '../environment.std.js'; const log = createLogger('createStore'); diff --git a/ts/state/ducks/accounts.ts b/ts/state/ducks/accounts.ts index 23de639b88..c8bb877c7d 100644 --- a/ts/state/ducks/accounts.ts +++ b/ts/state/ducks/accounts.ts @@ -4,17 +4,17 @@ import type { ThunkAction } from 'redux-thunk'; import type { ReadonlyDeep } from 'type-fest'; -import * as Errors from '../../types/errors.js'; -import { cdsLookup } from '../../textsecure/WebAPI.js'; -import { createLogger } from '../../logging/log.js'; +import * as Errors from '../../types/errors.std.js'; +import { cdsLookup } from '../../textsecure/WebAPI.preload.js'; +import { createLogger } from '../../logging/log.std.js'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; -import type { StateType as RootStateType } from '../reducer.js'; -import type { ServiceIdString } from '../../types/ServiceId.js'; -import { getServiceIdsForE164s } from '../../util/getServiceIdsForE164s.js'; -import { useBoundActions } from '../../hooks/useBoundActions.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.js'; +import type { StateType as RootStateType } from '../reducer.preload.js'; +import type { ServiceIdString } from '../../types/ServiceId.std.js'; +import { getServiceIdsForE164s } from '../../util/getServiceIdsForE164s.dom.js'; +import { useBoundActions } from '../../hooks/useBoundActions.std.js'; -import type { NoopActionType } from './noop.js'; +import type { NoopActionType } from './noop.std.js'; const log = createLogger('accounts'); diff --git a/ts/state/ducks/app.ts b/ts/state/ducks/app.ts index 9a03ca0963..ddda047dc6 100644 --- a/ts/state/ducks/app.ts +++ b/ts/state/ducks/app.ts @@ -3,17 +3,17 @@ import type { ThunkAction } from 'redux-thunk'; import type { ReadonlyDeep } from 'type-fest'; -import type { StateType as RootStateType } from '../reducer.js'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; -import { useBoundActions } from '../../hooks/useBoundActions.js'; -import { createLogger } from '../../logging/log.js'; -import { getEnvironment, Environment } from '../../environment.js'; +import type { StateType as RootStateType } from '../reducer.preload.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.js'; +import { useBoundActions } from '../../hooks/useBoundActions.std.js'; +import { createLogger } from '../../logging/log.std.js'; +import { getEnvironment, Environment } from '../../environment.std.js'; import { START_INSTALLER, type StartInstallerActionType, SHOW_BACKUP_IMPORT, type ShowBackupImportActionType, -} from './installer.js'; +} from './installer.preload.js'; const log = createLogger('app'); diff --git a/ts/state/ducks/audioPlayer.ts b/ts/state/ducks/audioPlayer.ts index 53f1499504..e8136fb4f4 100644 --- a/ts/state/ducks/audioPlayer.ts +++ b/ts/state/ducks/audioPlayer.ts @@ -3,16 +3,16 @@ import type { ThunkAction } from 'redux-thunk'; import type { ReadonlyDeep } from 'type-fest'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; -import { useBoundActions } from '../../hooks/useBoundActions.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.js'; +import { useBoundActions } from '../../hooks/useBoundActions.std.js'; -import type { StateType as RootStateType } from '../reducer.js'; -import { setVoiceNotePlaybackRate } from './conversations.js'; -import { extractVoiceNoteForPlayback } from '../selectors/audioPlayer.js'; +import type { StateType as RootStateType } from '../reducer.preload.js'; +import { setVoiceNotePlaybackRate } from './conversations.preload.js'; +import { extractVoiceNoteForPlayback } from '../selectors/audioPlayer.preload.js'; import type { VoiceNoteAndConsecutiveForPlayback, VoiceNoteForPlayback, -} from '../selectors/audioPlayer.js'; +} from '../selectors/audioPlayer.preload.js'; import type { MessagesAddedActionType, @@ -20,11 +20,11 @@ import type { MessageChangedActionType, TargetedConversationChangedActionType, ConversationsUpdatedActionType, -} from './conversations.js'; -import { createLogger } from '../../logging/log.js'; -import { isAudio } from '../../util/Attachment.js'; -import { getLocalAttachmentUrl } from '../../util/getLocalAttachmentUrl.js'; -import { assertDev } from '../../util/assert.js'; +} from './conversations.preload.js'; +import { createLogger } from '../../logging/log.std.js'; +import { isAudio } from '../../util/Attachment.std.js'; +import { getLocalAttachmentUrl } from '../../util/getLocalAttachmentUrl.std.js'; +import { assertDev } from '../../util/assert.std.js'; const log = createLogger('audioPlayer'); diff --git a/ts/state/ducks/audioRecorder.ts b/ts/state/ducks/audioRecorder.ts index 2f1576671f..86458f7dc6 100644 --- a/ts/state/ducks/audioRecorder.ts +++ b/ts/state/ducks/audioRecorder.ts @@ -5,22 +5,22 @@ import type { ThunkAction } from 'redux-thunk'; import { v4 as generateUuid } from 'uuid'; import type { ReadonlyDeep } from 'type-fest'; -import { createLogger } from '../../logging/log.js'; -import type { InMemoryAttachmentDraftType } from '../../types/Attachment.js'; -import { SignalService as Proto } from '../../protobuf/index.js'; -import type { StateType as RootStateType } from '../reducer.js'; -import { fileToBytes } from '../../util/fileToBytes.js'; -import { recorder } from '../../services/audioRecorder.js'; -import { stringToMIMEType } from '../../types/MIME.js'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; -import { useBoundActions } from '../../hooks/useBoundActions.js'; -import { getComposerStateForConversation } from './composer.js'; +import { createLogger } from '../../logging/log.std.js'; +import type { InMemoryAttachmentDraftType } from '../../types/Attachment.std.js'; +import { SignalService as Proto } from '../../protobuf/index.std.js'; +import type { StateType as RootStateType } from '../reducer.preload.js'; +import { fileToBytes } from '../../util/fileToBytes.std.js'; +import { recorder } from '../../services/audioRecorder.dom.js'; +import { stringToMIMEType } from '../../types/MIME.std.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.js'; +import { useBoundActions } from '../../hooks/useBoundActions.std.js'; +import { getComposerStateForConversation } from './composer.preload.js'; -import * as Errors from '../../types/errors.js'; +import * as Errors from '../../types/errors.std.js'; import { ErrorDialogAudioRecorderType, RecordingState, -} from '../../types/AudioRecorder.js'; +} from '../../types/AudioRecorder.std.js'; const log = createLogger('audioRecorder'); diff --git a/ts/state/ducks/badges.ts b/ts/state/ducks/badges.ts index b7ac2d685f..5dde061796 100644 --- a/ts/state/ducks/badges.ts +++ b/ts/state/ducks/badges.ts @@ -4,13 +4,13 @@ import type { ThunkAction } from 'redux-thunk'; import lodash from 'lodash'; import type { ReadonlyDeep } from 'type-fest'; -import { DataWriter } from '../../sql/Client.js'; -import type { StateType as RootStateType } from '../reducer.js'; -import type { BadgeType, BadgeImageType } from '../../badges/types.js'; -import { getOwn } from '../../util/getOwn.js'; -import { badgeImageFileDownloader } from '../../badges/badgeImageFileDownloader.js'; -import { useBoundActions } from '../../hooks/useBoundActions.js'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; +import { DataWriter } from '../../sql/Client.preload.js'; +import type { StateType as RootStateType } from '../reducer.preload.js'; +import type { BadgeType, BadgeImageType } from '../../badges/types.std.js'; +import { getOwn } from '../../util/getOwn.std.js'; +import { badgeImageFileDownloader } from '../../badges/badgeImageFileDownloader.preload.js'; +import { useBoundActions } from '../../hooks/useBoundActions.std.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.js'; const { isEqual, mapValues } = lodash; diff --git a/ts/state/ducks/callHistory.ts b/ts/state/ducks/callHistory.ts index a9eb06d03b..10e9ec6773 100644 --- a/ts/state/ducks/callHistory.ts +++ b/ts/state/ducks/callHistory.ts @@ -4,38 +4,38 @@ import type { ReadonlyDeep } from 'type-fest'; import type { ThunkAction, ThunkDispatch } from 'redux-thunk'; import lodash from 'lodash'; -import type { StateType as RootStateType } from '../reducer.js'; +import type { StateType as RootStateType } from '../reducer.preload.js'; import { clearCallHistoryDataAndSync, markAllCallHistoryReadAndSync, -} from '../../util/callDisposition.js'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; -import { useBoundActions } from '../../hooks/useBoundActions.js'; -import type { ToastActionType } from './toast.js'; -import { showToast } from './toast.js'; -import { DataReader, DataWriter } from '../../sql/Client.js'; -import { ToastType } from '../../types/Toast.js'; +} from '../../util/callDisposition.preload.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.js'; +import { useBoundActions } from '../../hooks/useBoundActions.std.js'; +import type { ToastActionType } from './toast.preload.js'; +import { showToast } from './toast.preload.js'; +import { DataReader, DataWriter } from '../../sql/Client.preload.js'; +import { ToastType } from '../../types/Toast.dom.js'; import { ClearCallHistoryResult, type CallHistoryDetails, -} from '../../types/CallDisposition.js'; -import { createLogger } from '../../logging/log.js'; -import * as Errors from '../../types/errors.js'; +} from '../../types/CallDisposition.std.js'; +import { createLogger } from '../../logging/log.std.js'; +import * as Errors from '../../types/errors.std.js'; import { getCallHistoryLatestCall, getCallHistorySelector, -} from '../selectors/callHistory.js'; +} from '../selectors/callHistory.std.js'; import { getCallsHistoryForRedux, getCallsHistoryUnreadCountForRedux, loadCallHistory, -} from '../../services/callHistoryLoader.js'; -import { makeLookup } from '../../util/makeLookup.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; -import { getIntl } from '../selectors/user.js'; -import { ButtonVariant } from '../../components/Button.js'; -import type { ShowErrorModalActionType } from './globalModals.js'; -import { SHOW_ERROR_MODAL } from './globalModals.js'; +} from '../../services/callHistoryLoader.preload.js'; +import { makeLookup } from '../../util/makeLookup.std.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; +import { getIntl } from '../selectors/user.std.js'; +import { ButtonVariant } from '../../components/Button.dom.js'; +import type { ShowErrorModalActionType } from './globalModals.preload.js'; +import { SHOW_ERROR_MODAL } from './globalModals.preload.js'; const { debounce, omit } = lodash; diff --git a/ts/state/ducks/calling.ts b/ts/state/ducks/calling.ts index e543114e02..e0197fa450 100644 --- a/ts/state/ducks/calling.ts +++ b/ts/state/ducks/calling.ts @@ -10,20 +10,20 @@ import { GroupCallEndReason, type Reaction as CallReaction, } from '@signalapp/ringrtc'; -import { getOwn } from '../../util/getOwn.js'; -import * as Errors from '../../types/errors.js'; -import { getIntl, getPlatform } from '../selectors/user.js'; -import { isConversationTooBigToRing } from '../../conversations/isConversationTooBigToRing.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; -import { drop } from '../../util/drop.js'; +import { getOwn } from '../../util/getOwn.std.js'; +import * as Errors from '../../types/errors.std.js'; +import { getIntl, getPlatform } from '../selectors/user.std.js'; +import { isConversationTooBigToRing } from '../../conversations/isConversationTooBigToRing.dom.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; +import { drop } from '../../util/drop.std.js'; import { DesktopCapturer, isNativeMacScreenShareSupported, type DesktopCapturerBaton, -} from '../../util/desktopCapturer.js'; -import { calling } from '../../services/calling.js'; -import { truncateAudioLevel } from '../../calling/truncateAudioLevel.js'; -import type { StateType as RootStateType } from '../reducer.js'; +} from '../../util/desktopCapturer.preload.js'; +import { calling } from '../../services/calling.preload.js'; +import { truncateAudioLevel } from '../../calling/truncateAudioLevel.std.js'; +import type { StateType as RootStateType } from '../reducer.preload.js'; import type { ActiveCallReaction, ActiveCallReactionsType, @@ -33,13 +33,13 @@ import type { ObservedRemoteMuteType, PresentedSource, PresentableSource, -} from '../../types/Calling.js'; +} from '../../types/Calling.std.js'; import { isCallLinkAdmin, type CallLinkRestrictions, type CallLinkStateType, type CallLinkType, -} from '../../types/CallLink.js'; +} from '../../types/CallLink.std.js'; import { CALLING_REACTIONS_LIFETIME, MAX_CALLING_REACTIONS, @@ -49,71 +49,74 @@ import { CallState, GroupCallConnectionState, GroupCallJoinState, -} from '../../types/Calling.js'; -import { CallMode } from '../../types/CallDisposition.js'; -import { callingTones } from '../../util/callingTones.js'; -import { requestCameraPermissions } from '../../util/callingPermissions.js'; +} from '../../types/Calling.std.js'; +import { CallMode } from '../../types/CallDisposition.std.js'; +import { callingTones } from '../../util/callingTones.preload.js'; +import { requestCameraPermissions } from '../../util/callingPermissions.dom.js'; import { CALL_LINK_DEFAULT_STATE, toAdminKeyBytes, toCallHistoryFromUnusedCallLink, -} from '../../util/callLinks.js'; -import { getRoomIdFromRootKey } from '../../util/callLinksRingrtc.js'; -import { sendCallLinkUpdateSync } from '../../util/sendCallLinkUpdateSync.js'; -import { sleep } from '../../util/sleep.js'; -import { LatestQueue } from '../../util/LatestQueue.js'; -import type { AciString, ServiceIdString } from '../../types/ServiceId.js'; +} from '../../util/callLinks.std.js'; +import { getRoomIdFromRootKey } from '../../util/callLinksRingrtc.node.js'; +import { sendCallLinkUpdateSync } from '../../util/sendCallLinkUpdateSync.preload.js'; +import { sleep } from '../../util/sleep.std.js'; +import { LatestQueue } from '../../util/LatestQueue.std.js'; +import type { AciString, ServiceIdString } from '../../types/ServiceId.std.js'; import type { ConversationsUpdatedActionType, ConversationRemovedActionType, -} from './conversations.js'; -import { getConversationCallMode, updateLastMessage } from './conversations.js'; -import { createLogger } from '../../logging/log.js'; -import { strictAssert } from '../../util/assert.js'; -import { waitForOnline } from '../../util/waitForOnline.js'; -import * as mapUtil from '../../util/mapUtil.js'; -import { isCallSafe } from '../../util/isCallSafe.js'; -import { isDirectConversation } from '../../util/whatTypeOfConversation.js'; -import { SHOW_TOAST } from './toast.js'; -import { ToastType } from '../../types/Toast.js'; -import type { ShowToastActionType } from './toast.js'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; -import { useBoundActions } from '../../hooks/useBoundActions.js'; +} from './conversations.preload.js'; +import { + getConversationCallMode, + updateLastMessage, +} from './conversations.preload.js'; +import { createLogger } from '../../logging/log.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { waitForOnline } from '../../util/waitForOnline.dom.js'; +import * as mapUtil from '../../util/mapUtil.std.js'; +import { isCallSafe } from '../../util/isCallSafe.dom.js'; +import { isDirectConversation } from '../../util/whatTypeOfConversation.dom.js'; +import { SHOW_TOAST } from './toast.preload.js'; +import { ToastType } from '../../types/Toast.dom.js'; +import type { ShowToastActionType } from './toast.preload.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.js'; +import { useBoundActions } from '../../hooks/useBoundActions.std.js'; import { isAnybodyElseInGroupCall, isAnybodyInGroupCall, MAX_CALL_PARTICIPANTS_FOR_DEFAULT_MUTE, -} from './callingHelpers.js'; -import { SafetyNumberChangeSource } from '../../types/SafetyNumberChangeSource.js'; +} from './callingHelpers.std.js'; +import { SafetyNumberChangeSource } from '../../types/SafetyNumberChangeSource.std.js'; import { isGroupOrAdhocCallMode, isGroupOrAdhocCallState, -} from '../../util/isGroupOrAdhocCall.js'; +} from '../../util/isGroupOrAdhocCall.std.js'; import type { ShowErrorModalActionType, ToggleConfirmLeaveCallModalActionType, -} from './globalModals.js'; +} from './globalModals.preload.js'; import { SHOW_ERROR_MODAL, toggleConfirmLeaveCallModal, -} from './globalModals.js'; -import { ButtonVariant } from '../../components/Button.js'; -import { getConversationIdForLogging } from '../../util/idForLogging.js'; -import { DataReader, DataWriter } from '../../sql/Client.js'; -import { isAciString } from '../../util/isAciString.js'; -import type { CallHistoryAdd } from './callHistory.js'; -import { addCallHistory, reloadCallHistory } from './callHistory.js'; -import { saveDraftRecordingIfNeeded } from './composer.js'; -import type { StartCallData } from '../../components/ConfirmLeaveCallModal.js'; +} from './globalModals.preload.js'; +import { ButtonVariant } from '../../components/Button.dom.js'; +import { getConversationIdForLogging } from '../../util/idForLogging.preload.js'; +import { DataReader, DataWriter } from '../../sql/Client.preload.js'; +import { isAciString } from '../../util/isAciString.std.js'; +import type { CallHistoryAdd } from './callHistory.preload.js'; +import { addCallHistory, reloadCallHistory } from './callHistory.preload.js'; +import { saveDraftRecordingIfNeeded } from './composer.preload.js'; +import type { StartCallData } from '../../components/ConfirmLeaveCallModal.dom.js'; import { getCallLinksByRoomId, getPresentingSource, -} from '../selectors/calling.js'; -import { storageServiceUploadJob } from '../../services/storage.js'; -import { CallLinkFinalizeDeleteManager } from '../../jobs/CallLinkFinalizeDeleteManager.js'; -import { callLinkRefreshJobQueue } from '../../jobs/callLinkRefreshJobQueue.js'; -import { isOnline } from '../../textsecure/WebAPI.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +} from '../selectors/calling.std.js'; +import { storageServiceUploadJob } from '../../services/storage.preload.js'; +import { CallLinkFinalizeDeleteManager } from '../../jobs/CallLinkFinalizeDeleteManager.preload.js'; +import { callLinkRefreshJobQueue } from '../../jobs/callLinkRefreshJobQueue.preload.js'; +import { isOnline } from '../../textsecure/WebAPI.preload.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; const { omit } = lodash; diff --git a/ts/state/ducks/callingHelpers.ts b/ts/state/ducks/callingHelpers.ts index d6275adb0b..fe30fefe5a 100644 --- a/ts/state/ducks/callingHelpers.ts +++ b/ts/state/ducks/callingHelpers.ts @@ -7,11 +7,11 @@ import { CallState, GroupCallConnectionState, GroupCallJoinState, -} from '../../types/Calling.js'; -import { CallMode } from '../../types/CallDisposition.js'; +} from '../../types/Calling.std.js'; +import { CallMode } from '../../types/CallDisposition.std.js'; -import type { CallingConversationType } from '../../types/Calling.js'; -import type { AciString } from '../../types/ServiceId.js'; +import type { CallingConversationType } from '../../types/Calling.std.js'; +import type { AciString } from '../../types/ServiceId.std.js'; import type { DirectCallStateType, CallsByConversationType, @@ -19,7 +19,7 @@ import type { GroupCallStateType, GroupCallParticipantInfoType, ActiveCallStateType, -} from './calling.js'; +} from './calling.preload.js'; export const MAX_CALL_PARTICIPANTS_FOR_DEFAULT_MUTE = 8; diff --git a/ts/state/ducks/chatFolders.ts b/ts/state/ducks/chatFolders.ts index d30bb90fe5..6163d16ac2 100644 --- a/ts/state/ducks/chatFolders.ts +++ b/ts/state/ducks/chatFolders.ts @@ -4,30 +4,30 @@ import type { ReadonlyDeep } from 'type-fest'; import { v4 as generateUuid } from 'uuid'; import type { ThunkAction } from 'redux-thunk'; import { throttle } from 'lodash'; -import type { StateType as RootStateType } from '../reducer.js'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; -import { useBoundActions } from '../../hooks/useBoundActions.js'; +import type { StateType as RootStateType } from '../reducer.preload.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.js'; +import { useBoundActions } from '../../hooks/useBoundActions.std.js'; import { ChatFolderParamsSchema, type ChatFolder, type ChatFolderId, type ChatFolderParams, -} from '../../types/ChatFolder.js'; -import { getCurrentChatFolders } from '../selectors/chatFolders.js'; -import { DataReader, DataWriter } from '../../sql/Client.js'; -import { storageServiceUploadJob } from '../../services/storage.js'; -import { parseStrict } from '../../util/schemas.js'; -import { chatFolderCleanupService } from '../../services/expiring/chatFolderCleanupService.js'; -import { drop } from '../../util/drop.js'; +} from '../../types/ChatFolder.std.js'; +import { getCurrentChatFolders } from '../selectors/chatFolders.std.js'; +import { DataReader, DataWriter } from '../../sql/Client.preload.js'; +import { storageServiceUploadJob } from '../../services/storage.preload.js'; +import { parseStrict } from '../../util/schemas.std.js'; +import { chatFolderCleanupService } from '../../services/expiring/chatFolderCleanupService.preload.js'; +import { drop } from '../../util/drop.std.js'; import { TARGETED_CONVERSATION_CHANGED, type TargetedConversationChangedActionType, -} from './conversations.js'; -import type { ShowToastActionType } from './toast.js'; -import { showToast } from './toast.js'; -import { ToastType } from '../../types/Toast.js'; -import type { CurrentChatFolder } from '../../types/CurrentChatFolders.js'; -import { CurrentChatFolders } from '../../types/CurrentChatFolders.js'; +} from './conversations.preload.js'; +import type { ShowToastActionType } from './toast.preload.js'; +import { showToast } from './toast.preload.js'; +import { ToastType } from '../../types/Toast.dom.js'; +import type { CurrentChatFolder } from '../../types/CurrentChatFolders.std.js'; +import { CurrentChatFolders } from '../../types/CurrentChatFolders.std.js'; export type ChatFoldersState = ReadonlyDeep<{ currentChatFolders: CurrentChatFolders; diff --git a/ts/state/ducks/composer.ts b/ts/state/ducks/composer.ts index f8d2500923..2e2b4a0740 100644 --- a/ts/state/ducks/composer.ts +++ b/ts/state/ducks/composer.ts @@ -10,38 +10,41 @@ import type { ReadonlyDeep } from 'type-fest'; import type { AddLinkPreviewActionType, RemoveLinkPreviewActionType, -} from './linkPreviews.js'; +} from './linkPreviews.preload.js'; import type { AttachmentType, AttachmentDraftType, InMemoryAttachmentDraftType, -} from '../../types/Attachment.js'; -import { isVideoAttachment, isImageAttachment } from '../../util/Attachment.js'; -import { DataReader, DataWriter } from '../../sql/Client.js'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; -import type { DraftBodyRanges } from '../../types/BodyRange.js'; -import type { LinkPreviewForUIType } from '../../types/message/LinkPreviews.js'; +} from '../../types/Attachment.std.js'; +import { + isVideoAttachment, + isImageAttachment, +} from '../../util/Attachment.std.js'; +import { DataReader, DataWriter } from '../../sql/Client.preload.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.js'; +import type { DraftBodyRanges } from '../../types/BodyRange.std.js'; +import type { LinkPreviewForUIType } from '../../types/message/LinkPreviews.std.js'; import type { ReadonlyMessageAttributesType } from '../../model-types.d.ts'; -import type { NoopActionType } from './noop.js'; -import type { ShowToastActionType } from './toast.js'; -import type { StateType as RootStateType } from '../reducer.js'; -import { createLogger } from '../../logging/log.js'; -import * as Errors from '../../types/errors.js'; +import type { NoopActionType } from './noop.std.js'; +import type { ShowToastActionType } from './toast.preload.js'; +import type { StateType as RootStateType } from '../reducer.preload.js'; +import { createLogger } from '../../logging/log.std.js'; +import * as Errors from '../../types/errors.std.js'; import { ADD_PREVIEW as ADD_LINK_PREVIEW, REMOVE_PREVIEW as REMOVE_LINK_PREVIEW, -} from './linkPreviews.js'; -import { LinkPreviewSourceType } from '../../types/LinkPreview.js'; -import type { AciString } from '../../types/ServiceId.js'; -import { completeRecording, getIsRecording } from './audioRecorder.js'; -import { SHOW_TOAST } from './toast.js'; -import type { AnyToast } from '../../types/Toast.js'; -import { ToastType } from '../../types/Toast.js'; -import { SafetyNumberChangeSource } from '../../types/SafetyNumberChangeSource.js'; -import { assignWithNoUnnecessaryAllocation } from '../../util/assignWithNoUnnecessaryAllocation.js'; -import { blockSendUntilConversationsAreVerified } from '../../util/blockSendUntilConversationsAreVerified.js'; -import { clearConversationDraftAttachments } from '../../util/clearConversationDraftAttachments.js'; -import { deleteDraftAttachment } from '../../util/deleteDraftAttachment.js'; +} from './linkPreviews.preload.js'; +import { LinkPreviewSourceType } from '../../types/LinkPreview.std.js'; +import type { AciString } from '../../types/ServiceId.std.js'; +import { completeRecording, getIsRecording } from './audioRecorder.preload.js'; +import { SHOW_TOAST } from './toast.preload.js'; +import type { AnyToast } from '../../types/Toast.dom.js'; +import { ToastType } from '../../types/Toast.dom.js'; +import { SafetyNumberChangeSource } from '../../types/SafetyNumberChangeSource.std.js'; +import { assignWithNoUnnecessaryAllocation } from '../../util/assignWithNoUnnecessaryAllocation.std.js'; +import { blockSendUntilConversationsAreVerified } from '../../util/blockSendUntilConversationsAreVerified.dom.js'; +import { clearConversationDraftAttachments } from '../../util/clearConversationDraftAttachments.preload.js'; +import { deleteDraftAttachment } from '../../util/deleteDraftAttachment.preload.js'; import { getLinkPreviewForSend, hasLinkPreviewLoaded, @@ -49,50 +52,50 @@ import { removeLinkPreview, resetLinkPreview, suspendLinkPreviews, -} from '../../services/LinkPreview.js'; +} from '../../services/LinkPreview.preload.js'; import { getMaximumOutgoingAttachmentSizeInKb, getRenderDetailsForLimit, KIBIBYTE, -} from '../../types/AttachmentSize.js'; -import { getValue as getRemoteConfigValue } from '../../RemoteConfig.js'; -import { getRecipientsByConversation } from '../../util/getRecipientsByConversation.js'; -import { processAttachment } from '../../util/processAttachment.js'; -import { hasDraftAttachments } from '../../util/hasDraftAttachments.js'; -import { isFileDangerous } from '../../util/isFileDangerous.js'; -import { stringToMIMEType } from '../../types/MIME.js'; -import { isNotNil } from '../../util/isNotNil.js'; -import { replaceIndex } from '../../util/replaceIndex.js'; -import { resolveAttachmentDraftData } from '../../util/resolveAttachmentDraftData.js'; -import { resolveDraftAttachmentOnDisk } from '../../util/resolveDraftAttachmentOnDisk.js'; -import { shouldShowInvalidMessageToast } from '../../util/shouldShowInvalidMessageToast.js'; -import { writeDraftAttachment } from '../../util/writeDraftAttachment.js'; -import { getMessageById } from '../../messages/getMessageById.js'; -import { canReply, isNormalBubble } from '../selectors/message.js'; -import { getAuthorId } from '../../messages/sources.js'; -import { getConversationSelector } from '../selectors/conversations.js'; -import { enqueueReactionForSend } from '../../reactions/enqueueReactionForSend.js'; -import { useBoundActions } from '../../hooks/useBoundActions.js'; +} from '../../types/AttachmentSize.std.js'; +import { getValue as getRemoteConfigValue } from '../../RemoteConfig.dom.js'; +import { getRecipientsByConversation } from '../../util/getRecipientsByConversation.dom.js'; +import { processAttachment } from '../../util/processAttachment.preload.js'; +import { hasDraftAttachments } from '../../util/hasDraftAttachments.std.js'; +import { isFileDangerous } from '../../util/isFileDangerous.std.js'; +import { stringToMIMEType } from '../../types/MIME.std.js'; +import { isNotNil } from '../../util/isNotNil.std.js'; +import { replaceIndex } from '../../util/replaceIndex.std.js'; +import { resolveAttachmentDraftData } from '../../util/resolveAttachmentDraftData.preload.js'; +import { resolveDraftAttachmentOnDisk } from '../../util/resolveDraftAttachmentOnDisk.preload.js'; +import { shouldShowInvalidMessageToast } from '../../util/shouldShowInvalidMessageToast.preload.js'; +import { writeDraftAttachment } from '../../util/writeDraftAttachment.preload.js'; +import { getMessageById } from '../../messages/getMessageById.preload.js'; +import { canReply, isNormalBubble } from '../selectors/message.preload.js'; +import { getAuthorId } from '../../messages/sources.preload.js'; +import { getConversationSelector } from '../selectors/conversations.dom.js'; +import { enqueueReactionForSend } from '../../reactions/enqueueReactionForSend.preload.js'; +import { useBoundActions } from '../../hooks/useBoundActions.std.js'; import { CONVERSATION_UNLOADED, TARGETED_CONVERSATION_CHANGED, scrollToMessage, -} from './conversations.js'; +} from './conversations.preload.js'; import type { ConversationUnloadedActionType, TargetedConversationChangedActionType, ScrollToMessageActionType, -} from './conversations.js'; -import { longRunningTaskWrapper } from '../../util/longRunningTaskWrapper.js'; -import { drop } from '../../util/drop.js'; -import { strictAssert } from '../../util/assert.js'; -import { makeQuote } from '../../util/makeQuote.js'; -import { sendEditedMessage as doSendEditedMessage } from '../../util/sendEditedMessage.js'; -import { Sound, SoundType } from '../../util/Sound.js'; +} from './conversations.preload.js'; +import { longRunningTaskWrapper } from '../../util/longRunningTaskWrapper.dom.js'; +import { drop } from '../../util/drop.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { makeQuote } from '../../util/makeQuote.preload.js'; +import { sendEditedMessage as doSendEditedMessage } from '../../util/sendEditedMessage.preload.js'; +import { Sound, SoundType } from '../../util/Sound.std.js'; import { isImageTypeSupported, isVideoTypeSupported, -} from '../../util/GoogleChrome.js'; +} from '../../util/GoogleChrome.std.js'; const { debounce, isEqual } = lodash; diff --git a/ts/state/ducks/conversations.ts b/ts/state/ducks/conversations.ts index 1e55444a39..78869defa4 100644 --- a/ts/state/ducks/conversations.ts +++ b/ts/state/ducks/conversations.ts @@ -7,53 +7,56 @@ import { type PhoneNumber } from 'google-libphonenumber'; import { clipboard, ipcRenderer } from 'electron'; import type { ReadonlyDeep } from 'type-fest'; -import { DataReader, DataWriter } from '../../sql/Client.js'; -import type { AttachmentType } from '../../types/Attachment.js'; -import type { StateType as RootStateType } from '../reducer.js'; -import * as groups from '../../groups.js'; -import { createLogger } from '../../logging/log.js'; -import { calling } from '../../services/calling.js'; -import { retryPlaceholders } from '../../services/retryPlaceholders.js'; -import { getOwn } from '../../util/getOwn.js'; -import { assertDev, strictAssert } from '../../util/assert.js'; -import { drop } from '../../util/drop.js'; +import { DataReader, DataWriter } from '../../sql/Client.preload.js'; +import type { AttachmentType } from '../../types/Attachment.std.js'; +import type { StateType as RootStateType } from '../reducer.preload.js'; +import * as groups from '../../groups.preload.js'; +import { createLogger } from '../../logging/log.std.js'; +import { calling } from '../../services/calling.preload.js'; +import { retryPlaceholders } from '../../services/retryPlaceholders.std.js'; +import { getOwn } from '../../util/getOwn.std.js'; +import { assertDev, strictAssert } from '../../util/assert.std.js'; +import { drop } from '../../util/drop.std.js'; import { deleteAvatar, writeNewAvatarData, getUnusedFilename, readAttachmentData, saveAttachmentToDisk, -} from '../../util/migrations.js'; -import type { DurationInSeconds } from '../../util/durations/index.js'; -import * as universalExpireTimer from '../../util/universalExpireTimer.js'; -import * as Attachment from '../../util/Attachment.js'; -import type { LocalizerType } from '../../types/I18N.js'; -import { AttachmentDownloadUrgency } from '../../types/AttachmentDownload.js'; -import { isFileDangerous } from '../../util/isFileDangerous.js'; -import { getLocalAttachmentUrl } from '../../util/getLocalAttachmentUrl.js'; -import { instance as libphonenumberInstance } from '../../util/libphonenumberInstance.js'; +} from '../../util/migrations.preload.js'; +import type { DurationInSeconds } from '../../util/durations/index.std.js'; +import * as universalExpireTimer from '../../util/universalExpireTimer.preload.js'; +import * as Attachment from '../../util/Attachment.std.js'; +import type { LocalizerType } from '../../types/I18N.std.js'; +import { AttachmentDownloadUrgency } from '../../types/AttachmentDownload.std.js'; +import { isFileDangerous } from '../../util/isFileDangerous.std.js'; +import { getLocalAttachmentUrl } from '../../util/getLocalAttachmentUrl.std.js'; +import { instance as libphonenumberInstance } from '../../util/libphonenumberInstance.std.js'; import type { ShowSendAnywayDialogActionType, ShowErrorModalActionType, -} from './globalModals.js'; -import { SHOW_SEND_ANYWAY_DIALOG, SHOW_ERROR_MODAL } from './globalModals.js'; +} from './globalModals.preload.js'; +import { + SHOW_SEND_ANYWAY_DIALOG, + SHOW_ERROR_MODAL, +} from './globalModals.preload.js'; import { MODIFY_LIST, DELETE_LIST, HIDE_MY_STORIES_FROM, VIEWERS_CHANGED, -} from './storyDistributionLists.js'; -import type { StoryDistributionListsActionType } from './storyDistributionLists.js'; +} from './storyDistributionLists.preload.js'; +import type { StoryDistributionListsActionType } from './storyDistributionLists.preload.js'; import type { UUIDFetchStateKeyType, UUIDFetchStateType, -} from '../../util/uuidFetchState.js'; +} from '../../util/uuidFetchState.std.js'; import type { AvatarColorType, ConversationColorType, CustomColorType, -} from '../../types/Colors.js'; +} from '../../types/Colors.std.js'; import type { ConversationAttributesType, DraftEditMessageType, @@ -63,27 +66,27 @@ import type { import type { DraftBodyRanges, HydratedBodyRangesType, -} from '../../types/BodyRange.js'; -import { CallMode } from '../../types/CallDisposition.js'; -import type { MediaItemType } from '../../types/MediaItem.js'; -import type { StoryDistributionIdString } from '../../types/StoryDistributionId.js'; -import { normalizeStoryDistributionId } from '../../types/StoryDistributionId.js'; +} from '../../types/BodyRange.std.js'; +import { CallMode } from '../../types/CallDisposition.std.js'; +import type { MediaItemType } from '../../types/MediaItem.std.js'; +import type { StoryDistributionIdString } from '../../types/StoryDistributionId.std.js'; +import { normalizeStoryDistributionId } from '../../types/StoryDistributionId.std.js'; import type { ServiceIdString, AciString, PniString, -} from '../../types/ServiceId.js'; -import { isAciString } from '../../util/isAciString.js'; -import { MY_STORY_ID, StorySendMode } from '../../types/Stories.js'; -import * as Errors from '../../types/errors.js'; +} from '../../types/ServiceId.std.js'; +import { isAciString } from '../../util/isAciString.std.js'; +import { MY_STORY_ID, StorySendMode } from '../../types/Stories.std.js'; +import * as Errors from '../../types/errors.std.js'; import { getGroupSizeRecommendedLimit, getGroupSizeHardLimit, -} from '../../groups/limits.js'; -import { isMessageUnread } from '../../util/isMessageUnread.js'; -import { toggleSelectedContactForGroupAddition } from '../../groups/toggleSelectedContactForGroupAddition.js'; -import type { GroupNameCollisionsWithIdsByTitle } from '../../util/groupMemberNameCollisions.js'; -import { writeProfile } from '../../services/writeProfile.js'; +} from '../../groups/limits.dom.js'; +import { isMessageUnread } from '../../util/isMessageUnread.std.js'; +import { toggleSelectedContactForGroupAddition } from '../../groups/toggleSelectedContactForGroupAddition.std.js'; +import type { GroupNameCollisionsWithIdsByTitle } from '../../util/groupMemberNameCollisions.std.js'; +import { writeProfile } from '../../services/writeProfile.preload.js'; import { getConversationServiceIdsStoppingSend, getConversationIdsStoppedForVerification, @@ -92,80 +95,83 @@ import { getMessagesByConversation, getPendingAvatarDownloadSelector, getAllConversations, -} from '../selectors/conversations.js'; -import { getIntl } from '../selectors/user.js'; +} from '../selectors/conversations.dom.js'; +import { getIntl } from '../selectors/user.std.js'; import type { AvatarDataType, AvatarUpdateOptionsType, -} from '../../types/Avatar.js'; -import { getDefaultAvatars } from '../../types/Avatar.js'; -import { getAvatarData } from '../../util/getAvatarData.js'; -import { isSameAvatarData } from '../../util/isSameAvatarData.js'; -import { longRunningTaskWrapper } from '../../util/longRunningTaskWrapper.js'; +} from '../../types/Avatar.std.js'; +import { getDefaultAvatars } from '../../types/Avatar.std.js'; +import { getAvatarData } from '../../util/getAvatarData.dom.js'; +import { isSameAvatarData } from '../../util/isSameAvatarData.std.js'; +import { longRunningTaskWrapper } from '../../util/longRunningTaskWrapper.dom.js'; import { ComposerStep, ConversationVerificationState, OneTimeModalState, TargetedMessageSource, -} from './conversationsEnums.js'; -import { markViewed as messageUpdaterMarkViewed } from '../../services/MessageUpdater.js'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; -import { useBoundActions } from '../../hooks/useBoundActions.js'; +} from './conversationsEnums.std.js'; +import { markViewed as messageUpdaterMarkViewed } from '../../services/MessageUpdater.preload.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.js'; +import { useBoundActions } from '../../hooks/useBoundActions.std.js'; -import type { NoopActionType } from './noop.js'; +import type { NoopActionType } from './noop.std.js'; import { conversationJobQueue, conversationQueueJobEnum, -} from '../../jobs/conversationJobQueue.js'; -import type { TimelineMessageLoadingState } from '../../util/timelineUtil.js'; +} from '../../jobs/conversationJobQueue.preload.js'; +import type { TimelineMessageLoadingState } from '../../util/timelineUtil.std.js'; import { isDirectConversation, isGroup, isGroupV2, isMe, -} from '../../util/whatTypeOfConversation.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; -import { viewSyncJobQueue } from '../../jobs/viewSyncJobQueue.js'; -import { ReadStatus } from '../../messages/MessageReadStatus.js'; +} from '../../util/whatTypeOfConversation.dom.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; +import { viewSyncJobQueue } from '../../jobs/viewSyncJobQueue.preload.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.std.js'; import { isIncoming, isStory, processBodyRanges, -} from '../selectors/message.js'; -import { getActiveCall, getActiveCallState } from '../selectors/calling.js'; -import { sendDeleteForEveryoneMessage } from '../../util/sendDeleteForEveryoneMessage.js'; -import type { ShowToastActionType } from './toast.js'; -import { SHOW_TOAST } from './toast.js'; -import { ToastType } from '../../types/Toast.js'; -import { isMemberRequestingToJoin } from '../../util/groupMembershipUtils.js'; -import { removePendingMember } from '../../util/removePendingMember.js'; -import { denyPendingApprovalRequest } from '../../util/denyPendingApprovalRequest.js'; -import { SignalService as Proto } from '../../protobuf/index.js'; -import { addReportSpamJob } from '../../jobs/helpers/addReportSpamJob.js'; -import { reportSpamJobQueue } from '../../jobs/reportSpamJobQueue.js'; +} from '../selectors/message.preload.js'; +import { getActiveCall, getActiveCallState } from '../selectors/calling.std.js'; +import { sendDeleteForEveryoneMessage } from '../../util/sendDeleteForEveryoneMessage.preload.js'; +import type { ShowToastActionType } from './toast.preload.js'; +import { SHOW_TOAST } from './toast.preload.js'; +import { ToastType } from '../../types/Toast.dom.js'; +import { isMemberRequestingToJoin } from '../../util/groupMembershipUtils.preload.js'; +import { removePendingMember } from '../../util/removePendingMember.preload.js'; +import { denyPendingApprovalRequest } from '../../util/denyPendingApprovalRequest.preload.js'; +import { SignalService as Proto } from '../../protobuf/index.std.js'; +import { addReportSpamJob } from '../../jobs/helpers/addReportSpamJob.dom.js'; +import { reportSpamJobQueue } from '../../jobs/reportSpamJobQueue.preload.js'; import { modifyGroupV2, buildAddMembersChange, buildPromotePendingAdminApprovalMemberChange, buildUpdateAttributesChange, initiateMigrationToGroupV2 as doInitiateMigrationToGroupV2, -} from '../../groups.js'; -import { getMessageById } from '../../messages/getMessageById.js'; -import type { PanelRenderType, PanelRequestType } from '../../types/Panels.js'; -import type { ConversationQueueJobData } from '../../jobs/conversationJobQueue.js'; -import { isOlderThan } from '../../util/timestamp.js'; -import { DAY } from '../../util/durations/index.js'; -import { isNotNil } from '../../util/isNotNil.js'; -import { PanelType } from '../../types/Panels.js'; -import { startConversation } from '../../util/startConversation.js'; -import { getMessageSentTimestamp } from '../../util/getMessageSentTimestamp.js'; -import { removeLinkPreview } from '../../services/LinkPreview.js'; +} from '../../groups.preload.js'; +import { getMessageById } from '../../messages/getMessageById.preload.js'; +import type { + PanelRenderType, + PanelRequestType, +} from '../../types/Panels.std.js'; +import type { ConversationQueueJobData } from '../../jobs/conversationJobQueue.preload.js'; +import { isOlderThan } from '../../util/timestamp.std.js'; +import { DAY } from '../../util/durations/index.std.js'; +import { isNotNil } from '../../util/isNotNil.std.js'; +import { PanelType } from '../../types/Panels.std.js'; +import { startConversation } from '../../util/startConversation.dom.js'; +import { getMessageSentTimestamp } from '../../util/getMessageSentTimestamp.std.js'; +import { removeLinkPreview } from '../../services/LinkPreview.preload.js'; import type { ReplaceAttachmentsActionType, ResetComposerActionType, SetFocusActionType, SetQuotedMessageActionType, -} from './composer.js'; +} from './composer.preload.js'; import { SET_FOCUS, replaceAttachments, @@ -173,63 +179,67 @@ import { setQuoteByMessageId, resetComposer, saveDraftRecordingIfNeeded, -} from './composer.js'; -import { ReceiptType } from '../../types/Receipt.js'; -import { Sound, SoundType } from '../../util/Sound.js'; +} from './composer.preload.js'; +import { ReceiptType } from '../../types/Receipt.std.js'; +import { Sound, SoundType } from '../../util/Sound.std.js'; import { canEditMessage, isWithinMaxEdits, MESSAGE_MAX_EDIT_COUNT, -} from '../../util/canEditMessage.js'; -import type { ChangeLocationAction } from './nav.js'; +} from '../../util/canEditMessage.dom.js'; +import type { ChangeLocationAction } from './nav.std.js'; import { CHANGE_LOCATION, changeLocation, actions as navActions, -} from './nav.js'; -import { NavTab, ProfileEditorPage, SettingsPage } from '../../types/Nav.js'; -import { sortByMessageOrder } from '../../types/ForwardDraft.js'; -import { getAddedByForOurPendingInvitation } from '../../util/getAddedByForOurPendingInvitation.js'; +} from './nav.std.js'; +import { + NavTab, + ProfileEditorPage, + SettingsPage, +} from '../../types/Nav.std.js'; +import { sortByMessageOrder } from '../../types/ForwardDraft.std.js'; +import { getAddedByForOurPendingInvitation } from '../../util/getAddedByForOurPendingInvitation.preload.js'; import { getConversationIdForLogging, getMessageIdForLogging, -} from '../../util/idForLogging.js'; -import { singleProtoJobQueue } from '../../jobs/singleProtoJobQueue.js'; -import { MessageSender } from '../../textsecure/SendMessage.js'; -import { AttachmentDownloadManager } from '../../jobs/AttachmentDownloadManager.js'; +} from '../../util/idForLogging.preload.js'; +import { singleProtoJobQueue } from '../../jobs/singleProtoJobQueue.preload.js'; +import { MessageSender } from '../../textsecure/SendMessage.preload.js'; +import { AttachmentDownloadManager } from '../../jobs/AttachmentDownloadManager.preload.js'; import type { DeleteForMeSyncEventData, AddressableMessage, -} from '../../textsecure/messageReceiverEvents.js'; +} from '../../textsecure/messageReceiverEvents.std.js'; import { getConversationIdentifier, getAddressableMessage, -} from '../../util/syncIdentifiers.js'; -import { MAX_MESSAGE_COUNT } from '../../util/deleteForMe.types.js'; -import { markCallHistoryReadInConversation } from './callHistory.js'; +} from '../../util/syncIdentifiers.preload.js'; +import { MAX_MESSAGE_COUNT } from '../../util/deleteForMe.types.std.js'; +import { markCallHistoryReadInConversation } from './callHistory.preload.js'; import type { CapabilitiesType } from '../../types/Capabilities.d.ts'; -import { actions as searchActions } from './search.js'; -import type { SearchActionType } from './search.js'; -import { getNotificationTextForMessage } from '../../util/getNotificationTextForMessage.js'; -import { doubleCheckMissingQuoteReference as doDoubleCheckMissingQuoteReference } from '../../util/doubleCheckMissingQuoteReference.js'; -import { queueAttachmentDownloads } from '../../util/queueAttachmentDownloads.js'; -import { markAttachmentAsCorrupted as doMarkAttachmentAsCorrupted } from '../../messageModifiers/AttachmentDownloads.js'; +import { actions as searchActions } from './search.preload.js'; +import type { SearchActionType } from './search.preload.js'; +import { getNotificationTextForMessage } from '../../util/getNotificationTextForMessage.preload.js'; +import { doubleCheckMissingQuoteReference as doDoubleCheckMissingQuoteReference } from '../../util/doubleCheckMissingQuoteReference.preload.js'; +import { queueAttachmentDownloads } from '../../util/queueAttachmentDownloads.preload.js'; +import { markAttachmentAsCorrupted as doMarkAttachmentAsCorrupted } from '../../messageModifiers/AttachmentDownloads.preload.js'; import { isSent, SendActionType, sendStateReducer, -} from '../../messages/MessageSendState.js'; -import { markFailed } from '../../test-node/util/messageFailures.js'; -import { cleanupMessages } from '../../util/cleanup.js'; -import type { ConversationModel } from '../../models/conversations.js'; -import { MessageRequestResponseSource } from '../../types/MessageRequestResponseEvent.js'; -import { JobCancelReason } from '../../jobs/types.js'; -import type { ChatFolderId } from '../../types/ChatFolder.js'; -import { isConversationInChatFolder } from '../../types/ChatFolder.js'; -import { getCurrentChatFolders } from '../selectors/chatFolders.js'; -import { isConversationUnread } from '../../util/isConversationUnread.js'; -import { CurrentChatFolders } from '../../types/CurrentChatFolders.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +} from '../../messages/MessageSendState.std.js'; +import { markFailed } from '../../test-node/util/messageFailures.preload.js'; +import { cleanupMessages } from '../../util/cleanup.preload.js'; +import type { ConversationModel } from '../../models/conversations.preload.js'; +import { MessageRequestResponseSource } from '../../types/MessageRequestResponseEvent.std.js'; +import { JobCancelReason } from '../../jobs/types.std.js'; +import type { ChatFolderId } from '../../types/ChatFolder.std.js'; +import { isConversationInChatFolder } from '../../types/ChatFolder.std.js'; +import { getCurrentChatFolders } from '../selectors/chatFolders.std.js'; +import { isConversationUnread } from '../../util/isConversationUnread.std.js'; +import { CurrentChatFolders } from '../../types/CurrentChatFolders.std.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; const { chunk, diff --git a/ts/state/ducks/crashReports.ts b/ts/state/ducks/crashReports.ts index 539da6fe96..317de6e896 100644 --- a/ts/state/ducks/crashReports.ts +++ b/ts/state/ducks/crashReports.ts @@ -4,15 +4,15 @@ import type { ReadonlyDeep } from 'type-fest'; import type { ThunkAction } from 'redux-thunk'; -import { createLogger } from '../../logging/log.js'; -import * as Errors from '../../types/errors.js'; -import { ToastType } from '../../types/Toast.js'; -import type { StateType as RootStateType } from '../reducer.js'; -import { showToast } from './toast.js'; -import type { ShowToastActionType } from './toast.js'; -import type { PromiseAction } from '../util.js'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; -import { useBoundActions } from '../../hooks/useBoundActions.js'; +import { createLogger } from '../../logging/log.std.js'; +import * as Errors from '../../types/errors.std.js'; +import { ToastType } from '../../types/Toast.dom.js'; +import type { StateType as RootStateType } from '../reducer.preload.js'; +import { showToast } from './toast.preload.js'; +import type { ShowToastActionType } from './toast.preload.js'; +import type { PromiseAction } from '../util.std.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.js'; +import { useBoundActions } from '../../hooks/useBoundActions.std.js'; const log = createLogger('crashReports'); diff --git a/ts/state/ducks/donations.ts b/ts/state/ducks/donations.ts index 97bd6ec272..836fce4297 100644 --- a/ts/state/ducks/donations.ts +++ b/ts/state/ducks/donations.ts @@ -4,33 +4,33 @@ import type { ReadonlyDeep } from 'type-fest'; import type { ThunkAction } from 'redux-thunk'; -import { useBoundActions } from '../../hooks/useBoundActions.js'; -import { createLogger } from '../../logging/log.js'; -import * as Errors from '../../types/errors.js'; -import { isStagingServer } from '../../util/isStagingServer.js'; -import { DataWriter } from '../../sql/Client.js'; -import * as donations from '../../services/donations.js'; -import { donationStateSchema } from '../../types/Donations.js'; -import { drop } from '../../util/drop.js'; -import { storageServiceUploadJob } from '../../services/storage.js'; -import { getMe } from '../selectors/conversations.js'; -import { actions as conversationActions } from './conversations.js'; +import { useBoundActions } from '../../hooks/useBoundActions.std.js'; +import { createLogger } from '../../logging/log.std.js'; +import * as Errors from '../../types/errors.std.js'; +import { isStagingServer } from '../../util/isStagingServer.dom.js'; +import { DataWriter } from '../../sql/Client.preload.js'; +import * as donations from '../../services/donations.preload.js'; +import { donationStateSchema } from '../../types/Donations.std.js'; +import { drop } from '../../util/drop.std.js'; +import { storageServiceUploadJob } from '../../services/storage.preload.js'; +import { getMe } from '../selectors/conversations.dom.js'; +import { actions as conversationActions } from './conversations.preload.js'; import type { ProfileDataType, SetProfileUpdateErrorActionType, -} from './conversations.js'; +} from './conversations.preload.js'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.js'; import type { CardDetail, DonationErrorType, DonationReceipt, DonationWorkflow, StripeDonationAmount, -} from '../../types/Donations.js'; -import type { BadgeType } from '../../badges/types.js'; -import type { StateType as RootStateType } from '../reducer.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +} from '../../types/Donations.std.js'; +import type { BadgeType } from '../../badges/types.std.js'; +import type { StateType as RootStateType } from '../reducer.preload.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; const log = createLogger('donations'); diff --git a/ts/state/ducks/emojis.ts b/ts/state/ducks/emojis.ts index 334108ff73..a4ec88e9b8 100644 --- a/ts/state/ducks/emojis.ts +++ b/ts/state/ducks/emojis.ts @@ -4,14 +4,14 @@ import lodash from 'lodash'; import type { ThunkAction } from 'redux-thunk'; import type { ReadonlyDeep } from 'type-fest'; -import { DataWriter } from '../../sql/Client.js'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; -import { useBoundActions } from '../../hooks/useBoundActions.js'; -import type { FunEmojiSelection } from '../../components/fun/panels/FunPanelEmojis.js'; +import { DataWriter } from '../../sql/Client.preload.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.js'; +import { useBoundActions } from '../../hooks/useBoundActions.std.js'; +import type { FunEmojiSelection } from '../../components/fun/panels/FunPanelEmojis.dom.js'; import { getEmojiParentByKey, getEmojiParentKeyByVariantKey, -} from '../../components/fun/data/emojis.js'; +} from '../../components/fun/data/emojis.std.js'; const { take, uniq } = lodash; diff --git a/ts/state/ducks/gifs.ts b/ts/state/ducks/gifs.ts index a6e4bab54a..d0ecb9be15 100644 --- a/ts/state/ducks/gifs.ts +++ b/ts/state/ducks/gifs.ts @@ -3,12 +3,12 @@ import type { ReadonlyDeep } from 'type-fest'; import type { ThunkAction } from 'redux-thunk'; import lodash from 'lodash'; -import type { GifType } from '../../components/fun/panels/FunPanelGifs.js'; -import { DataWriter } from '../../sql/Client.js'; +import type { GifType } from '../../components/fun/panels/FunPanelGifs.dom.js'; +import { DataWriter } from '../../sql/Client.preload.js'; import { type BoundActionCreatorsMapObject, useBoundActions, -} from '../../hooks/useBoundActions.js'; +} from '../../hooks/useBoundActions.std.js'; const { take } = lodash; diff --git a/ts/state/ducks/globalModals.ts b/ts/state/ducks/globalModals.ts index a361dbee92..d7dcd087aa 100644 --- a/ts/state/ducks/globalModals.ts +++ b/ts/state/ducks/globalModals.ts @@ -3,8 +3,8 @@ import type { ThunkAction } from 'redux-thunk'; import type { ReadonlyDeep } from 'type-fest'; -import OS from '../../util/os/osMain.js'; -import type { ExplodePromiseResultType } from '../../util/explodePromise.js'; +import OS from '../../util/os/osMain.node.js'; +import type { ExplodePromiseResultType } from '../../util/explodePromise.std.js'; import type { GroupV2PendingMemberType, ReadonlyMessageAttributesType, @@ -13,53 +13,53 @@ import type { MessageChangedActionType, MessageDeletedActionType, MessageExpiredActionType, -} from './conversations.js'; -import type { MessagePropsType } from '../selectors/message.js'; -import type { RecipientsByConversation } from './stories.js'; -import type { SafetyNumberChangeSource } from '../../types/SafetyNumberChangeSource.js'; -import type { StateType as RootStateType } from '../reducer.js'; -import * as SingleServePromise from '../../services/singleServePromise.js'; -import * as Stickers from '../../types/Stickers.js'; -import { UsernameOnboardingState } from '../../types/globalModals.js'; -import { createLogger } from '../../logging/log.js'; +} from './conversations.preload.js'; +import type { MessagePropsType } from '../selectors/message.preload.js'; +import type { RecipientsByConversation } from './stories.preload.js'; +import type { SafetyNumberChangeSource } from '../../types/SafetyNumberChangeSource.std.js'; +import type { StateType as RootStateType } from '../reducer.preload.js'; +import * as SingleServePromise from '../../services/singleServePromise.std.js'; +import * as Stickers from '../../types/Stickers.preload.js'; +import { UsernameOnboardingState } from '../../types/globalModals.std.js'; +import { createLogger } from '../../logging/log.std.js'; import { getMessagePropsSelector, getPropsForAttachment, -} from '../selectors/message.js'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; -import { longRunningTaskWrapper } from '../../util/longRunningTaskWrapper.js'; -import { useBoundActions } from '../../hooks/useBoundActions.js'; -import { isGroupV1 } from '../../util/whatTypeOfConversation.js'; -import { sleep } from '../../util/sleep.js'; -import { SECOND } from '../../util/durations/index.js'; -import { getGroupMigrationMembers } from '../../groups.js'; +} from '../selectors/message.preload.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.js'; +import { longRunningTaskWrapper } from '../../util/longRunningTaskWrapper.dom.js'; +import { useBoundActions } from '../../hooks/useBoundActions.std.js'; +import { isGroupV1 } from '../../util/whatTypeOfConversation.dom.js'; +import { sleep } from '../../util/sleep.std.js'; +import { SECOND } from '../../util/durations/index.std.js'; +import { getGroupMigrationMembers } from '../../groups.preload.js'; import { MESSAGE_CHANGED, MESSAGE_DELETED, MESSAGE_EXPIRED, actions as conversationsActions, -} from './conversations.js'; -import { isDownloaded } from '../../util/Attachment.js'; -import { isPermanentlyUndownloadable } from '../../jobs/AttachmentDownloadManager.js'; -import type { ButtonVariant } from '../../components/Button.js'; -import type { MessageRequestState } from '../../components/conversation/MessageRequestActionsConfirmation.js'; -import type { MessageForwardDraft } from '../../types/ForwardDraft.js'; -import { hydrateRanges } from '../../types/BodyRange.js'; +} from './conversations.preload.js'; +import { isDownloaded } from '../../util/Attachment.std.js'; +import { isPermanentlyUndownloadable } from '../../jobs/AttachmentDownloadManager.preload.js'; +import type { ButtonVariant } from '../../components/Button.dom.js'; +import type { MessageRequestState } from '../../components/conversation/MessageRequestActionsConfirmation.dom.js'; +import type { MessageForwardDraft } from '../../types/ForwardDraft.std.js'; +import { hydrateRanges } from '../../types/BodyRange.std.js'; import { getConversationSelector, type GetConversationByIdType, -} from '../selectors/conversations.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; -import { ForwardMessagesModalType } from '../../components/ForwardMessagesModal.js'; -import type { CallLinkType } from '../../types/CallLink.js'; -import type { LocalizerType } from '../../types/I18N.js'; -import { linkCallRoute } from '../../util/signalRoutes.js'; -import type { StartCallData } from '../../components/ConfirmLeaveCallModal.js'; -import { getMessageById } from '../../messages/getMessageById.js'; -import type { DataPropsType as TapToViewNotAvailablePropsType } from '../../components/TapToViewNotAvailableModal.js'; -import type { DataPropsType as BackfillFailureModalPropsType } from '../../components/BackfillFailureModal.js'; -import type { SmartDraftGifMessageSendModalProps } from '../smart/DraftGifMessageSendModal.js'; -import { onCriticalIdlePrimaryDeviceModalDismissed } from '../../util/handleServerAlerts.js'; +} from '../selectors/conversations.dom.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; +import { ForwardMessagesModalType } from '../../components/ForwardMessagesModal.dom.js'; +import type { CallLinkType } from '../../types/CallLink.std.js'; +import type { LocalizerType } from '../../types/I18N.std.js'; +import { linkCallRoute } from '../../util/signalRoutes.std.js'; +import type { StartCallData } from '../../components/ConfirmLeaveCallModal.dom.js'; +import { getMessageById } from '../../messages/getMessageById.preload.js'; +import type { DataPropsType as TapToViewNotAvailablePropsType } from '../../components/TapToViewNotAvailableModal.dom.js'; +import type { DataPropsType as BackfillFailureModalPropsType } from '../../components/BackfillFailureModal.dom.js'; +import type { SmartDraftGifMessageSendModalProps } from '../smart/DraftGifMessageSendModal.preload.js'; +import { onCriticalIdlePrimaryDeviceModalDismissed } from '../../util/handleServerAlerts.preload.js'; const log = createLogger('globalModals'); diff --git a/ts/state/ducks/installer.ts b/ts/state/ducks/installer.ts index cf847614fb..7a880507a5 100644 --- a/ts/state/ducks/installer.ts +++ b/ts/state/ducks/installer.ts @@ -4,34 +4,34 @@ import type { ThunkAction } from 'redux-thunk'; import type { ReadonlyDeep } from 'type-fest'; -import type { StateType as RootStateType } from '../reducer.js'; +import type { StateType as RootStateType } from '../reducer.preload.js'; import { type InstallScreenBackupError, InstallScreenBackupStep, InstallScreenStep, InstallScreenError, InstallScreenQRCodeError, -} from '../../types/InstallScreen.js'; -import * as Errors from '../../types/errors.js'; -import { type Loadable, LoadingState } from '../../util/loadable.js'; -import { isRecord } from '../../util/isRecord.js'; -import { strictAssert } from '../../util/assert.js'; -import * as Registration from '../../util/registration.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; -import { HTTPError } from '../../types/HTTPError.js'; +} from '../../types/InstallScreen.std.js'; +import * as Errors from '../../types/errors.std.js'; +import { type Loadable, LoadingState } from '../../util/loadable.std.js'; +import { isRecord } from '../../util/isRecord.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import * as Registration from '../../util/registration.preload.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; +import { HTTPError } from '../../types/HTTPError.std.js'; import { Provisioner, EventKind as ProvisionEventKind, type EnvelopeType as ProvisionEnvelopeType, -} from '../../textsecure/Provisioner.js'; -import { accountManager } from '../../textsecure/AccountManager.js'; -import { getProvisioningResource } from '../../textsecure/WebAPI.js'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; -import { useBoundActions } from '../../hooks/useBoundActions.js'; -import { createLogger } from '../../logging/log.js'; -import { backupsService } from '../../services/backups/index.js'; -import OS from '../../util/os/osMain.js'; -import { signalProtocolStore } from '../../SignalProtocolStore.js'; +} from '../../textsecure/Provisioner.preload.js'; +import { accountManager } from '../../textsecure/AccountManager.preload.js'; +import { getProvisioningResource } from '../../textsecure/WebAPI.preload.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.js'; +import { useBoundActions } from '../../hooks/useBoundActions.std.js'; +import { createLogger } from '../../logging/log.std.js'; +import { backupsService } from '../../services/backups/index.preload.js'; +import OS from '../../util/os/osMain.node.js'; +import { signalProtocolStore } from '../../SignalProtocolStore.preload.js'; const log = createLogger('installer'); diff --git a/ts/state/ducks/items.ts b/ts/state/ducks/items.ts index db46dee32f..c1c00a59d4 100644 --- a/ts/state/ducks/items.ts +++ b/ts/state/ducks/items.ts @@ -5,21 +5,21 @@ import lodash from 'lodash'; import { v4 as getGuid } from 'uuid'; import type { ThunkAction } from 'redux-thunk'; import type { ReadonlyDeep } from 'type-fest'; -import type { StateType as RootStateType } from '../reducer.js'; -import * as storageShim from '../../shims/storage.js'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; -import { useBoundActions } from '../../hooks/useBoundActions.js'; -import { drop } from '../../util/drop.js'; +import type { StateType as RootStateType } from '../reducer.preload.js'; +import * as storageShim from '../../shims/storage.preload.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.js'; +import { useBoundActions } from '../../hooks/useBoundActions.std.js'; +import { drop } from '../../util/drop.std.js'; import type { ConversationColorType, CustomColorType, -} from '../../types/Colors.js'; -import { ConversationColors } from '../../types/Colors.js'; -import { reloadSelectedConversation } from '../../shims/reloadSelectedConversation.js'; +} from '../../types/Colors.std.js'; +import { ConversationColors } from '../../types/Colors.std.js'; +import { reloadSelectedConversation } from '../../shims/reloadSelectedConversation.dom.js'; import type { StorageAccessType } from '../../types/Storage.d.ts'; -import { actions as conversationActions } from './conversations.js'; -import type { ConfigMapType as RemoteConfigType } from '../../RemoteConfig.js'; -import type { EmojiSkinTone } from '../../components/fun/data/emojis.js'; +import { actions as conversationActions } from './conversations.preload.js'; +import type { ConfigMapType as RemoteConfigType } from '../../RemoteConfig.dom.js'; +import type { EmojiSkinTone } from '../../components/fun/data/emojis.std.js'; const { omit } = lodash; diff --git a/ts/state/ducks/lightbox.ts b/ts/state/ducks/lightbox.ts index 1cb92248e4..d7e815489b 100644 --- a/ts/state/ducks/lightbox.ts +++ b/ts/state/ducks/lightbox.ts @@ -4,55 +4,58 @@ import type { ThunkAction } from 'redux-thunk'; import type { ReadonlyDeep } from 'type-fest'; -import type { AttachmentType } from '../../types/Attachment.js'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; -import type { MediaItemType } from '../../types/MediaItem.js'; +import type { AttachmentType } from '../../types/Attachment.std.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.js'; +import type { MediaItemType } from '../../types/MediaItem.std.js'; import type { MessageChangedActionType, MessageDeletedActionType, MessageExpiredActionType, -} from './conversations.js'; -import type { ShowStickerPackPreviewActionType } from './globalModals.js'; -import type { ShowToastActionType } from './toast.js'; -import type { StateType as RootStateType } from '../reducer.js'; +} from './conversations.preload.js'; +import type { ShowStickerPackPreviewActionType } from './globalModals.preload.js'; +import type { ShowToastActionType } from './toast.preload.js'; +import type { StateType as RootStateType } from '../reducer.preload.js'; -import { createLogger } from '../../logging/log.js'; -import { getMessageById } from '../../messages/getMessageById.js'; +import { createLogger } from '../../logging/log.std.js'; +import { getMessageById } from '../../messages/getMessageById.preload.js'; import type { ReadonlyMessageAttributesType } from '../../model-types.d.ts'; import { getUndownloadedAttachmentSignature, isIncremental, -} from '../../util/Attachment.js'; +} from '../../util/Attachment.std.js'; import { isImageTypeSupported, isVideoTypeSupported, -} from '../../util/GoogleChrome.js'; +} from '../../util/GoogleChrome.std.js'; import { getLocalAttachmentUrl, AttachmentDisposition, -} from '../../util/getLocalAttachmentUrl.js'; +} from '../../util/getLocalAttachmentUrl.std.js'; import { deleteTempFile, copyAttachmentIntoTempDirectory, getAbsoluteAttachmentPath, -} from '../../util/migrations.js'; -import { isTapToView, getPropsForAttachment } from '../selectors/message.js'; -import { SHOW_TOAST } from './toast.js'; -import { ToastType } from '../../types/Toast.js'; +} from '../../util/migrations.preload.js'; +import { + isTapToView, + getPropsForAttachment, +} from '../selectors/message.preload.js'; +import { SHOW_TOAST } from './toast.preload.js'; +import { ToastType } from '../../types/Toast.dom.js'; import { MESSAGE_CHANGED, MESSAGE_DELETED, MESSAGE_EXPIRED, saveAttachmentFromMessage, -} from './conversations.js'; -import { showStickerPackPreview } from './globalModals.js'; -import { useBoundActions } from '../../hooks/useBoundActions.js'; -import { DataReader } from '../../sql/Client.js'; -import { deleteDownloadsJobQueue } from '../../jobs/deleteDownloadsJobQueue.js'; -import { AttachmentDownloadUrgency } from '../../types/AttachmentDownload.js'; -import { queueAttachmentDownloadsAndMaybeSaveMessage } from '../../util/queueAttachmentDownloads.js'; -import { getMessageIdForLogging } from '../../util/idForLogging.js'; -import { markViewOnceMessageViewed } from '../../services/MessageUpdater.js'; +} from './conversations.preload.js'; +import { showStickerPackPreview } from './globalModals.preload.js'; +import { useBoundActions } from '../../hooks/useBoundActions.std.js'; +import { DataReader } from '../../sql/Client.preload.js'; +import { deleteDownloadsJobQueue } from '../../jobs/deleteDownloadsJobQueue.preload.js'; +import { AttachmentDownloadUrgency } from '../../types/AttachmentDownload.std.js'; +import { queueAttachmentDownloadsAndMaybeSaveMessage } from '../../util/queueAttachmentDownloads.preload.js'; +import { getMessageIdForLogging } from '../../util/idForLogging.preload.js'; +import { markViewOnceMessageViewed } from '../../services/MessageUpdater.preload.js'; const log = createLogger('lightbox'); diff --git a/ts/state/ducks/linkPreviews.ts b/ts/state/ducks/linkPreviews.ts index b002e184ea..f371aa08b8 100644 --- a/ts/state/ducks/linkPreviews.ts +++ b/ts/state/ducks/linkPreviews.ts @@ -4,21 +4,21 @@ import type { ThunkAction } from 'redux-thunk'; import type { ReadonlyDeep } from 'type-fest'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.js'; import type { LinkPreviewType, LinkPreviewForUIType, -} from '../../types/message/LinkPreviews.js'; -import type { AttachmentForUIType } from '../../types/Attachment.js'; -import type { MaybeGrabLinkPreviewOptionsType } from '../../types/LinkPreview.js'; -import type { NoopActionType } from './noop.js'; -import type { StateType as RootStateType } from '../reducer.js'; -import { LinkPreviewSourceType } from '../../types/LinkPreview.js'; -import { assignWithNoUnnecessaryAllocation } from '../../util/assignWithNoUnnecessaryAllocation.js'; -import { maybeGrabLinkPreview } from '../../services/LinkPreview.js'; -import { strictAssert } from '../../util/assert.js'; -import { useBoundActions } from '../../hooks/useBoundActions.js'; -import { getPropsForAttachment } from '../selectors/message.js'; +} from '../../types/message/LinkPreviews.std.js'; +import type { AttachmentForUIType } from '../../types/Attachment.std.js'; +import type { MaybeGrabLinkPreviewOptionsType } from '../../types/LinkPreview.std.js'; +import type { NoopActionType } from './noop.std.js'; +import type { StateType as RootStateType } from '../reducer.preload.js'; +import { LinkPreviewSourceType } from '../../types/LinkPreview.std.js'; +import { assignWithNoUnnecessaryAllocation } from '../../util/assignWithNoUnnecessaryAllocation.std.js'; +import { maybeGrabLinkPreview } from '../../services/LinkPreview.preload.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { useBoundActions } from '../../hooks/useBoundActions.std.js'; +import { getPropsForAttachment } from '../selectors/message.preload.js'; // State diff --git a/ts/state/ducks/mediaGallery.ts b/ts/state/ducks/mediaGallery.ts index 8e3ee28d68..a3bf9999b5 100644 --- a/ts/state/ducks/mediaGallery.ts +++ b/ts/state/ducks/mediaGallery.ts @@ -5,28 +5,28 @@ import lodash from 'lodash'; import type { ThunkAction } from 'redux-thunk'; import type { ReadonlyDeep } from 'type-fest'; -import { createLogger } from '../../logging/log.js'; -import { DataReader } from '../../sql/Client.js'; -import type { MediaItemDBType } from '../../sql/Interface.js'; +import { createLogger } from '../../logging/log.std.js'; +import { DataReader } from '../../sql/Client.preload.js'; +import type { MediaItemDBType } from '../../sql/Interface.std.js'; import { CONVERSATION_UNLOADED, MESSAGE_CHANGED, MESSAGE_DELETED, MESSAGE_EXPIRED, -} from './conversations.js'; -import { useBoundActions } from '../../hooks/useBoundActions.js'; +} from './conversations.preload.js'; +import { useBoundActions } from '../../hooks/useBoundActions.std.js'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.js'; import type { ConversationUnloadedActionType, MessageChangedActionType, MessageDeletedActionType, MessageExpiredActionType, -} from './conversations.js'; -import type { MediaItemType } from '../../types/MediaItem.js'; -import { isFile, isVisualMedia } from '../../util/Attachment.js'; -import type { StateType as RootStateType } from '../reducer.js'; -import { getPropsForAttachment } from '../selectors/message.js'; +} from './conversations.preload.js'; +import type { MediaItemType } from '../../types/MediaItem.std.js'; +import { isFile, isVisualMedia } from '../../util/Attachment.std.js'; +import type { StateType as RootStateType } from '../reducer.preload.js'; +import { getPropsForAttachment } from '../selectors/message.preload.js'; const { orderBy } = lodash; diff --git a/ts/state/ducks/nav.ts b/ts/state/ducks/nav.ts index 9971fd0af3..edcf590ba1 100644 --- a/ts/state/ducks/nav.ts +++ b/ts/state/ducks/nav.ts @@ -4,14 +4,14 @@ import type { ReadonlyDeep } from 'type-fest'; import type { ThunkAction } from 'redux-thunk'; -import { createLogger } from '../../logging/log.js'; -import { useBoundActions } from '../../hooks/useBoundActions.js'; -import { NavTab, SettingsPage } from '../../types/Nav.js'; -import { beforeNavigateService } from '../../services/BeforeNavigate.js'; +import { createLogger } from '../../logging/log.std.js'; +import { useBoundActions } from '../../hooks/useBoundActions.std.js'; +import { NavTab, SettingsPage } from '../../types/Nav.std.js'; +import { beforeNavigateService } from '../../services/BeforeNavigate.std.js'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; -import type { StateType as RootStateType } from '../reducer.js'; -import type { Location } from '../../types/Nav.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.js'; +import type { StateType as RootStateType } from '../reducer.preload.js'; +import type { Location } from '../../types/Nav.std.js'; const log = createLogger('nav'); diff --git a/ts/state/ducks/network.ts b/ts/state/ducks/network.ts index 04fc1d1d5d..00ca98f3c7 100644 --- a/ts/state/ducks/network.ts +++ b/ts/state/ducks/network.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { ReadonlyDeep } from 'type-fest'; -import { SocketStatus } from '../../types/SocketStatus.js'; -import { trigger } from '../../shims/events.js'; -import { assignWithNoUnnecessaryAllocation } from '../../util/assignWithNoUnnecessaryAllocation.js'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; -import { useBoundActions } from '../../hooks/useBoundActions.js'; +import { SocketStatus } from '../../types/SocketStatus.std.js'; +import { trigger } from '../../shims/events.dom.js'; +import { assignWithNoUnnecessaryAllocation } from '../../util/assignWithNoUnnecessaryAllocation.std.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.js'; +import { useBoundActions } from '../../hooks/useBoundActions.std.js'; // State diff --git a/ts/state/ducks/notificationProfiles.ts b/ts/state/ducks/notificationProfiles.ts index d133d34d4c..7bfe976536 100644 --- a/ts/state/ducks/notificationProfiles.ts +++ b/ts/state/ducks/notificationProfiles.ts @@ -6,39 +6,39 @@ import { debounce, difference } from 'lodash'; import type { ReadonlyDeep } from 'type-fest'; import type { ThunkAction } from 'redux-thunk'; -import { createLogger } from '../../logging/log.js'; +import { createLogger } from '../../logging/log.std.js'; import { update as updateProfileService, fastUpdate as fastUpdateProfileService, -} from '../../services/notificationProfilesService.js'; -import { strictAssert } from '../../util/assert.js'; +} from '../../services/notificationProfilesService.preload.js'; +import { strictAssert } from '../../util/assert.std.js'; import { type BoundActionCreatorsMapObject, useBoundActions, -} from '../../hooks/useBoundActions.js'; -import { DataWriter } from '../../sql/Client.js'; +} from '../../hooks/useBoundActions.std.js'; +import { DataWriter } from '../../sql/Client.preload.js'; import { redactNotificationProfileId, sortProfiles, -} from '../../types/NotificationProfile.js'; -import { generateNotificationProfileId } from '../../types/NotificationProfile-node.js'; -import { getOverride } from '../selectors/notificationProfiles.js'; -import { getItems } from '../selectors/items.js'; +} from '../../types/NotificationProfile.std.js'; +import { generateNotificationProfileId } from '../../types/NotificationProfile-node.node.js'; +import { getOverride } from '../selectors/notificationProfiles.dom.js'; +import { getItems } from '../selectors/items.dom.js'; import { prepareForDisabledNotificationProfileSync, prepareForEnabledNotificationProfileSync, -} from '../../services/storageRecordOps.js'; -import { storageServiceUploadJob } from '../../services/storage.js'; -import { SECOND } from '../../util/durations/constants.js'; +} from '../../services/storageRecordOps.preload.js'; +import { storageServiceUploadJob } from '../../services/storage.preload.js'; +import { SECOND } from '../../util/durations/constants.std.js'; import type { NextProfileEvent, NotificationProfileIdString, NotificationProfileOverride, NotificationProfileType, -} from '../../types/NotificationProfile.js'; -import type { StateType } from '../reducer.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +} from '../../types/NotificationProfile.std.js'; +import type { StateType } from '../reducer.preload.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; const log = createLogger('ducks/notificationProfiles'); diff --git a/ts/state/ducks/preferredReactions.ts b/ts/state/ducks/preferredReactions.ts index c750444825..ae2fc732d2 100644 --- a/ts/state/ducks/preferredReactions.ts +++ b/ts/state/ducks/preferredReactions.ts @@ -4,20 +4,20 @@ import type { ThunkAction } from 'redux-thunk'; import lodash from 'lodash'; import type { ReadonlyDeep } from 'type-fest'; -import { createLogger } from '../../logging/log.js'; -import * as Errors from '../../types/errors.js'; -import { replaceIndex } from '../../util/replaceIndex.js'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; -import { useBoundActions } from '../../hooks/useBoundActions.js'; -import type { StateType as RootStateType } from '../reducer.js'; -import { DEFAULT_PREFERRED_REACTION_EMOJI_PARENT_KEYS } from '../../reactions/constants.js'; -import { getPreferredReactionEmoji } from '../../reactions/preferredReactionEmoji.js'; -import { getEmojiSkinToneDefault } from '../selectors/items.js'; +import { createLogger } from '../../logging/log.std.js'; +import * as Errors from '../../types/errors.std.js'; +import { replaceIndex } from '../../util/replaceIndex.std.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.js'; +import { useBoundActions } from '../../hooks/useBoundActions.std.js'; +import type { StateType as RootStateType } from '../reducer.preload.js'; +import { DEFAULT_PREFERRED_REACTION_EMOJI_PARENT_KEYS } from '../../reactions/constants.std.js'; +import { getPreferredReactionEmoji } from '../../reactions/preferredReactionEmoji.std.js'; +import { getEmojiSkinToneDefault } from '../selectors/items.dom.js'; import { EmojiSkinTone, getEmojiVariantByParentKeyAndSkinTone, -} from '../../components/fun/data/emojis.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +} from '../../components/fun/data/emojis.std.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; const { omit } = lodash; diff --git a/ts/state/ducks/safetyNumber.ts b/ts/state/ducks/safetyNumber.ts index ec96d008aa..dcce2b77af 100644 --- a/ts/state/ducks/safetyNumber.ts +++ b/ts/state/ducks/safetyNumber.ts @@ -5,18 +5,18 @@ import type { ReadonlyDeep } from 'type-fest'; import type { ThunkAction } from 'redux-thunk'; import lodash from 'lodash'; -import { generateSafetyNumber } from '../../util/safetyNumber.js'; -import type { SafetyNumberType } from '../../types/safetyNumber.js'; -import type { ConversationType } from './conversations.js'; +import { generateSafetyNumber } from '../../util/safetyNumber.preload.js'; +import type { SafetyNumberType } from '../../types/safetyNumber.std.js'; +import type { ConversationType } from './conversations.preload.js'; import { reloadProfiles, toggleVerification, -} from '../../shims/contactVerification.js'; -import { createLogger } from '../../logging/log.js'; -import * as Errors from '../../types/errors.js'; -import type { StateType as RootStateType } from '../reducer.js'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; -import { useBoundActions } from '../../hooks/useBoundActions.js'; +} from '../../shims/contactVerification.dom.js'; +import { createLogger } from '../../logging/log.std.js'; +import * as Errors from '../../types/errors.std.js'; +import type { StateType as RootStateType } from '../reducer.preload.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.js'; +import { useBoundActions } from '../../hooks/useBoundActions.std.js'; const { omit } = lodash; diff --git a/ts/state/ducks/search.ts b/ts/state/ducks/search.ts index 4db21726a7..325e2d23fc 100644 --- a/ts/state/ducks/search.ts +++ b/ts/state/ducks/search.ts @@ -5,15 +5,15 @@ import type { ThunkAction, ThunkDispatch } from 'redux-thunk'; import lodash from 'lodash'; import type { ReadonlyDeep } from 'type-fest'; -import type { StateType as RootStateType } from '../reducer.js'; -import { filterAndSortConversations } from '../../util/filterAndSortConversations.js'; -import type { ClientSearchResultMessageType } from '../../sql/Interface.js'; -import { DataReader } from '../../sql/Client.js'; -import { makeLookup } from '../../util/makeLookup.js'; -import { isNotNil } from '../../util/isNotNil.js'; -import type { ServiceIdString } from '../../types/ServiceId.js'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; -import { useBoundActions } from '../../hooks/useBoundActions.js'; +import type { StateType as RootStateType } from '../reducer.preload.js'; +import { filterAndSortConversations } from '../../util/filterAndSortConversations.std.js'; +import type { ClientSearchResultMessageType } from '../../sql/Interface.std.js'; +import { DataReader } from '../../sql/Client.preload.js'; +import { makeLookup } from '../../util/makeLookup.std.js'; +import { isNotNil } from '../../util/isNotNil.std.js'; +import type { ServiceIdString } from '../../types/ServiceId.std.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.js'; +import { useBoundActions } from '../../hooks/useBoundActions.std.js'; import type { ConversationType, @@ -24,30 +24,30 @@ import type { ShowArchivedConversationsActionType, MessageType, ConversationLookupType, -} from './conversations.js'; +} from './conversations.preload.js'; import { getFilterByUnread, getIsActivelySearching, getQuery, getSearchConversation, -} from '../selectors/search.js'; -import { getAllConversations } from '../selectors/conversations.js'; +} from '../selectors/search.dom.js'; +import { getAllConversations } from '../selectors/conversations.dom.js'; import { getIntl, getRegionCode, getUserConversationId, -} from '../selectors/user.js'; -import { strictAssert } from '../../util/assert.js'; +} from '../selectors/user.std.js'; +import { strictAssert } from '../../util/assert.std.js'; import { CONVERSATION_UNLOADED, TARGETED_CONVERSATION_CHANGED, -} from './conversations.js'; -import { removeDiacritics } from '../../util/removeDiacritics.js'; -import { createLogger } from '../../logging/log.js'; -import { searchConversationTitles } from '../../util/searchConversationTitles.js'; -import { isDirectConversation } from '../../util/whatTypeOfConversation.js'; -import { isConversationSMSOnly } from '../../util/isConversationSMSOnly.js'; -import { isConversationUnread } from '../../util/countUnreadStats.js'; +} from './conversations.preload.js'; +import { removeDiacritics } from '../../util/removeDiacritics.std.js'; +import { createLogger } from '../../logging/log.std.js'; +import { searchConversationTitles } from '../../util/searchConversationTitles.std.js'; +import { isDirectConversation } from '../../util/whatTypeOfConversation.dom.js'; +import { isConversationSMSOnly } from '../../util/isConversationSMSOnly.std.js'; +import { isConversationUnread } from '../../util/countUnreadStats.std.js'; const { debounce, omit, reject } = lodash; diff --git a/ts/state/ducks/stickers.ts b/ts/state/ducks/stickers.ts index ba16988725..200c15913f 100644 --- a/ts/state/ducks/stickers.ts +++ b/ts/state/ducks/stickers.ts @@ -7,26 +7,26 @@ import type { StickerPackStatusType, StickerType as StickerDBType, StickerPackType as StickerPackDBType, -} from '../../sql/Interface.js'; -import { DataReader, DataWriter } from '../../sql/Client.js'; +} from '../../sql/Interface.std.js'; +import { DataReader, DataWriter } from '../../sql/Client.preload.js'; import type { ActionSourceType, RecentStickerType, -} from '../../types/Stickers.js'; +} from '../../types/Stickers.preload.js'; import { downloadStickerPack as externalDownloadStickerPack, maybeDeletePack, -} from '../../types/Stickers.js'; -import { drop } from '../../util/drop.js'; -import { storageServiceUploadJob } from '../../services/storage.js'; -import { sendStickerPackSync } from '../../shims/textsecure.js'; -import { trigger } from '../../shims/events.js'; -import { ERASE_STORAGE_SERVICE } from './user.js'; -import type { EraseStorageServiceStateAction } from './user.js'; +} from '../../types/Stickers.preload.js'; +import { drop } from '../../util/drop.std.js'; +import { storageServiceUploadJob } from '../../services/storage.preload.js'; +import { sendStickerPackSync } from '../../shims/textsecure.preload.js'; +import { trigger } from '../../shims/events.dom.js'; +import { ERASE_STORAGE_SERVICE } from './user.preload.js'; +import type { EraseStorageServiceStateAction } from './user.preload.js'; -import type { NoopActionType } from './noop.js'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; -import { useBoundActions } from '../../hooks/useBoundActions.js'; +import type { NoopActionType } from './noop.std.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.js'; +import { useBoundActions } from '../../hooks/useBoundActions.std.js'; const { omit, reject } = lodash; diff --git a/ts/state/ducks/stories.ts b/ts/state/ducks/stories.ts index 5a61fc49fd..d87251ee26 100644 --- a/ts/state/ducks/stories.ts +++ b/ts/state/ducks/stories.ts @@ -5,85 +5,85 @@ import type { ThunkAction, ThunkDispatch } from 'redux-thunk'; import lodash from 'lodash'; import type { ReadonlyDeep } from 'type-fest'; -import * as Errors from '../../types/errors.js'; -import type { AttachmentType } from '../../types/Attachment.js'; -import type { DraftBodyRanges } from '../../types/BodyRange.js'; +import * as Errors from '../../types/errors.std.js'; +import type { AttachmentType } from '../../types/Attachment.std.js'; +import type { DraftBodyRanges } from '../../types/BodyRange.std.js'; import type { ReadonlyMessageAttributesType } from '../../model-types.d.ts'; import type { MessageChangedActionType, MessageDeletedActionType, MessagesAddedActionType, TargetedConversationChangedActionType, -} from './conversations.js'; -import type { NoopActionType } from './noop.js'; -import type { StateType as RootStateType } from '../reducer.js'; +} from './conversations.preload.js'; +import type { NoopActionType } from './noop.std.js'; +import type { StateType as RootStateType } from '../reducer.preload.js'; import type { StoryViewTargetType, StoryViewType, -} from '../../types/Stories.js'; -import type { SyncType } from '../../jobs/helpers/syncHelpers.js'; -import type { StoryDistributionIdString } from '../../types/StoryDistributionId.js'; -import type { ServiceIdString } from '../../types/ServiceId.js'; -import { isAciString } from '../../util/isAciString.js'; -import { createLogger } from '../../logging/log.js'; -import { TARGETED_CONVERSATION_CHANGED } from './conversations.js'; -import { SIGNAL_ACI } from '../../types/SignalConversation.js'; -import { DataReader, DataWriter } from '../../sql/Client.js'; -import { ReadStatus } from '../../messages/MessageReadStatus.js'; -import { SendStatus } from '../../messages/MessageSendState.js'; -import { SafetyNumberChangeSource } from '../../types/SafetyNumberChangeSource.js'; +} from '../../types/Stories.std.js'; +import type { SyncType } from '../../jobs/helpers/syncHelpers.preload.js'; +import type { StoryDistributionIdString } from '../../types/StoryDistributionId.std.js'; +import type { ServiceIdString } from '../../types/ServiceId.std.js'; +import { isAciString } from '../../util/isAciString.std.js'; +import { createLogger } from '../../logging/log.std.js'; +import { TARGETED_CONVERSATION_CHANGED } from './conversations.preload.js'; +import { SIGNAL_ACI } from '../../types/SignalConversation.std.js'; +import { DataReader, DataWriter } from '../../sql/Client.preload.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.std.js'; +import { SendStatus } from '../../messages/MessageSendState.std.js'; +import { SafetyNumberChangeSource } from '../../types/SafetyNumberChangeSource.std.js'; import { StoryViewDirectionType, StoryViewModeType, -} from '../../types/Stories.js'; -import { areStoryViewReceiptsEnabled } from '../../util/Settings.js'; -import { assertDev, strictAssert } from '../../util/assert.js'; -import { drop } from '../../util/drop.js'; -import { blockSendUntilConversationsAreVerified } from '../../util/blockSendUntilConversationsAreVerified.js'; -import { deleteStoryForEveryone as doDeleteStoryForEveryone } from '../../util/deleteStoryForEveryone.js'; -import { deleteGroupStoryReplyForEveryone as doDeleteGroupStoryReplyForEveryone } from '../../util/deleteGroupStoryReplyForEveryone.js'; -import { enqueueReactionForSend } from '../../reactions/enqueueReactionForSend.js'; -import { getMessageById } from '../../messages/getMessageById.js'; -import { markOnboardingStoryAsRead } from '../../util/markOnboardingStoryAsRead.js'; -import { markViewed } from '../../services/MessageUpdater.js'; -import { queueAttachmentDownloads } from '../../util/queueAttachmentDownloads.js'; -import { replaceIndex } from '../../util/replaceIndex.js'; -import type { DurationInSeconds } from '../../util/durations/index.js'; +} from '../../types/Stories.std.js'; +import { areStoryViewReceiptsEnabled } from '../../util/Settings.preload.js'; +import { assertDev, strictAssert } from '../../util/assert.std.js'; +import { drop } from '../../util/drop.std.js'; +import { blockSendUntilConversationsAreVerified } from '../../util/blockSendUntilConversationsAreVerified.dom.js'; +import { deleteStoryForEveryone as doDeleteStoryForEveryone } from '../../util/deleteStoryForEveryone.preload.js'; +import { deleteGroupStoryReplyForEveryone as doDeleteGroupStoryReplyForEveryone } from '../../util/deleteGroupStoryReplyForEveryone.preload.js'; +import { enqueueReactionForSend } from '../../reactions/enqueueReactionForSend.preload.js'; +import { getMessageById } from '../../messages/getMessageById.preload.js'; +import { markOnboardingStoryAsRead } from '../../util/markOnboardingStoryAsRead.preload.js'; +import { markViewed } from '../../services/MessageUpdater.preload.js'; +import { queueAttachmentDownloads } from '../../util/queueAttachmentDownloads.preload.js'; +import { replaceIndex } from '../../util/replaceIndex.std.js'; +import type { DurationInSeconds } from '../../util/durations/index.std.js'; import { hasFailed, isDownloaded, isDownloading, -} from '../../util/Attachment.js'; +} from '../../util/Attachment.std.js'; import { getConversationSelector, getHideStoryConversationIds, -} from '../selectors/conversations.js'; +} from '../selectors/conversations.dom.js'; import { getStories, getStoryDownloadableAttachment, -} from '../selectors/stories.js'; -import { setStoriesDisabled as utilSetStoriesDisabled } from '../../util/stories.js'; -import { getStoryDataFromMessageAttributes } from '../../services/storyLoader.js'; -import { isGroup } from '../../util/whatTypeOfConversation.js'; -import { isNotNil } from '../../util/isNotNil.js'; -import { isStory } from '../../messages/helpers.js'; -import { sendStoryMessage as doSendStoryMessage } from '../../util/sendStoryMessage.js'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; -import { useBoundActions } from '../../hooks/useBoundActions.js'; -import { verifyStoryListMembers as doVerifyStoryListMembers } from '../../util/verifyStoryListMembers.js'; -import { viewSyncJobQueue } from '../../jobs/viewSyncJobQueue.js'; -import { getOwn } from '../../util/getOwn.js'; -import { SHOW_TOAST } from './toast.js'; -import { ToastType } from '../../types/Toast.js'; -import type { ShowToastActionType } from './toast.js'; +} from '../selectors/stories.preload.js'; +import { setStoriesDisabled as utilSetStoriesDisabled } from '../../util/stories.preload.js'; +import { getStoryDataFromMessageAttributes } from '../../services/storyLoader.preload.js'; +import { isGroup } from '../../util/whatTypeOfConversation.dom.js'; +import { isNotNil } from '../../util/isNotNil.std.js'; +import { isStory } from '../../messages/helpers.std.js'; +import { sendStoryMessage as doSendStoryMessage } from '../../util/sendStoryMessage.preload.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.js'; +import { useBoundActions } from '../../hooks/useBoundActions.std.js'; +import { verifyStoryListMembers as doVerifyStoryListMembers } from '../../util/verifyStoryListMembers.preload.js'; +import { viewSyncJobQueue } from '../../jobs/viewSyncJobQueue.preload.js'; +import { getOwn } from '../../util/getOwn.std.js'; +import { SHOW_TOAST } from './toast.preload.js'; +import { ToastType } from '../../types/Toast.dom.js'; +import type { ShowToastActionType } from './toast.preload.js'; import { conversationJobQueue, conversationQueueJobEnum, -} from '../../jobs/conversationJobQueue.js'; -import { ReceiptType } from '../../types/Receipt.js'; -import { cleanupMessages } from '../../util/cleanup.js'; -import { AttachmentDownloadUrgency } from '../../types/AttachmentDownload.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +} from '../../jobs/conversationJobQueue.preload.js'; +import { ReceiptType } from '../../types/Receipt.std.js'; +import { cleanupMessages } from '../../util/cleanup.preload.js'; +import { AttachmentDownloadUrgency } from '../../types/AttachmentDownload.std.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; const { isEqual, pick } = lodash; diff --git a/ts/state/ducks/storyDistributionLists.ts b/ts/state/ducks/storyDistributionLists.ts index fc7581f439..1293c6274b 100644 --- a/ts/state/ducks/storyDistributionLists.ts +++ b/ts/state/ducks/storyDistributionLists.ts @@ -5,20 +5,20 @@ import lodash from 'lodash'; import type { ThunkAction } from 'redux-thunk'; import type { ReadonlyDeep } from 'type-fest'; -import type { StateType as RootStateType } from '../reducer.js'; -import type { StoryDistributionWithMembersType } from '../../sql/Interface.js'; -import type { StoryDistributionIdString } from '../../types/StoryDistributionId.js'; -import type { ServiceIdString } from '../../types/ServiceId.js'; -import { createLogger } from '../../logging/log.js'; -import { DataReader, DataWriter } from '../../sql/Client.js'; -import { MY_STORY_ID } from '../../types/Stories.js'; -import { generateStoryDistributionId } from '../../types/StoryDistributionId.js'; -import { deleteStoryForEveryone } from '../../util/deleteStoryForEveryone.js'; -import { replaceIndex } from '../../util/replaceIndex.js'; -import { storageServiceUploadJob } from '../../services/storage.js'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; -import { useBoundActions } from '../../hooks/useBoundActions.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +import type { StateType as RootStateType } from '../reducer.preload.js'; +import type { StoryDistributionWithMembersType } from '../../sql/Interface.std.js'; +import type { StoryDistributionIdString } from '../../types/StoryDistributionId.std.js'; +import type { ServiceIdString } from '../../types/ServiceId.std.js'; +import { createLogger } from '../../logging/log.std.js'; +import { DataReader, DataWriter } from '../../sql/Client.preload.js'; +import { MY_STORY_ID } from '../../types/Stories.std.js'; +import { generateStoryDistributionId } from '../../types/StoryDistributionId.std.js'; +import { deleteStoryForEveryone } from '../../util/deleteStoryForEveryone.preload.js'; +import { replaceIndex } from '../../util/replaceIndex.std.js'; +import { storageServiceUploadJob } from '../../services/storage.preload.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.js'; +import { useBoundActions } from '../../hooks/useBoundActions.std.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; const { omit } = lodash; diff --git a/ts/state/ducks/toast.ts b/ts/state/ducks/toast.ts index 1c926ac62a..949e7335b1 100644 --- a/ts/state/ducks/toast.ts +++ b/ts/state/ducks/toast.ts @@ -4,10 +4,10 @@ import { ipcRenderer } from 'electron'; import type { ReadonlyDeep } from 'type-fest'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; -import type { NoopActionType } from './noop.js'; -import { useBoundActions } from '../../hooks/useBoundActions.js'; -import type { AnyToast } from '../../types/Toast.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.js'; +import type { NoopActionType } from './noop.std.js'; +import { useBoundActions } from '../../hooks/useBoundActions.std.js'; +import type { AnyToast } from '../../types/Toast.dom.js'; // State diff --git a/ts/state/ducks/updates.ts b/ts/state/ducks/updates.ts index 6722ccfb4d..0dab50a123 100644 --- a/ts/state/ducks/updates.ts +++ b/ts/state/ducks/updates.ts @@ -3,12 +3,12 @@ import type { ThunkAction } from 'redux-thunk'; import type { ReadonlyDeep } from 'type-fest'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; -import { useBoundActions } from '../../hooks/useBoundActions.js'; -import * as updateIpc from '../../shims/updateIpc.js'; -import { DialogType } from '../../types/Dialogs.js'; -import { DAY } from '../../util/durations/index.js'; -import type { StateType as RootStateType } from '../reducer.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.js'; +import { useBoundActions } from '../../hooks/useBoundActions.std.js'; +import * as updateIpc from '../../shims/updateIpc.preload.js'; +import { DialogType } from '../../types/Dialogs.std.js'; +import { DAY } from '../../util/durations/index.std.js'; +import type { StateType as RootStateType } from '../reducer.preload.js'; // State diff --git a/ts/state/ducks/user.ts b/ts/state/ducks/user.ts index 5bc2b80fa9..a99a5a6ac2 100644 --- a/ts/state/ducks/user.ts +++ b/ts/state/ducks/user.ts @@ -2,16 +2,16 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { ReadonlyDeep } from 'type-fest'; -import { trigger } from '../../shims/events.js'; -import type { LocaleMessagesType } from '../../types/I18N.js'; -import type { LocalizerType } from '../../types/Util.js'; -import type { MenuOptionsType } from '../../types/menu.js'; -import type { NoopActionType } from './noop.js'; -import type { AciString, PniString } from '../../types/ServiceId.js'; -import OS from '../../util/os/osMain.js'; -import { ThemeType } from '../../types/Util.js'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; -import { useBoundActions } from '../../hooks/useBoundActions.js'; +import { trigger } from '../../shims/events.dom.js'; +import type { LocaleMessagesType } from '../../types/I18N.std.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import type { MenuOptionsType } from '../../types/menu.std.js'; +import type { NoopActionType } from './noop.std.js'; +import type { AciString, PniString } from '../../types/ServiceId.std.js'; +import OS from '../../util/os/osMain.node.js'; +import { ThemeType } from '../../types/Util.std.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.js'; +import { useBoundActions } from '../../hooks/useBoundActions.std.js'; // State diff --git a/ts/state/ducks/username.ts b/ts/state/ducks/username.ts index 6fb8cc8b59..10c0c727ac 100644 --- a/ts/state/ducks/username.ts +++ b/ts/state/ducks/username.ts @@ -4,33 +4,33 @@ import type { ThunkAction } from 'redux-thunk'; import type { ReadonlyDeep } from 'type-fest'; -import type { UsernameReservationType } from '../../types/Username.js'; +import type { UsernameReservationType } from '../../types/Username.std.js'; import { ReserveUsernameError, ConfirmUsernameResult, -} from '../../types/Username.js'; -import * as usernameServices from '../../services/username.js'; -import { storageServiceUploadJob } from '../../services/storage.js'; -import type { ReserveUsernameResultType } from '../../services/username.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; -import { sleep } from '../../util/sleep.js'; -import { assertDev } from '../../util/assert.js'; -import type { StateType as RootStateType } from '../reducer.js'; -import type { PromiseAction } from '../util.js'; -import { getMe } from '../selectors/conversations.js'; -import { getUsernameCorrupted } from '../selectors/items.js'; +} from '../../types/Username.std.js'; +import * as usernameServices from '../../services/username.preload.js'; +import { storageServiceUploadJob } from '../../services/storage.preload.js'; +import type { ReserveUsernameResultType } from '../../services/username.preload.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; +import { sleep } from '../../util/sleep.std.js'; +import { assertDev } from '../../util/assert.std.js'; +import type { StateType as RootStateType } from '../reducer.preload.js'; +import type { PromiseAction } from '../util.std.js'; +import { getMe } from '../selectors/conversations.dom.js'; +import { getUsernameCorrupted } from '../selectors/items.dom.js'; import { UsernameEditState, UsernameLinkState, UsernameReservationState, UsernameReservationError, -} from './usernameEnums.js'; -import { showToast } from './toast.js'; -import { ToastType } from '../../types/Toast.js'; -import type { ToastActionType } from './toast.js'; -import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.js'; -import { useBoundActions } from '../../hooks/useBoundActions.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +} from './usernameEnums.std.js'; +import { showToast } from './toast.preload.js'; +import { ToastType } from '../../types/Toast.dom.js'; +import type { ToastActionType } from './toast.preload.js'; +import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.js'; +import { useBoundActions } from '../../hooks/useBoundActions.std.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; export type UsernameReservationStateType = ReadonlyDeep<{ state: UsernameReservationState; diff --git a/ts/state/getInitialState.ts b/ts/state/getInitialState.ts index d7c855129e..359fe5cf48 100644 --- a/ts/state/getInitialState.ts +++ b/ts/state/getInitialState.ts @@ -1,66 +1,66 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { getEmptyState as accountsEmptyState } from './ducks/accounts.js'; -import { getEmptyState as appEmptyState } from './ducks/app.js'; -import { getEmptyState as audioPlayerEmptyState } from './ducks/audioPlayer.js'; -import { getEmptyState as audioRecorderEmptyState } from './ducks/audioRecorder.js'; -import { getEmptyState as badgesEmptyState } from './ducks/badges.js'; -import { getEmptyState as callHistoryEmptyState } from './ducks/callHistory.js'; -import { getEmptyState as callingEmptyState } from './ducks/calling.js'; +import { getEmptyState as accountsEmptyState } from './ducks/accounts.preload.js'; +import { getEmptyState as appEmptyState } from './ducks/app.preload.js'; +import { getEmptyState as audioPlayerEmptyState } from './ducks/audioPlayer.preload.js'; +import { getEmptyState as audioRecorderEmptyState } from './ducks/audioRecorder.preload.js'; +import { getEmptyState as badgesEmptyState } from './ducks/badges.preload.js'; +import { getEmptyState as callHistoryEmptyState } from './ducks/callHistory.preload.js'; +import { getEmptyState as callingEmptyState } from './ducks/calling.preload.js'; import { getEmptyState as chatFoldersEmptyState, getInitialChatFoldersState, -} from './ducks/chatFolders.js'; -import { getEmptyState as composerEmptyState } from './ducks/composer.js'; -import { getEmptyState as conversationsEmptyState } from './ducks/conversations.js'; -import { getEmptyState as crashReportsEmptyState } from './ducks/crashReports.js'; -import { getEmptyState as donationsEmptyState } from './ducks/donations.js'; -import { getEmptyState as emojiEmptyState } from './ducks/emojis.js'; -import { getEmptyState as expirationEmptyState } from './ducks/expiration.js'; -import { getEmptyState as gifsEmptyState } from './ducks/gifs.js'; -import { getEmptyState as globalModalsEmptyState } from './ducks/globalModals.js'; -import { getEmptyState as inboxEmptyState } from './ducks/inbox.js'; -import { getEmptyState as installerEmptyState } from './ducks/installer.js'; -import { getEmptyState as itemsEmptyState } from './ducks/items.js'; -import { getEmptyState as lightboxEmptyState } from './ducks/lightbox.js'; -import { getEmptyState as linkPreviewsEmptyState } from './ducks/linkPreviews.js'; -import { getEmptyState as mediaGalleryEmptyState } from './ducks/mediaGallery.js'; -import { getEmptyState as navEmptyState } from './ducks/nav.js'; -import { getEmptyState as networkEmptyState } from './ducks/network.js'; -import { getEmptyState as notificationProfilesEmptyState } from './ducks/notificationProfiles.js'; -import { getEmptyState as preferredReactionsEmptyState } from './ducks/preferredReactions.js'; -import { getEmptyState as safetyNumberEmptyState } from './ducks/safetyNumber.js'; -import { getEmptyState as searchEmptyState } from './ducks/search.js'; -import { getEmptyState as stickersEmptyState } from './ducks/stickers.js'; -import { getEmptyState as storiesEmptyState } from './ducks/stories.js'; -import { getEmptyState as storyDistributionListsEmptyState } from './ducks/storyDistributionLists.js'; -import { getEmptyState as toastEmptyState } from './ducks/toast.js'; -import { getEmptyState as updatesEmptyState } from './ducks/updates.js'; -import { getEmptyState as userEmptyState } from './ducks/user.js'; -import { getEmptyState as usernameEmptyState } from './ducks/username.js'; +} from './ducks/chatFolders.preload.js'; +import { getEmptyState as composerEmptyState } from './ducks/composer.preload.js'; +import { getEmptyState as conversationsEmptyState } from './ducks/conversations.preload.js'; +import { getEmptyState as crashReportsEmptyState } from './ducks/crashReports.preload.js'; +import { getEmptyState as donationsEmptyState } from './ducks/donations.preload.js'; +import { getEmptyState as emojiEmptyState } from './ducks/emojis.preload.js'; +import { getEmptyState as expirationEmptyState } from './ducks/expiration.std.js'; +import { getEmptyState as gifsEmptyState } from './ducks/gifs.preload.js'; +import { getEmptyState as globalModalsEmptyState } from './ducks/globalModals.preload.js'; +import { getEmptyState as inboxEmptyState } from './ducks/inbox.std.js'; +import { getEmptyState as installerEmptyState } from './ducks/installer.preload.js'; +import { getEmptyState as itemsEmptyState } from './ducks/items.preload.js'; +import { getEmptyState as lightboxEmptyState } from './ducks/lightbox.preload.js'; +import { getEmptyState as linkPreviewsEmptyState } from './ducks/linkPreviews.preload.js'; +import { getEmptyState as mediaGalleryEmptyState } from './ducks/mediaGallery.preload.js'; +import { getEmptyState as navEmptyState } from './ducks/nav.std.js'; +import { getEmptyState as networkEmptyState } from './ducks/network.dom.js'; +import { getEmptyState as notificationProfilesEmptyState } from './ducks/notificationProfiles.preload.js'; +import { getEmptyState as preferredReactionsEmptyState } from './ducks/preferredReactions.preload.js'; +import { getEmptyState as safetyNumberEmptyState } from './ducks/safetyNumber.preload.js'; +import { getEmptyState as searchEmptyState } from './ducks/search.preload.js'; +import { getEmptyState as stickersEmptyState } from './ducks/stickers.preload.js'; +import { getEmptyState as storiesEmptyState } from './ducks/stories.preload.js'; +import { getEmptyState as storyDistributionListsEmptyState } from './ducks/storyDistributionLists.preload.js'; +import { getEmptyState as toastEmptyState } from './ducks/toast.preload.js'; +import { getEmptyState as updatesEmptyState } from './ducks/updates.preload.js'; +import { getEmptyState as userEmptyState } from './ducks/user.preload.js'; +import { getEmptyState as usernameEmptyState } from './ducks/username.preload.js'; -import OS from '../util/os/osMain.js'; -import { getInteractionMode } from '../services/InteractionMode.js'; -import { makeLookup } from '../util/makeLookup.js'; +import OS from '../util/os/osMain.node.js'; +import { getInteractionMode } from '../services/InteractionMode.dom.js'; +import { makeLookup } from '../util/makeLookup.std.js'; import { ATTACHMENTS_PATH, STICKERS_PATH, TEMP_PATH, -} from '../util/basePaths.js'; +} from '../util/basePaths.preload.js'; -import type { StateType } from './reducer.js'; -import type { MainWindowStatsType } from '../windows/context.js'; -import type { ConversationsStateType } from './ducks/conversations.js'; -import type { MenuOptionsType } from '../types/menu.js'; +import type { StateType } from './reducer.preload.js'; +import type { MainWindowStatsType } from '../windows/context.preload.js'; +import type { ConversationsStateType } from './ducks/conversations.preload.js'; +import type { MenuOptionsType } from '../types/menu.std.js'; import type { StoryDistributionListDataType, StoryDistributionListStateType, -} from './ducks/storyDistributionLists.js'; -import type { ThemeType } from '../types/Util.js'; -import type { UserStateType } from './ducks/user.js'; -import type { ReduxInitData } from './initializeRedux.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from './ducks/storyDistributionLists.preload.js'; +import type { ThemeType } from '../types/Util.std.js'; +import type { UserStateType } from './ducks/user.preload.js'; +import type { ReduxInitData } from './initializeRedux.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; export function getInitialState( { diff --git a/ts/state/initializeRedux.ts b/ts/state/initializeRedux.ts index 2b7279733e..8162c67e46 100644 --- a/ts/state/initializeRedux.ts +++ b/ts/state/initializeRedux.ts @@ -2,24 +2,24 @@ // SPDX-License-Identifier: AGPL-3.0-only import { bindActionCreators } from 'redux'; -import { actionCreators } from './actions.js'; -import { createStore } from './createStore.js'; -import { getInitialState } from './getInitialState.js'; +import { actionCreators } from './actions.preload.js'; +import { createStore } from './createStore.preload.js'; +import { getInitialState } from './getInitialState.preload.js'; -import type { BadgesStateType } from './ducks/badges.js'; -import type { CallHistoryDetails } from '../types/CallDisposition.js'; -import type { DonationsStateType } from './ducks/donations.js'; -import type { MainWindowStatsType } from '../windows/context.js'; -import type { MenuOptionsType } from '../types/menu.js'; -import type { StoryDataType } from './ducks/stories.js'; -import type { StoryDistributionListDataType } from './ducks/storyDistributionLists.js'; -import type { ThemeType } from '../types/Util.js'; -import type { CallLinkType } from '../types/CallLink.js'; -import type { RecentEmojiObjectType } from '../util/loadRecentEmojis.js'; -import type { StickersStateType } from './ducks/stickers.js'; -import type { GifsStateType } from './ducks/gifs.js'; -import type { NotificationProfileType } from '../types/NotificationProfile.js'; -import type { CurrentChatFolder } from '../types/CurrentChatFolders.js'; +import type { BadgesStateType } from './ducks/badges.preload.js'; +import type { CallHistoryDetails } from '../types/CallDisposition.std.js'; +import type { DonationsStateType } from './ducks/donations.preload.js'; +import type { MainWindowStatsType } from '../windows/context.preload.js'; +import type { MenuOptionsType } from '../types/menu.std.js'; +import type { StoryDataType } from './ducks/stories.preload.js'; +import type { StoryDistributionListDataType } from './ducks/storyDistributionLists.preload.js'; +import type { ThemeType } from '../types/Util.std.js'; +import type { CallLinkType } from '../types/CallLink.std.js'; +import type { RecentEmojiObjectType } from '../util/loadRecentEmojis.preload.js'; +import type { StickersStateType } from './ducks/stickers.preload.js'; +import type { GifsStateType } from './ducks/gifs.preload.js'; +import type { NotificationProfileType } from '../types/NotificationProfile.std.js'; +import type { CurrentChatFolder } from '../types/CurrentChatFolders.std.js'; export type ReduxInitData = { badgesState: BadgesStateType; diff --git a/ts/state/reducer.ts b/ts/state/reducer.ts index 4fe84b1545..d4077813d1 100644 --- a/ts/state/reducer.ts +++ b/ts/state/reducer.ts @@ -3,41 +3,41 @@ import { combineReducers } from 'redux'; -import { reducer as accounts } from './ducks/accounts.js'; -import { reducer as app } from './ducks/app.js'; -import { reducer as audioPlayer } from './ducks/audioPlayer.js'; -import { reducer as audioRecorder } from './ducks/audioRecorder.js'; -import { reducer as badges } from './ducks/badges.js'; -import { reducer as calling } from './ducks/calling.js'; -import { reducer as callHistory } from './ducks/callHistory.js'; -import { reducer as chatFolders } from './ducks/chatFolders.js'; -import { reducer as composer } from './ducks/composer.js'; -import { reducer as conversations } from './ducks/conversations.js'; -import { reducer as crashReports } from './ducks/crashReports.js'; -import { reducer as donations } from './ducks/donations.js'; -import { reducer as emojis } from './ducks/emojis.js'; -import { reducer as expiration } from './ducks/expiration.js'; -import { reducer as gifs } from './ducks/gifs.js'; -import { reducer as globalModals } from './ducks/globalModals.js'; -import { reducer as inbox } from './ducks/inbox.js'; -import { reducer as installer } from './ducks/installer.js'; -import { reducer as items } from './ducks/items.js'; -import { reducer as lightbox } from './ducks/lightbox.js'; -import { reducer as linkPreviews } from './ducks/linkPreviews.js'; -import { reducer as mediaGallery } from './ducks/mediaGallery.js'; -import { reducer as nav } from './ducks/nav.js'; -import { reducer as network } from './ducks/network.js'; -import { reducer as notificationProfiles } from './ducks/notificationProfiles.js'; -import { reducer as preferredReactions } from './ducks/preferredReactions.js'; -import { reducer as safetyNumber } from './ducks/safetyNumber.js'; -import { reducer as search } from './ducks/search.js'; -import { reducer as stickers } from './ducks/stickers.js'; -import { reducer as stories } from './ducks/stories.js'; -import { reducer as storyDistributionLists } from './ducks/storyDistributionLists.js'; -import { reducer as toast } from './ducks/toast.js'; -import { reducer as updates } from './ducks/updates.js'; -import { reducer as user } from './ducks/user.js'; -import { reducer as username } from './ducks/username.js'; +import { reducer as accounts } from './ducks/accounts.preload.js'; +import { reducer as app } from './ducks/app.preload.js'; +import { reducer as audioPlayer } from './ducks/audioPlayer.preload.js'; +import { reducer as audioRecorder } from './ducks/audioRecorder.preload.js'; +import { reducer as badges } from './ducks/badges.preload.js'; +import { reducer as calling } from './ducks/calling.preload.js'; +import { reducer as callHistory } from './ducks/callHistory.preload.js'; +import { reducer as chatFolders } from './ducks/chatFolders.preload.js'; +import { reducer as composer } from './ducks/composer.preload.js'; +import { reducer as conversations } from './ducks/conversations.preload.js'; +import { reducer as crashReports } from './ducks/crashReports.preload.js'; +import { reducer as donations } from './ducks/donations.preload.js'; +import { reducer as emojis } from './ducks/emojis.preload.js'; +import { reducer as expiration } from './ducks/expiration.std.js'; +import { reducer as gifs } from './ducks/gifs.preload.js'; +import { reducer as globalModals } from './ducks/globalModals.preload.js'; +import { reducer as inbox } from './ducks/inbox.std.js'; +import { reducer as installer } from './ducks/installer.preload.js'; +import { reducer as items } from './ducks/items.preload.js'; +import { reducer as lightbox } from './ducks/lightbox.preload.js'; +import { reducer as linkPreviews } from './ducks/linkPreviews.preload.js'; +import { reducer as mediaGallery } from './ducks/mediaGallery.preload.js'; +import { reducer as nav } from './ducks/nav.std.js'; +import { reducer as network } from './ducks/network.dom.js'; +import { reducer as notificationProfiles } from './ducks/notificationProfiles.preload.js'; +import { reducer as preferredReactions } from './ducks/preferredReactions.preload.js'; +import { reducer as safetyNumber } from './ducks/safetyNumber.preload.js'; +import { reducer as search } from './ducks/search.preload.js'; +import { reducer as stickers } from './ducks/stickers.preload.js'; +import { reducer as stories } from './ducks/stories.preload.js'; +import { reducer as storyDistributionLists } from './ducks/storyDistributionLists.preload.js'; +import { reducer as toast } from './ducks/toast.preload.js'; +import { reducer as updates } from './ducks/updates.preload.js'; +import { reducer as user } from './ducks/user.preload.js'; +import { reducer as username } from './ducks/username.preload.js'; export const reducer = combineReducers({ accounts, diff --git a/ts/state/reinitializeRedux.ts b/ts/state/reinitializeRedux.ts index de49db8a60..cb61f78fc5 100644 --- a/ts/state/reinitializeRedux.ts +++ b/ts/state/reinitializeRedux.ts @@ -3,12 +3,12 @@ import type { UnknownAction } from 'redux'; -import { createLogger } from '../logging/log.js'; -import { getInitialState } from './getInitialState.js'; -import { reducer as normalReducer } from './reducer.js'; +import { createLogger } from '../logging/log.std.js'; +import { getInitialState } from './getInitialState.preload.js'; +import { reducer as normalReducer } from './reducer.preload.js'; -import type { StateType } from './reducer.js'; -import type { ReduxInitData } from './initializeRedux.js'; +import type { StateType } from './reducer.preload.js'; +import type { ReduxInitData } from './initializeRedux.preload.js'; const log = createLogger('reinitializeRedux'); diff --git a/ts/state/roots/createApp.tsx b/ts/state/roots/createApp.tsx index d690186c0e..3ae614ef47 100644 --- a/ts/state/roots/createApp.tsx +++ b/ts/state/roots/createApp.tsx @@ -7,9 +7,9 @@ import { Provider } from 'react-redux'; import type { Store } from 'redux'; -import { SmartApp } from '../smart/App.js'; -import { SmartVoiceNotesPlaybackProvider } from '../smart/VoiceNotesPlaybackProvider.js'; -import { AxoProvider } from '../../axo/AxoProvider.js'; +import { SmartApp } from '../smart/App.preload.js'; +import { SmartVoiceNotesPlaybackProvider } from '../smart/VoiceNotesPlaybackProvider.preload.js'; +import { AxoProvider } from '../../axo/AxoProvider.dom.js'; export const createApp = (store: Store): ReactElement => ( diff --git a/ts/state/roots/createGroupV2JoinModal.tsx b/ts/state/roots/createGroupV2JoinModal.tsx index 97cc507f34..fcb863deb9 100644 --- a/ts/state/roots/createGroupV2JoinModal.tsx +++ b/ts/state/roots/createGroupV2JoinModal.tsx @@ -8,10 +8,10 @@ import { Provider } from 'react-redux'; import type { Store } from 'redux'; -import { ModalHost } from '../../components/ModalHost.js'; -import type { SmartGroupV2JoinDialogProps } from '../smart/GroupV2JoinDialog.js'; -import { SmartGroupV2JoinDialog } from '../smart/GroupV2JoinDialog.js'; -import { FunEmojiLocalizationProvider } from '../../components/fun/FunEmojiLocalizationProvider.js'; +import { ModalHost } from '../../components/ModalHost.dom.js'; +import type { SmartGroupV2JoinDialogProps } from '../smart/GroupV2JoinDialog.dom.js'; +import { SmartGroupV2JoinDialog } from '../smart/GroupV2JoinDialog.dom.js'; +import { FunEmojiLocalizationProvider } from '../../components/fun/FunEmojiLocalizationProvider.dom.js'; export const createGroupV2JoinModal = ( store: Store, diff --git a/ts/state/selectors/accounts.ts b/ts/state/selectors/accounts.ts index 7e6eaeee22..5b62c9cd04 100644 --- a/ts/state/selectors/accounts.ts +++ b/ts/state/selectors/accounts.ts @@ -3,9 +3,9 @@ import { createSelector } from 'reselect'; -import type { StateType } from '../reducer.js'; -import type { AccountsStateType } from '../ducks/accounts.js'; -import type { ServiceIdString } from '../../types/ServiceId.js'; +import type { StateType } from '../reducer.preload.js'; +import type { AccountsStateType } from '../ducks/accounts.preload.js'; +import type { ServiceIdString } from '../../types/ServiceId.std.js'; export const getAccounts = (state: StateType): AccountsStateType => state.accounts; diff --git a/ts/state/selectors/app.ts b/ts/state/selectors/app.ts index ddd66e1d6e..f25d491c37 100644 --- a/ts/state/selectors/app.ts +++ b/ts/state/selectors/app.ts @@ -1,8 +1,8 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import { createSelector } from 'reselect'; -import type { StateType } from '../reducer.js'; -import type { AppStateType } from '../ducks/app.js'; +import type { StateType } from '../reducer.preload.js'; +import type { AppStateType } from '../ducks/app.preload.js'; export const getApp = (state: StateType): AppStateType => state.app; diff --git a/ts/state/selectors/audioPlayer.ts b/ts/state/selectors/audioPlayer.ts index f1fc736f6d..9c33bd96d6 100644 --- a/ts/state/selectors/audioPlayer.ts +++ b/ts/state/selectors/audioPlayer.ts @@ -7,28 +7,28 @@ import { getUserACI, getUserConversationId, getUserNumber, -} from './user.js'; +} from './user.std.js'; import { getMessagePropStatus, getSource, getSourceServiceId, -} from './message.js'; +} from './message.preload.js'; import { getConversationByIdSelector, getConversations, getConversationSelector, getSelectedConversationId, -} from './conversations.js'; -import type { StateType } from '../reducer.js'; -import { createLogger } from '../../logging/log.js'; -import { getLocalAttachmentUrl } from '../../util/getLocalAttachmentUrl.js'; -import type { MessageWithUIFieldsType } from '../ducks/conversations.js'; +} from './conversations.dom.js'; +import type { StateType } from '../reducer.preload.js'; +import { createLogger } from '../../logging/log.std.js'; +import { getLocalAttachmentUrl } from '../../util/getLocalAttachmentUrl.std.js'; +import type { MessageWithUIFieldsType } from '../ducks/conversations.preload.js'; import type { ReadonlyMessageAttributesType } from '../../model-types.d.ts'; -import { getMessageIdForLogging } from '../../util/idForLogging.js'; -import * as Attachment from '../../util/Attachment.js'; -import type { ActiveAudioPlayerStateType } from '../ducks/audioPlayer.js'; -import { isPlayed } from '../../util/Attachment.js'; -import type { ServiceIdString } from '../../types/ServiceId.js'; +import { getMessageIdForLogging } from '../../util/idForLogging.preload.js'; +import * as Attachment from '../../util/Attachment.std.js'; +import type { ActiveAudioPlayerStateType } from '../ducks/audioPlayer.preload.js'; +import { isPlayed } from '../../util/Attachment.std.js'; +import type { ServiceIdString } from '../../types/ServiceId.std.js'; const log = createLogger('audioPlayer'); diff --git a/ts/state/selectors/audioRecorder.ts b/ts/state/selectors/audioRecorder.ts index d9f7d562d8..8f45811321 100644 --- a/ts/state/selectors/audioRecorder.ts +++ b/ts/state/selectors/audioRecorder.ts @@ -1,8 +1,8 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import { createSelector } from 'reselect'; -import type { StateType } from '../reducer.js'; -import type { AudioRecorderStateType } from '../ducks/audioRecorder.js'; +import type { StateType } from '../reducer.preload.js'; +import type { AudioRecorderStateType } from '../ducks/audioRecorder.preload.js'; export function getAudioRecorder(state: StateType): AudioRecorderStateType { return state.audioRecorder; diff --git a/ts/state/selectors/badges.ts b/ts/state/selectors/badges.ts index 749e8cf6e4..31986be5ba 100644 --- a/ts/state/selectors/badges.ts +++ b/ts/state/selectors/badges.ts @@ -3,13 +3,13 @@ import { createSelector } from 'reselect'; import lodash from 'lodash'; -import { createLogger } from '../../logging/log.js'; -import type { StateType } from '../reducer.js'; -import type { BadgesStateType } from '../ducks/badges.js'; -import type { BadgeType } from '../../badges/types.js'; -import { getOwn } from '../../util/getOwn.js'; -import { getAbsoluteBadgeImageFilePath } from '../../util/migrations.js'; -import type { ConversationType } from '../ducks/conversations.js'; +import { createLogger } from '../../logging/log.std.js'; +import type { StateType } from '../reducer.preload.js'; +import type { BadgesStateType } from '../ducks/badges.preload.js'; +import type { BadgeType } from '../../badges/types.std.js'; +import { getOwn } from '../../util/getOwn.std.js'; +import { getAbsoluteBadgeImageFilePath } from '../../util/migrations.preload.js'; +import type { ConversationType } from '../ducks/conversations.preload.js'; const { mapValues } = lodash; diff --git a/ts/state/selectors/callHistory.ts b/ts/state/selectors/callHistory.ts index 0cdbbf6800..b2c3c0f928 100644 --- a/ts/state/selectors/callHistory.ts +++ b/ts/state/selectors/callHistory.ts @@ -2,14 +2,14 @@ // SPDX-License-Identifier: AGPL-3.0-only import { createSelector } from 'reselect'; -import type { CallHistoryState } from '../ducks/callHistory.js'; -import type { StateType } from '../reducer.js'; +import type { CallHistoryState } from '../ducks/callHistory.preload.js'; +import type { StateType } from '../reducer.preload.js'; import { AdhocCallStatus, CallType, type CallHistoryDetails, -} from '../../types/CallDisposition.js'; -import { getOwn } from '../../util/getOwn.js'; +} from '../../types/CallDisposition.std.js'; +import { getOwn } from '../../util/getOwn.std.js'; const getCallHistory = (state: StateType): CallHistoryState => state.callHistory; diff --git a/ts/state/selectors/calling.ts b/ts/state/selectors/calling.ts index 8dccb712ea..631e0e6d21 100644 --- a/ts/state/selectors/calling.ts +++ b/ts/state/selectors/calling.ts @@ -3,7 +3,7 @@ import { createSelector } from 'reselect'; -import type { StateType } from '../reducer.js'; +import type { StateType } from '../reducer.preload.js'; import type { CallingStateType, CallsByConversationType, @@ -12,14 +12,17 @@ import type { DirectCallStateType, GroupCallStateType, ActiveCallStateType, -} from '../ducks/calling.js'; -import { getRingingCall as getRingingCallHelper } from '../ducks/callingHelpers.js'; -import type { PresentedSource } from '../../types/Calling.js'; -import { CallMode } from '../../types/CallDisposition.js'; -import { isCallLinkAdmin, type CallLinkType } from '../../types/CallLink.js'; -import { getUserACI } from './user.js'; -import { getOwn } from '../../util/getOwn.js'; -import type { AciString } from '../../types/ServiceId.js'; +} from '../ducks/calling.preload.js'; +import { getRingingCall as getRingingCallHelper } from '../ducks/callingHelpers.std.js'; +import type { PresentedSource } from '../../types/Calling.std.js'; +import { CallMode } from '../../types/CallDisposition.std.js'; +import { + isCallLinkAdmin, + type CallLinkType, +} from '../../types/CallLink.std.js'; +import { getUserACI } from './user.std.js'; +import { getOwn } from '../../util/getOwn.std.js'; +import type { AciString } from '../../types/ServiceId.std.js'; export type CallStateType = DirectCallStateType | GroupCallStateType; diff --git a/ts/state/selectors/chatFolders.ts b/ts/state/selectors/chatFolders.ts index 0def13dad1..c1215740b1 100644 --- a/ts/state/selectors/chatFolders.ts +++ b/ts/state/selectors/chatFolders.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import { createSelector } from 'reselect'; -import type { StateType } from '../reducer.js'; -import type { StateSelector } from '../types.js'; -import type { ChatFoldersState } from '../ducks/chatFolders.js'; -import type { CurrentChatFolder } from '../../types/CurrentChatFolders.js'; -import { CurrentChatFolders } from '../../types/CurrentChatFolders.js'; +import type { StateType } from '../reducer.preload.js'; +import type { StateSelector } from '../types.std.js'; +import type { ChatFoldersState } from '../ducks/chatFolders.preload.js'; +import type { CurrentChatFolder } from '../../types/CurrentChatFolders.std.js'; +import { CurrentChatFolders } from '../../types/CurrentChatFolders.std.js'; export function getChatFoldersState(state: StateType): ChatFoldersState { return state.chatFolders; diff --git a/ts/state/selectors/composer.ts b/ts/state/selectors/composer.ts index 5fd15c1470..8ed2d33aa0 100644 --- a/ts/state/selectors/composer.ts +++ b/ts/state/selectors/composer.ts @@ -3,12 +3,12 @@ import { createSelector } from 'reselect'; -import type { StateType } from '../reducer.js'; +import type { StateType } from '../reducer.preload.js'; import type { ComposerStateType, QuotedMessageForComposerType, -} from '../ducks/composer.js'; -import { getComposerStateForConversation } from '../ducks/composer.js'; +} from '../ducks/composer.preload.js'; +import { getComposerStateForConversation } from '../ducks/composer.preload.js'; export const getComposerState = (state: StateType): ComposerStateType => state.composer; diff --git a/ts/state/selectors/conversations-extra.ts b/ts/state/selectors/conversations-extra.ts index 64383e6ec8..82b20868c2 100644 --- a/ts/state/selectors/conversations-extra.ts +++ b/ts/state/selectors/conversations-extra.ts @@ -6,21 +6,21 @@ import { createSelector } from 'reselect'; -import { normalizeStoryDistributionId } from '../../types/StoryDistributionId.js'; -import type { ContactsByStory } from '../../components/SafetyNumberChangeDialog.js'; -import type { ConversationVerificationData } from '../ducks/conversations.js'; -import type { StoryDistributionListDataType } from '../ducks/storyDistributionLists.js'; -import type { GetConversationByIdType } from './conversations.js'; -import { isSignalConnection } from '../../util/getSignalConnections.js'; +import { normalizeStoryDistributionId } from '../../types/StoryDistributionId.std.js'; +import type { ContactsByStory } from '../../components/SafetyNumberChangeDialog.dom.js'; +import type { ConversationVerificationData } from '../ducks/conversations.preload.js'; +import type { StoryDistributionListDataType } from '../ducks/storyDistributionLists.preload.js'; +import type { GetConversationByIdType } from './conversations.dom.js'; +import { isSignalConnection } from '../../util/getSignalConnections.preload.js'; -import { isGroup } from '../../util/whatTypeOfConversation.js'; +import { isGroup } from '../../util/whatTypeOfConversation.dom.js'; import { getAllConversations, getConversationSelector, getConversationVerificationData, -} from './conversations.js'; -import { ConversationVerificationState } from '../ducks/conversationsEnums.js'; -import { getDistributionListSelector } from './storyDistributionLists.js'; +} from './conversations.dom.js'; +import { ConversationVerificationState } from '../ducks/conversationsEnums.std.js'; +import { getDistributionListSelector } from './storyDistributionLists.dom.js'; export const getByDistributionListConversationsStoppingSend = createSelector( getConversationSelector, diff --git a/ts/state/selectors/conversations.ts b/ts/state/selectors/conversations.ts index 3760c89f7e..dafcb79daf 100644 --- a/ts/state/selectors/conversations.ts +++ b/ts/state/selectors/conversations.ts @@ -4,8 +4,8 @@ import memoizee from 'memoizee'; import lodash from 'lodash'; import { createSelector } from 'reselect'; -import type { StateType } from '../reducer.js'; -import type { StateSelector } from '../types.js'; +import type { StateType } from '../reducer.preload.js'; +import type { StateSelector } from '../types.std.js'; import type { ConversationLookupType, ConversationMessageType, @@ -16,72 +16,75 @@ import type { MessagesByConversationType, MessageTimestamps, PreJoinConversationType, -} from '../ducks/conversations.js'; -import type { StoriesStateType, StoryDataType } from '../ducks/stories.js'; +} from '../ducks/conversations.preload.js'; +import type { + StoriesStateType, + StoryDataType, +} from '../ducks/stories.preload.js'; import { ComposerStep, OneTimeModalState, ConversationVerificationState, -} from '../ducks/conversationsEnums.js'; -import { getOwn } from '../../util/getOwn.js'; -import type { UUIDFetchStateType } from '../../util/uuidFetchState.js'; -import { deconstructLookup } from '../../util/deconstructLookup.js'; -import type { PropsDataType as TimelinePropsType } from '../../components/conversation/Timeline.js'; -import { assertDev } from '../../util/assert.js'; -import { isConversationUnregistered } from '../../util/isConversationUnregistered.js'; -import { filterAndSortConversations } from '../../util/filterAndSortConversations.js'; -import type { ContactNameColorType } from '../../types/Colors.js'; -import { ContactNameColors } from '../../types/Colors.js'; -import type { AvatarDataType } from '../../types/Avatar.js'; -import type { AciString, ServiceIdString } from '../../types/ServiceId.js'; -import { normalizeServiceId } from '../../types/ServiceId.js'; -import { isInSystemContacts } from '../../util/isInSystemContacts.js'; -import { sortByTitle } from '../../util/sortByTitle.js'; -import { DurationInSeconds } from '../../util/durations/index.js'; +} from '../ducks/conversationsEnums.std.js'; +import { getOwn } from '../../util/getOwn.std.js'; +import type { UUIDFetchStateType } from '../../util/uuidFetchState.std.js'; +import { deconstructLookup } from '../../util/deconstructLookup.std.js'; +import type { PropsDataType as TimelinePropsType } from '../../components/conversation/Timeline.dom.js'; +import { assertDev } from '../../util/assert.std.js'; +import { isConversationUnregistered } from '../../util/isConversationUnregistered.dom.js'; +import { filterAndSortConversations } from '../../util/filterAndSortConversations.std.js'; +import type { ContactNameColorType } from '../../types/Colors.std.js'; +import { ContactNameColors } from '../../types/Colors.std.js'; +import type { AvatarDataType } from '../../types/Avatar.std.js'; +import type { AciString, ServiceIdString } from '../../types/ServiceId.std.js'; +import { normalizeServiceId } from '../../types/ServiceId.std.js'; +import { isInSystemContacts } from '../../util/isInSystemContacts.std.js'; +import { sortByTitle } from '../../util/sortByTitle.std.js'; +import { DurationInSeconds } from '../../util/durations/index.std.js'; import { isDirectConversation, isGroupV1, isGroupV2, -} from '../../util/whatTypeOfConversation.js'; -import { isGroupInStoryMode } from '../../util/isGroupInStoryMode.js'; +} from '../../util/whatTypeOfConversation.dom.js'; +import { isGroupInStoryMode } from '../../util/isGroupInStoryMode.std.js'; import { getIntl, getRegionCode, getUserConversationId, getUserNumber, -} from './user.js'; -import { getPinnedConversationIds } from './items.js'; -import { createLogger } from '../../logging/log.js'; -import { TimelineMessageLoadingState } from '../../util/timelineUtil.js'; -import { isSignalConversation } from '../../util/isSignalConversation.js'; -import { reduce } from '../../util/iterables.js'; -import { getConversationTitleForPanelType } from '../../util/getConversationTitleForPanelType.js'; -import type { PanelRenderType } from '../../types/Panels.js'; -import type { HasStories } from '../../types/Stories.js'; -import { getHasStoriesSelector } from './stories2.js'; -import { canEditMessage } from '../../util/canEditMessage.js'; -import { isOutgoing } from '../../messages/helpers.js'; +} from './user.std.js'; +import { getPinnedConversationIds } from './items.dom.js'; +import { createLogger } from '../../logging/log.std.js'; +import { TimelineMessageLoadingState } from '../../util/timelineUtil.std.js'; +import { isSignalConversation } from '../../util/isSignalConversation.dom.js'; +import { reduce } from '../../util/iterables.std.js'; +import { getConversationTitleForPanelType } from '../../util/getConversationTitleForPanelType.std.js'; +import type { PanelRenderType } from '../../types/Panels.std.js'; +import type { HasStories } from '../../types/Stories.std.js'; +import { getHasStoriesSelector } from './stories2.dom.js'; +import { canEditMessage } from '../../util/canEditMessage.dom.js'; +import { isOutgoing } from '../../messages/helpers.std.js'; import type { AllChatFoldersUnreadStats, UnreadStats, -} from '../../util/countUnreadStats.js'; +} from '../../util/countUnreadStats.std.js'; import { - isChatFoldersEnabled, - isConversationInChatFolder, type ChatFolder, -} from '../../types/ChatFolder.js'; + isConversationInChatFolder, +} from '../../types/ChatFolder.std.js'; +import { isChatFoldersEnabled } from '../../util/isChatFoldersEnabled.dom.js'; import { getSelectedChatFolder, getCurrentChatFolders, getStableSelectedConversationIdInChatFolder, -} from './chatFolders.js'; +} from './chatFolders.std.js'; import { countAllChatFoldersUnreadStats, countAllConversationsUnreadStats, -} from '../../util/countUnreadStats.js'; -import type { AllChatFoldersMutedStats } from '../../util/countMutedStats.js'; -import { countAllChatFoldersMutedStats } from '../../util/countMutedStats.js'; +} from '../../util/countUnreadStats.std.js'; +import type { AllChatFoldersMutedStats } from '../../util/countMutedStats.std.js'; +import { countAllChatFoldersMutedStats } from '../../util/countMutedStats.std.js'; const { isNumber, pick } = lodash; @@ -427,7 +430,7 @@ export const _getLeftPaneLists = ({ let conversation = values[i]; if ( - isChatFoldersEnabled() && + isChatFoldersEnabled(window.SignalContext.getVersion()) && !_shouldIncludeInChatFolder( conversation, selectedChatFolder, diff --git a/ts/state/selectors/crashReports.ts b/ts/state/selectors/crashReports.ts index b0cd1870fc..3df77c308b 100644 --- a/ts/state/selectors/crashReports.ts +++ b/ts/state/selectors/crashReports.ts @@ -1,8 +1,8 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import { createSelector } from 'reselect'; -import type { StateType } from '../reducer.js'; -import type { CrashReportsStateType } from '../ducks/crashReports.js'; +import type { StateType } from '../reducer.preload.js'; +import type { CrashReportsStateType } from '../ducks/crashReports.preload.js'; const getCrashReports = (state: StateType): CrashReportsStateType => state.crashReports; diff --git a/ts/state/selectors/emojis.ts b/ts/state/selectors/emojis.ts index 6c5048b850..0530a0263f 100644 --- a/ts/state/selectors/emojis.ts +++ b/ts/state/selectors/emojis.ts @@ -3,8 +3,8 @@ import { createSelector } from 'reselect'; import { useSelector } from 'react-redux'; -import type { StateType } from '../reducer.js'; -import { isEmojiEnglishShortName } from '../../components/fun/data/emojis.js'; +import type { StateType } from '../reducer.preload.js'; +import { isEmojiEnglishShortName } from '../../components/fun/data/emojis.std.js'; export const selectRecentEmojis = createSelector( ({ emojis }: StateType) => emojis.recents, diff --git a/ts/state/selectors/expiration.ts b/ts/state/selectors/expiration.ts index b9fd9483ba..94c732685f 100644 --- a/ts/state/selectors/expiration.ts +++ b/ts/state/selectors/expiration.ts @@ -3,14 +3,17 @@ import { createSelector } from 'reselect'; -import { createLogger } from '../../logging/log.js'; -import type { StateType } from '../reducer.js'; -import type { ExpirationStateType } from '../ducks/expiration.js'; -import { getRemoteBuildExpiration, getAutoDownloadUpdate } from './items.js'; +import { createLogger } from '../../logging/log.std.js'; +import type { StateType } from '../reducer.preload.js'; +import type { ExpirationStateType } from '../ducks/expiration.std.js'; +import { + getRemoteBuildExpiration, + getAutoDownloadUpdate, +} from './items.dom.js'; import { getBuildExpirationTimestamp, hasBuildExpired, -} from '../../util/buildExpiration.js'; +} from '../../util/buildExpiration.std.js'; const log = createLogger('expiration'); diff --git a/ts/state/selectors/gifs.ts b/ts/state/selectors/gifs.ts index a5bb8f5a27..3cb696206c 100644 --- a/ts/state/selectors/gifs.ts +++ b/ts/state/selectors/gifs.ts @@ -1,8 +1,8 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import { createSelector } from 'reselect'; -import type { StateType } from '../reducer.js'; -import type { GifsStateType } from '../ducks/gifs.js'; +import type { StateType } from '../reducer.preload.js'; +import type { GifsStateType } from '../ducks/gifs.preload.js'; export const selectGifs = (state: StateType): GifsStateType => state.gifs; diff --git a/ts/state/selectors/globalModals.ts b/ts/state/selectors/globalModals.ts index a79961ecf2..b52a0debd2 100644 --- a/ts/state/selectors/globalModals.ts +++ b/ts/state/selectors/globalModals.ts @@ -3,9 +3,9 @@ import { createSelector } from 'reselect'; -import type { StateType } from '../reducer.js'; -import type { GlobalModalsStateType } from '../ducks/globalModals.js'; -import { UsernameOnboardingState } from '../../types/globalModals.js'; +import type { StateType } from '../reducer.preload.js'; +import type { GlobalModalsStateType } from '../ducks/globalModals.preload.js'; +import { UsernameOnboardingState } from '../../types/globalModals.std.js'; export const getGlobalModalsState = (state: StateType): GlobalModalsStateType => state.globalModals; diff --git a/ts/state/selectors/inbox.ts b/ts/state/selectors/inbox.ts index d414bff869..77fa6e409e 100644 --- a/ts/state/selectors/inbox.ts +++ b/ts/state/selectors/inbox.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { createSelector } from 'reselect'; -import type { StateType } from '../reducer.js'; +import type { StateType } from '../reducer.preload.js'; const getInboxState = (state: StateType) => state.inbox; diff --git a/ts/state/selectors/installer.ts b/ts/state/selectors/installer.ts index 80f9875974..5c456d3cbf 100644 --- a/ts/state/selectors/installer.ts +++ b/ts/state/selectors/installer.ts @@ -1,8 +1,8 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { StateType } from '../reducer.js'; -import type { InstallerStateType } from '../ducks/installer.js'; +import type { StateType } from '../reducer.preload.js'; +import type { InstallerStateType } from '../ducks/installer.preload.js'; export const getInstallerState = (state: StateType): InstallerStateType => state.installer; diff --git a/ts/state/selectors/items.ts b/ts/state/selectors/items.ts index c96c2a661c..a3dada7288 100644 --- a/ts/state/selectors/items.ts +++ b/ts/state/selectors/items.ts @@ -3,26 +3,26 @@ import { createSelector } from 'reselect'; -import { innerIsBucketValueEnabled } from '../../RemoteConfig.js'; -import type { ConfigKeyType, ConfigMapType } from '../../RemoteConfig.js'; -import type { StateType } from '../reducer.js'; -import type { ItemsStateType } from '../ducks/items.js'; +import { innerIsBucketValueEnabled } from '../../RemoteConfig.dom.js'; +import type { ConfigKeyType, ConfigMapType } from '../../RemoteConfig.dom.js'; +import type { StateType } from '../reducer.preload.js'; +import type { ItemsStateType } from '../ducks/items.preload.js'; import type { ConversationColorType, CustomColorType, -} from '../../types/Colors.js'; -import type { AciString } from '../../types/ServiceId.js'; -import { DEFAULT_CONVERSATION_COLOR } from '../../types/Colors.js'; -import { getPreferredReactionEmoji as getPreferredReactionEmojiFromStoredValue } from '../../reactions/preferredReactionEmoji.js'; -import { DurationInSeconds } from '../../util/durations/index.js'; -import * as Bytes from '../../Bytes.js'; -import { contactByEncryptedUsernameRoute } from '../../util/signalRoutes.js'; -import { isNotUpdatable } from '../../util/version.js'; +} from '../../types/Colors.std.js'; +import type { AciString } from '../../types/ServiceId.std.js'; +import { DEFAULT_CONVERSATION_COLOR } from '../../types/Colors.std.js'; +import { getPreferredReactionEmoji as getPreferredReactionEmojiFromStoredValue } from '../../reactions/preferredReactionEmoji.std.js'; +import { DurationInSeconds } from '../../util/durations/index.std.js'; +import * as Bytes from '../../Bytes.std.js'; +import { contactByEncryptedUsernameRoute } from '../../util/signalRoutes.std.js'; +import { isNotUpdatable } from '../../util/version.std.js'; import { EmojiSkinTone, isValidEmojiSkinTone, -} from '../../components/fun/data/emojis.js'; -import { BackupLevel } from '../../services/backups/types.js'; +} from '../../components/fun/data/emojis.std.js'; +import { BackupLevel } from '../../services/backups/types.std.js'; const DEFAULT_PREFERRED_LEFT_PANE_WIDTH = 320; diff --git a/ts/state/selectors/lightbox.ts b/ts/state/selectors/lightbox.ts index 0e47050420..a77d4cceca 100644 --- a/ts/state/selectors/lightbox.ts +++ b/ts/state/selectors/lightbox.ts @@ -3,9 +3,9 @@ import { createSelector } from 'reselect'; import type { ReadonlyDeep } from 'type-fest'; -import type { MediaItemType } from '../../types/MediaItem.js'; -import type { StateType } from '../reducer.js'; -import type { LightboxStateType } from '../ducks/lightbox.js'; +import type { MediaItemType } from '../../types/MediaItem.std.js'; +import type { StateType } from '../reducer.preload.js'; +import type { LightboxStateType } from '../ducks/lightbox.preload.js'; export const getLightboxState = (state: StateType): LightboxStateType => state.lightbox; diff --git a/ts/state/selectors/linkPreviews.ts b/ts/state/selectors/linkPreviews.ts index 4e19584d23..bfe198454a 100644 --- a/ts/state/selectors/linkPreviews.ts +++ b/ts/state/selectors/linkPreviews.ts @@ -3,8 +3,8 @@ import { createSelector } from 'reselect'; -import type { LinkPreviewSourceType } from '../../types/LinkPreview.js'; -import type { StateType } from '../reducer.js'; +import type { LinkPreviewSourceType } from '../../types/LinkPreview.std.js'; +import type { StateType } from '../reducer.preload.js'; export const getLinkPreview = createSelector( ({ linkPreviews }: StateType) => linkPreviews, diff --git a/ts/state/selectors/mediaGallery.ts b/ts/state/selectors/mediaGallery.ts index 342c913141..cd82ff1474 100644 --- a/ts/state/selectors/mediaGallery.ts +++ b/ts/state/selectors/mediaGallery.ts @@ -1,8 +1,8 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { StateType } from '../reducer.js'; -import type { MediaGalleryStateType } from '../ducks/mediaGallery.js'; +import type { StateType } from '../reducer.preload.js'; +import type { MediaGalleryStateType } from '../ducks/mediaGallery.preload.js'; export const getMediaGalleryState = (state: StateType): MediaGalleryStateType => state.mediaGallery; diff --git a/ts/state/selectors/message.ts b/ts/state/selectors/message.ts index 093c0cbdb1..44bb23dc4a 100644 --- a/ts/state/selectors/message.ts +++ b/ts/state/selectors/message.ts @@ -8,7 +8,7 @@ import emojiRegex from 'emoji-regex'; import LinkifyIt from 'linkify-it'; import type { ReadonlyDeep } from 'type-fest'; -import type { StateType } from '../reducer.js'; +import type { StateType } from '../reducer.preload.js'; import type { LastMessageStatus, ReadonlyMessageAttributesType, @@ -20,80 +20,80 @@ import type { import type { Contact as SmartMessageDetailContact, OwnProps as SmartMessageDetailPropsType, -} from '../smart/MessageDetail.js'; -import type { TimelineItemType } from '../../components/conversation/TimelineItem.js'; -import type { PropsData } from '../../components/conversation/Message.js'; -import type { PropsData as TimelineMessagePropsData } from '../../components/conversation/TimelineMessage.js'; -import { TextDirection } from '../../components/conversation/Message.js'; -import type { PropsData as TimerNotificationProps } from '../../components/conversation/TimerNotification.js'; -import type { PropsData as ChangeNumberNotificationProps } from '../../components/conversation/ChangeNumberNotification.js'; -import type { PropsData as JoinedSignalNotificationProps } from '../../components/conversation/JoinedSignalNotification.js'; -import type { PropsData as SafetyNumberNotificationProps } from '../../components/conversation/SafetyNumberNotification.js'; -import type { PropsData as VerificationNotificationProps } from '../../components/conversation/VerificationNotification.js'; -import type { PropsData as TitleTransitionNotificationProps } from '../../components/conversation/TitleTransitionNotification.js'; -import type { PropsDataType as GroupsV2Props } from '../../components/conversation/GroupV2Change.js'; -import type { PropsDataType as GroupV1MigrationPropsType } from '../../components/conversation/GroupV1Migration.js'; -import type { PropsDataType as DeliveryIssuePropsType } from '../../components/conversation/DeliveryIssueNotification.js'; -import type { PropsType as PaymentEventNotificationPropsType } from '../../components/conversation/PaymentEventNotification.js'; -import type { PropsDataType as ConversationMergePropsType } from '../../components/conversation/ConversationMergeNotification.js'; -import type { PropsDataType as PhoneNumberDiscoveryPropsType } from '../../components/conversation/PhoneNumberDiscoveryNotification.js'; +} from '../smart/MessageDetail.preload.js'; +import type { TimelineItemType } from '../../components/conversation/TimelineItem.dom.js'; +import type { PropsData } from '../../components/conversation/Message.dom.js'; +import type { PropsData as TimelineMessagePropsData } from '../../components/conversation/TimelineMessage.dom.js'; +import { TextDirection } from '../../components/conversation/Message.dom.js'; +import type { PropsData as TimerNotificationProps } from '../../components/conversation/TimerNotification.dom.js'; +import type { PropsData as ChangeNumberNotificationProps } from '../../components/conversation/ChangeNumberNotification.dom.js'; +import type { PropsData as JoinedSignalNotificationProps } from '../../components/conversation/JoinedSignalNotification.dom.js'; +import type { PropsData as SafetyNumberNotificationProps } from '../../components/conversation/SafetyNumberNotification.dom.js'; +import type { PropsData as VerificationNotificationProps } from '../../components/conversation/VerificationNotification.dom.js'; +import type { PropsData as TitleTransitionNotificationProps } from '../../components/conversation/TitleTransitionNotification.dom.js'; +import type { PropsDataType as GroupsV2Props } from '../../components/conversation/GroupV2Change.dom.js'; +import type { PropsDataType as GroupV1MigrationPropsType } from '../../components/conversation/GroupV1Migration.dom.js'; +import type { PropsDataType as DeliveryIssuePropsType } from '../../components/conversation/DeliveryIssueNotification.dom.js'; +import type { PropsType as PaymentEventNotificationPropsType } from '../../components/conversation/PaymentEventNotification.dom.js'; +import type { PropsDataType as ConversationMergePropsType } from '../../components/conversation/ConversationMergeNotification.dom.js'; +import type { PropsDataType as PhoneNumberDiscoveryPropsType } from '../../components/conversation/PhoneNumberDiscoveryNotification.dom.js'; import type { PropsData as GroupNotificationProps, ChangeType, -} from '../../components/conversation/GroupNotification.js'; -import type { PropsType as ProfileChangeNotificationPropsType } from '../../components/conversation/ProfileChangeNotification.js'; +} from '../../components/conversation/GroupNotification.dom.js'; +import type { PropsType as ProfileChangeNotificationPropsType } from '../../components/conversation/ProfileChangeNotification.dom.js'; import { getSafeDomain, isCallLink, isStickerPack, -} from '../../types/LinkPreview.js'; +} from '../../types/LinkPreview.std.js'; import type { AciString, PniString, ServiceIdString, -} from '../../types/ServiceId.js'; +} from '../../types/ServiceId.std.js'; -import type { EmbeddedContactForUIType } from '../../types/EmbeddedContact.js'; -import { embeddedContactSelector } from '../../types/EmbeddedContact.js'; -import type { HydratedBodyRangesType } from '../../types/BodyRange.js'; -import { hydrateRanges } from '../../types/BodyRange.js'; -import type { AssertProps } from '../../types/Util.js'; -import type { LinkPreviewForUIType } from '../../types/message/LinkPreviews.js'; -import { getMentionsRegex } from '../../types/Message.js'; -import { SignalService as Proto } from '../../protobuf/index.js'; +import type { EmbeddedContactForUIType } from '../../types/EmbeddedContact.std.js'; +import { embeddedContactSelector } from '../../types/EmbeddedContact.std.js'; +import type { HydratedBodyRangesType } from '../../types/BodyRange.std.js'; +import { hydrateRanges } from '../../types/BodyRange.std.js'; +import type { AssertProps } from '../../types/Util.std.js'; +import type { LinkPreviewForUIType } from '../../types/message/LinkPreviews.std.js'; +import { getMentionsRegex } from '../../types/Message.std.js'; +import { SignalService as Proto } from '../../protobuf/index.std.js'; import type { AttachmentForUIType, AttachmentType, -} from '../../types/Attachment.js'; +} from '../../types/Attachment.std.js'; import { isVoiceMessage, isIncremental, defaultBlurHash, -} from '../../util/Attachment.js'; -import type { MessageAttachmentType } from '../../types/AttachmentDownload.js'; -import { type DefaultConversationColorType } from '../../types/Colors.js'; -import { ReadStatus } from '../../messages/MessageReadStatus.js'; +} from '../../util/Attachment.std.js'; +import type { MessageAttachmentType } from '../../types/AttachmentDownload.std.js'; +import { type DefaultConversationColorType } from '../../types/Colors.std.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.std.js'; -import type { CallingNotificationType } from '../../util/callingNotification.js'; -import { getRecipients } from '../../util/getRecipients.js'; -import { getOwn } from '../../util/getOwn.js'; -import { isNotNil } from '../../util/isNotNil.js'; -import { isMoreRecentThan } from '../../util/timestamp.js'; -import * as iterables from '../../util/iterables.js'; -import { strictAssert } from '../../util/assert.js'; -import { canEditMessage } from '../../util/canEditMessage.js'; +import type { CallingNotificationType } from '../../util/callingNotification.std.js'; +import { getRecipients } from '../../util/getRecipients.dom.js'; +import { getOwn } from '../../util/getOwn.std.js'; +import { isNotNil } from '../../util/isNotNil.std.js'; +import { isMoreRecentThan } from '../../util/timestamp.std.js'; +import * as iterables from '../../util/iterables.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { canEditMessage } from '../../util/canEditMessage.dom.js'; import { getLocalAttachmentUrl, AttachmentDisposition, -} from '../../util/getLocalAttachmentUrl.js'; -import { isPermanentlyUndownloadable } from '../../jobs/AttachmentDownloadManager.js'; +} from '../../util/getLocalAttachmentUrl.std.js'; +import { isPermanentlyUndownloadable } from '../../jobs/AttachmentDownloadManager.preload.js'; -import { getAccountSelector } from './accounts.js'; +import { getAccountSelector } from './accounts.std.js'; import { getDefaultConversationColor, getHasUnidentifiedDeliveryIndicators, -} from './items.js'; +} from './items.dom.js'; import { getConversationSelector, getSelectedMessageIds, @@ -102,7 +102,7 @@ import { getMessages, getCachedConversationMemberColorsSelector, getContactNameColor, -} from './conversations.js'; +} from './conversations.dom.js'; import { getIntl, getRegionCode, @@ -110,16 +110,16 @@ import { getUserPNI, getUserConversationId, getUserNumber, -} from './user.js'; +} from './user.std.js'; import type { ConversationType, MessageWithUIFieldsType, -} from '../ducks/conversations.js'; +} from '../ducks/conversations.preload.js'; -import type { AccountSelectorType } from './accounts.js'; -import type { CallSelectorType, CallStateType } from './calling.js'; -import type { GetConversationByIdType } from './conversations.js'; +import type { AccountSelectorType } from './accounts.std.js'; +import type { CallSelectorType, CallStateType } from './calling.std.js'; +import type { GetConversationByIdType } from './conversations.dom.js'; import { SendStatus, isDelivered, @@ -131,32 +131,32 @@ import { someRecipientSendStatus, getHighestSuccessfulRecipientStatus, someSendStatus, -} from '../../messages/MessageSendState.js'; -import { createLogger } from '../../logging/log.js'; -import { getConversationColorAttributes } from '../../util/getConversationColorAttributes.js'; -import { DAY, DurationInSeconds } from '../../util/durations/index.js'; -import { getStoryReplyText } from '../../util/getStoryReplyText.js'; -import type { MessageAttributesWithPaymentEvent } from '../../messages/payments.js'; -import { isIncoming, isOutgoing, isStory } from '../../messages/helpers.js'; -import { messageHasPaymentEvent } from '../../messages/payments.js'; +} from '../../messages/MessageSendState.std.js'; +import { createLogger } from '../../logging/log.std.js'; +import { getConversationColorAttributes } from '../../util/getConversationColorAttributes.std.js'; +import { DAY, DurationInSeconds } from '../../util/durations/index.std.js'; +import { getStoryReplyText } from '../../util/getStoryReplyText.std.js'; +import type { MessageAttributesWithPaymentEvent } from '../../messages/payments.std.js'; +import { isIncoming, isOutgoing, isStory } from '../../messages/helpers.std.js'; +import { messageHasPaymentEvent } from '../../messages/payments.std.js'; -import { calculateExpirationTimestamp } from '../../util/expirationTimer.js'; -import { isSignalConversation } from '../../util/isSignalConversation.js'; -import type { AnyPaymentEvent } from '../../types/Payment.js'; -import { isPaymentNotificationEvent } from '../../types/Payment.js'; -import type { PollMessageAttribute } from '../../types/Polls.js'; +import { calculateExpirationTimestamp } from '../../util/expirationTimer.std.js'; +import { isSignalConversation } from '../../util/isSignalConversation.dom.js'; +import type { AnyPaymentEvent } from '../../types/Payment.std.js'; +import { isPaymentNotificationEvent } from '../../types/Payment.std.js'; +import type { PollMessageAttribute } from '../../types/Polls.dom.js'; import { getTitleNoDefault, getTitle, getNumber, renderNumber, -} from '../../util/getTitle.js'; -import { getMessageSentTimestamp } from '../../util/getMessageSentTimestamp.js'; -import type { CallHistorySelectorType } from './callHistory.js'; -import { CallMode, CallDirection } from '../../types/CallDisposition.js'; -import { getCallIdFromEra } from '../../util/callDisposition.js'; -import { LONG_MESSAGE } from '../../types/MIME.js'; -import type { MessageRequestResponseNotificationData } from '../../components/conversation/MessageRequestResponseNotification.js'; +} from '../../util/getTitle.preload.js'; +import { getMessageSentTimestamp } from '../../util/getMessageSentTimestamp.std.js'; +import type { CallHistorySelectorType } from './callHistory.std.js'; +import { CallMode, CallDirection } from '../../types/CallDisposition.std.js'; +import { getCallIdFromEra } from '../../util/callDisposition.preload.js'; +import { LONG_MESSAGE } from '../../types/MIME.std.js'; +import type { MessageRequestResponseNotificationData } from '../../components/conversation/MessageRequestResponseNotification.dom.js'; const { groupBy, isEmpty, isNumber, isObject, map } = lodash; diff --git a/ts/state/selectors/nav.ts b/ts/state/selectors/nav.ts index f931a1a115..bacb815033 100644 --- a/ts/state/selectors/nav.ts +++ b/ts/state/selectors/nav.ts @@ -2,14 +2,14 @@ // SPDX-License-Identifier: AGPL-3.0-only import { createSelector } from 'reselect'; -import { getAllConversationsUnreadStats } from './conversations.js'; -import { getStoriesNotificationCount } from './stories.js'; -import { getCallHistoryUnreadCount } from './callHistory.js'; -import { NavTab } from '../../types/Nav.js'; +import { getAllConversationsUnreadStats } from './conversations.dom.js'; +import { getStoriesNotificationCount } from './stories.preload.js'; +import { getCallHistoryUnreadCount } from './callHistory.std.js'; +import { NavTab } from '../../types/Nav.std.js'; -import type { StateType } from '../reducer.js'; -import type { NavStateType } from '../ducks/nav.js'; -import type { UnreadStats } from '../../util/countUnreadStats.js'; +import type { StateType } from '../reducer.preload.js'; +import type { NavStateType } from '../ducks/nav.std.js'; +import type { UnreadStats } from '../../util/countUnreadStats.std.js'; function getNav(state: StateType): NavStateType { return state.nav; diff --git a/ts/state/selectors/network.ts b/ts/state/selectors/network.ts index e93a5d2f44..678c4333b9 100644 --- a/ts/state/selectors/network.ts +++ b/ts/state/selectors/network.ts @@ -3,9 +3,9 @@ import { createSelector } from 'reselect'; -import type { StateType } from '../reducer.js'; -import type { NetworkStateType } from '../ducks/network.js'; -import { isDone } from '../../util/registration.js'; +import type { StateType } from '../reducer.preload.js'; +import type { NetworkStateType } from '../ducks/network.dom.js'; +import { isDone } from '../../util/registration.preload.js'; const getNetwork = (state: StateType): NetworkStateType => state.network; diff --git a/ts/state/selectors/notificationProfiles.ts b/ts/state/selectors/notificationProfiles.ts index 1af783a3b5..b2801396d3 100644 --- a/ts/state/selectors/notificationProfiles.ts +++ b/ts/state/selectors/notificationProfiles.ts @@ -5,15 +5,15 @@ import { createSelector } from 'reselect'; -import { getNotificationProfileSyncDisabled } from './items.js'; +import { getNotificationProfileSyncDisabled } from './items.dom.js'; -import type { StateType } from '../reducer.js'; -import type { NotificationProfilesStateType } from '../ducks/notificationProfiles.js'; +import type { StateType } from '../reducer.preload.js'; +import type { NotificationProfilesStateType } from '../ducks/notificationProfiles.preload.js'; import type { NextProfileEvent, NotificationProfileOverride, NotificationProfileType, -} from '../../types/NotificationProfile.js'; +} from '../../types/NotificationProfile.std.js'; export const getNotificationProfileData = ( state: StateType diff --git a/ts/state/selectors/preferredReactions.ts b/ts/state/selectors/preferredReactions.ts index a419e4d58a..c6b726bb56 100644 --- a/ts/state/selectors/preferredReactions.ts +++ b/ts/state/selectors/preferredReactions.ts @@ -3,8 +3,8 @@ import { createSelector } from 'reselect'; -import type { StateType } from '../reducer.js'; -import type { PreferredReactionsStateType } from '../ducks/preferredReactions.js'; +import type { StateType } from '../reducer.preload.js'; +import type { PreferredReactionsStateType } from '../ducks/preferredReactions.preload.js'; const getPreferredReactionsState = ( state: Readonly diff --git a/ts/state/selectors/safetyNumber.ts b/ts/state/selectors/safetyNumber.ts index f762f02578..326051f07e 100644 --- a/ts/state/selectors/safetyNumber.ts +++ b/ts/state/selectors/safetyNumber.ts @@ -3,11 +3,11 @@ import { createSelector } from 'reselect'; -import type { StateType } from '../reducer.js'; +import type { StateType } from '../reducer.preload.js'; import type { SafetyNumberContactType, SafetyNumberStateType, -} from '../ducks/safetyNumber.js'; +} from '../ducks/safetyNumber.preload.js'; const getSafetyNumber = (state: StateType): SafetyNumberStateType => state.safetyNumber; diff --git a/ts/state/selectors/search.ts b/ts/state/selectors/search.ts index e21af71719..43f1749813 100644 --- a/ts/state/selectors/search.ts +++ b/ts/state/selectors/search.ts @@ -4,34 +4,34 @@ import memoizee from 'memoizee'; import { createSelector } from 'reselect'; -import { deconstructLookup } from '../../util/deconstructLookup.js'; +import { deconstructLookup } from '../../util/deconstructLookup.std.js'; -import type { StateType } from '../reducer.js'; +import type { StateType } from '../reducer.preload.js'; import type { MessageSearchResultLookupType, MessageSearchResultType, SearchStateType, -} from '../ducks/search.js'; +} from '../ducks/search.preload.js'; import type { ConversationLookupType, ConversationType, -} from '../ducks/conversations.js'; +} from '../ducks/conversations.preload.js'; -import type { LeftPaneSearchPropsType } from '../../components/leftPane/LeftPaneSearchHelper.js'; -import type { PropsDataType as MessageSearchResultPropsDataType } from '../../components/conversationList/MessageSearchResult.js'; +import type { LeftPaneSearchPropsType } from '../../components/leftPane/LeftPaneSearchHelper.dom.js'; +import type { PropsDataType as MessageSearchResultPropsDataType } from '../../components/conversationList/MessageSearchResult.dom.js'; -import { getIntl, getUserConversationId } from './user.js'; -import type { GetConversationByIdType } from './conversations.js'; +import { getIntl, getUserConversationId } from './user.std.js'; +import type { GetConversationByIdType } from './conversations.dom.js'; import { getConversationLookup, getConversationSelector, getSelectedConversationId, -} from './conversations.js'; +} from './conversations.dom.js'; -import { hydrateRanges } from '../../types/BodyRange.js'; -import { createLogger } from '../../logging/log.js'; -import { getOwn } from '../../util/getOwn.js'; +import { hydrateRanges } from '../../types/BodyRange.std.js'; +import { createLogger } from '../../logging/log.std.js'; +import { getOwn } from '../../util/getOwn.std.js'; const log = createLogger('search'); diff --git a/ts/state/selectors/stickers.ts b/ts/state/selectors/stickers.ts index 9ee842b2fb..eca1e08bcf 100644 --- a/ts/state/selectors/stickers.ts +++ b/ts/state/selectors/stickers.ts @@ -4,21 +4,21 @@ import lodash, { type Dictionary } from 'lodash'; import { createSelector } from 'reselect'; -import type { RecentStickerType } from '../../types/Stickers.js'; +import type { RecentStickerType } from '../../types/Stickers.preload.js'; import { getLocalAttachmentUrl, AttachmentDisposition, -} from '../../util/getLocalAttachmentUrl.js'; +} from '../../util/getLocalAttachmentUrl.std.js'; import type { StickerType as StickerDBType, StickerPackType as StickerPackDBType, -} from '../../sql/Interface.js'; -import type { StateType } from '../reducer.js'; +} from '../../sql/Interface.std.js'; +import type { StateType } from '../reducer.preload.js'; import type { StickersStateType, StickerPackType, StickerType, -} from '../ducks/stickers.js'; +} from '../ducks/stickers.preload.js'; const { compact, filter, map, orderBy, reject, sortBy, values } = lodash; diff --git a/ts/state/selectors/stories.ts b/ts/state/selectors/stories.ts index cf0abfe5a6..d32b6ad49d 100644 --- a/ts/state/selectors/stories.ts +++ b/ts/state/selectors/stories.ts @@ -4,9 +4,9 @@ import { createSelector } from 'reselect'; import lodash from 'lodash'; -import type { GetConversationByIdType } from './conversations.js'; -import type { ConversationType } from '../ducks/conversations.js'; -import type { AttachmentType } from '../../types/Attachment.js'; +import type { GetConversationByIdType } from './conversations.dom.js'; +import type { ConversationType } from '../ducks/conversations.preload.js'; +import type { AttachmentType } from '../../types/Attachment.std.js'; import type { ConversationStoryType, MyStoryType, @@ -14,37 +14,37 @@ import type { StoryDistributionListWithMembersDataType, StorySendStateType, StoryViewType, -} from '../../types/Stories.js'; -import type { StateType } from '../reducer.js'; +} from '../../types/Stories.std.js'; +import type { StateType } from '../reducer.preload.js'; import type { SelectedStoryDataType, StoryDataType, StoriesStateType, AddStoryData, -} from '../ducks/stories.js'; -import { MY_STORY_ID, ResolvedSendStatus } from '../../types/Stories.js'; -import { ReadStatus } from '../../messages/MessageReadStatus.js'; -import { SendStatus } from '../../messages/MessageSendState.js'; -import { canReply } from './message.js'; +} from '../ducks/stories.preload.js'; +import { MY_STORY_ID, ResolvedSendStatus } from '../../types/Stories.std.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.std.js'; +import { SendStatus } from '../../messages/MessageSendState.std.js'; +import { canReply } from './message.preload.js'; import { getContactNameColorSelector, getConversationSelector, getHideStoryConversationIds, getMe, PLACEHOLDER_CONTACT_ID, -} from './conversations.js'; -import { getUserConversationId } from './user.js'; -import { getDistributionListSelector } from './storyDistributionLists.js'; -import { calculateExpirationTimestamp } from '../../util/expirationTimer.js'; -import { getMessageIdForLogging } from '../../util/idForLogging.js'; -import { createLogger } from '../../logging/log.js'; -import { SIGNAL_ACI } from '../../types/SignalConversation.js'; +} from './conversations.dom.js'; +import { getUserConversationId } from './user.std.js'; +import { getDistributionListSelector } from './storyDistributionLists.dom.js'; +import { calculateExpirationTimestamp } from '../../util/expirationTimer.std.js'; +import { getMessageIdForLogging } from '../../util/idForLogging.preload.js'; +import { createLogger } from '../../logging/log.std.js'; +import { SIGNAL_ACI } from '../../types/SignalConversation.std.js'; import { reduceStorySendStatus, resolveStorySendStatus, -} from '../../util/resolveStorySendStatus.js'; -import { BodyRange, hydrateRanges } from '../../types/BodyRange.js'; -import { getStoriesEnabled } from './items.js'; +} from '../../util/resolveStorySendStatus.std.js'; +import { BodyRange, hydrateRanges } from '../../types/BodyRange.std.js'; +import { getStoriesEnabled } from './items.dom.js'; const { pick } = lodash; diff --git a/ts/state/selectors/stories2.ts b/ts/state/selectors/stories2.ts index 7cf4ede7ec..aff7a1b826 100644 --- a/ts/state/selectors/stories2.ts +++ b/ts/state/selectors/stories2.ts @@ -2,12 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import { createSelector } from 'reselect'; -import { ReadStatus } from '../../messages/MessageReadStatus.js'; -import { HasStories } from '../../types/Stories.js'; -import { getStoriesEnabled } from './items.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.std.js'; +import { HasStories } from '../../types/Stories.std.js'; +import { getStoriesEnabled } from './items.dom.js'; -import type { StateType } from '../reducer.js'; -import type { StoriesStateType } from '../ducks/stories.js'; +import type { StateType } from '../reducer.preload.js'; +import type { StoriesStateType } from '../ducks/stories.preload.js'; const getStoriesState = (state: StateType): StoriesStateType => state.stories; diff --git a/ts/state/selectors/storyDistributionLists.ts b/ts/state/selectors/storyDistributionLists.ts index cd3f30aa21..c692f26d5e 100644 --- a/ts/state/selectors/storyDistributionLists.ts +++ b/ts/state/selectors/storyDistributionLists.ts @@ -3,11 +3,11 @@ import { createSelector } from 'reselect'; -import type { StateType } from '../reducer.js'; -import type { StoryDistributionListDataType } from '../ducks/storyDistributionLists.js'; -import type { StoryDistributionListWithMembersDataType } from '../../types/Stories.js'; -import { getConversationSelector } from './conversations.js'; -import { MY_STORY_ID } from '../../types/Stories.js'; +import type { StateType } from '../reducer.preload.js'; +import type { StoryDistributionListDataType } from '../ducks/storyDistributionLists.preload.js'; +import type { StoryDistributionListWithMembersDataType } from '../../types/Stories.std.js'; +import { getConversationSelector } from './conversations.dom.js'; +import { MY_STORY_ID } from '../../types/Stories.std.js'; export const getDistributionLists = ( state: StateType diff --git a/ts/state/selectors/timeline.ts b/ts/state/selectors/timeline.ts index 112ac4a346..2e00170eab 100644 --- a/ts/state/selectors/timeline.ts +++ b/ts/state/selectors/timeline.ts @@ -2,29 +2,29 @@ // SPDX-License-Identifier: AGPL-3.0-only import { useSelector } from 'react-redux'; -import type { TimelineItemType } from '../../components/conversation/TimelineItem.js'; +import type { TimelineItemType } from '../../components/conversation/TimelineItem.dom.js'; -import type { StateType } from '../reducer.js'; +import type { StateType } from '../reducer.preload.js'; import { getConversationSelector, getTargetedMessage, getSelectedMessageIds, getMessages, getCachedConversationMemberColorsSelector, -} from './conversations.js'; -import { getAccountSelector } from './accounts.js'; +} from './conversations.dom.js'; +import { getAccountSelector } from './accounts.std.js'; import { getRegionCode, getUserConversationId, getUserNumber, getUserACI, getUserPNI, -} from './user.js'; -import { getDefaultConversationColor } from './items.js'; -import { getActiveCall, getCallSelector } from './calling.js'; -import { getPropsForBubble } from './message.js'; -import { getCallHistorySelector } from './callHistory.js'; -import { useProxySelector } from '../../hooks/useProxySelector.js'; +} from './user.std.js'; +import { getDefaultConversationColor } from './items.dom.js'; +import { getActiveCall, getCallSelector } from './calling.std.js'; +import { getPropsForBubble } from './message.preload.js'; +import { getCallHistorySelector } from './callHistory.std.js'; +import { useProxySelector } from '../../hooks/useProxySelector.std.js'; const getTimelineItem = ( state: StateType, diff --git a/ts/state/selectors/toast.ts b/ts/state/selectors/toast.ts index 738643ba6c..8bf8cd35af 100644 --- a/ts/state/selectors/toast.ts +++ b/ts/state/selectors/toast.ts @@ -1,8 +1,8 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import { createSelector } from 'reselect'; -import type { StateType } from '../reducer.js'; -import type { ToastStateType } from '../ducks/toast.js'; +import type { StateType } from '../reducer.preload.js'; +import type { ToastStateType } from '../ducks/toast.preload.js'; export function getToastState(state: StateType): ToastStateType { return state.toast; diff --git a/ts/state/selectors/updates.ts b/ts/state/selectors/updates.ts index 29d555b358..2504029440 100644 --- a/ts/state/selectors/updates.ts +++ b/ts/state/selectors/updates.ts @@ -3,10 +3,10 @@ import { createSelector } from 'reselect'; -import { DialogType } from '../../types/Dialogs.js'; +import { DialogType } from '../../types/Dialogs.std.js'; -import type { StateType } from '../reducer.js'; -import type { UpdatesStateType } from '../ducks/updates.js'; +import type { StateType } from '../reducer.preload.js'; +import type { UpdatesStateType } from '../ducks/updates.preload.js'; export const getUpdatesState = (state: Readonly): UpdatesStateType => state.updates; diff --git a/ts/state/selectors/user.ts b/ts/state/selectors/user.ts index 9fd3dc93f4..693029d9a4 100644 --- a/ts/state/selectors/user.ts +++ b/ts/state/selectors/user.ts @@ -3,16 +3,16 @@ import { createSelector } from 'reselect'; -import { type LocalizerType, ThemeType } from '../../types/Util.js'; -import type { AciString, PniString } from '../../types/ServiceId.js'; -import type { LocaleMessagesType } from '../../types/I18N.js'; -import type { MenuOptionsType } from '../../types/menu.js'; +import { type LocalizerType, ThemeType } from '../../types/Util.std.js'; +import type { AciString, PniString } from '../../types/ServiceId.std.js'; +import type { LocaleMessagesType } from '../../types/I18N.std.js'; +import type { MenuOptionsType } from '../../types/menu.std.js'; -import type { StateType } from '../reducer.js'; -import type { CallingStateType } from '../ducks/calling.js'; -import type { UserStateType } from '../ducks/user.js'; +import type { StateType } from '../reducer.preload.js'; +import type { CallingStateType } from '../ducks/calling.preload.js'; +import type { UserStateType } from '../ducks/user.preload.js'; -import { isNightly, isBeta } from '../../util/version.js'; +import { isNightly, isBeta } from '../../util/version.std.js'; export const getUser = (state: StateType): UserStateType => state.user; diff --git a/ts/state/selectors/username.ts b/ts/state/selectors/username.ts index c384ac7d90..b018ad2c06 100644 --- a/ts/state/selectors/username.ts +++ b/ts/state/selectors/username.ts @@ -3,18 +3,18 @@ import { createSelector } from 'reselect'; -import type { UsernameReservationType } from '../../types/Username.js'; -import type { StateType } from '../reducer.js'; +import type { UsernameReservationType } from '../../types/Username.std.js'; +import type { StateType } from '../reducer.preload.js'; import type { UsernameStateType, UsernameReservationStateType, -} from '../ducks/username.js'; +} from '../ducks/username.preload.js'; import type { UsernameEditState, UsernameLinkState, UsernameReservationState, UsernameReservationError, -} from '../ducks/usernameEnums.js'; +} from '../ducks/usernameEnums.std.js'; export const getUsernameState = (state: StateType): UsernameStateType => state.username; diff --git a/ts/state/smart/AboutContactModal.tsx b/ts/state/smart/AboutContactModal.tsx index 980df63b68..fd62d67fc2 100644 --- a/ts/state/smart/AboutContactModal.tsx +++ b/ts/state/smart/AboutContactModal.tsx @@ -2,19 +2,19 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import { AboutContactModal } from '../../components/conversation/AboutContactModal.js'; -import { isSignalConnection } from '../../util/getSignalConnections.js'; -import { getIntl } from '../selectors/user.js'; -import { getGlobalModalsState } from '../selectors/globalModals.js'; +import { AboutContactModal } from '../../components/conversation/AboutContactModal.dom.js'; +import { isSignalConnection } from '../../util/getSignalConnections.preload.js'; +import { getIntl } from '../selectors/user.std.js'; +import { getGlobalModalsState } from '../selectors/globalModals.std.js'; import { getConversationSelector, getPendingAvatarDownloadSelector, -} from '../selectors/conversations.js'; -import type { ConversationType } from '../ducks/conversations.js'; -import { useConversationsActions } from '../ducks/conversations.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; -import { strictAssert } from '../../util/assert.js'; -import { getAddedByForOurPendingInvitation } from '../../util/getAddedByForOurPendingInvitation.js'; +} from '../selectors/conversations.dom.js'; +import type { ConversationType } from '../ducks/conversations.preload.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { getAddedByForOurPendingInvitation } from '../../util/getAddedByForOurPendingInvitation.preload.js'; function isFromOrAddedByTrustedContact( conversation: ConversationType diff --git a/ts/state/smart/AddUserToAnotherGroupModal.tsx b/ts/state/smart/AddUserToAnotherGroupModal.tsx index 08e55ef320..8e27681a9a 100644 --- a/ts/state/smart/AddUserToAnotherGroupModal.tsx +++ b/ts/state/smart/AddUserToAnotherGroupModal.tsx @@ -3,15 +3,15 @@ import { useSelector } from 'react-redux'; import React, { memo } from 'react'; -import { AddUserToAnotherGroupModal } from '../../components/AddUserToAnotherGroupModal.js'; +import { AddUserToAnotherGroupModal } from '../../components/AddUserToAnotherGroupModal.dom.js'; import { getAllGroupsWithInviteAccess, getContactSelector, -} from '../selectors/conversations.js'; -import { getIntl, getRegionCode } from '../selectors/user.js'; -import { useToastActions } from '../ducks/toast.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; -import { useConversationsActions } from '../ducks/conversations.js'; +} from '../selectors/conversations.dom.js'; +import { getIntl, getRegionCode } from '../selectors/user.std.js'; +import { useToastActions } from '../ducks/toast.preload.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; export type SmartAddUserToAnotherGroupModalProps = Readonly<{ contactID: string; diff --git a/ts/state/smart/AllMedia.tsx b/ts/state/smart/AllMedia.tsx index cffaa97d25..e1abbe1df3 100644 --- a/ts/state/smart/AllMedia.tsx +++ b/ts/state/smart/AllMedia.tsx @@ -2,12 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { MediaGallery } from '../../components/conversation/media-gallery/MediaGallery.js'; -import { getMediaGalleryState } from '../selectors/mediaGallery.js'; -import { getIntl, getTheme } from '../selectors/user.js'; -import { useConversationsActions } from '../ducks/conversations.js'; -import { useLightboxActions } from '../ducks/lightbox.js'; -import { useMediaGalleryActions } from '../ducks/mediaGallery.js'; +import { MediaGallery } from '../../components/conversation/media-gallery/MediaGallery.dom.js'; +import { getMediaGalleryState } from '../selectors/mediaGallery.std.js'; +import { getIntl, getTheme } from '../selectors/user.std.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; +import { useLightboxActions } from '../ducks/lightbox.preload.js'; +import { useMediaGalleryActions } from '../ducks/mediaGallery.preload.js'; export type PropsType = { conversationId: string; diff --git a/ts/state/smart/App.tsx b/ts/state/smart/App.tsx index 5b345549a8..168289b99e 100644 --- a/ts/state/smart/App.tsx +++ b/ts/state/smart/App.tsx @@ -2,34 +2,34 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { requestVerification as doRequestVerification } from '../../textsecure/WebAPI.js'; -import { accountManager } from '../../textsecure/AccountManager.js'; -import type { VerificationTransport } from '../../types/VerificationTransport.js'; -import { DataWriter } from '../../sql/Client.js'; -import { App } from '../../components/App.js'; -import OS from '../../util/os/osMain.js'; -import { getConversation } from '../../util/getConversation.js'; -import { getChallengeURL } from '../../challenge.js'; -import { writeProfile } from '../../services/writeProfile.js'; -import { challengeHandler } from '../../services/challengeHandler.js'; -import { SmartCallManager } from './CallManager.js'; -import { SmartGlobalModalContainer } from './GlobalModalContainer.js'; -import { SmartLightbox } from './Lightbox.js'; -import { SmartStoryViewer } from './StoryViewer.js'; +import { requestVerification as doRequestVerification } from '../../textsecure/WebAPI.preload.js'; +import { accountManager } from '../../textsecure/AccountManager.preload.js'; +import type { VerificationTransport } from '../../types/VerificationTransport.std.js'; +import { DataWriter } from '../../sql/Client.preload.js'; +import { App } from '../../components/App.preload.js'; +import OS from '../../util/os/osMain.node.js'; +import { getConversation } from '../../util/getConversation.preload.js'; +import { getChallengeURL } from '../../challenge.dom.js'; +import { writeProfile } from '../../services/writeProfile.preload.js'; +import { challengeHandler } from '../../services/challengeHandler.preload.js'; +import { SmartCallManager } from './CallManager.preload.js'; +import { SmartGlobalModalContainer } from './GlobalModalContainer.preload.js'; +import { SmartLightbox } from './Lightbox.preload.js'; +import { SmartStoryViewer } from './StoryViewer.preload.js'; import { getIsMainWindowMaximized, getIsMainWindowFullScreen, getTheme, -} from '../selectors/user.js'; -import { hasSelectedStoryData as getHasSelectedStoryData } from '../selectors/stories.js'; -import { useAppActions } from '../ducks/app.js'; -import { useConversationsActions } from '../ducks/conversations.js'; -import { useStoriesActions } from '../ducks/stories.js'; -import { ErrorBoundary } from '../../components/ErrorBoundary.js'; -import { ModalContainer } from '../../components/ModalContainer.js'; -import { SmartInbox } from './Inbox.js'; -import { getApp } from '../selectors/app.js'; -import { SmartFunProvider } from './FunProvider.js'; +} from '../selectors/user.std.js'; +import { hasSelectedStoryData as getHasSelectedStoryData } from '../selectors/stories.preload.js'; +import { useAppActions } from '../ducks/app.preload.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; +import { useStoriesActions } from '../ducks/stories.preload.js'; +import { ErrorBoundary } from '../../components/ErrorBoundary.dom.js'; +import { ModalContainer } from '../../components/ModalContainer.dom.js'; +import { SmartInbox } from './Inbox.preload.js'; +import { getApp } from '../selectors/app.std.js'; +import { SmartFunProvider } from './FunProvider.preload.js'; function renderInbox(): JSX.Element { return ; diff --git a/ts/state/smart/CallLinkAddNameModal.tsx b/ts/state/smart/CallLinkAddNameModal.tsx index 26486e841b..20dc588127 100644 --- a/ts/state/smart/CallLinkAddNameModal.tsx +++ b/ts/state/smart/CallLinkAddNameModal.tsx @@ -2,15 +2,15 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo, useCallback, useMemo } from 'react'; import { useSelector } from 'react-redux'; -import { useCallingActions } from '../ducks/calling.js'; -import { getCallLinkSelector } from '../selectors/calling.js'; -import { createLogger } from '../../logging/log.js'; -import { getIntl } from '../selectors/user.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; -import { getCallLinkAddNameModalRoomId } from '../selectors/globalModals.js'; -import { strictAssert } from '../../util/assert.js'; -import { isCallLinkAdmin } from '../../types/CallLink.js'; -import { CallLinkAddNameModal } from '../../components/CallLinkAddNameModal.js'; +import { useCallingActions } from '../ducks/calling.preload.js'; +import { getCallLinkSelector } from '../selectors/calling.std.js'; +import { createLogger } from '../../logging/log.std.js'; +import { getIntl } from '../selectors/user.std.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; +import { getCallLinkAddNameModalRoomId } from '../selectors/globalModals.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { isCallLinkAdmin } from '../../types/CallLink.std.js'; +import { CallLinkAddNameModal } from '../../components/CallLinkAddNameModal.dom.js'; const log = createLogger('CallLinkAddNameModal'); diff --git a/ts/state/smart/CallLinkDetails.tsx b/ts/state/smart/CallLinkDetails.tsx index be3cdccbaa..e4e8bcb3b2 100644 --- a/ts/state/smart/CallLinkDetails.tsx +++ b/ts/state/smart/CallLinkDetails.tsx @@ -2,22 +2,22 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import type { CallHistoryGroup } from '../../types/CallDisposition.js'; -import { getIntl } from '../selectors/user.js'; -import { CallLinkDetails } from '../../components/CallLinkDetails.js'; +import type { CallHistoryGroup } from '../../types/CallDisposition.std.js'; +import { getIntl } from '../selectors/user.std.js'; +import { CallLinkDetails } from '../../components/CallLinkDetails.dom.js'; import { getActiveCallState, getAdhocCallSelector, getCallLinkSelector, -} from '../selectors/calling.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; -import { useCallingActions } from '../ducks/calling.js'; -import { strictAssert } from '../../util/assert.js'; -import type { CallLinkRestrictions } from '../../types/CallLink.js'; +} from '../selectors/calling.std.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; +import { useCallingActions } from '../ducks/calling.preload.js'; +import { strictAssert } from '../../util/assert.std.js'; +import type { CallLinkRestrictions } from '../../types/CallLink.std.js'; import { isAnybodyInGroupCall, isGroupCallActiveOnServer, -} from '../ducks/callingHelpers.js'; +} from '../ducks/callingHelpers.std.js'; export type SmartCallLinkDetailsProps = Readonly<{ roomId: string; diff --git a/ts/state/smart/CallLinkEditModal.tsx b/ts/state/smart/CallLinkEditModal.tsx index e10198cc65..c98ddf7390 100644 --- a/ts/state/smart/CallLinkEditModal.tsx +++ b/ts/state/smart/CallLinkEditModal.tsx @@ -2,21 +2,21 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo, useCallback, useMemo } from 'react'; import { useSelector } from 'react-redux'; -import { CallLinkEditModal } from '../../components/CallLinkEditModal.js'; -import { useCallingActions } from '../ducks/calling.js'; +import { CallLinkEditModal } from '../../components/CallLinkEditModal.dom.js'; +import { useCallingActions } from '../ducks/calling.preload.js'; import { getActiveCallState, getCallLinkSelector, -} from '../selectors/calling.js'; -import { createLogger } from '../../logging/log.js'; -import { getIntl } from '../selectors/user.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; -import type { CallLinkRestrictions } from '../../types/CallLink.js'; -import { getCallLinkEditModalRoomId } from '../selectors/globalModals.js'; -import { strictAssert } from '../../util/assert.js'; -import { linkCallRoute } from '../../util/signalRoutes.js'; -import { copyCallLink } from '../../util/copyLinksWithToast.js'; -import { drop } from '../../util/drop.js'; +} from '../selectors/calling.std.js'; +import { createLogger } from '../../logging/log.std.js'; +import { getIntl } from '../selectors/user.std.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; +import type { CallLinkRestrictions } from '../../types/CallLink.std.js'; +import { getCallLinkEditModalRoomId } from '../selectors/globalModals.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { linkCallRoute } from '../../util/signalRoutes.std.js'; +import { copyCallLink } from '../../util/copyLinksWithToast.dom.js'; +import { drop } from '../../util/drop.std.js'; const log = createLogger('CallLinkEditModal'); diff --git a/ts/state/smart/CallLinkPendingParticipantModal.tsx b/ts/state/smart/CallLinkPendingParticipantModal.tsx index b79f9b576d..3ef2374372 100644 --- a/ts/state/smart/CallLinkPendingParticipantModal.tsx +++ b/ts/state/smart/CallLinkPendingParticipantModal.tsx @@ -2,14 +2,14 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { CallLinkPendingParticipantModal } from '../../components/CallLinkPendingParticipantModal.js'; -import { useCallingActions } from '../ducks/calling.js'; -import { getIntl } from '../selectors/user.js'; -import { useConversationsActions } from '../ducks/conversations.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; -import { getConversationSelector } from '../selectors/conversations.js'; -import { getCallLinkPendingParticipantContactId } from '../selectors/globalModals.js'; -import { strictAssert } from '../../util/assert.js'; +import { CallLinkPendingParticipantModal } from '../../components/CallLinkPendingParticipantModal.dom.js'; +import { useCallingActions } from '../ducks/calling.preload.js'; +import { getIntl } from '../selectors/user.std.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; +import { getConversationSelector } from '../selectors/conversations.dom.js'; +import { getCallLinkPendingParticipantContactId } from '../selectors/globalModals.std.js'; +import { strictAssert } from '../../util/assert.std.js'; export const SmartCallLinkPendingParticipantModal = memo( function SmartCallLinkPendingParticipantModal(): JSX.Element | null { diff --git a/ts/state/smart/CallManager.tsx b/ts/state/smart/CallManager.tsx index 44e1487a63..2d6c283e87 100644 --- a/ts/state/smart/CallManager.tsx +++ b/ts/state/smart/CallManager.tsx @@ -7,16 +7,16 @@ import { useSelector } from 'react-redux'; import type { DirectIncomingCall, GroupIncomingCall, -} from '../../components/CallManager.js'; -import { CallManager } from '../../components/CallManager.js'; -import { isConversationTooBigToRing as getIsConversationTooBigToRing } from '../../conversations/isConversationTooBigToRing.js'; -import { createLogger } from '../../logging/log.js'; -import { calling as callingService } from '../../services/calling.js'; +} from '../../components/CallManager.dom.js'; +import { CallManager } from '../../components/CallManager.dom.js'; +import { isConversationTooBigToRing as getIsConversationTooBigToRing } from '../../conversations/isConversationTooBigToRing.dom.js'; +import { createLogger } from '../../logging/log.std.js'; +import { calling as callingService } from '../../services/calling.preload.js'; import { bounceAppIconStart, bounceAppIconStop, -} from '../../shims/bounceAppIcon.js'; -import type { CallLinkType } from '../../types/CallLink.js'; +} from '../../shims/bounceAppIcon.preload.js'; +import type { CallLinkType } from '../../types/CallLink.std.js'; import type { ActiveCallBaseType, ActiveCallType, @@ -25,33 +25,36 @@ import type { CallingConversationType, ConversationsByDemuxIdType, GroupCallRemoteParticipantType, -} from '../../types/Calling.js'; -import { CallState } from '../../types/Calling.js'; -import { CallMode } from '../../types/CallDisposition.js'; -import type { AciString } from '../../types/ServiceId.js'; -import { callLinkToConversation } from '../../util/callLinks.js'; -import { callingTones } from '../../util/callingTones.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; -import { useAudioPlayerActions } from '../ducks/audioPlayer.js'; -import { getActiveCall, useCallingActions } from '../ducks/calling.js'; -import type { ConversationType } from '../ducks/conversations.js'; -import type { StateType } from '../reducer.js'; -import { getHasInitialLoadCompleted } from '../selectors/app.js'; +} from '../../types/Calling.std.js'; +import { CallState } from '../../types/Calling.std.js'; +import { CallMode } from '../../types/CallDisposition.std.js'; +import type { AciString } from '../../types/ServiceId.std.js'; +import { callLinkToConversation } from '../../util/callLinks.std.js'; +import { callingTones } from '../../util/callingTones.preload.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; +import { useAudioPlayerActions } from '../ducks/audioPlayer.preload.js'; +import { getActiveCall, useCallingActions } from '../ducks/calling.preload.js'; +import type { ConversationType } from '../ducks/conversations.preload.js'; +import type { StateType } from '../reducer.preload.js'; +import { getHasInitialLoadCompleted } from '../selectors/app.std.js'; import { getActiveCallState, getAvailableCameras, getCallLinkSelector, getRingingCall, -} from '../selectors/calling.js'; -import { getConversationSelector, getMe } from '../selectors/conversations.js'; -import { getIntl, getUserACI } from '../selectors/user.js'; -import { SmartCallingDeviceSelection } from './CallingDeviceSelection.js'; -import { renderReactionPicker } from './renderReactionPicker.js'; -import { isSharingPhoneNumberWithEverybody as getIsSharingPhoneNumberWithEverybody } from '../../util/phoneNumberSharingMode.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; -import { isLonelyGroup } from '../ducks/callingHelpers.js'; -import { getActiveProfile } from '../selectors/notificationProfiles.js'; -import { isOnline as isWebAPIOnline } from '../../textsecure/WebAPI.js'; +} from '../selectors/calling.std.js'; +import { + getConversationSelector, + getMe, +} from '../selectors/conversations.dom.js'; +import { getIntl, getUserACI } from '../selectors/user.std.js'; +import { SmartCallingDeviceSelection } from './CallingDeviceSelection.preload.js'; +import { renderReactionPicker } from './renderReactionPicker.dom.js'; +import { isSharingPhoneNumberWithEverybody as getIsSharingPhoneNumberWithEverybody } from '../../util/phoneNumberSharingMode.preload.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; +import { isLonelyGroup } from '../ducks/callingHelpers.std.js'; +import { getActiveProfile } from '../selectors/notificationProfiles.dom.js'; +import { isOnline as isWebAPIOnline } from '../../textsecure/WebAPI.preload.js'; const { memoize } = lodash; diff --git a/ts/state/smart/CallingDeviceSelection.tsx b/ts/state/smart/CallingDeviceSelection.tsx index 09d5093296..8015e3c855 100644 --- a/ts/state/smart/CallingDeviceSelection.tsx +++ b/ts/state/smart/CallingDeviceSelection.tsx @@ -3,8 +3,8 @@ import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { CallingDeviceSelection } from '../../components/CallingDeviceSelection.js'; -import { getIntl } from '../selectors/user.js'; +import { CallingDeviceSelection } from '../../components/CallingDeviceSelection.dom.js'; +import { getIntl } from '../selectors/user.std.js'; import { getAvailableCameras, getAvailableMicrophones, @@ -12,8 +12,8 @@ import { getSelectedCamera, getSelectedMicrophone, getSelectedSpeaker, -} from '../selectors/calling.js'; -import { useCallingActions } from '../ducks/calling.js'; +} from '../selectors/calling.std.js'; +import { useCallingActions } from '../ducks/calling.preload.js'; export const SmartCallingDeviceSelection = memo( function SmartCallingDeviceSelection() { diff --git a/ts/state/smart/CallsTab.tsx b/ts/state/smart/CallsTab.tsx index 7c006f752e..765a34bf12 100644 --- a/ts/state/smart/CallsTab.tsx +++ b/ts/state/smart/CallsTab.tsx @@ -2,30 +2,30 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo, useCallback, useEffect } from 'react'; import { useSelector } from 'react-redux'; -import { DataReader } from '../../sql/Client.js'; -import { useItemsActions } from '../ducks/items.js'; +import { DataReader } from '../../sql/Client.preload.js'; +import { useItemsActions } from '../ducks/items.preload.js'; import { getNavTabsCollapsed, getPreferredLeftPaneWidth, -} from '../selectors/items.js'; -import { getIntl, getRegionCode } from '../selectors/user.js'; -import type { WidthBreakpoint } from '../../components/_util.js'; -import { CallsTab } from '../../components/CallsTab.js'; +} from '../selectors/items.dom.js'; +import { getIntl, getRegionCode } from '../selectors/user.std.js'; +import type { WidthBreakpoint } from '../../components/_util.std.js'; +import { CallsTab } from '../../components/CallsTab.preload.js'; import { getAllConversations, getConversationSelector, -} from '../selectors/conversations.js'; -import { filterAndSortConversations } from '../../util/filterAndSortConversations.js'; +} from '../selectors/conversations.dom.js'; +import { filterAndSortConversations } from '../../util/filterAndSortConversations.std.js'; import type { CallHistoryFilter, CallHistoryFilterOptions, CallHistoryGroup, CallHistoryPagination, -} from '../../types/CallDisposition.js'; -import type { ConversationType } from '../ducks/conversations.js'; -import { SmartConversationDetails } from './ConversationDetails.js'; -import { SmartToastManager } from './ToastManager.js'; -import { useCallingActions } from '../ducks/calling.js'; +} from '../../types/CallDisposition.std.js'; +import type { ConversationType } from '../ducks/conversations.preload.js'; +import { SmartConversationDetails } from './ConversationDetails.preload.js'; +import { SmartToastManager } from './ToastManager.preload.js'; +import { useCallingActions } from '../ducks/calling.preload.js'; import { getActiveCallState, getAdhocCallSelector, @@ -33,16 +33,16 @@ import { getCallSelector, getCallLinkSelector, getHasAnyAdminCallLinks, -} from '../selectors/calling.js'; -import { useCallHistoryActions } from '../ducks/callHistory.js'; -import { getCallHistoryEdition } from '../selectors/callHistory.js'; -import { getHasPendingUpdate } from '../selectors/updates.js'; -import { getHasAnyFailedStorySends } from '../selectors/stories.js'; -import { getOtherTabsUnreadStats } from '../selectors/nav.js'; -import { SmartCallLinkDetails } from './CallLinkDetails.js'; -import type { CallLinkType } from '../../types/CallLink.js'; -import { filterCallLinks } from '../../util/filterCallLinks.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; +} from '../selectors/calling.std.js'; +import { useCallHistoryActions } from '../ducks/callHistory.preload.js'; +import { getCallHistoryEdition } from '../selectors/callHistory.std.js'; +import { getHasPendingUpdate } from '../selectors/updates.std.js'; +import { getHasAnyFailedStorySends } from '../selectors/stories.preload.js'; +import { getOtherTabsUnreadStats } from '../selectors/nav.preload.js'; +import { SmartCallLinkDetails } from './CallLinkDetails.preload.js'; +import type { CallLinkType } from '../../types/CallLink.std.js'; +import { filterCallLinks } from '../../util/filterCallLinks.dom.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; function getCallHistoryFilter({ allCallLinks, diff --git a/ts/state/smart/CaptchaDialog.tsx b/ts/state/smart/CaptchaDialog.tsx index bc9b8478a3..07329c0dd6 100644 --- a/ts/state/smart/CaptchaDialog.tsx +++ b/ts/state/smart/CaptchaDialog.tsx @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import { CaptchaDialog } from '../../components/CaptchaDialog.js'; -import { getIntl } from '../selectors/user.js'; -import { isChallengePending } from '../selectors/network.js'; -import { getChallengeURL } from '../../challenge.js'; -import { createLogger } from '../../logging/log.js'; +import { CaptchaDialog } from '../../components/CaptchaDialog.dom.js'; +import { getIntl } from '../selectors/user.std.js'; +import { isChallengePending } from '../selectors/network.preload.js'; +import { getChallengeURL } from '../../challenge.dom.js'; +import { createLogger } from '../../logging/log.std.js'; const log = createLogger('CaptchaDialog'); diff --git a/ts/state/smart/ChatColorPicker.tsx b/ts/state/smart/ChatColorPicker.tsx index f02f2eee47..de2b4bcd3a 100644 --- a/ts/state/smart/ChatColorPicker.tsx +++ b/ts/state/smart/ChatColorPicker.tsx @@ -2,22 +2,22 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import { ChatColorPicker } from '../../components/ChatColorPicker.js'; +import { ChatColorPicker } from '../../components/ChatColorPicker.dom.js'; import { getConversationSelector, getConversationsWithCustomColorSelector, -} from '../selectors/conversations.js'; -import { getIntl } from '../selectors/user.js'; +} from '../selectors/conversations.dom.js'; +import { getIntl } from '../selectors/user.std.js'; import { getCustomColors, getDefaultConversationColor, -} from '../selectors/items.js'; -import { getConversationColorAttributes } from '../../util/getConversationColorAttributes.js'; +} from '../selectors/items.dom.js'; +import { getConversationColorAttributes } from '../../util/getConversationColorAttributes.std.js'; import { useConversationsActions, type ConversationType, -} from '../ducks/conversations.js'; -import { useItemsActions } from '../ducks/items.js'; +} from '../ducks/conversations.preload.js'; +import { useItemsActions } from '../ducks/items.preload.js'; export type SmartChatColorPickerProps = Readonly<{ conversationId?: string; diff --git a/ts/state/smart/ChatsTab.tsx b/ts/state/smart/ChatsTab.tsx index 8aba99332a..3f3a0b9864 100644 --- a/ts/state/smart/ChatsTab.tsx +++ b/ts/state/smart/ChatsTab.tsx @@ -2,31 +2,31 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo, useEffect, useRef } from 'react'; import { useSelector } from 'react-redux'; -import { ChatsTab } from '../../components/ChatsTab.js'; -import type { SmartConversationViewProps } from './ConversationView.js'; -import { SmartConversationView } from './ConversationView.js'; -import { SmartMiniPlayer } from './MiniPlayer.js'; -import { SmartLeftPane } from './LeftPane.js'; -import type { NavTabPanelProps } from '../../components/NavTabs.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; -import { getIntl } from '../selectors/user.js'; -import { usePrevious } from '../../hooks/usePrevious.js'; -import { TargetedMessageSource } from '../ducks/conversationsEnums.js'; -import { useConversationsActions } from '../ducks/conversations.js'; -import { useToastActions } from '../ducks/toast.js'; -import { strictAssert } from '../../util/assert.js'; -import { isStagingServer } from '../../util/isStagingServer.js'; -import { ToastType } from '../../types/Toast.js'; -import { getNavTabsCollapsed } from '../selectors/items.js'; -import { useItemsActions } from '../ducks/items.js'; -import { getHasAnyFailedStorySends } from '../selectors/stories.js'; -import { getHasPendingUpdate } from '../selectors/updates.js'; -import { getOtherTabsUnreadStats } from '../selectors/nav.js'; +import { ChatsTab } from '../../components/ChatsTab.dom.js'; +import type { SmartConversationViewProps } from './ConversationView.preload.js'; +import { SmartConversationView } from './ConversationView.preload.js'; +import { SmartMiniPlayer } from './MiniPlayer.preload.js'; +import { SmartLeftPane } from './LeftPane.preload.js'; +import type { NavTabPanelProps } from '../../components/NavTabs.dom.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; +import { getIntl } from '../selectors/user.std.js'; +import { usePrevious } from '../../hooks/usePrevious.std.js'; +import { TargetedMessageSource } from '../ducks/conversationsEnums.std.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; +import { useToastActions } from '../ducks/toast.preload.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { isStagingServer } from '../../util/isStagingServer.dom.js'; +import { ToastType } from '../../types/Toast.dom.js'; +import { getNavTabsCollapsed } from '../selectors/items.dom.js'; +import { useItemsActions } from '../ducks/items.preload.js'; +import { getHasAnyFailedStorySends } from '../selectors/stories.preload.js'; +import { getHasPendingUpdate } from '../selectors/updates.std.js'; +import { getOtherTabsUnreadStats } from '../selectors/nav.preload.js'; import { getSelectedConversationId, getTargetedMessage, getTargetedMessageSource, -} from '../selectors/conversations.js'; +} from '../selectors/conversations.dom.js'; function renderConversationView(props: SmartConversationViewProps) { return ; diff --git a/ts/state/smart/ChooseGroupMembersModal.tsx b/ts/state/smart/ChooseGroupMembersModal.tsx index 3f3608d9e4..9aab4ab334 100644 --- a/ts/state/smart/ChooseGroupMembersModal.tsx +++ b/ts/state/smart/ChooseGroupMembersModal.tsx @@ -2,17 +2,17 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo, useMemo } from 'react'; import { useSelector } from 'react-redux'; -import { strictAssert } from '../../util/assert.js'; -import { lookupConversationWithoutServiceId } from '../../util/lookupConversationWithoutServiceId.js'; -import { getUsernameFromSearch } from '../../util/Username.js'; -import { ChooseGroupMembersModal } from '../../components/conversation/conversation-details/AddGroupMembersModal/ChooseGroupMembersModal.js'; -import { getIntl, getTheme, getRegionCode } from '../selectors/user.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { lookupConversationWithoutServiceId } from '../../util/lookupConversationWithoutServiceId.preload.js'; +import { getUsernameFromSearch } from '../../util/Username.dom.js'; +import { ChooseGroupMembersModal } from '../../components/conversation/conversation-details/AddGroupMembersModal/ChooseGroupMembersModal.dom.js'; +import { getIntl, getTheme, getRegionCode } from '../selectors/user.std.js'; import { getCandidateContactsForNewGroup, getConversationByIdSelector, getMe, -} from '../selectors/conversations.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; +} from '../selectors/conversations.dom.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; export type SmartChooseGroupMembersModalPropsType = Readonly<{ conversationIdsAlreadyInGroup: Set; diff --git a/ts/state/smart/CollidingAvatars.tsx b/ts/state/smart/CollidingAvatars.tsx index e2288e5b58..052900e10b 100644 --- a/ts/state/smart/CollidingAvatars.tsx +++ b/ts/state/smart/CollidingAvatars.tsx @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo, useMemo } from 'react'; import { useSelector } from 'react-redux'; -import { CollidingAvatars } from '../../components/CollidingAvatars.js'; -import { getIntl } from '../selectors/user.js'; -import { getConversationSelector } from '../selectors/conversations.js'; +import { CollidingAvatars } from '../../components/CollidingAvatars.dom.js'; +import { getIntl } from '../selectors/user.std.js'; +import { getConversationSelector } from '../selectors/conversations.dom.js'; export type PropsType = Readonly<{ conversationIds: ReadonlyArray; diff --git a/ts/state/smart/CompositionArea.tsx b/ts/state/smart/CompositionArea.tsx index 2fac26e07f..ef6281bc87 100644 --- a/ts/state/smart/CompositionArea.tsx +++ b/ts/state/smart/CompositionArea.tsx @@ -3,25 +3,25 @@ import React, { useCallback, useMemo, memo } from 'react'; import { useSelector } from 'react-redux'; -import { CompositionArea } from '../../components/CompositionArea.js'; -import { useContactNameData } from '../../components/conversation/ContactName.js'; +import { CompositionArea } from '../../components/CompositionArea.dom.js'; +import { useContactNameData } from '../../components/conversation/ContactName.dom.js'; import type { DraftBodyRanges, HydratedBodyRangesType, -} from '../../types/BodyRange.js'; -import { hydrateRanges } from '../../types/BodyRange.js'; -import { strictAssert } from '../../util/assert.js'; -import { getAddedByForOurPendingInvitation } from '../../util/getAddedByForOurPendingInvitation.js'; -import { AutoSubstituteAsciiEmojis } from '../../quill/auto-substitute-ascii-emojis/index.js'; -import { imageToBlurHash } from '../../util/imageToBlurHash.js'; -import { isConversationSMSOnly } from '../../util/isConversationSMSOnly.js'; -import { isSignalConversation } from '../../util/isSignalConversation.js'; +} from '../../types/BodyRange.std.js'; +import { hydrateRanges } from '../../types/BodyRange.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { getAddedByForOurPendingInvitation } from '../../util/getAddedByForOurPendingInvitation.preload.js'; +import { AutoSubstituteAsciiEmojis } from '../../quill/auto-substitute-ascii-emojis/index.dom.js'; +import { imageToBlurHash } from '../../util/imageToBlurHash.dom.js'; +import { isConversationSMSOnly } from '../../util/isConversationSMSOnly.std.js'; +import { isSignalConversation } from '../../util/isSignalConversation.dom.js'; import { getErrorDialogAudioRecorderType, getRecordingState, -} from '../selectors/audioRecorder.js'; -import { getPreferredBadgeSelector } from '../selectors/badges.js'; -import { getComposerStateForConversationIdSelector } from '../selectors/composer.js'; +} from '../selectors/audioRecorder.std.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.preload.js'; +import { getComposerStateForConversationIdSelector } from '../selectors/composer.preload.js'; import { getConversationSelector, getGroupAdminsSelector, @@ -30,33 +30,33 @@ import { getMessages, getSelectedMessageIds, isMissingRequiredProfileSharing, -} from '../selectors/conversations.js'; +} from '../selectors/conversations.dom.js'; import { getDefaultConversationColor, getEmojiSkinToneDefault, getTextFormattingEnabled, -} from '../selectors/items.js'; -import { canForward, getPropsForQuote } from '../selectors/message.js'; +} from '../selectors/items.dom.js'; +import { canForward, getPropsForQuote } from '../selectors/message.preload.js'; import { getIntl, getPlatform, getTheme, getUserConversationId, -} from '../selectors/user.js'; -import { SmartCompositionRecording } from './CompositionRecording.js'; -import type { SmartCompositionRecordingDraftProps } from './CompositionRecordingDraft.js'; -import { SmartCompositionRecordingDraft } from './CompositionRecordingDraft.js'; -import { useComposerActions } from '../ducks/composer.js'; -import { useConversationsActions } from '../ducks/conversations.js'; -import { useAudioRecorderActions } from '../ducks/audioRecorder.js'; -import { useEmojisActions } from '../ducks/emojis.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; -import { useToastActions } from '../ducks/toast.js'; -import { isShowingAnyModal } from '../selectors/globalModals.js'; -import { isConversationEverUnregistered } from '../../util/isConversationUnregistered.js'; -import { isDirectConversation } from '../../util/whatTypeOfConversation.js'; -import { isConversationMuted } from '../../util/isConversationMuted.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +} from '../selectors/user.std.js'; +import { SmartCompositionRecording } from './CompositionRecording.preload.js'; +import type { SmartCompositionRecordingDraftProps } from './CompositionRecordingDraft.preload.js'; +import { SmartCompositionRecordingDraft } from './CompositionRecordingDraft.preload.js'; +import { useComposerActions } from '../ducks/composer.preload.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; +import { useAudioRecorderActions } from '../ducks/audioRecorder.preload.js'; +import { useEmojisActions } from '../ducks/emojis.preload.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; +import { useToastActions } from '../ducks/toast.preload.js'; +import { isShowingAnyModal } from '../selectors/globalModals.std.js'; +import { isConversationEverUnregistered } from '../../util/isConversationUnregistered.dom.js'; +import { isDirectConversation } from '../../util/whatTypeOfConversation.dom.js'; +import { isConversationMuted } from '../../util/isConversationMuted.std.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; function renderSmartCompositionRecording() { return ; diff --git a/ts/state/smart/CompositionRecording.tsx b/ts/state/smart/CompositionRecording.tsx index 001b6c5742..1201cedf51 100644 --- a/ts/state/smart/CompositionRecording.tsx +++ b/ts/state/smart/CompositionRecording.tsx @@ -3,12 +3,12 @@ import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import { CompositionRecording } from '../../components/CompositionRecording.js'; -import { useAudioRecorderActions } from '../ducks/audioRecorder.js'; -import { useComposerActions } from '../ducks/composer.js'; -import { useToastActions } from '../ducks/toast.js'; -import { getSelectedConversationId } from '../selectors/conversations.js'; -import { getIntl } from '../selectors/user.js'; +import { CompositionRecording } from '../../components/CompositionRecording.dom.js'; +import { useAudioRecorderActions } from '../ducks/audioRecorder.preload.js'; +import { useComposerActions } from '../ducks/composer.preload.js'; +import { useToastActions } from '../ducks/toast.preload.js'; +import { getSelectedConversationId } from '../selectors/conversations.dom.js'; +import { getIntl } from '../selectors/user.std.js'; export const SmartCompositionRecording = memo( function SmartCompositionRecording() { diff --git a/ts/state/smart/CompositionRecordingDraft.tsx b/ts/state/smart/CompositionRecordingDraft.tsx index 2d02042ced..59bfdc2d65 100644 --- a/ts/state/smart/CompositionRecordingDraft.tsx +++ b/ts/state/smart/CompositionRecordingDraft.tsx @@ -3,19 +3,19 @@ import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import { CompositionRecordingDraft } from '../../components/CompositionRecordingDraft.js'; -import type { AttachmentDraftType } from '../../types/Attachment.js'; +import { CompositionRecordingDraft } from '../../components/CompositionRecordingDraft.dom.js'; +import type { AttachmentDraftType } from '../../types/Attachment.std.js'; import { AudioPlayerContent, useAudioPlayerActions, -} from '../ducks/audioPlayer.js'; -import { useComposerActions } from '../ducks/composer.js'; -import { selectAudioPlayerActive } from '../selectors/audioPlayer.js'; +} from '../ducks/audioPlayer.preload.js'; +import { useComposerActions } from '../ducks/composer.preload.js'; +import { selectAudioPlayerActive } from '../selectors/audioPlayer.preload.js'; import { getConversationByIdSelector, getSelectedConversationId, -} from '../selectors/conversations.js'; -import { getIntl } from '../selectors/user.js'; +} from '../selectors/conversations.dom.js'; +import { getIntl } from '../selectors/user.std.js'; export type SmartCompositionRecordingDraftProps = { voiceNoteAttachment: AttachmentDraftType; diff --git a/ts/state/smart/CompositionTextArea.tsx b/ts/state/smart/CompositionTextArea.tsx index 058aef63a5..6c8d802bd0 100644 --- a/ts/state/smart/CompositionTextArea.tsx +++ b/ts/state/smart/CompositionTextArea.tsx @@ -2,19 +2,19 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import type { CompositionTextAreaProps } from '../../components/CompositionTextArea.js'; -import { CompositionTextArea } from '../../components/CompositionTextArea.js'; +import type { CompositionTextAreaProps } from '../../components/CompositionTextArea.dom.js'; +import { CompositionTextArea } from '../../components/CompositionTextArea.dom.js'; import { getIntl, getPlatform, getUserConversationId, -} from '../selectors/user.js'; -import { useEmojisActions as useEmojiActions } from '../ducks/emojis.js'; -import { useItemsActions } from '../ducks/items.js'; -import { getPreferredBadgeSelector } from '../selectors/badges.js'; -import { useComposerActions } from '../ducks/composer.js'; -import { getTextFormattingEnabled } from '../selectors/items.js'; -import { getConversationSelector } from '../selectors/conversations.js'; +} from '../selectors/user.std.js'; +import { useEmojisActions as useEmojiActions } from '../ducks/emojis.preload.js'; +import { useItemsActions } from '../ducks/items.preload.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.preload.js'; +import { useComposerActions } from '../ducks/composer.preload.js'; +import { getTextFormattingEnabled } from '../selectors/items.dom.js'; +import { getConversationSelector } from '../selectors/conversations.dom.js'; export type SmartCompositionTextAreaProps = Pick< CompositionTextAreaProps, diff --git a/ts/state/smart/ConfirmAdditionsModal.tsx b/ts/state/smart/ConfirmAdditionsModal.tsx index ffdba437a1..aa2d98f7d2 100644 --- a/ts/state/smart/ConfirmAdditionsModal.tsx +++ b/ts/state/smart/ConfirmAdditionsModal.tsx @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo, useMemo } from 'react'; import { useSelector } from 'react-redux'; -import { strictAssert } from '../../util/assert.js'; -import { ConfirmAdditionsModal } from '../../components/conversation/conversation-details/AddGroupMembersModal/ConfirmAdditionsModal.js'; -import type { RequestState } from '../../components/conversation/conversation-details/util.js'; -import { getIntl } from '../selectors/user.js'; -import { getConversationByIdSelector } from '../selectors/conversations.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { ConfirmAdditionsModal } from '../../components/conversation/conversation-details/AddGroupMembersModal/ConfirmAdditionsModal.dom.js'; +import type { RequestState } from '../../components/conversation/conversation-details/util.std.js'; +import { getIntl } from '../selectors/user.std.js'; +import { getConversationByIdSelector } from '../selectors/conversations.dom.js'; export type SmartConfirmAdditionsModalPropsType = { selectedConversationIds: ReadonlyArray; diff --git a/ts/state/smart/ConfirmLeaveCallModal.tsx b/ts/state/smart/ConfirmLeaveCallModal.tsx index 57be1ec837..529c74c9b3 100644 --- a/ts/state/smart/ConfirmLeaveCallModal.tsx +++ b/ts/state/smart/ConfirmLeaveCallModal.tsx @@ -3,11 +3,11 @@ import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { useCallingActions } from '../ducks/calling.js'; -import { getIntl } from '../selectors/user.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; -import { getConfirmLeaveCallModalState } from '../selectors/globalModals.js'; -import { ConfirmLeaveCallModal } from '../../components/ConfirmLeaveCallModal.js'; +import { useCallingActions } from '../ducks/calling.preload.js'; +import { getIntl } from '../selectors/user.std.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; +import { getConfirmLeaveCallModalState } from '../selectors/globalModals.std.js'; +import { ConfirmLeaveCallModal } from '../../components/ConfirmLeaveCallModal.dom.js'; export const SmartConfirmLeaveCallModal = memo( function SmartConfirmLeaveCallModal(): JSX.Element | null { diff --git a/ts/state/smart/ContactDetail.tsx b/ts/state/smart/ContactDetail.tsx index a3e188f4ef..6b6315f70a 100644 --- a/ts/state/smart/ContactDetail.tsx +++ b/ts/state/smart/ContactDetail.tsx @@ -4,13 +4,13 @@ import React, { memo, useEffect } from 'react'; import { useSelector } from 'react-redux'; -import type { Props as ContactDetailProps } from '../../components/conversation/ContactDetail.js'; -import { ContactDetail } from '../../components/conversation/ContactDetail.js'; -import { useConversationsActions } from '../ducks/conversations.js'; -import { getMessages } from '../selectors/conversations.js'; -import { getIntl, getRegionCode } from '../selectors/user.js'; -import { embeddedContactSelector } from '../../types/EmbeddedContact.js'; -import { getAccountSelector } from '../selectors/accounts.js'; +import type { Props as ContactDetailProps } from '../../components/conversation/ContactDetail.dom.js'; +import { ContactDetail } from '../../components/conversation/ContactDetail.dom.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; +import { getMessages } from '../selectors/conversations.dom.js'; +import { getIntl, getRegionCode } from '../selectors/user.std.js'; +import { embeddedContactSelector } from '../../types/EmbeddedContact.std.js'; +import { getAccountSelector } from '../selectors/accounts.std.js'; export type OwnProps = Pick; diff --git a/ts/state/smart/ContactModal.tsx b/ts/state/smart/ContactModal.tsx index d98fa5e27f..63f660ea3c 100644 --- a/ts/state/smart/ContactModal.tsx +++ b/ts/state/smart/ContactModal.tsx @@ -3,22 +3,22 @@ import React, { memo, useCallback, useMemo } from 'react'; import { useSelector } from 'react-redux'; -import { ContactModal } from '../../components/conversation/ContactModal.js'; -import { getAreWeASubscriber } from '../selectors/items.js'; -import { getIntl, getTheme } from '../selectors/user.js'; -import { getBadgesSelector } from '../selectors/badges.js'; -import { getConversationSelector } from '../selectors/conversations.js'; -import { getHasStoriesSelector } from '../selectors/stories2.js'; +import { ContactModal } from '../../components/conversation/ContactModal.dom.js'; +import { getAreWeASubscriber } from '../selectors/items.dom.js'; +import { getIntl, getTheme } from '../selectors/user.std.js'; +import { getBadgesSelector } from '../selectors/badges.preload.js'; +import { getConversationSelector } from '../selectors/conversations.dom.js'; +import { getHasStoriesSelector } from '../selectors/stories2.dom.js'; import { getActiveCallState, isInFullScreenCall as getIsInFullScreenCall, -} from '../selectors/calling.js'; -import { useStoriesActions } from '../ducks/stories.js'; -import { useConversationsActions } from '../ducks/conversations.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; -import { useCallingActions } from '../ducks/calling.js'; -import { getContactModalState } from '../selectors/globalModals.js'; -import { strictAssert } from '../../util/assert.js'; +} from '../selectors/calling.std.js'; +import { useStoriesActions } from '../ducks/stories.preload.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; +import { useCallingActions } from '../ducks/calling.preload.js'; +import { getContactModalState } from '../selectors/globalModals.std.js'; +import { strictAssert } from '../../util/assert.std.js'; export const SmartContactModal = memo(function SmartContactModal() { const i18n = useSelector(getIntl); diff --git a/ts/state/smart/ContactName.tsx b/ts/state/smart/ContactName.tsx index 0a082129d2..18a0110e7d 100644 --- a/ts/state/smart/ContactName.tsx +++ b/ts/state/smart/ContactName.tsx @@ -2,13 +2,13 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo, useCallback, useMemo } from 'react'; import { useSelector } from 'react-redux'; -import { ContactName } from '../../components/conversation/ContactName.js'; -import { getIntl } from '../selectors/user.js'; +import { ContactName } from '../../components/conversation/ContactName.dom.js'; +import { getIntl } from '../selectors/user.std.js'; import { getConversationSelector, getSelectedConversationId, -} from '../selectors/conversations.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; +} from '../selectors/conversations.dom.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; type ExternalProps = { contactId: string; diff --git a/ts/state/smart/ContactSpoofingReviewDialog.tsx b/ts/state/smart/ContactSpoofingReviewDialog.tsx index ba2f025049..39bfc1a5bb 100644 --- a/ts/state/smart/ContactSpoofingReviewDialog.tsx +++ b/ts/state/smart/ContactSpoofingReviewDialog.tsx @@ -4,26 +4,26 @@ import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; import lodash from 'lodash'; -import type { StateType } from '../reducer.js'; -import { ContactSpoofingReviewDialog } from '../../components/conversation/ContactSpoofingReviewDialog.js'; -import { useConversationsActions } from '../ducks/conversations.js'; +import type { StateType } from '../reducer.preload.js'; +import { ContactSpoofingReviewDialog } from '../../components/conversation/ContactSpoofingReviewDialog.dom.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; import { getConversationSelector, getConversationByServiceIdSelector, getSafeConversationWithSameTitle, -} from '../selectors/conversations.js'; -import { getOwn } from '../../util/getOwn.js'; -import { assertDev } from '../../util/assert.js'; -import { ContactSpoofingType } from '../../util/contactSpoofing.js'; -import { getGroupMemberships } from '../../util/getGroupMemberships.js'; -import { isSignalConnection } from '../../util/getSignalConnections.js'; +} from '../selectors/conversations.dom.js'; +import { getOwn } from '../../util/getOwn.std.js'; +import { assertDev } from '../../util/assert.std.js'; +import { ContactSpoofingType } from '../../util/contactSpoofing.std.js'; +import { getGroupMemberships } from '../../util/getGroupMemberships.dom.js'; +import { isSignalConnection } from '../../util/getSignalConnections.preload.js'; import { getCollisionsFromMemberships, invertIdsByTitle, -} from '../../util/groupMemberNameCollisions.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; -import { getPreferredBadgeSelector } from '../selectors/badges.js'; -import { getIntl, getTheme } from '../selectors/user.js'; +} from '../../util/groupMemberNameCollisions.std.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.preload.js'; +import { getIntl, getTheme } from '../selectors/user.std.js'; const { mapValues } = lodash; diff --git a/ts/state/smart/ConversationDetails.tsx b/ts/state/smart/ConversationDetails.tsx index e47a61293c..84e435b612 100644 --- a/ts/state/smart/ConversationDetails.tsx +++ b/ts/state/smart/ConversationDetails.tsx @@ -4,45 +4,45 @@ import lodash from 'lodash'; import React, { memo, useCallback, useState, useEffect } from 'react'; import { useSelector } from 'react-redux'; -import { ConversationDetails } from '../../components/conversation/conversation-details/ConversationDetails.js'; +import { ConversationDetails } from '../../components/conversation/conversation-details/ConversationDetails.dom.js'; import { getGroupSizeHardLimit, getGroupSizeRecommendedLimit, -} from '../../groups/limits.js'; -import { SignalService as Proto } from '../../protobuf/index.js'; -import type { CallHistoryGroup } from '../../types/CallDisposition.js'; -import { assertDev } from '../../util/assert.js'; -import { getConversationColorAttributes } from '../../util/getConversationColorAttributes.js'; -import { getGroupMemberships } from '../../util/getGroupMemberships.js'; +} from '../../groups/limits.dom.js'; +import { SignalService as Proto } from '../../protobuf/index.std.js'; +import type { CallHistoryGroup } from '../../types/CallDisposition.std.js'; +import { assertDev } from '../../util/assert.std.js'; +import { getConversationColorAttributes } from '../../util/getConversationColorAttributes.std.js'; +import { getGroupMemberships } from '../../util/getGroupMemberships.dom.js'; import { getBadgesSelector, getPreferredBadgeSelector, -} from '../selectors/badges.js'; -import { getActiveCallState } from '../selectors/calling.js'; +} from '../selectors/badges.preload.js'; +import { getActiveCallState } from '../selectors/calling.std.js'; import { getAllComposableConversations, getConversationByIdSelector, getConversationByServiceIdSelector, getPendingAvatarDownloadSelector, -} from '../selectors/conversations.js'; +} from '../selectors/conversations.dom.js'; import { getAreWeASubscriber, getDefaultConversationColor, -} from '../selectors/items.js'; -import { getSelectedNavTab } from '../selectors/nav.js'; -import { getIntl, getTheme } from '../selectors/user.js'; -import type { SmartChooseGroupMembersModalPropsType } from './ChooseGroupMembersModal.js'; -import { SmartChooseGroupMembersModal } from './ChooseGroupMembersModal.js'; -import type { SmartConfirmAdditionsModalPropsType } from './ConfirmAdditionsModal.js'; -import { SmartConfirmAdditionsModal } from './ConfirmAdditionsModal.js'; -import type { ConversationType } from '../ducks/conversations.js'; -import { useConversationsActions } from '../ducks/conversations.js'; -import { useCallingActions } from '../ducks/calling.js'; -import { useSearchActions } from '../ducks/search.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; -import { isSignalConversation } from '../../util/isSignalConversation.js'; -import { drop } from '../../util/drop.js'; -import { DataReader } from '../../sql/Client.js'; +} from '../selectors/items.dom.js'; +import { getSelectedNavTab } from '../selectors/nav.preload.js'; +import { getIntl, getTheme } from '../selectors/user.std.js'; +import type { SmartChooseGroupMembersModalPropsType } from './ChooseGroupMembersModal.preload.js'; +import { SmartChooseGroupMembersModal } from './ChooseGroupMembersModal.preload.js'; +import type { SmartConfirmAdditionsModalPropsType } from './ConfirmAdditionsModal.dom.js'; +import { SmartConfirmAdditionsModal } from './ConfirmAdditionsModal.dom.js'; +import type { ConversationType } from '../ducks/conversations.preload.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; +import { useCallingActions } from '../ducks/calling.preload.js'; +import { useSearchActions } from '../ducks/search.preload.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; +import { isSignalConversation } from '../../util/isSignalConversation.dom.js'; +import { drop } from '../../util/drop.std.js'; +import { DataReader } from '../../sql/Client.preload.js'; const { sortBy } = lodash; diff --git a/ts/state/smart/ConversationHeader.tsx b/ts/state/smart/ConversationHeader.tsx index 94a264ba1f..56582b278d 100644 --- a/ts/state/smart/ConversationHeader.tsx +++ b/ts/state/smart/ConversationHeader.tsx @@ -3,48 +3,51 @@ import React, { memo, useCallback, useMemo } from 'react'; import { useSelector } from 'react-redux'; -import { useContactNameData } from '../../components/conversation/ContactName.js'; +import { useContactNameData } from '../../components/conversation/ContactName.dom.js'; import { ConversationHeader, OutgoingCallButtonStyle, -} from '../../components/conversation/ConversationHeader.js'; -import { getCannotLeaveBecauseYouAreLastAdmin } from '../../components/conversation/conversation-details/ConversationDetails.js'; -import { useMinimalConversation } from '../../hooks/useMinimalConversation.js'; -import { CallMode } from '../../types/CallDisposition.js'; -import { PanelType } from '../../types/Panels.js'; -import { StoryViewModeType } from '../../types/Stories.js'; -import { strictAssert } from '../../util/assert.js'; -import { getAddedByForOurPendingInvitation } from '../../util/getAddedByForOurPendingInvitation.js'; -import { getGroupMemberships } from '../../util/getGroupMemberships.js'; -import { isConversationSMSOnly } from '../../util/isConversationSMSOnly.js'; -import { isGroupOrAdhocCallState } from '../../util/isGroupOrAdhocCall.js'; -import { isSignalConversation } from '../../util/isSignalConversation.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; -import { useCallingActions } from '../ducks/calling.js'; -import { isAnybodyElseInGroupCall } from '../ducks/callingHelpers.js'; -import type { ConversationType } from '../ducks/conversations.js'; +} from '../../components/conversation/ConversationHeader.dom.js'; +import { getCannotLeaveBecauseYouAreLastAdmin } from '../../components/conversation/conversation-details/ConversationDetails.dom.js'; +import { useMinimalConversation } from '../../hooks/useMinimalConversation.std.js'; +import { CallMode } from '../../types/CallDisposition.std.js'; +import { PanelType } from '../../types/Panels.std.js'; +import { StoryViewModeType } from '../../types/Stories.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { getAddedByForOurPendingInvitation } from '../../util/getAddedByForOurPendingInvitation.preload.js'; +import { getGroupMemberships } from '../../util/getGroupMemberships.dom.js'; +import { isConversationSMSOnly } from '../../util/isConversationSMSOnly.std.js'; +import { isGroupOrAdhocCallState } from '../../util/isGroupOrAdhocCall.std.js'; +import { isSignalConversation } from '../../util/isSignalConversation.dom.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; +import { useCallingActions } from '../ducks/calling.preload.js'; +import { isAnybodyElseInGroupCall } from '../ducks/callingHelpers.std.js'; +import type { ConversationType } from '../ducks/conversations.preload.js'; import { getConversationCallMode, useConversationsActions, -} from '../ducks/conversations.js'; -import { useSearchActions } from '../ducks/search.js'; -import { useStoriesActions } from '../ducks/stories.js'; -import { getPreferredBadgeSelector } from '../selectors/badges.js'; -import { getActiveCallState, getCallSelector } from '../selectors/calling.js'; +} from '../ducks/conversations.preload.js'; +import { useSearchActions } from '../ducks/search.preload.js'; +import { useStoriesActions } from '../ducks/stories.preload.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.preload.js'; +import { + getActiveCallState, + getCallSelector, +} from '../selectors/calling.std.js'; import { getConversationByServiceIdSelector, getConversationSelector, getHasPanelOpen, isMissingRequiredProfileSharing as getIsMissingRequiredProfileSharing, getSelectedMessageIds, -} from '../selectors/conversations.js'; -import { getHasStoriesSelector } from '../selectors/stories2.js'; -import { getIntl, getTheme, getUserACI } from '../selectors/user.js'; -import { useItemsActions } from '../ducks/items.js'; -import { getLocalDeleteWarningShown } from '../selectors/items.js'; -import { isConversationEverUnregistered } from '../../util/isConversationUnregistered.js'; -import { isDirectConversation } from '../../util/whatTypeOfConversation.js'; -import type { DurationInSeconds } from '../../util/durations/index.js'; +} from '../selectors/conversations.dom.js'; +import { getHasStoriesSelector } from '../selectors/stories2.dom.js'; +import { getIntl, getTheme, getUserACI } from '../selectors/user.std.js'; +import { useItemsActions } from '../ducks/items.preload.js'; +import { getLocalDeleteWarningShown } from '../selectors/items.dom.js'; +import { isConversationEverUnregistered } from '../../util/isConversationUnregistered.dom.js'; +import { isDirectConversation } from '../../util/whatTypeOfConversation.dom.js'; +import type { DurationInSeconds } from '../../util/durations/index.std.js'; export type OwnProps = { id: string; diff --git a/ts/state/smart/ConversationNotificationsSettings.tsx b/ts/state/smart/ConversationNotificationsSettings.tsx index e26db336c9..56f8cc7635 100644 --- a/ts/state/smart/ConversationNotificationsSettings.tsx +++ b/ts/state/smart/ConversationNotificationsSettings.tsx @@ -3,11 +3,11 @@ import { useSelector } from 'react-redux'; import React, { memo } from 'react'; -import { ConversationNotificationsSettings } from '../../components/conversation/conversation-details/ConversationNotificationsSettings.js'; -import { getIntl } from '../selectors/user.js'; -import { getConversationByIdSelector } from '../selectors/conversations.js'; -import { strictAssert } from '../../util/assert.js'; -import { useConversationsActions } from '../ducks/conversations.js'; +import { ConversationNotificationsSettings } from '../../components/conversation/conversation-details/ConversationNotificationsSettings.dom.js'; +import { getIntl } from '../selectors/user.std.js'; +import { getConversationByIdSelector } from '../selectors/conversations.dom.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; export type SmartConversationNotificationsSettingsProps = { conversationId: string; diff --git a/ts/state/smart/ConversationPanel.tsx b/ts/state/smart/ConversationPanel.tsx index 1efe620f60..7c1dad00a8 100644 --- a/ts/state/smart/ConversationPanel.tsx +++ b/ts/state/smart/ConversationPanel.tsx @@ -11,32 +11,32 @@ import React, { useState, } from 'react'; import { useSelector } from 'react-redux'; -import type { PanelRenderType } from '../../types/Panels.js'; -import { createLogger } from '../../logging/log.js'; -import { PanelType } from '../../types/Panels.js'; -import { toLogFormat } from '../../types/errors.js'; -import { SmartAllMedia } from './AllMedia.js'; -import { SmartChatColorPicker } from './ChatColorPicker.js'; -import { SmartContactDetail } from './ContactDetail.js'; -import { SmartConversationDetails } from './ConversationDetails.js'; -import { SmartConversationNotificationsSettings } from './ConversationNotificationsSettings.js'; -import { SmartGV1Members } from './GV1Members.js'; -import { SmartGroupLinkManagement } from './GroupLinkManagement.js'; -import { SmartGroupV2Permissions } from './GroupV2Permissions.js'; -import { SmartMessageDetail } from './MessageDetail.js'; -import { SmartPendingInvites } from './PendingInvites.js'; -import { SmartStickerManager } from './StickerManager.js'; -import { getConversationTitleForPanelType } from '../../util/getConversationTitleForPanelType.js'; -import { getIntl } from '../selectors/user.js'; +import type { PanelRenderType } from '../../types/Panels.std.js'; +import { createLogger } from '../../logging/log.std.js'; +import { PanelType } from '../../types/Panels.std.js'; +import { toLogFormat } from '../../types/errors.std.js'; +import { SmartAllMedia } from './AllMedia.preload.js'; +import { SmartChatColorPicker } from './ChatColorPicker.preload.js'; +import { SmartContactDetail } from './ContactDetail.preload.js'; +import { SmartConversationDetails } from './ConversationDetails.preload.js'; +import { SmartConversationNotificationsSettings } from './ConversationNotificationsSettings.preload.js'; +import { SmartGV1Members } from './GV1Members.preload.js'; +import { SmartGroupLinkManagement } from './GroupLinkManagement.preload.js'; +import { SmartGroupV2Permissions } from './GroupV2Permissions.preload.js'; +import { SmartMessageDetail } from './MessageDetail.preload.js'; +import { SmartPendingInvites } from './PendingInvites.preload.js'; +import { SmartStickerManager } from './StickerManager.preload.js'; +import { getConversationTitleForPanelType } from '../../util/getConversationTitleForPanelType.std.js'; +import { getIntl } from '../selectors/user.std.js'; import { getPanelInformation, getWasPanelAnimated, -} from '../selectors/conversations.js'; -import { focusableSelector } from '../../util/focusableSelectors.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; -import { useConversationsActions } from '../ducks/conversations.js'; -import { useReducedMotion } from '../../hooks/useReducedMotion.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +} from '../selectors/conversations.dom.js'; +import { focusableSelector } from '../../util/focusableSelectors.std.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; +import { useReducedMotion } from '../../hooks/useReducedMotion.dom.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; const log = createLogger('ConversationPanel'); diff --git a/ts/state/smart/ConversationView.tsx b/ts/state/smart/ConversationView.tsx index 9d384e57e3..54679c9c95 100644 --- a/ts/state/smart/ConversationView.tsx +++ b/ts/state/smart/ConversationView.tsx @@ -3,19 +3,19 @@ import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import { ConversationPanel } from './ConversationPanel.js'; -import { ConversationView } from '../../components/conversation/ConversationView.js'; -import { SmartCompositionArea } from './CompositionArea.js'; -import { SmartConversationHeader } from './ConversationHeader.js'; -import { SmartTimeline } from './Timeline.js'; +import { ConversationPanel } from './ConversationPanel.preload.js'; +import { ConversationView } from '../../components/conversation/ConversationView.dom.js'; +import { SmartCompositionArea } from './CompositionArea.preload.js'; +import { SmartConversationHeader } from './ConversationHeader.preload.js'; +import { SmartTimeline } from './Timeline.preload.js'; import { getActivePanel, getIsPanelAnimating, getSelectedMessageIds, -} from '../selectors/conversations.js'; -import { useComposerActions } from '../ducks/composer.js'; -import { useConversationsActions } from '../ducks/conversations.js'; -import { isShowingAnyModal } from '../selectors/globalModals.js'; +} from '../selectors/conversations.dom.js'; +import { useComposerActions } from '../ducks/composer.preload.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; +import { isShowingAnyModal } from '../selectors/globalModals.std.js'; function renderCompositionArea(conversationId: string) { return ; diff --git a/ts/state/smart/CrashReportDialog.tsx b/ts/state/smart/CrashReportDialog.tsx index b9f5b24361..aa44205dd0 100644 --- a/ts/state/smart/CrashReportDialog.tsx +++ b/ts/state/smart/CrashReportDialog.tsx @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import { useSelector } from 'react-redux'; import React, { memo } from 'react'; -import { CrashReportDialog } from '../../components/CrashReportDialog.js'; -import { getIntl } from '../selectors/user.js'; -import { useCrashReportsActions } from '../ducks/crashReports.js'; -import { getCrashReportsIsPending } from '../selectors/crashReports.js'; +import { CrashReportDialog } from '../../components/CrashReportDialog.dom.js'; +import { getIntl } from '../selectors/user.std.js'; +import { useCrashReportsActions } from '../ducks/crashReports.preload.js'; +import { getCrashReportsIsPending } from '../selectors/crashReports.std.js'; export const SmartCrashReportDialog = memo(function SmartCrashReportDialog() { const i18n = useSelector(getIntl); diff --git a/ts/state/smart/CustomizingPreferredReactionsModal.tsx b/ts/state/smart/CustomizingPreferredReactionsModal.tsx index 4bc74e831a..81f88b86e3 100644 --- a/ts/state/smart/CustomizingPreferredReactionsModal.tsx +++ b/ts/state/smart/CustomizingPreferredReactionsModal.tsx @@ -2,14 +2,14 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { usePreferredReactionsActions } from '../ducks/preferredReactions.js'; -import { useItemsActions } from '../ducks/items.js'; -import { getIntl } from '../selectors/user.js'; -import { getEmojiSkinToneDefault } from '../selectors/items.js'; -import { useRecentEmojis } from '../selectors/emojis.js'; -import { getCustomizeModalState } from '../selectors/preferredReactions.js'; -import { CustomizingPreferredReactionsModal } from '../../components/CustomizingPreferredReactionsModal.js'; -import { strictAssert } from '../../util/assert.js'; +import { usePreferredReactionsActions } from '../ducks/preferredReactions.preload.js'; +import { useItemsActions } from '../ducks/items.preload.js'; +import { getIntl } from '../selectors/user.std.js'; +import { getEmojiSkinToneDefault } from '../selectors/items.dom.js'; +import { useRecentEmojis } from '../selectors/emojis.std.js'; +import { getCustomizeModalState } from '../selectors/preferredReactions.std.js'; +import { CustomizingPreferredReactionsModal } from '../../components/CustomizingPreferredReactionsModal.dom.js'; +import { strictAssert } from '../../util/assert.std.js'; export const SmartCustomizingPreferredReactionsModal = memo( function SmartCustomizingPreferredReactionsModal(): JSX.Element { diff --git a/ts/state/smart/DeleteMessagesModal.tsx b/ts/state/smart/DeleteMessagesModal.tsx index af3524c1ec..e080016c76 100644 --- a/ts/state/smart/DeleteMessagesModal.tsx +++ b/ts/state/smart/DeleteMessagesModal.tsx @@ -3,22 +3,22 @@ import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import type { StateType } from '../reducer.js'; -import { getIntl } from '../selectors/user.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; -import DeleteMessagesModal from '../../components/DeleteMessagesModal.js'; -import { strictAssert } from '../../util/assert.js'; -import { canDeleteMessagesForEveryone } from '../selectors/message.js'; -import { useConversationsActions } from '../ducks/conversations.js'; -import { useToastActions } from '../ducks/toast.js'; +import type { StateType } from '../reducer.preload.js'; +import { getIntl } from '../selectors/user.std.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; +import DeleteMessagesModal from '../../components/DeleteMessagesModal.dom.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { canDeleteMessagesForEveryone } from '../selectors/message.preload.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; +import { useToastActions } from '../ducks/toast.preload.js'; import { getConversationSelector, getLastSelectedMessage, -} from '../selectors/conversations.js'; -import { getDeleteMessagesProps } from '../selectors/globalModals.js'; -import { useItemsActions } from '../ducks/items.js'; -import { getLocalDeleteWarningShown } from '../selectors/items.js'; -import { LocalDeleteWarningModal } from '../../components/LocalDeleteWarningModal.js'; +} from '../selectors/conversations.dom.js'; +import { getDeleteMessagesProps } from '../selectors/globalModals.std.js'; +import { useItemsActions } from '../ducks/items.preload.js'; +import { getLocalDeleteWarningShown } from '../selectors/items.dom.js'; +import { LocalDeleteWarningModal } from '../../components/LocalDeleteWarningModal.dom.js'; export const SmartDeleteMessagesModal = memo( function SmartDeleteMessagesModal() { diff --git a/ts/state/smart/DraftGifMessageSendModal.tsx b/ts/state/smart/DraftGifMessageSendModal.tsx index a6a501dc76..12de6bcfe3 100644 --- a/ts/state/smart/DraftGifMessageSendModal.tsx +++ b/ts/state/smart/DraftGifMessageSendModal.tsx @@ -2,26 +2,26 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo, useCallback, useEffect, useState } from 'react'; import { useSelector } from 'react-redux'; -import { getIntl, getTheme } from '../selectors/user.js'; -import type { DraftGifMessageSendModalProps } from '../../components/DraftGifMessageSendModal.js'; -import { DraftGifMessageSendModal } from '../../components/DraftGifMessageSendModal.js'; -import { strictAssert } from '../../util/assert.js'; -import type { HydratedBodyRangesType } from '../../types/BodyRange.js'; -import { SmartCompositionTextArea } from './CompositionTextArea.js'; -import { getDraftGifMessageSendModalProps } from '../selectors/globalModals.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; -import { useComposerActions } from '../ducks/composer.js'; -import type { FunGifSelection } from '../../components/fun/panels/FunPanelGifs.js'; -import { tenorDownload } from '../../components/fun/data/tenor.js'; -import { drop } from '../../util/drop.js'; -import { processAttachment } from '../../util/processAttachment.js'; -import { SignalService as Proto } from '../../protobuf/index.js'; -import { writeDraftAttachment } from '../../util/writeDraftAttachment.js'; -import type { AttachmentDraftType } from '../../types/Attachment.js'; -import { createLogger } from '../../logging/log.js'; -import * as Errors from '../../types/errors.js'; -import { type Loadable, LoadingState } from '../../util/loadable.js'; -import { isAbortError } from '../../util/isAbortError.js'; +import { getIntl, getTheme } from '../selectors/user.std.js'; +import type { DraftGifMessageSendModalProps } from '../../components/DraftGifMessageSendModal.dom.js'; +import { DraftGifMessageSendModal } from '../../components/DraftGifMessageSendModal.dom.js'; +import { strictAssert } from '../../util/assert.std.js'; +import type { HydratedBodyRangesType } from '../../types/BodyRange.std.js'; +import { SmartCompositionTextArea } from './CompositionTextArea.preload.js'; +import { getDraftGifMessageSendModalProps } from '../selectors/globalModals.std.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; +import { useComposerActions } from '../ducks/composer.preload.js'; +import type { FunGifSelection } from '../../components/fun/panels/FunPanelGifs.dom.js'; +import { tenorDownload } from '../../components/fun/data/tenor.preload.js'; +import { drop } from '../../util/drop.std.js'; +import { processAttachment } from '../../util/processAttachment.preload.js'; +import { SignalService as Proto } from '../../protobuf/index.std.js'; +import { writeDraftAttachment } from '../../util/writeDraftAttachment.preload.js'; +import type { AttachmentDraftType } from '../../types/Attachment.std.js'; +import { createLogger } from '../../logging/log.std.js'; +import * as Errors from '../../types/errors.std.js'; +import { type Loadable, LoadingState } from '../../util/loadable.std.js'; +import { isAbortError } from '../../util/isAbortError.std.js'; const log = createLogger('DraftGifMessageSendModal'); diff --git a/ts/state/smart/EditHistoryMessagesModal.tsx b/ts/state/smart/EditHistoryMessagesModal.tsx index 6ee7acec35..4263d8d2ed 100644 --- a/ts/state/smart/EditHistoryMessagesModal.tsx +++ b/ts/state/smart/EditHistoryMessagesModal.tsx @@ -4,15 +4,15 @@ import React, { memo, useMemo } from 'react'; import { useSelector } from 'react-redux'; import type { ReadonlyMessageAttributesType } from '../../model-types.d.ts'; -import { EditHistoryMessagesModal } from '../../components/EditHistoryMessagesModal.js'; -import { getIntl, getPlatform } from '../selectors/user.js'; -import { getMessagePropsSelector } from '../selectors/message.js'; -import { getPreferredBadgeSelector } from '../selectors/badges.js'; -import { useConversationsActions } from '../ducks/conversations.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; -import { useLightboxActions } from '../ducks/lightbox.js'; -import { strictAssert } from '../../util/assert.js'; -import { getEditHistoryMessages } from '../selectors/globalModals.js'; +import { EditHistoryMessagesModal } from '../../components/EditHistoryMessagesModal.dom.js'; +import { getIntl, getPlatform } from '../selectors/user.std.js'; +import { getMessagePropsSelector } from '../selectors/message.preload.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.preload.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; +import { useLightboxActions } from '../ducks/lightbox.preload.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { getEditHistoryMessages } from '../selectors/globalModals.std.js'; export const SmartEditHistoryMessagesModal = memo( function SmartEditHistoryMessagesModal(): JSX.Element { diff --git a/ts/state/smart/EditNicknameAndNoteModal.tsx b/ts/state/smart/EditNicknameAndNoteModal.tsx index 53a6f83459..a6fbc5becb 100644 --- a/ts/state/smart/EditNicknameAndNoteModal.tsx +++ b/ts/state/smart/EditNicknameAndNoteModal.tsx @@ -2,14 +2,14 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import { getConversationSelector } from '../selectors/conversations.js'; -import { getEditNicknameAndNoteModalProps } from '../selectors/globalModals.js'; -import { strictAssert } from '../../util/assert.js'; -import { EditNicknameAndNoteModal } from '../../components/EditNicknameAndNoteModal.js'; -import { getIntl } from '../selectors/user.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; -import type { NicknameAndNote } from '../ducks/conversations.js'; -import { useConversationsActions } from '../ducks/conversations.js'; +import { getConversationSelector } from '../selectors/conversations.dom.js'; +import { getEditNicknameAndNoteModalProps } from '../selectors/globalModals.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { EditNicknameAndNoteModal } from '../../components/EditNicknameAndNoteModal.dom.js'; +import { getIntl } from '../selectors/user.std.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; +import type { NicknameAndNote } from '../ducks/conversations.preload.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; export const SmartEditNicknameAndNoteModal = memo( function SmartEditNicknameAndNoteModal(): JSX.Element { diff --git a/ts/state/smart/ForwardMessagesModal.tsx b/ts/state/smart/ForwardMessagesModal.tsx index 76b6c18ab5..d5c5b0e504 100644 --- a/ts/state/smart/ForwardMessagesModal.tsx +++ b/ts/state/smart/ForwardMessagesModal.tsx @@ -3,33 +3,33 @@ import React, { useCallback, useState } from 'react'; import { useSelector } from 'react-redux'; -import type { ForwardMessagesPropsType } from '../ducks/globalModals.js'; -import { createLogger } from '../../logging/log.js'; -import { ForwardMessagesModal } from '../../components/ForwardMessagesModal.js'; -import { LinkPreviewSourceType } from '../../types/LinkPreview.js'; -import * as Errors from '../../types/errors.js'; -import { getAllComposableConversations } from '../selectors/conversations.js'; -import { getIntl, getTheme, getRegionCode } from '../selectors/user.js'; -import { getLinkPreview } from '../selectors/linkPreviews.js'; -import { isInFullScreenCall as getIsInFullScreenCall } from '../selectors/calling.js'; -import { getPreferredBadgeSelector } from '../selectors/badges.js'; -import { maybeForwardMessages } from '../../util/maybeForwardMessages.js'; +import type { ForwardMessagesPropsType } from '../ducks/globalModals.preload.js'; +import { createLogger } from '../../logging/log.std.js'; +import { ForwardMessagesModal } from '../../components/ForwardMessagesModal.dom.js'; +import { LinkPreviewSourceType } from '../../types/LinkPreview.std.js'; +import * as Errors from '../../types/errors.std.js'; +import { getAllComposableConversations } from '../selectors/conversations.dom.js'; +import { getIntl, getTheme, getRegionCode } from '../selectors/user.std.js'; +import { getLinkPreview } from '../selectors/linkPreviews.std.js'; +import { isInFullScreenCall as getIsInFullScreenCall } from '../selectors/calling.std.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.preload.js'; +import { maybeForwardMessages } from '../../util/maybeForwardMessages.preload.js'; import { maybeGrabLinkPreview, resetLinkPreview, -} from '../../services/LinkPreview.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; -import { useLinkPreviewActions } from '../ducks/linkPreviews.js'; -import { SmartCompositionTextArea } from './CompositionTextArea.js'; -import { useToastActions } from '../ducks/toast.js'; -import { isDownloaded } from '../../util/Attachment.js'; -import { getMessageById } from '../../messages/getMessageById.js'; -import { strictAssert } from '../../util/assert.js'; +} from '../../services/LinkPreview.preload.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; +import { useLinkPreviewActions } from '../ducks/linkPreviews.preload.js'; +import { SmartCompositionTextArea } from './CompositionTextArea.preload.js'; +import { useToastActions } from '../ducks/toast.preload.js'; +import { isDownloaded } from '../../util/Attachment.std.js'; +import { getMessageById } from '../../messages/getMessageById.preload.js'; +import { strictAssert } from '../../util/assert.std.js'; import type { ForwardMessageData, MessageForwardDraft, -} from '../../types/ForwardDraft.js'; -import { getForwardMessagesProps } from '../selectors/globalModals.js'; +} from '../../types/ForwardDraft.std.js'; +import { getForwardMessagesProps } from '../selectors/globalModals.std.js'; const log = createLogger('ForwardMessagesModal'); diff --git a/ts/state/smart/FunProvider.tsx b/ts/state/smart/FunProvider.tsx index 2524fe9112..b44a533a49 100644 --- a/ts/state/smart/FunProvider.tsx +++ b/ts/state/smart/FunProvider.tsx @@ -4,37 +4,37 @@ import type { ReactNode } from 'react'; import React, { memo, useCallback, useMemo } from 'react'; import { useSelector } from 'react-redux'; -import { FunProvider } from '../../components/fun/FunProvider.js'; -import { getIntl } from '../selectors/user.js'; -import { selectRecentEmojis } from '../selectors/emojis.js'; -import type { FunGifSelection } from '../../components/fun/panels/FunPanelGifs.js'; +import { FunProvider } from '../../components/fun/FunProvider.dom.js'; +import { getIntl } from '../selectors/user.std.js'; +import { selectRecentEmojis } from '../selectors/emojis.std.js'; +import type { FunGifSelection } from '../../components/fun/panels/FunPanelGifs.dom.js'; import { getInstalledStickerPacks, getRecentStickers, -} from '../selectors/stickers.js'; -import { strictAssert } from '../../util/assert.js'; -import type { EmojiSkinTone } from '../../components/fun/data/emojis.js'; +} from '../selectors/stickers.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import type { EmojiSkinTone } from '../../components/fun/data/emojis.std.js'; import { getEmojiParentKeyByEnglishShortName, isEmojiEnglishShortName, -} from '../../components/fun/data/emojis.js'; +} from '../../components/fun/data/emojis.std.js'; import { getEmojiSkinToneDefault, getShowStickerPickerHint, -} from '../selectors/items.js'; -import { useItemsActions } from '../ducks/items.js'; -import { useGifsActions } from '../ducks/gifs.js'; +} from '../selectors/items.dom.js'; +import { useItemsActions } from '../ducks/items.preload.js'; +import { useGifsActions } from '../ducks/gifs.preload.js'; import { fetchGifsFeatured, fetchGifsSearch, -} from '../../components/fun/data/gifs.js'; -import { tenorDownload } from '../../components/fun/data/tenor.js'; -import { usePreferredReactionsActions } from '../ducks/preferredReactions.js'; -import { useEmojisActions } from '../ducks/emojis.js'; -import { useStickersActions } from '../ducks/stickers.js'; -import type { FunStickerSelection } from '../../components/fun/panels/FunPanelStickers.js'; -import type { FunEmojiSelection } from '../../components/fun/panels/FunPanelEmojis.js'; -import { getRecentGifs } from '../selectors/gifs.js'; +} from '../../components/fun/data/gifs.preload.js'; +import { tenorDownload } from '../../components/fun/data/tenor.preload.js'; +import { usePreferredReactionsActions } from '../ducks/preferredReactions.preload.js'; +import { useEmojisActions } from '../ducks/emojis.preload.js'; +import { useStickersActions } from '../ducks/stickers.preload.js'; +import type { FunStickerSelection } from '../../components/fun/panels/FunPanelStickers.dom.js'; +import type { FunEmojiSelection } from '../../components/fun/panels/FunPanelEmojis.dom.js'; +import { getRecentGifs } from '../selectors/gifs.std.js'; export type SmartFunProviderProps = Readonly<{ children: ReactNode; diff --git a/ts/state/smart/GV1Members.tsx b/ts/state/smart/GV1Members.tsx index d3b3f017dc..b4a98a8c22 100644 --- a/ts/state/smart/GV1Members.tsx +++ b/ts/state/smart/GV1Members.tsx @@ -4,16 +4,16 @@ import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { ConversationDetailsMembershipList } from '../../components/conversation/conversation-details/ConversationDetailsMembershipList.js'; -import { assertDev } from '../../util/assert.js'; -import { getGroupMemberships } from '../../util/getGroupMemberships.js'; +import { ConversationDetailsMembershipList } from '../../components/conversation/conversation-details/ConversationDetailsMembershipList.dom.js'; +import { assertDev } from '../../util/assert.std.js'; +import { getGroupMemberships } from '../../util/getGroupMemberships.dom.js'; import { getConversationByIdSelector, getConversationByServiceIdSelector, -} from '../selectors/conversations.js'; -import { getIntl, getTheme } from '../selectors/user.js'; -import { getPreferredBadgeSelector } from '../selectors/badges.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; +} from '../selectors/conversations.dom.js'; +import { getIntl, getTheme } from '../selectors/user.std.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.preload.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; export type PropsType = { conversationId: string; diff --git a/ts/state/smart/GlobalModalContainer.tsx b/ts/state/smart/GlobalModalContainer.tsx index 089514263d..a106c0465d 100644 --- a/ts/state/smart/GlobalModalContainer.tsx +++ b/ts/state/smart/GlobalModalContainer.tsx @@ -3,35 +3,35 @@ import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import type { ButtonVariant } from '../../components/Button.js'; -import { ErrorModal } from '../../components/ErrorModal.js'; -import { GlobalModalContainer } from '../../components/GlobalModalContainer.js'; -import { SmartAboutContactModal } from './AboutContactModal.js'; -import { SmartAddUserToAnotherGroupModal } from './AddUserToAnotherGroupModal.js'; -import { SmartContactModal } from './ContactModal.js'; -import { SmartEditHistoryMessagesModal } from './EditHistoryMessagesModal.js'; -import { SmartForwardMessagesModal } from './ForwardMessagesModal.js'; -import { SmartUsernameOnboardingModal } from './UsernameOnboardingModal.js'; -import { SmartSafetyNumberModal } from './SafetyNumberModal.js'; -import { SmartSendAnywayDialog } from './SendAnywayDialog.js'; -import { SmartShortcutGuideModal } from './ShortcutGuideModal.js'; -import { SmartStickerPreviewModal } from './StickerPreviewModal.js'; -import { SmartStoriesSettingsModal } from './StoriesSettingsModal.js'; -import { getConversationsStoppingSend } from '../selectors/conversations.js'; -import { getIntl, getTheme } from '../selectors/user.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; -import { SmartDeleteMessagesModal } from './DeleteMessagesModal.js'; -import { SmartMessageRequestActionsConfirmation } from './MessageRequestActionsConfirmation.js'; -import { getGlobalModalsState } from '../selectors/globalModals.js'; -import { SmartEditNicknameAndNoteModal } from './EditNicknameAndNoteModal.js'; -import { SmartNotePreviewModal } from './NotePreviewModal.js'; -import { SmartCallLinkEditModal } from './CallLinkEditModal.js'; -import { SmartCallLinkAddNameModal } from './CallLinkAddNameModal.js'; -import { SmartConfirmLeaveCallModal } from './ConfirmLeaveCallModal.js'; -import { SmartCallLinkPendingParticipantModal } from './CallLinkPendingParticipantModal.js'; -import { SmartProfileNameWarningModal } from './ProfileNameWarningModal.js'; -import { SmartDraftGifMessageSendModal } from './DraftGifMessageSendModal.js'; -import { DebugLogErrorModal } from '../../components/DebugLogErrorModal.js'; +import type { ButtonVariant } from '../../components/Button.dom.js'; +import { ErrorModal } from '../../components/ErrorModal.dom.js'; +import { GlobalModalContainer } from '../../components/GlobalModalContainer.dom.js'; +import { SmartAboutContactModal } from './AboutContactModal.preload.js'; +import { SmartAddUserToAnotherGroupModal } from './AddUserToAnotherGroupModal.preload.js'; +import { SmartContactModal } from './ContactModal.preload.js'; +import { SmartEditHistoryMessagesModal } from './EditHistoryMessagesModal.preload.js'; +import { SmartForwardMessagesModal } from './ForwardMessagesModal.preload.js'; +import { SmartUsernameOnboardingModal } from './UsernameOnboardingModal.preload.js'; +import { SmartSafetyNumberModal } from './SafetyNumberModal.preload.js'; +import { SmartSendAnywayDialog } from './SendAnywayDialog.preload.js'; +import { SmartShortcutGuideModal } from './ShortcutGuideModal.preload.js'; +import { SmartStickerPreviewModal } from './StickerPreviewModal.preload.js'; +import { SmartStoriesSettingsModal } from './StoriesSettingsModal.preload.js'; +import { getConversationsStoppingSend } from '../selectors/conversations.dom.js'; +import { getIntl, getTheme } from '../selectors/user.std.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; +import { SmartDeleteMessagesModal } from './DeleteMessagesModal.preload.js'; +import { SmartMessageRequestActionsConfirmation } from './MessageRequestActionsConfirmation.preload.js'; +import { getGlobalModalsState } from '../selectors/globalModals.std.js'; +import { SmartEditNicknameAndNoteModal } from './EditNicknameAndNoteModal.preload.js'; +import { SmartNotePreviewModal } from './NotePreviewModal.preload.js'; +import { SmartCallLinkEditModal } from './CallLinkEditModal.preload.js'; +import { SmartCallLinkAddNameModal } from './CallLinkAddNameModal.preload.js'; +import { SmartConfirmLeaveCallModal } from './ConfirmLeaveCallModal.preload.js'; +import { SmartCallLinkPendingParticipantModal } from './CallLinkPendingParticipantModal.preload.js'; +import { SmartProfileNameWarningModal } from './ProfileNameWarningModal.preload.js'; +import { SmartDraftGifMessageSendModal } from './DraftGifMessageSendModal.preload.js'; +import { DebugLogErrorModal } from '../../components/DebugLogErrorModal.dom.js'; function renderCallLinkAddNameModal(): JSX.Element { return ; diff --git a/ts/state/smart/GroupLinkManagement.tsx b/ts/state/smart/GroupLinkManagement.tsx index d4d725fd9d..09126a48b3 100644 --- a/ts/state/smart/GroupLinkManagement.tsx +++ b/ts/state/smart/GroupLinkManagement.tsx @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { GroupLinkManagement } from '../../components/conversation/conversation-details/GroupLinkManagement.js'; -import { getConversationSelector } from '../selectors/conversations.js'; -import { getIntl } from '../selectors/user.js'; -import { useConversationsActions } from '../ducks/conversations.js'; +import { GroupLinkManagement } from '../../components/conversation/conversation-details/GroupLinkManagement.dom.js'; +import { getConversationSelector } from '../selectors/conversations.dom.js'; +import { getIntl } from '../selectors/user.std.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; export type SmartGroupLinkManagementProps = Readonly<{ conversationId: string; diff --git a/ts/state/smart/GroupV1MigrationDialog.tsx b/ts/state/smart/GroupV1MigrationDialog.tsx index 6042eecd08..02eee3246d 100644 --- a/ts/state/smart/GroupV1MigrationDialog.tsx +++ b/ts/state/smart/GroupV1MigrationDialog.tsx @@ -2,14 +2,14 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo, useCallback, useMemo } from 'react'; import { useSelector } from 'react-redux'; -import type { DataPropsType as GroupV1MigrationDialogPropsType } from '../../components/GroupV1MigrationDialog.js'; -import { GroupV1MigrationDialog } from '../../components/GroupV1MigrationDialog.js'; -import { useConversationsActions } from '../ducks/conversations.js'; -import { getPreferredBadgeSelector } from '../selectors/badges.js'; -import { getConversationSelector } from '../selectors/conversations.js'; -import { getIntl, getTheme } from '../selectors/user.js'; -import { createLogger } from '../../logging/log.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; +import type { DataPropsType as GroupV1MigrationDialogPropsType } from '../../components/GroupV1MigrationDialog.dom.js'; +import { GroupV1MigrationDialog } from '../../components/GroupV1MigrationDialog.dom.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.preload.js'; +import { getConversationSelector } from '../selectors/conversations.dom.js'; +import { getIntl, getTheme } from '../selectors/user.std.js'; +import { createLogger } from '../../logging/log.std.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; const log = createLogger('GroupV1MigrationDialog'); diff --git a/ts/state/smart/GroupV2JoinDialog.tsx b/ts/state/smart/GroupV2JoinDialog.tsx index 7a51dd4d24..6224c757f6 100644 --- a/ts/state/smart/GroupV2JoinDialog.tsx +++ b/ts/state/smart/GroupV2JoinDialog.tsx @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import type { PropsType as GroupV2JoinDialogPropsType } from '../../components/GroupV2JoinDialog.js'; -import { GroupV2JoinDialog } from '../../components/GroupV2JoinDialog.js'; -import { getIntl } from '../selectors/user.js'; -import { getPreJoinConversation } from '../selectors/conversations.js'; +import type { PropsType as GroupV2JoinDialogPropsType } from '../../components/GroupV2JoinDialog.dom.js'; +import { GroupV2JoinDialog } from '../../components/GroupV2JoinDialog.dom.js'; +import { getIntl } from '../selectors/user.std.js'; +import { getPreJoinConversation } from '../selectors/conversations.dom.js'; export type SmartGroupV2JoinDialogProps = Pick< GroupV2JoinDialogPropsType, diff --git a/ts/state/smart/GroupV2Permissions.tsx b/ts/state/smart/GroupV2Permissions.tsx index 5f13ed0ac1..42703c0684 100644 --- a/ts/state/smart/GroupV2Permissions.tsx +++ b/ts/state/smart/GroupV2Permissions.tsx @@ -3,10 +3,10 @@ import { useSelector } from 'react-redux'; import React, { memo } from 'react'; -import { GroupV2Permissions } from '../../components/conversation/conversation-details/GroupV2Permissions.js'; -import { getConversationSelector } from '../selectors/conversations.js'; -import { getIntl } from '../selectors/user.js'; -import { useConversationsActions } from '../ducks/conversations.js'; +import { GroupV2Permissions } from '../../components/conversation/conversation-details/GroupV2Permissions.dom.js'; +import { getConversationSelector } from '../selectors/conversations.dom.js'; +import { getIntl } from '../selectors/user.std.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; export type SmartGroupV2PermissionsProps = { conversationId: string; diff --git a/ts/state/smart/HeroRow.tsx b/ts/state/smart/HeroRow.tsx index 7e0f7a6bef..6d64e57f87 100644 --- a/ts/state/smart/HeroRow.tsx +++ b/ts/state/smart/HeroRow.tsx @@ -2,25 +2,25 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import { PanelType } from '../../types/Panels.js'; -import { ConversationHero } from '../../components/conversation/ConversationHero.js'; -import { getPreferredBadgeSelector } from '../selectors/badges.js'; -import { getIntl, getTheme } from '../selectors/user.js'; -import { getHasStoriesSelector } from '../selectors/stories2.js'; -import { isSignalConversation } from '../../util/isSignalConversation.js'; +import { PanelType } from '../../types/Panels.std.js'; +import { ConversationHero } from '../../components/conversation/ConversationHero.dom.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.preload.js'; +import { getIntl, getTheme } from '../selectors/user.std.js'; +import { getHasStoriesSelector } from '../selectors/stories2.dom.js'; +import { isSignalConversation } from '../../util/isSignalConversation.dom.js'; import { getConversationByServiceIdSelector, getConversationSelector, getPendingAvatarDownloadSelector, -} from '../selectors/conversations.js'; +} from '../selectors/conversations.dom.js'; import { type ConversationType, useConversationsActions, -} from '../ducks/conversations.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; -import { useStoriesActions } from '../ducks/stories.js'; -import { getAddedByForOurPendingInvitation } from '../../util/getAddedByForOurPendingInvitation.js'; -import { getGroupMemberships } from '../../util/getGroupMemberships.js'; +} from '../ducks/conversations.preload.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; +import { useStoriesActions } from '../ducks/stories.preload.js'; +import { getAddedByForOurPendingInvitation } from '../../util/getAddedByForOurPendingInvitation.preload.js'; +import { getGroupMemberships } from '../../util/getGroupMemberships.dom.js'; type SmartHeroRowProps = Readonly<{ id: string; diff --git a/ts/state/smart/Inbox.tsx b/ts/state/smart/Inbox.tsx index 26de8ec93a..1a1a2c13cf 100644 --- a/ts/state/smart/Inbox.tsx +++ b/ts/state/smart/Inbox.tsx @@ -3,24 +3,24 @@ import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { Inbox } from '../../components/Inbox.js'; -import { isNightly } from '../../util/version.js'; -import { getIntl } from '../selectors/user.js'; -import { SmartCustomizingPreferredReactionsModal } from './CustomizingPreferredReactionsModal.js'; -import { getIsCustomizingPreferredReactions } from '../selectors/preferredReactions.js'; -import type { SmartNavTabsProps } from './NavTabs.js'; -import { SmartNavTabs } from './NavTabs.js'; -import { SmartStoriesTab } from './StoriesTab.js'; -import { SmartCallsTab } from './CallsTab.js'; -import { useItemsActions } from '../ducks/items.js'; -import { getNavTabsCollapsed } from '../selectors/items.js'; -import { SmartChatsTab } from './ChatsTab.js'; -import { getHasInitialLoadCompleted } from '../selectors/app.js'; +import { Inbox } from '../../components/Inbox.dom.js'; +import { isNightly } from '../../util/version.std.js'; +import { getIntl } from '../selectors/user.std.js'; +import { SmartCustomizingPreferredReactionsModal } from './CustomizingPreferredReactionsModal.preload.js'; +import { getIsCustomizingPreferredReactions } from '../selectors/preferredReactions.std.js'; +import type { SmartNavTabsProps } from './NavTabs.preload.js'; +import { SmartNavTabs } from './NavTabs.preload.js'; +import { SmartStoriesTab } from './StoriesTab.preload.js'; +import { SmartCallsTab } from './CallsTab.preload.js'; +import { useItemsActions } from '../ducks/items.preload.js'; +import { getNavTabsCollapsed } from '../selectors/items.dom.js'; +import { SmartChatsTab } from './ChatsTab.preload.js'; +import { getHasInitialLoadCompleted } from '../selectors/app.std.js'; import { getInboxEnvelopeTimestamp, getInboxFirstEnvelopeTimestamp, -} from '../selectors/inbox.js'; -import { SmartPreferences } from './Preferences.js'; +} from '../selectors/inbox.std.js'; +import { SmartPreferences } from './Preferences.preload.js'; function renderChatsTab() { return ; diff --git a/ts/state/smart/InstallScreen.tsx b/ts/state/smart/InstallScreen.tsx index 5c5b0ac477..3b58eb8d01 100644 --- a/ts/state/smart/InstallScreen.tsx +++ b/ts/state/smart/InstallScreen.tsx @@ -5,21 +5,21 @@ import type { ComponentProps } from 'react'; import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import { getIntl } from '../selectors/user.js'; -import { getUpdatesState } from '../selectors/updates.js'; -import { getInstallerState } from '../selectors/installer.js'; -import { useInstallerActions } from '../ducks/installer.js'; -import { useUpdatesActions } from '../ducks/updates.js'; -import { hasExpired as hasExpiredSelector } from '../selectors/expiration.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; -import { backupsService } from '../../services/backups/index.js'; -import { InstallScreen } from '../../components/InstallScreen.js'; -import { WidthBreakpoint } from '../../components/_util.js'; -import { InstallScreenStep } from '../../types/InstallScreen.js'; -import OS from '../../util/os/osMain.js'; -import { isStagingServer } from '../../util/isStagingServer.js'; -import { createLogger } from '../../logging/log.js'; -import { SmartToastManager } from './ToastManager.js'; +import { getIntl } from '../selectors/user.std.js'; +import { getUpdatesState } from '../selectors/updates.std.js'; +import { getInstallerState } from '../selectors/installer.std.js'; +import { useInstallerActions } from '../ducks/installer.preload.js'; +import { useUpdatesActions } from '../ducks/updates.preload.js'; +import { hasExpired as hasExpiredSelector } from '../selectors/expiration.dom.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; +import { backupsService } from '../../services/backups/index.preload.js'; +import { InstallScreen } from '../../components/InstallScreen.dom.js'; +import { WidthBreakpoint } from '../../components/_util.std.js'; +import { InstallScreenStep } from '../../types/InstallScreen.std.js'; +import OS from '../../util/os/osMain.node.js'; +import { isStagingServer } from '../../util/isStagingServer.dom.js'; +import { createLogger } from '../../logging/log.std.js'; +import { SmartToastManager } from './ToastManager.preload.js'; const log = createLogger('InstallScreen'); diff --git a/ts/state/smart/LeftPane.tsx b/ts/state/smart/LeftPane.tsx index 558ec42849..a4f48ae58d 100644 --- a/ts/state/smart/LeftPane.tsx +++ b/ts/state/smart/LeftPane.tsx @@ -3,39 +3,40 @@ import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import type { PropsType as DialogExpiredBuildPropsType } from '../../components/DialogExpiredBuild.js'; -import { DialogExpiredBuild } from '../../components/DialogExpiredBuild.js'; -import type { PropsType as LeftPanePropsType } from '../../components/LeftPane.js'; -import { LeftPane } from '../../components/LeftPane.js'; -import type { NavTabPanelProps } from '../../components/NavTabs.js'; -import type { WidthBreakpoint } from '../../components/_util.js'; +import type { PropsType as DialogExpiredBuildPropsType } from '../../components/DialogExpiredBuild.dom.js'; +import { DialogExpiredBuild } from '../../components/DialogExpiredBuild.dom.js'; +import type { PropsType as LeftPanePropsType } from '../../components/LeftPane.dom.js'; +import { LeftPane } from '../../components/LeftPane.dom.js'; +import type { NavTabPanelProps } from '../../components/NavTabs.dom.js'; +import type { WidthBreakpoint } from '../../components/_util.std.js'; import { getGroupSizeHardLimit, getGroupSizeRecommendedLimit, -} from '../../groups/limits.js'; -import { LeftPaneMode } from '../../types/leftPane.js'; -import { getUsernameFromSearch } from '../../util/Username.js'; -import { getCountryDataForLocale } from '../../util/getCountryData.js'; -import { lookupConversationWithoutServiceId } from '../../util/lookupConversationWithoutServiceId.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; -import { isDone as isRegistrationDone } from '../../util/registration.js'; -import { drop } from '../../util/drop.js'; -import type { ServerAlertsType } from '../../types/ServerAlert.js'; -import { getServerAlertToShow } from '../../util/handleServerAlerts.js'; -import { itemStorage } from '../../textsecure/Storage.js'; -import { useCallingActions } from '../ducks/calling.js'; -import { useConversationsActions } from '../ducks/conversations.js'; +} from '../../groups/limits.dom.js'; +import { LeftPaneMode } from '../../types/leftPane.std.js'; +import { getUsernameFromSearch } from '../../util/Username.dom.js'; +import { getCountryDataForLocale } from '../../util/getCountryData.dom.js'; +import { isChatFoldersEnabled } from '../../util/isChatFoldersEnabled.dom.js'; +import { lookupConversationWithoutServiceId } from '../../util/lookupConversationWithoutServiceId.preload.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; +import { isDone as isRegistrationDone } from '../../util/registration.preload.js'; +import { drop } from '../../util/drop.std.js'; +import type { ServerAlertsType } from '../../types/ServerAlert.std.js'; +import { getServerAlertToShow } from '../../util/handleServerAlerts.preload.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; +import { useCallingActions } from '../ducks/calling.preload.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; import { ComposerStep, OneTimeModalState, -} from '../ducks/conversationsEnums.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; -import { useItemsActions } from '../ducks/items.js'; -import { useNetworkActions } from '../ducks/network.js'; -import { useSearchActions } from '../ducks/search.js'; -import { useUsernameActions } from '../ducks/username.js'; -import type { StateType } from '../reducer.js'; -import { getPreferredBadgeSelector } from '../selectors/badges.js'; +} from '../ducks/conversationsEnums.std.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; +import { useItemsActions } from '../ducks/items.preload.js'; +import { useNetworkActions } from '../ducks/network.dom.js'; +import { useSearchActions } from '../ducks/search.preload.js'; +import { useUsernameActions } from '../ducks/username.preload.js'; +import type { StateType } from '../reducer.preload.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.preload.js'; import { getComposeAvatarData, getComposeGroupAvatar, @@ -59,9 +60,9 @@ import { hasGroupCreationError, isCreatingGroup, isEditingAvatar, -} from '../selectors/conversations.js'; -import { getCrashReportCount } from '../selectors/crashReports.js'; -import { hasExpired } from '../selectors/expiration.js'; +} from '../selectors/conversations.dom.js'; +import { getCrashReportCount } from '../selectors/crashReports.std.js'; +import { hasExpired } from '../selectors/expiration.dom.js'; import { getBackupMediaDownloadProgress, getNavTabsCollapsed, @@ -69,12 +70,12 @@ import { getServerAlerts, getUsernameCorrupted, getUsernameLinkCorrupted, -} from '../selectors/items.js'; +} from '../selectors/items.dom.js'; import { getChallengeStatus, hasNetworkDialog as getHasNetworkDialog, getNetworkIsOnline, -} from '../selectors/network.js'; +} from '../selectors/network.preload.js'; import { getFilterByUnread, getHasSearchQuery, @@ -85,44 +86,44 @@ import { getSearchConversation, getSearchResults, getStartSearchCounter, -} from '../selectors/search.js'; +} from '../selectors/search.dom.js'; import { isUpdateDownloaded as getIsUpdateDownloaded, isOSUnsupported, isUpdateDialogVisible, -} from '../selectors/updates.js'; +} from '../selectors/updates.std.js'; import { getIntl, getIsMacOS, getRegionCode, getTheme, -} from '../selectors/user.js'; -import { SmartCaptchaDialog } from './CaptchaDialog.js'; -import { SmartCrashReportDialog } from './CrashReportDialog.js'; -import { SmartMessageSearchResult } from './MessageSearchResult.js'; -import { SmartNetworkStatus } from './NetworkStatus.js'; -import { SmartRelinkDialog } from './RelinkDialog.js'; -import { SmartToastManager } from './ToastManager.js'; -import type { PropsType as SmartUnsupportedOSDialogPropsType } from './UnsupportedOSDialog.js'; -import { SmartUnsupportedOSDialog } from './UnsupportedOSDialog.js'; -import { SmartUpdateDialog } from './UpdateDialog.js'; +} from '../selectors/user.std.js'; +import { SmartCaptchaDialog } from './CaptchaDialog.preload.js'; +import { SmartCrashReportDialog } from './CrashReportDialog.preload.js'; +import { SmartMessageSearchResult } from './MessageSearchResult.preload.js'; +import { SmartNetworkStatus } from './NetworkStatus.preload.js'; +import { SmartRelinkDialog } from './RelinkDialog.dom.js'; +import { SmartToastManager } from './ToastManager.preload.js'; +import type { PropsType as SmartUnsupportedOSDialogPropsType } from './UnsupportedOSDialog.preload.js'; +import { SmartUnsupportedOSDialog } from './UnsupportedOSDialog.preload.js'; +import { SmartUpdateDialog } from './UpdateDialog.preload.js'; import { cancelBackupMediaDownload, dismissBackupMediaDownloadBanner, pauseBackupMediaDownload, resumeBackupMediaDownload, -} from '../../util/backupMediaDownload.js'; -import { useNavActions } from '../ducks/nav.js'; -import { SmartLeftPaneChatFolders } from './LeftPaneChatFolders.js'; -import { SmartLeftPaneConversationListItemContextMenu } from './LeftPaneConversationListItemContextMenu.js'; -import type { RenderConversationListItemContextMenuProps } from '../../components/conversationList/BaseConversationListItem.js'; +} from '../../util/backupMediaDownload.preload.js'; +import { useNavActions } from '../ducks/nav.std.js'; +import { SmartLeftPaneChatFolders } from './LeftPaneChatFolders.preload.js'; +import { SmartLeftPaneConversationListItemContextMenu } from './LeftPaneConversationListItemContextMenu.preload.js'; +import type { RenderConversationListItemContextMenuProps } from '../../components/conversationList/BaseConversationListItem.dom.js'; import { getHasAnyCurrentCustomChatFolders, getSelectedChatFolder, -} from '../selectors/chatFolders.js'; -import { NavTab, SettingsPage } from '../../types/Nav.js'; -import { SmartNotificationProfilesMenu } from './NotificationProfilesMenu.js'; -import { getActiveProfile } from '../selectors/notificationProfiles.js'; +} from '../selectors/chatFolders.std.js'; +import { NavTab, SettingsPage } from '../../types/Nav.std.js'; +import { SmartNotificationProfilesMenu } from './NotificationProfilesMenu.preload.js'; +import { getActiveProfile } from '../selectors/notificationProfiles.dom.js'; function renderMessageSearchResult(id: string): JSX.Element { return ; @@ -308,6 +309,7 @@ export const SmartLeftPane = memo(function SmartLeftPane({ hasPendingUpdate, otherTabsUnreadStats, }: NavTabPanelProps) { + const version = window.SignalContext.getVersion(); const challengeStatus = useSelector(getChallengeStatus); const composerStep = useSelector(getComposerStep); const crashReportCount = useSelector(getCrashReportCount); @@ -455,6 +457,7 @@ export const SmartLeftPane = memo(function SmartLeftPane({ isMacOS={isMacOS} isOnline={isOnline} isNotificationProfileActive={isNotificationProfileActive} + isChatFoldersEnabled={isChatFoldersEnabled(version)} isUpdateDownloaded={isUpdateDownloaded} lookupConversationWithoutServiceId={lookupConversationWithoutServiceId} modeSpecificProps={modeSpecificProps} diff --git a/ts/state/smart/LeftPaneChatFolders.tsx b/ts/state/smart/LeftPaneChatFolders.tsx index 76c4bf19c2..df564f6c0f 100644 --- a/ts/state/smart/LeftPaneChatFolders.tsx +++ b/ts/state/smart/LeftPaneChatFolders.tsx @@ -2,26 +2,24 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo, useCallback, useContext } from 'react'; import { useSelector } from 'react-redux'; -import { LeftPaneChatFolders } from '../../components/leftPane/LeftPaneChatFolders.js'; +import { LeftPaneChatFolders } from '../../components/leftPane/LeftPaneChatFolders.dom.js'; import { getCurrentChatFolders, getSelectedChatFolder, -} from '../selectors/chatFolders.js'; -import { getIntl } from '../selectors/user.js'; +} from '../selectors/chatFolders.std.js'; +import { getIntl } from '../selectors/user.std.js'; import { getAllChatFoldersMutedStats, getAllChatFoldersUnreadStats, -} from '../selectors/conversations.js'; -import { useChatFolderActions } from '../ducks/chatFolders.js'; -import { NavSidebarWidthBreakpointContext } from '../../components/NavSidebar.js'; -import { useNavActions } from '../ducks/nav.js'; -import { NavTab, SettingsPage } from '../../types/Nav.js'; -import { - isChatFoldersEnabled, - type ChatFolderId, -} from '../../types/ChatFolder.js'; -import { getSelectedLocation } from '../selectors/nav.js'; -import { useConversationsActions } from '../ducks/conversations.js'; +} from '../selectors/conversations.dom.js'; +import { useChatFolderActions } from '../ducks/chatFolders.preload.js'; +import { NavSidebarWidthBreakpointContext } from '../../components/NavSidebar.dom.js'; +import { useNavActions } from '../ducks/nav.std.js'; +import { NavTab, SettingsPage } from '../../types/Nav.std.js'; +import { isChatFoldersEnabled } from '../../util/isChatFoldersEnabled.dom.js'; +import type { ChatFolderId } from '../../types/ChatFolder.std.js'; +import { getSelectedLocation } from '../selectors/nav.preload.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; export const SmartLeftPaneChatFolders = memo( function SmartLeftPaneChatFolders() { @@ -54,7 +52,8 @@ export const SmartLeftPaneChatFolders = memo( [changeLocation, location] ); - if (!isChatFoldersEnabled()) { + const version = window.SignalContext.getVersion(); + if (!isChatFoldersEnabled(version)) { return null; } diff --git a/ts/state/smart/LeftPaneConversationListItemContextMenu.tsx b/ts/state/smart/LeftPaneConversationListItemContextMenu.tsx index 5ec8f855b6..c87d42b06c 100644 --- a/ts/state/smart/LeftPaneConversationListItemContextMenu.tsx +++ b/ts/state/smart/LeftPaneConversationListItemContextMenu.tsx @@ -4,14 +4,14 @@ import type { FC } from 'react'; import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import { getIntl } from '../selectors/user.js'; -import { getConversationByIdSelector } from '../selectors/conversations.js'; -import { LeftPaneConversationListItemContextMenu } from '../../components/leftPane/LeftPaneConversationListItemContextMenu.js'; -import { strictAssert } from '../../util/assert.js'; -import type { RenderConversationListItemContextMenuProps } from '../../components/conversationList/BaseConversationListItem.js'; -import { useConversationsActions } from '../ducks/conversations.js'; -import { getLocalDeleteWarningShown } from '../selectors/items.js'; -import { useItemsActions } from '../ducks/items.js'; +import { getIntl } from '../selectors/user.std.js'; +import { getConversationByIdSelector } from '../selectors/conversations.dom.js'; +import { LeftPaneConversationListItemContextMenu } from '../../components/leftPane/LeftPaneConversationListItemContextMenu.dom.js'; +import { strictAssert } from '../../util/assert.std.js'; +import type { RenderConversationListItemContextMenuProps } from '../../components/conversationList/BaseConversationListItem.dom.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; +import { getLocalDeleteWarningShown } from '../selectors/items.dom.js'; +import { useItemsActions } from '../ducks/items.preload.js'; export const SmartLeftPaneConversationListItemContextMenu: FC = memo(function SmartLeftPaneConversationListItemContextMenu(props) { diff --git a/ts/state/smart/Lightbox.tsx b/ts/state/smart/Lightbox.tsx index e8d00a7f66..2fc46677af 100644 --- a/ts/state/smart/Lightbox.tsx +++ b/ts/state/smart/Lightbox.tsx @@ -3,13 +3,13 @@ import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import { Lightbox } from '../../components/Lightbox.js'; -import { getConversationSelector } from '../selectors/conversations.js'; -import { getIntl } from '../selectors/user.js'; -import { useConversationsActions } from '../ducks/conversations.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; -import { useLightboxActions } from '../ducks/lightbox.js'; -import { useAudioPlayerActions } from '../ducks/audioPlayer.js'; +import { Lightbox } from '../../components/Lightbox.dom.js'; +import { getConversationSelector } from '../selectors/conversations.dom.js'; +import { getIntl } from '../selectors/user.std.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; +import { useLightboxActions } from '../ducks/lightbox.preload.js'; +import { useAudioPlayerActions } from '../ducks/audioPlayer.preload.js'; import { getIsViewOnce, getMedia, @@ -18,7 +18,7 @@ import { getPlaybackDisabled, getSelectedIndex, shouldShowLightbox, -} from '../selectors/lightbox.js'; +} from '../selectors/lightbox.std.js'; export const SmartLightbox = memo(function SmartLightbox() { const i18n = useSelector(getIntl); diff --git a/ts/state/smart/MessageAudio.tsx b/ts/state/smart/MessageAudio.tsx index 23d900640d..ee63d3c0a2 100644 --- a/ts/state/smart/MessageAudio.tsx +++ b/ts/state/smart/MessageAudio.tsx @@ -3,24 +3,24 @@ import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import { MessageAudio } from '../../components/conversation/MessageAudio.js'; -import type { OwnProps as MessageAudioOwnProps } from '../../components/conversation/MessageAudio.js'; -import type { ActiveAudioPlayerStateType } from '../ducks/audioPlayer.js'; +import { MessageAudio } from '../../components/conversation/MessageAudio.dom.js'; +import type { OwnProps as MessageAudioOwnProps } from '../../components/conversation/MessageAudio.dom.js'; +import type { ActiveAudioPlayerStateType } from '../ducks/audioPlayer.preload.js'; import { AudioPlayerContent, useAudioPlayerActions, -} from '../ducks/audioPlayer.js'; +} from '../ducks/audioPlayer.preload.js'; import { selectAudioPlayerActive, selectVoiceNoteAndConsecutive, -} from '../selectors/audioPlayer.js'; -import { useConversationsActions } from '../ducks/conversations.js'; -import { getUserConversationId } from '../selectors/user.js'; -import { createLogger } from '../../logging/log.js'; +} from '../selectors/audioPlayer.preload.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; +import { getUserConversationId } from '../selectors/user.std.js'; +import { createLogger } from '../../logging/log.std.js'; import { getConversationByIdSelector, getSelectedConversationId, -} from '../selectors/conversations.js'; +} from '../selectors/conversations.dom.js'; const log = createLogger('MessageAudio'); diff --git a/ts/state/smart/MessageDetail.tsx b/ts/state/smart/MessageDetail.tsx index 62e720ac42..f5dc30c82c 100644 --- a/ts/state/smart/MessageDetail.tsx +++ b/ts/state/smart/MessageDetail.tsx @@ -4,25 +4,25 @@ import React, { memo, useEffect } from 'react'; import { useSelector } from 'react-redux'; -import type { Props as MessageDetailProps } from '../../components/conversation/MessageDetail.js'; -import { MessageDetail } from '../../components/conversation/MessageDetail.js'; -import { getContactNameColorSelector } from '../selectors/conversations.js'; +import type { Props as MessageDetailProps } from '../../components/conversation/MessageDetail.dom.js'; +import { MessageDetail } from '../../components/conversation/MessageDetail.dom.js'; +import { getContactNameColorSelector } from '../selectors/conversations.dom.js'; import { getIntl, getInteractionMode, getTheme, getPlatform, -} from '../selectors/user.js'; -import { getMessageDetails } from '../selectors/message.js'; -import { getPreferredBadgeSelector } from '../selectors/badges.js'; -import { renderAudioAttachment } from './renderAudioAttachment.js'; -import { useAccountsActions } from '../ducks/accounts.js'; -import { useConversationsActions } from '../ducks/conversations.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; -import { useLightboxActions } from '../ducks/lightbox.js'; -import { useStoriesActions } from '../ducks/stories.js'; +} from '../selectors/user.std.js'; +import { getMessageDetails } from '../selectors/message.preload.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.preload.js'; +import { renderAudioAttachment } from './renderAudioAttachment.preload.js'; +import { useAccountsActions } from '../ducks/accounts.preload.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; +import { useLightboxActions } from '../ducks/lightbox.preload.js'; +import { useStoriesActions } from '../ducks/stories.preload.js'; -export type { Contact } from '../../components/conversation/MessageDetail.js'; +export type { Contact } from '../../components/conversation/MessageDetail.dom.js'; export type OwnProps = Pick< MessageDetailProps, 'contacts' | 'errors' | 'message' | 'receivedAt' diff --git a/ts/state/smart/MessageRequestActionsConfirmation.tsx b/ts/state/smart/MessageRequestActionsConfirmation.tsx index d165aa7871..069f86e048 100644 --- a/ts/state/smart/MessageRequestActionsConfirmation.tsx +++ b/ts/state/smart/MessageRequestActionsConfirmation.tsx @@ -3,18 +3,18 @@ import React, { memo, useCallback, useMemo } from 'react'; import { useSelector } from 'react-redux'; -import { getIntl } from '../selectors/user.js'; -import { getGlobalModalsState } from '../selectors/globalModals.js'; -import { getConversationSelector } from '../selectors/conversations.js'; -import { useConversationsActions } from '../ducks/conversations.js'; +import { getIntl } from '../selectors/user.std.js'; +import { getGlobalModalsState } from '../selectors/globalModals.std.js'; +import { getConversationSelector } from '../selectors/conversations.dom.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; import { MessageRequestActionsConfirmation, MessageRequestState, -} from '../../components/conversation/MessageRequestActionsConfirmation.js'; -import { useContactNameData } from '../../components/conversation/ContactName.js'; -import { getAddedByForOurPendingInvitation } from '../../util/getAddedByForOurPendingInvitation.js'; -import { strictAssert } from '../../util/assert.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; +} from '../../components/conversation/MessageRequestActionsConfirmation.dom.js'; +import { useContactNameData } from '../../components/conversation/ContactName.dom.js'; +import { getAddedByForOurPendingInvitation } from '../../util/getAddedByForOurPendingInvitation.preload.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; export const SmartMessageRequestActionsConfirmation = memo( function SmartMessageRequestActionsConfirmation() { diff --git a/ts/state/smart/MessageSearchResult.tsx b/ts/state/smart/MessageSearchResult.tsx index f378257fc6..b6543d3009 100644 --- a/ts/state/smart/MessageSearchResult.tsx +++ b/ts/state/smart/MessageSearchResult.tsx @@ -2,12 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { MessageSearchResult } from '../../components/conversationList/MessageSearchResult.js'; -import { getPreferredBadgeSelector } from '../selectors/badges.js'; -import { getIntl, getTheme } from '../selectors/user.js'; -import { getMessageSearchResultSelector } from '../selectors/search.js'; -import { createLogger } from '../../logging/log.js'; -import { useConversationsActions } from '../ducks/conversations.js'; +import { MessageSearchResult } from '../../components/conversationList/MessageSearchResult.dom.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.preload.js'; +import { getIntl, getTheme } from '../selectors/user.std.js'; +import { getMessageSearchResultSelector } from '../selectors/search.dom.js'; +import { createLogger } from '../../logging/log.std.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; const log = createLogger('MessageSearchResult'); diff --git a/ts/state/smart/MiniPlayer.tsx b/ts/state/smart/MiniPlayer.tsx index 1b0050918d..96545cd453 100644 --- a/ts/state/smart/MiniPlayer.tsx +++ b/ts/state/smart/MiniPlayer.tsx @@ -3,17 +3,17 @@ import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import { MiniPlayer, PlayerState } from '../../components/MiniPlayer.js'; -import type { Props as DumbProps } from '../../components/MiniPlayer.js'; +import { MiniPlayer, PlayerState } from '../../components/MiniPlayer.dom.js'; +import type { Props as DumbProps } from '../../components/MiniPlayer.dom.js'; import { AudioPlayerContent, useAudioPlayerActions, -} from '../ducks/audioPlayer.js'; +} from '../ducks/audioPlayer.preload.js'; import { selectAudioPlayerActive, selectVoiceNoteTitle, -} from '../selectors/audioPlayer.js'; -import { getIntl } from '../selectors/user.js'; +} from '../selectors/audioPlayer.preload.js'; +import { getIntl } from '../selectors/user.std.js'; type Props = Pick; diff --git a/ts/state/smart/NavTabs.tsx b/ts/state/smart/NavTabs.tsx index d7b19dc6b9..a04d28ba49 100644 --- a/ts/state/smart/NavTabs.tsx +++ b/ts/state/smart/NavTabs.tsx @@ -6,29 +6,29 @@ import React, { memo, useCallback } from 'react'; import type { ReactNode } from 'react'; import { useSelector } from 'react-redux'; -import { NavTabs } from '../../components/NavTabs.js'; -import { getIntl, getTheme, getIsNightly } from '../selectors/user.js'; +import { NavTabs } from '../../components/NavTabs.dom.js'; +import { getIntl, getTheme, getIsNightly } from '../selectors/user.std.js'; import { getAllConversationsUnreadStats, getMe, -} from '../selectors/conversations.js'; -import { getPreferredBadgeSelector } from '../selectors/badges.js'; +} from '../selectors/conversations.dom.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.preload.js'; import { getHasAnyFailedStorySends, getStoriesNotificationCount, -} from '../selectors/stories.js'; +} from '../selectors/stories.preload.js'; import { getProfileMovedModalNeeded, getStoriesEnabled, -} from '../selectors/items.js'; -import { getSelectedNavTab } from '../selectors/nav.js'; -import { useNavActions } from '../ducks/nav.js'; -import { getHasPendingUpdate } from '../selectors/updates.js'; -import { getCallHistoryUnreadCount } from '../selectors/callHistory.js'; -import { Environment } from '../../environment.js'; -import { useItemsActions } from '../ducks/items.js'; +} from '../selectors/items.dom.js'; +import { getSelectedNavTab } from '../selectors/nav.preload.js'; +import { useNavActions } from '../ducks/nav.std.js'; +import { getHasPendingUpdate } from '../selectors/updates.std.js'; +import { getCallHistoryUnreadCount } from '../selectors/callHistory.std.js'; +import { Environment } from '../../environment.std.js'; +import { useItemsActions } from '../ducks/items.preload.js'; -import type { Location } from '../../types/Nav.js'; +import type { Location } from '../../types/Nav.std.js'; export type SmartNavTabsProps = Readonly<{ navTabsCollapsed: boolean; diff --git a/ts/state/smart/NetworkStatus.tsx b/ts/state/smart/NetworkStatus.tsx index c7945da96d..3d42bb2af5 100644 --- a/ts/state/smart/NetworkStatus.tsx +++ b/ts/state/smart/NetworkStatus.tsx @@ -2,15 +2,15 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { DialogNetworkStatus } from '../../components/DialogNetworkStatus.js'; -import { getIntl } from '../selectors/user.js'; -import type { WidthBreakpoint } from '../../components/_util.js'; +import { DialogNetworkStatus } from '../../components/DialogNetworkStatus.dom.js'; +import { getIntl } from '../selectors/user.std.js'; +import type { WidthBreakpoint } from '../../components/_util.std.js'; import { getNetworkIsOnline, getNetworkIsOutage, getNetworkSocketStatus, -} from '../selectors/network.js'; -import { useUserActions } from '../ducks/user.js'; +} from '../selectors/network.preload.js'; +import { useUserActions } from '../ducks/user.preload.js'; type SmartNetworkStatusProps = Readonly<{ containerWidthBreakpoint: WidthBreakpoint; diff --git a/ts/state/smart/NotePreviewModal.tsx b/ts/state/smart/NotePreviewModal.tsx index 11a2664b1b..4d503a949e 100644 --- a/ts/state/smart/NotePreviewModal.tsx +++ b/ts/state/smart/NotePreviewModal.tsx @@ -3,12 +3,12 @@ import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import { NotePreviewModal } from '../../components/NotePreviewModal.js'; -import { strictAssert } from '../../util/assert.js'; -import { getConversationSelector } from '../selectors/conversations.js'; -import { getNotePreviewModalProps } from '../selectors/globalModals.js'; -import { getIntl } from '../selectors/user.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; +import { NotePreviewModal } from '../../components/NotePreviewModal.dom.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { getConversationSelector } from '../selectors/conversations.dom.js'; +import { getNotePreviewModalProps } from '../selectors/globalModals.std.js'; +import { getIntl } from '../selectors/user.std.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; export const SmartNotePreviewModal = memo(function SmartNotePreviewModal() { const i18n = useSelector(getIntl); diff --git a/ts/state/smart/NotificationProfilesMenu.tsx b/ts/state/smart/NotificationProfilesMenu.tsx index 81108e7ef2..007370012f 100644 --- a/ts/state/smart/NotificationProfilesMenu.tsx +++ b/ts/state/smart/NotificationProfilesMenu.tsx @@ -4,17 +4,17 @@ import React from 'react'; import { useSelector } from 'react-redux'; -import { getIntl } from '../selectors/user.js'; -import { NotificationProfilesMenu } from '../../components/NotificationProfilesMenu.js'; -import { useNotificationProfilesActions } from '../ducks/notificationProfiles.js'; +import { getIntl } from '../selectors/user.std.js'; +import { NotificationProfilesMenu } from '../../components/NotificationProfilesMenu.dom.js'; +import { useNotificationProfilesActions } from '../ducks/notificationProfiles.preload.js'; import { getActiveProfile, getLoading, getOverride, getProfiles, -} from '../selectors/notificationProfiles.js'; -import { useNavActions } from '../ducks/nav.js'; -import { NavTab, SettingsPage } from '../../types/Nav.js'; +} from '../selectors/notificationProfiles.dom.js'; +import { useNavActions } from '../ducks/nav.std.js'; +import { NavTab, SettingsPage } from '../../types/Nav.std.js'; export function SmartNotificationProfilesMenu(): JSX.Element { const i18n = useSelector(getIntl); diff --git a/ts/state/smart/PendingInvites.tsx b/ts/state/smart/PendingInvites.tsx index f507e3776b..0be80022bd 100644 --- a/ts/state/smart/PendingInvites.tsx +++ b/ts/state/smart/PendingInvites.tsx @@ -2,17 +2,17 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { PendingInvites } from '../../components/conversation/conversation-details/PendingInvites.js'; -import { getIntl, getTheme } from '../selectors/user.js'; -import { getPreferredBadgeSelector } from '../selectors/badges.js'; +import { PendingInvites } from '../../components/conversation/conversation-details/PendingInvites.dom.js'; +import { getIntl, getTheme } from '../selectors/user.std.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.preload.js'; import { getConversationByIdSelector, getConversationByServiceIdSelector, -} from '../selectors/conversations.js'; -import { getGroupMemberships } from '../../util/getGroupMemberships.js'; -import { assertDev } from '../../util/assert.js'; -import type { AciString } from '../../types/ServiceId.js'; -import { useConversationsActions } from '../ducks/conversations.js'; +} from '../selectors/conversations.dom.js'; +import { getGroupMemberships } from '../../util/getGroupMemberships.dom.js'; +import { assertDev } from '../../util/assert.std.js'; +import type { AciString } from '../../types/ServiceId.std.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; export type SmartPendingInvitesProps = { conversationId: string; diff --git a/ts/state/smart/Preferences.tsx b/ts/state/smart/Preferences.tsx index ef3f17c18b..15d96b3891 100644 --- a/ts/state/smart/Preferences.tsx +++ b/ts/state/smart/Preferences.tsx @@ -7,111 +7,115 @@ import { useSelector } from 'react-redux'; import type { AudioDevice } from '@signalapp/ringrtc'; import type { MutableRefObject } from 'react'; -import { useItemsActions } from '../ducks/items.js'; -import { useConversationsActions } from '../ducks/conversations.js'; +import { useItemsActions } from '../ducks/items.preload.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; import { getConversationsWithCustomColorSelector, getMe, -} from '../selectors/conversations.js'; +} from '../selectors/conversations.dom.js'; import { getCustomColors, getItems, getNavTabsCollapsed, getPreferredLeftPaneWidth, -} from '../selectors/items.js'; +} from '../selectors/items.dom.js'; import { itemStorage, DEFAULT_AUTO_DOWNLOAD_ATTACHMENT, -} from '../../textsecure/Storage.js'; +} from '../../textsecure/Storage.preload.js'; import { onHasStoriesDisabledChange, setPhoneNumberDiscoverability, -} from '../../textsecure/WebAPI.js'; -import { DEFAULT_CONVERSATION_COLOR } from '../../types/Colors.js'; -import { isBackupFeatureEnabled } from '../../util/isBackupEnabled.js'; -import { saveAttachmentToDisk } from '../../util/migrations.js'; -import { format } from '../../types/PhoneNumber.js'; +} from '../../textsecure/WebAPI.preload.js'; +import { DEFAULT_CONVERSATION_COLOR } from '../../types/Colors.std.js'; +import { isBackupFeatureEnabled } from '../../util/isBackupEnabled.preload.js'; +import { isChatFoldersEnabled } from '../../util/isChatFoldersEnabled.dom.js'; +import { saveAttachmentToDisk } from '../../util/migrations.preload.js'; +import { format } from '../../types/PhoneNumber.std.js'; import { getIntl, getTheme, getUserDeviceId, getUserNumber, -} from '../selectors/user.js'; -import { EmojiSkinTone } from '../../components/fun/data/emojis.js'; -import { renderClearingDataView } from '../../shims/renderClearingDataView.js'; -import OS from '../../util/os/osPreload.js'; -import { themeChanged } from '../../shims/themeChanged.js'; -import * as Settings from '../../types/Settings.js'; -import * as universalExpireTimerUtil from '../../util/universalExpireTimer.js'; +} from '../selectors/user.std.js'; +import { EmojiSkinTone } from '../../components/fun/data/emojis.std.js'; +import { renderClearingDataView } from '../../shims/renderClearingDataView.preload.js'; +import OS from '../../util/os/osPreload.preload.js'; +import { themeChanged } from '../../shims/themeChanged.dom.js'; +import * as Settings from '../../types/Settings.std.js'; +import * as universalExpireTimerUtil from '../../util/universalExpireTimer.preload.js'; import { parseSystemTraySetting, shouldMinimizeToSystemTray, SystemTraySetting, -} from '../../types/SystemTraySetting.js'; -import { calling } from '../../services/calling.js'; -import { drop } from '../../util/drop.js'; -import { assertDev } from '../../util/assert.js'; -import { backupsService } from '../../services/backups/index.js'; -import { DurationInSeconds } from '../../util/durations/duration-in-seconds.js'; -import { PhoneNumberDiscoverability } from '../../util/phoneNumberDiscoverability.js'; -import { PhoneNumberSharingMode } from '../../types/PhoneNumberSharingMode.js'; -import { writeProfile } from '../../services/writeProfile.js'; -import { getConversation } from '../../util/getConversation.js'; -import { waitForEvent } from '../../shims/events.js'; -import { DAY, MINUTE } from '../../util/durations/index.js'; -import { sendSyncRequests } from '../../textsecure/syncRequests.js'; -import { SmartUpdateDialog } from './UpdateDialog.js'; -import { Preferences } from '../../components/Preferences.js'; -import { useUpdatesActions } from '../ducks/updates.js'; -import { getUpdateDialogType } from '../selectors/updates.js'; -import { getHasAnyFailedStorySends } from '../selectors/stories.js'; +} from '../../types/SystemTraySetting.std.js'; +import { calling } from '../../services/calling.preload.js'; +import { drop } from '../../util/drop.std.js'; +import { assertDev } from '../../util/assert.std.js'; +import { backupsService } from '../../services/backups/index.preload.js'; +import { DurationInSeconds } from '../../util/durations/duration-in-seconds.std.js'; +import { PhoneNumberDiscoverability } from '../../util/phoneNumberDiscoverability.std.js'; +import { PhoneNumberSharingMode } from '../../types/PhoneNumberSharingMode.std.js'; +import { writeProfile } from '../../services/writeProfile.preload.js'; +import { getConversation } from '../../util/getConversation.preload.js'; +import { waitForEvent } from '../../shims/events.dom.js'; +import { DAY, MINUTE } from '../../util/durations/index.std.js'; +import { sendSyncRequests } from '../../textsecure/syncRequests.preload.js'; +import { SmartUpdateDialog } from './UpdateDialog.preload.js'; +import { Preferences } from '../../components/Preferences.dom.js'; +import { useUpdatesActions } from '../ducks/updates.preload.js'; +import { getUpdateDialogType } from '../selectors/updates.std.js'; +import { getHasAnyFailedStorySends } from '../selectors/stories.preload.js'; import { getOtherTabsUnreadStats, getSelectedLocation, -} from '../selectors/nav.js'; -import { getPreferredBadgeSelector } from '../selectors/badges.js'; -import { SmartProfileEditor } from './ProfileEditor.js'; -import { useNavActions } from '../ducks/nav.js'; -import type { SettingsLocation } from '../../types/Nav.js'; -import { NavTab } from '../../types/Nav.js'; -import { SmartToastManager } from './ToastManager.js'; -import { useToastActions } from '../ducks/toast.js'; -import { DataReader } from '../../sql/Client.js'; -import { deleteAllMyStories } from '../../util/deleteAllMyStories.js'; -import { isLocalBackupsEnabled } from '../../util/isLocalBackupsEnabled.js'; -import { SmartPreferencesDonations } from './PreferencesDonations.js'; -import { useDonationsActions } from '../ducks/donations.js'; -import { generateDonationReceiptBlob } from '../../util/generateDonationReceipt.js'; +} from '../selectors/nav.preload.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.preload.js'; +import { SmartProfileEditor } from './ProfileEditor.preload.js'; +import { useNavActions } from '../ducks/nav.std.js'; +import type { SettingsLocation } from '../../types/Nav.std.js'; +import { NavTab } from '../../types/Nav.std.js'; +import { SmartToastManager } from './ToastManager.preload.js'; +import { useToastActions } from '../ducks/toast.preload.js'; +import { DataReader } from '../../sql/Client.preload.js'; +import { deleteAllMyStories } from '../../util/deleteAllMyStories.preload.js'; +import { isLocalBackupsEnabled } from '../../util/isLocalBackupsEnabled.dom.js'; +import { SmartPreferencesDonations } from './PreferencesDonations.preload.js'; +import { useDonationsActions } from '../ducks/donations.preload.js'; +import { generateDonationReceiptBlob } from '../../util/generateDonationReceipt.dom.js'; -import type { StorageAccessType, ZoomFactorType } from '../../types/Storage.js'; -import type { ThemeType } from '../../util/preload.js'; -import type { WidthBreakpoint } from '../../components/_util.js'; -import { DialogType } from '../../types/Dialogs.js'; -import { promptOSAuth } from '../../util/promptOSAuth.js'; -import type { StateType } from '../reducer.js'; +import type { + StorageAccessType, + ZoomFactorType, +} from '../../types/Storage.d.ts'; +import type { ThemeType } from '../../util/preload.preload.js'; +import type { WidthBreakpoint } from '../../components/_util.std.js'; +import { DialogType } from '../../types/Dialogs.std.js'; +import { promptOSAuth } from '../../util/promptOSAuth.preload.js'; +import type { StateType } from '../reducer.preload.js'; import { pauseBackupMediaDownload, resumeBackupMediaDownload, cancelBackupMediaDownload, -} from '../../util/backupMediaDownload.js'; -import { DonationsErrorBoundary } from '../../components/DonationsErrorBoundary.js'; -import type { SmartPreferencesChatFoldersPageProps } from './PreferencesChatFoldersPage.js'; -import { SmartPreferencesChatFoldersPage } from './PreferencesChatFoldersPage.js'; -import type { SmartPreferencesEditChatFolderPageProps } from './PreferencesEditChatFolderPage.js'; -import { SmartPreferencesEditChatFolderPage } from './PreferencesEditChatFolderPage.js'; -import { AxoProvider } from '../../axo/AxoProvider.js'; +} from '../../util/backupMediaDownload.preload.js'; +import { DonationsErrorBoundary } from '../../components/DonationsErrorBoundary.dom.js'; +import type { SmartPreferencesChatFoldersPageProps } from './PreferencesChatFoldersPage.preload.js'; +import { SmartPreferencesChatFoldersPage } from './PreferencesChatFoldersPage.preload.js'; +import type { SmartPreferencesEditChatFolderPageProps } from './PreferencesEditChatFolderPage.preload.js'; +import { SmartPreferencesEditChatFolderPage } from './PreferencesEditChatFolderPage.preload.js'; +import { AxoProvider } from '../../axo/AxoProvider.dom.js'; import { getCurrentChatFoldersCount, getHasAnyCurrentCustomChatFolders, -} from '../selectors/chatFolders.js'; +} from '../selectors/chatFolders.std.js'; import { SmartNotificationProfilesCreateFlow, SmartNotificationProfilesHome, -} from './PreferencesNotificationProfiles.js'; -import type { ExternalProps as SmartNotificationProfilesProps } from './PreferencesNotificationProfiles.js'; -import { getProfiles } from '../selectors/notificationProfiles.js'; -import { backupLevelFromNumber } from '../../services/backups/types.js'; -import { getMessageQueueTime } from '../../util/getMessageQueueTime.js'; +} from './PreferencesNotificationProfiles.preload.js'; +import type { ExternalProps as SmartNotificationProfilesProps } from './PreferencesNotificationProfiles.preload.js'; +import { getProfiles } from '../selectors/notificationProfiles.dom.js'; +import { backupLevelFromNumber } from '../../services/backups/types.std.js'; +import { getMessageQueueTime } from '../../util/getMessageQueueTime.dom.js'; const DEFAULT_NOTIFICATION_SETTING = 'message'; @@ -788,6 +792,7 @@ export function SmartPreferences(): JSX.Element | null { backupLocalBackupsEnabled={backupLocalBackupsEnabled} badge={badge} blockedCount={blockedCount} + chatFoldersFeatureEnabled={isChatFoldersEnabled(version)} currentChatFoldersCount={currentChatFoldersCount} cloudBackupStatus={cloudBackupStatus} customColors={customColors} diff --git a/ts/state/smart/PreferencesChatFoldersPage.tsx b/ts/state/smart/PreferencesChatFoldersPage.tsx index 6340820189..cf86cc55a2 100644 --- a/ts/state/smart/PreferencesChatFoldersPage.tsx +++ b/ts/state/smart/PreferencesChatFoldersPage.tsx @@ -2,14 +2,14 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; import { useSelector } from 'react-redux'; -import type { PreferencesChatFoldersPageProps } from '../../components/preferences/chatFolders/PreferencesChatFoldersPage.js'; -import { PreferencesChatFoldersPage } from '../../components/preferences/chatFolders/PreferencesChatFoldersPage.js'; -import { getIntl } from '../selectors/user.js'; -import { getCurrentChatFolders } from '../selectors/chatFolders.js'; -import type { ChatFolderId } from '../../types/ChatFolder.js'; -import { useChatFolderActions } from '../ducks/chatFolders.js'; -import type { Location } from '../../types/Nav.js'; -import { useNavActions } from '../ducks/nav.js'; +import type { PreferencesChatFoldersPageProps } from '../../components/preferences/chatFolders/PreferencesChatFoldersPage.dom.js'; +import { PreferencesChatFoldersPage } from '../../components/preferences/chatFolders/PreferencesChatFoldersPage.dom.js'; +import { getIntl } from '../selectors/user.std.js'; +import { getCurrentChatFolders } from '../selectors/chatFolders.std.js'; +import type { ChatFolderId } from '../../types/ChatFolder.std.js'; +import { useChatFolderActions } from '../ducks/chatFolders.preload.js'; +import type { Location } from '../../types/Nav.std.js'; +import { useNavActions } from '../ducks/nav.std.js'; export type SmartPreferencesChatFoldersPageProps = Readonly<{ settingsPaneRef: PreferencesChatFoldersPageProps['settingsPaneRef']; diff --git a/ts/state/smart/PreferencesDonations.tsx b/ts/state/smart/PreferencesDonations.tsx index 397a9b5223..3e0529b478 100644 --- a/ts/state/smart/PreferencesDonations.tsx +++ b/ts/state/smart/PreferencesDonations.tsx @@ -6,35 +6,35 @@ import { useSelector } from 'react-redux'; import type { MutableRefObject } from 'react'; -import { getIntl, getTheme, getUserNumber } from '../selectors/user.js'; -import { getMe } from '../selectors/conversations.js'; -import { PreferencesDonations } from '../../components/PreferencesDonations.js'; -import type { SettingsLocation } from '../../types/Nav.js'; -import { useDonationsActions } from '../ducks/donations.js'; -import type { StateType } from '../reducer.js'; -import { useConversationsActions } from '../ducks/conversations.js'; -import { generateDonationReceiptBlob } from '../../util/generateDonationReceipt.js'; -import { useToastActions } from '../ducks/toast.js'; +import { getIntl, getTheme, getUserNumber } from '../selectors/user.std.js'; +import { getMe } from '../selectors/conversations.dom.js'; +import { PreferencesDonations } from '../../components/PreferencesDonations.dom.js'; +import type { SettingsLocation } from '../../types/Nav.std.js'; +import { useDonationsActions } from '../ducks/donations.preload.js'; +import type { StateType } from '../reducer.preload.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; +import { generateDonationReceiptBlob } from '../../util/generateDonationReceipt.dom.js'; +import { useToastActions } from '../ducks/toast.preload.js'; import { getDonationHumanAmounts, getCachedSubscriptionConfiguration, -} from '../../util/subscriptionConfiguration.js'; -import { drop } from '../../util/drop.js'; -import { saveAttachmentToDisk } from '../../util/migrations.js'; -import type { OneTimeDonationHumanAmounts } from '../../types/Donations.js'; +} from '../../util/subscriptionConfiguration.preload.js'; +import { drop } from '../../util/drop.std.js'; +import { saveAttachmentToDisk } from '../../util/migrations.preload.js'; +import type { OneTimeDonationHumanAmounts } from '../../types/Donations.std.js'; import { ONE_TIME_DONATION_CONFIG_ID, BOOST_ID, -} from '../../types/Donations.js'; -import { phoneNumberToCurrencyCode } from '../../services/donations.js'; +} from '../../types/Donations.std.js'; +import { phoneNumberToCurrencyCode } from '../../services/donations.preload.js'; import { getPreferredBadgeSelector, getBadgesById, -} from '../selectors/badges.js'; -import { parseBoostBadgeListFromServer } from '../../badges/parseBadgesFromServer.js'; -import { createLogger } from '../../logging/log.js'; -import { useBadgesActions } from '../ducks/badges.js'; -import { getNetworkIsOnline } from '../selectors/network.js'; +} from '../selectors/badges.preload.js'; +import { parseBoostBadgeListFromServer } from '../../badges/parseBadgesFromServer.std.js'; +import { createLogger } from '../../logging/log.std.js'; +import { useBadgesActions } from '../ducks/badges.preload.js'; +import { getNetworkIsOnline } from '../selectors/network.preload.js'; const log = createLogger('SmartPreferencesDonations'); diff --git a/ts/state/smart/PreferencesEditChatFolderPage.tsx b/ts/state/smart/PreferencesEditChatFolderPage.tsx index 6470495f87..0b132d5a19 100644 --- a/ts/state/smart/PreferencesEditChatFolderPage.tsx +++ b/ts/state/smart/PreferencesEditChatFolderPage.tsx @@ -2,20 +2,20 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { useMemo } from 'react'; import { useSelector } from 'react-redux'; -import type { PreferencesEditChatFolderPageProps } from '../../components/preferences/chatFolders/PreferencesEditChatFoldersPage.js'; -import { PreferencesEditChatFolderPage } from '../../components/preferences/chatFolders/PreferencesEditChatFoldersPage.js'; -import { getIntl, getTheme } from '../selectors/user.js'; -import { CHAT_FOLDER_DEFAULTS } from '../../types/ChatFolder.js'; +import type { PreferencesEditChatFolderPageProps } from '../../components/preferences/chatFolders/PreferencesEditChatFoldersPage.dom.js'; +import { PreferencesEditChatFolderPage } from '../../components/preferences/chatFolders/PreferencesEditChatFoldersPage.dom.js'; +import { getIntl, getTheme } from '../selectors/user.std.js'; +import { CHAT_FOLDER_DEFAULTS } from '../../types/ChatFolder.std.js'; import { getAllComposableConversations, getConversationSelector, -} from '../selectors/conversations.js'; -import { getPreferredBadgeSelector } from '../selectors/badges.js'; -import { useChatFolderActions } from '../ducks/chatFolders.js'; -import { getCurrentChatFolders } from '../selectors/chatFolders.js'; -import { useNavActions } from '../ducks/nav.js'; -import type { Location } from '../../types/Nav.js'; -import { CurrentChatFolders } from '../../types/CurrentChatFolders.js'; +} from '../selectors/conversations.dom.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.preload.js'; +import { useChatFolderActions } from '../ducks/chatFolders.preload.js'; +import { getCurrentChatFolders } from '../selectors/chatFolders.std.js'; +import { useNavActions } from '../ducks/nav.std.js'; +import type { Location } from '../../types/Nav.std.js'; +import { CurrentChatFolders } from '../../types/CurrentChatFolders.std.js'; export type SmartPreferencesEditChatFolderPageProps = Readonly<{ previousLocation: Location | null; diff --git a/ts/state/smart/PreferencesNotificationProfiles.tsx b/ts/state/smart/PreferencesNotificationProfiles.tsx index 35f156cd6b..d900d22226 100644 --- a/ts/state/smart/PreferencesNotificationProfiles.tsx +++ b/ts/state/smart/PreferencesNotificationProfiles.tsx @@ -5,25 +5,25 @@ import React, { memo } from 'react'; import type { MutableRefObject } from 'react'; import { useSelector } from 'react-redux'; -import { getIntl, getTheme } from '../selectors/user.js'; +import { getIntl, getTheme } from '../selectors/user.std.js'; import { NotificationProfilesCreateFlow, NotificationProfilesHome, -} from '../../components/PreferencesNotificationProfiles.js'; +} from '../../components/PreferencesNotificationProfiles.dom.js'; import { getAllComposableConversations, getConversationSelector, -} from '../selectors/conversations.js'; -import { getPreferredBadgeSelector } from '../selectors/badges.js'; -import { useNotificationProfilesActions } from '../ducks/notificationProfiles.js'; +} from '../selectors/conversations.dom.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.preload.js'; +import { useNotificationProfilesActions } from '../ducks/notificationProfiles.preload.js'; import { getActiveProfile, getLoading, getProfiles, -} from '../selectors/notificationProfiles.js'; -import type { SettingsLocation } from '../../types/Nav.js'; -import { getItems } from '../selectors/items.js'; -import { useItemsActions } from '../ducks/items.js'; +} from '../selectors/notificationProfiles.dom.js'; +import type { SettingsLocation } from '../../types/Nav.std.js'; +import { getItems } from '../selectors/items.dom.js'; +import { useItemsActions } from '../ducks/items.preload.js'; export type ExternalProps = { contentsRef: MutableRefObject; diff --git a/ts/state/smart/ProfileEditor.tsx b/ts/state/smart/ProfileEditor.tsx index d135b9a5ed..66a4536c12 100644 --- a/ts/state/smart/ProfileEditor.tsx +++ b/ts/state/smart/ProfileEditor.tsx @@ -5,11 +5,14 @@ import { useSelector } from 'react-redux'; import type { MutableRefObject } from 'react'; -import { ProfileEditor } from '../../components/ProfileEditor.js'; -import { useConversationsActions } from '../ducks/conversations.js'; -import { useToastActions } from '../ducks/toast.js'; -import { useUsernameActions } from '../ducks/username.js'; -import { getMe, getProfileUpdateError } from '../selectors/conversations.js'; +import { ProfileEditor } from '../../components/ProfileEditor.dom.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; +import { useToastActions } from '../ducks/toast.preload.js'; +import { useUsernameActions } from '../ducks/username.preload.js'; +import { + getMe, + getProfileUpdateError, +} from '../selectors/conversations.dom.js'; import { getEmojiSkinToneDefault, getHasCompletedUsernameLinkOnboarding, @@ -17,20 +20,20 @@ import { getUsernameLink, getUsernameLinkColor, getUsernameLinkCorrupted, -} from '../selectors/items.js'; -import { getIntl } from '../selectors/user.js'; +} from '../selectors/items.dom.js'; +import { getIntl } from '../selectors/user.std.js'; import { getUsernameEditState, getUsernameLinkState, -} from '../selectors/username.js'; -import { SmartUsernameEditor } from './UsernameEditor.js'; -import { getSelectedLocation } from '../selectors/nav.js'; -import { useNavActions } from '../ducks/nav.js'; -import { NavTab, SettingsPage } from '../../types/Nav.js'; +} from '../selectors/username.std.js'; +import { SmartUsernameEditor } from './UsernameEditor.preload.js'; +import { getSelectedLocation } from '../selectors/nav.preload.js'; +import { useNavActions } from '../ducks/nav.std.js'; +import { NavTab, SettingsPage } from '../../types/Nav.std.js'; -import type { ProfileEditorPage } from '../../types/Nav.js'; -import type { SmartUsernameEditorProps } from './UsernameEditor.js'; -import { ConfirmationDialog } from '../../components/ConfirmationDialog.js'; +import type { ProfileEditorPage } from '../../types/Nav.std.js'; +import type { SmartUsernameEditorProps } from './UsernameEditor.preload.js'; +import { ConfirmationDialog } from '../../components/ConfirmationDialog.dom.js'; function renderUsernameEditor(props: SmartUsernameEditorProps): JSX.Element { return ; diff --git a/ts/state/smart/ProfileNameWarningModal.tsx b/ts/state/smart/ProfileNameWarningModal.tsx index 32de04d467..0ad702cef5 100644 --- a/ts/state/smart/ProfileNameWarningModal.tsx +++ b/ts/state/smart/ProfileNameWarningModal.tsx @@ -3,10 +3,10 @@ import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { getIntl } from '../selectors/user.js'; -import { getGlobalModalsState } from '../selectors/globalModals.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; -import { ProfileNameWarningModal } from '../../components/conversation/ProfileNameWarningModal.js'; +import { getIntl } from '../selectors/user.std.js'; +import { getGlobalModalsState } from '../selectors/globalModals.std.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; +import { ProfileNameWarningModal } from '../../components/conversation/ProfileNameWarningModal.dom.js'; export const SmartProfileNameWarningModal = memo( function SmartProfileNameWarningModal() { diff --git a/ts/state/smart/ReactionPicker.tsx b/ts/state/smart/ReactionPicker.tsx index 39accde6c3..bf97ebb7a4 100644 --- a/ts/state/smart/ReactionPicker.tsx +++ b/ts/state/smart/ReactionPicker.tsx @@ -4,10 +4,10 @@ import type { Ref } from 'react'; import React, { forwardRef, memo } from 'react'; import { useSelector } from 'react-redux'; -import { getIntl } from '../selectors/user.js'; -import { getPreferredReactionEmoji } from '../selectors/items.js'; -import type { Props as InternalProps } from '../../components/conversation/ReactionPicker.js'; -import { ReactionPicker } from '../../components/conversation/ReactionPicker.js'; +import { getIntl } from '../selectors/user.std.js'; +import { getPreferredReactionEmoji } from '../selectors/items.dom.js'; +import type { Props as InternalProps } from '../../components/conversation/ReactionPicker.dom.js'; +import { ReactionPicker } from '../../components/conversation/ReactionPicker.dom.js'; type ExternalProps = Omit< InternalProps, diff --git a/ts/state/smart/RelinkDialog.tsx b/ts/state/smart/RelinkDialog.tsx index 0f02669ccd..f116bc9646 100644 --- a/ts/state/smart/RelinkDialog.tsx +++ b/ts/state/smart/RelinkDialog.tsx @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { DialogRelink } from '../../components/DialogRelink.js'; -import { getIntl } from '../selectors/user.js'; -import type { WidthBreakpoint } from '../../components/_util.js'; -import { useNetworkActions } from '../ducks/network.js'; +import { DialogRelink } from '../../components/DialogRelink.dom.js'; +import { getIntl } from '../selectors/user.std.js'; +import type { WidthBreakpoint } from '../../components/_util.std.js'; +import { useNetworkActions } from '../ducks/network.dom.js'; type SmartRelinkDialogProps = Readonly<{ containerWidthBreakpoint: WidthBreakpoint; diff --git a/ts/state/smart/SafetyNumberModal.tsx b/ts/state/smart/SafetyNumberModal.tsx index 865c32a94b..a2eb824b69 100644 --- a/ts/state/smart/SafetyNumberModal.tsx +++ b/ts/state/smart/SafetyNumberModal.tsx @@ -2,12 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { SafetyNumberModal } from '../../components/SafetyNumberModal.js'; -import { getContactSafetyNumberSelector } from '../selectors/safetyNumber.js'; -import { getConversationSelector } from '../selectors/conversations.js'; -import { getIntl } from '../selectors/user.js'; -import { useSafetyNumberActions } from '../ducks/safetyNumber.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; +import { SafetyNumberModal } from '../../components/SafetyNumberModal.dom.js'; +import { getContactSafetyNumberSelector } from '../selectors/safetyNumber.std.js'; +import { getConversationSelector } from '../selectors/conversations.dom.js'; +import { getIntl } from '../selectors/user.std.js'; +import { useSafetyNumberActions } from '../ducks/safetyNumber.preload.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; export type SmartSafetyNumberModalProps = { contactID: string; diff --git a/ts/state/smart/SafetyNumberViewer.tsx b/ts/state/smart/SafetyNumberViewer.tsx index 9a2f4738d4..a151c8ce81 100644 --- a/ts/state/smart/SafetyNumberViewer.tsx +++ b/ts/state/smart/SafetyNumberViewer.tsx @@ -3,12 +3,12 @@ import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { SafetyNumberViewer } from '../../components/SafetyNumberViewer.js'; -import type { SafetyNumberProps } from '../../components/SafetyNumberChangeDialog.js'; -import { getContactSafetyNumberSelector } from '../selectors/safetyNumber.js'; -import { getConversationSelector } from '../selectors/conversations.js'; -import { getIntl } from '../selectors/user.js'; -import { useSafetyNumberActions } from '../ducks/safetyNumber.js'; +import { SafetyNumberViewer } from '../../components/SafetyNumberViewer.dom.js'; +import type { SafetyNumberProps } from '../../components/SafetyNumberChangeDialog.dom.js'; +import { getContactSafetyNumberSelector } from '../selectors/safetyNumber.std.js'; +import { getConversationSelector } from '../selectors/conversations.dom.js'; +import { getIntl } from '../selectors/user.std.js'; +import { useSafetyNumberActions } from '../ducks/safetyNumber.preload.js'; export const SmartSafetyNumberViewer = memo(function SmartSafetyNumberViewer({ contactID, diff --git a/ts/state/smart/SendAnywayDialog.tsx b/ts/state/smart/SendAnywayDialog.tsx index f28a70661c..5cff9f288c 100644 --- a/ts/state/smart/SendAnywayDialog.tsx +++ b/ts/state/smart/SendAnywayDialog.tsx @@ -3,18 +3,18 @@ import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import { SafetyNumberChangeSource } from '../../types/SafetyNumberChangeSource.js'; -import * as SingleServePromise from '../../services/singleServePromise.js'; -import type { SafetyNumberProps } from '../../components/SafetyNumberChangeDialog.js'; -import { SafetyNumberChangeDialog } from '../../components/SafetyNumberChangeDialog.js'; -import { SmartSafetyNumberViewer } from './SafetyNumberViewer.js'; -import { getByDistributionListConversationsStoppingSend } from '../selectors/conversations-extra.js'; -import { getIntl, getTheme } from '../selectors/user.js'; -import { getPreferredBadgeSelector } from '../selectors/badges.js'; -import { useConversationsActions } from '../ducks/conversations.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; -import { useStoryDistributionListsActions } from '../ducks/storyDistributionLists.js'; -import { getSafetyNumberChangedBlockingData } from '../selectors/globalModals.js'; +import { SafetyNumberChangeSource } from '../../types/SafetyNumberChangeSource.std.js'; +import * as SingleServePromise from '../../services/singleServePromise.std.js'; +import type { SafetyNumberProps } from '../../components/SafetyNumberChangeDialog.dom.js'; +import { SafetyNumberChangeDialog } from '../../components/SafetyNumberChangeDialog.dom.js'; +import { SmartSafetyNumberViewer } from './SafetyNumberViewer.preload.js'; +import { getByDistributionListConversationsStoppingSend } from '../selectors/conversations-extra.preload.js'; +import { getIntl, getTheme } from '../selectors/user.std.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.preload.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; +import { useStoryDistributionListsActions } from '../ducks/storyDistributionLists.preload.js'; +import { getSafetyNumberChangedBlockingData } from '../selectors/globalModals.std.js'; function renderSafetyNumber({ contactID, onClose }: SafetyNumberProps) { return ; diff --git a/ts/state/smart/ShortcutGuideModal.tsx b/ts/state/smart/ShortcutGuideModal.tsx index d6ab62618d..5844c362fd 100644 --- a/ts/state/smart/ShortcutGuideModal.tsx +++ b/ts/state/smart/ShortcutGuideModal.tsx @@ -3,9 +3,9 @@ import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { ShortcutGuideModal } from '../../components/ShortcutGuideModal.js'; -import { getIntl, getPlatform } from '../selectors/user.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; +import { ShortcutGuideModal } from '../../components/ShortcutGuideModal.dom.js'; +import { getIntl, getPlatform } from '../selectors/user.std.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; export const SmartShortcutGuideModal = memo(function SmartShortcutGuideModal() { const i18n = useSelector(getIntl); diff --git a/ts/state/smart/StickerManager.tsx b/ts/state/smart/StickerManager.tsx index e0fb6136f4..7c45fca6e7 100644 --- a/ts/state/smart/StickerManager.tsx +++ b/ts/state/smart/StickerManager.tsx @@ -3,16 +3,16 @@ import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { StickerManager } from '../../components/stickers/StickerManager.js'; -import { getIntl } from '../selectors/user.js'; +import { StickerManager } from '../../components/stickers/StickerManager.dom.js'; +import { getIntl } from '../selectors/user.std.js'; import { getBlessedStickerPacks, getInstalledStickerPacks, getKnownStickerPacks, getReceivedStickerPacks, -} from '../selectors/stickers.js'; -import { useStickersActions } from '../ducks/stickers.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; +} from '../selectors/stickers.std.js'; +import { useStickersActions } from '../ducks/stickers.preload.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; export const SmartStickerManager = memo(function SmartStickerManager() { const i18n = useSelector(getIntl); diff --git a/ts/state/smart/StickerPreviewModal.tsx b/ts/state/smart/StickerPreviewModal.tsx index 540655d6df..83c207077d 100644 --- a/ts/state/smart/StickerPreviewModal.tsx +++ b/ts/state/smart/StickerPreviewModal.tsx @@ -3,15 +3,15 @@ import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { StickerPreviewModal } from '../../components/stickers/StickerPreviewModal.js'; -import { getIntl } from '../selectors/user.js'; +import { StickerPreviewModal } from '../../components/stickers/StickerPreviewModal.dom.js'; +import { getIntl } from '../selectors/user.std.js'; import { getBlessedPacks, getPacks, translatePackFromDB, -} from '../selectors/stickers.js'; -import { useStickersActions } from '../ducks/stickers.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; +} from '../selectors/stickers.std.js'; +import { useStickersActions } from '../ducks/stickers.preload.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; export type ExternalProps = { packId: string; diff --git a/ts/state/smart/StoriesSettingsModal.tsx b/ts/state/smart/StoriesSettingsModal.tsx index 4771f0508f..1d7b169b94 100644 --- a/ts/state/smart/StoriesSettingsModal.tsx +++ b/ts/state/smart/StoriesSettingsModal.tsx @@ -3,22 +3,22 @@ import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { StoriesSettingsModal } from '../../components/StoriesSettingsModal.js'; +import { StoriesSettingsModal } from '../../components/StoriesSettingsModal.dom.js'; import { getCandidateContactsForNewGroup, getConversationByServiceIdSelector, getGroupStories, getMe, -} from '../selectors/conversations.js'; -import { getAllSignalConnections } from '../selectors/conversations-extra.js'; -import { getDistributionListsWithMembers } from '../selectors/storyDistributionLists.js'; -import { getIntl, getTheme } from '../selectors/user.js'; -import { getPreferredBadgeSelector } from '../selectors/badges.js'; -import { getHasStoryViewReceiptSetting } from '../selectors/items.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; -import { useStoryDistributionListsActions } from '../ducks/storyDistributionLists.js'; -import { useStoriesActions } from '../ducks/stories.js'; -import { useConversationsActions } from '../ducks/conversations.js'; +} from '../selectors/conversations.dom.js'; +import { getAllSignalConnections } from '../selectors/conversations-extra.preload.js'; +import { getDistributionListsWithMembers } from '../selectors/storyDistributionLists.dom.js'; +import { getIntl, getTheme } from '../selectors/user.std.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.preload.js'; +import { getHasStoryViewReceiptSetting } from '../selectors/items.dom.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; +import { useStoryDistributionListsActions } from '../ducks/storyDistributionLists.preload.js'; +import { useStoriesActions } from '../ducks/stories.preload.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; export const SmartStoriesSettingsModal = memo( function SmartStoriesSettingsModal() { diff --git a/ts/state/smart/StoriesTab.tsx b/ts/state/smart/StoriesTab.tsx index d6fa78af9f..4aafd56f71 100644 --- a/ts/state/smart/StoriesTab.tsx +++ b/ts/state/smart/StoriesTab.tsx @@ -3,38 +3,38 @@ import React, { memo, useCallback, useEffect } from 'react'; import { useSelector } from 'react-redux'; -import { SmartStoryCreator } from './StoryCreator.js'; -import { SmartToastManager } from './ToastManager.js'; -import type { WidthBreakpoint } from '../../components/_util.js'; -import { StoriesTab } from '../../components/StoriesTab.js'; -import { getMaximumOutgoingAttachmentSizeInKb } from '../../types/AttachmentSize.js'; -import type { ConfigKeyType } from '../../RemoteConfig.js'; -import { getMe } from '../selectors/conversations.js'; -import { getIntl, getTheme } from '../selectors/user.js'; -import { getPreferredBadgeSelector } from '../selectors/badges.js'; +import { SmartStoryCreator } from './StoryCreator.preload.js'; +import { SmartToastManager } from './ToastManager.preload.js'; +import type { WidthBreakpoint } from '../../components/_util.std.js'; +import { StoriesTab } from '../../components/StoriesTab.dom.js'; +import { getMaximumOutgoingAttachmentSizeInKb } from '../../types/AttachmentSize.std.js'; +import type { ConfigKeyType } from '../../RemoteConfig.dom.js'; +import { getMe } from '../selectors/conversations.dom.js'; +import { getIntl, getTheme } from '../selectors/user.std.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.preload.js'; import { getHasStoryViewReceiptSetting, getNavTabsCollapsed, getPreferredLeftPaneWidth, getRemoteConfig, -} from '../selectors/items.js'; +} from '../selectors/items.dom.js'; import { getAddStoryData, getHasAnyFailedStorySends, getSelectedStoryData, getStories, -} from '../selectors/stories.js'; -import { useConversationsActions } from '../ducks/conversations.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; -import { useStoriesActions } from '../ducks/stories.js'; -import { useToastActions } from '../ducks/toast.js'; -import { useAudioPlayerActions } from '../ducks/audioPlayer.js'; -import { useItemsActions } from '../ducks/items.js'; -import { getHasPendingUpdate } from '../selectors/updates.js'; -import { getOtherTabsUnreadStats } from '../selectors/nav.js'; -import { getIsStoriesSettingsVisible } from '../selectors/globalModals.js'; -import type { StoryViewType } from '../../types/Stories.js'; -import { ForwardMessagesModalType } from '../../components/ForwardMessagesModal.js'; +} from '../selectors/stories.preload.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; +import { useStoriesActions } from '../ducks/stories.preload.js'; +import { useToastActions } from '../ducks/toast.preload.js'; +import { useAudioPlayerActions } from '../ducks/audioPlayer.preload.js'; +import { useItemsActions } from '../ducks/items.preload.js'; +import { getHasPendingUpdate } from '../selectors/updates.std.js'; +import { getOtherTabsUnreadStats } from '../selectors/nav.preload.js'; +import { getIsStoriesSettingsVisible } from '../selectors/globalModals.std.js'; +import type { StoryViewType } from '../../types/Stories.std.js'; +import { ForwardMessagesModalType } from '../../components/ForwardMessagesModal.dom.js'; function renderStoryCreator(): JSX.Element { return ; diff --git a/ts/state/smart/StoryCreator.tsx b/ts/state/smart/StoryCreator.tsx index d297c050c2..fafb0af664 100644 --- a/ts/state/smart/StoryCreator.tsx +++ b/ts/state/smart/StoryCreator.tsx @@ -3,9 +3,9 @@ import React, { memo, useMemo } from 'react'; import { useSelector } from 'react-redux'; -import { ThemeType } from '../../types/Util.js'; -import { LinkPreviewSourceType } from '../../types/LinkPreview.js'; -import { StoryCreator } from '../../components/StoryCreator.js'; +import { ThemeType } from '../../types/Util.std.js'; +import { LinkPreviewSourceType } from '../../types/LinkPreview.std.js'; +import { StoryCreator } from '../../components/StoryCreator.dom.js'; import { getCandidateContactsForNewGroup, getConversationSelector, @@ -13,32 +13,32 @@ import { getMe, getNonGroupStories, selectMostRecentActiveStoryTimestampByGroupOrDistributionList, -} from '../selectors/conversations.js'; -import { getAllSignalConnections } from '../selectors/conversations-extra.js'; -import { getDistributionListsWithMembers } from '../selectors/storyDistributionLists.js'; +} from '../selectors/conversations.dom.js'; +import { getAllSignalConnections } from '../selectors/conversations-extra.preload.js'; +import { getDistributionListsWithMembers } from '../selectors/storyDistributionLists.dom.js'; import { getIntl, getPlatform, getUserConversationId, -} from '../selectors/user.js'; -import { getAddStoryData } from '../selectors/stories.js'; -import { getLinkPreview } from '../selectors/linkPreviews.js'; -import { getPreferredBadgeSelector } from '../selectors/badges.js'; +} from '../selectors/user.std.js'; +import { getAddStoryData } from '../selectors/stories.preload.js'; +import { getLinkPreview } from '../selectors/linkPreviews.std.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.preload.js'; import { getEmojiSkinToneDefault, getHasSetMyStoriesPrivacy, getTextFormattingEnabled, -} from '../selectors/items.js'; -import { imageToBlurHash } from '../../util/imageToBlurHash.js'; -import { processAttachment } from '../../util/processAttachment.js'; -import { useEmojisActions } from '../ducks/emojis.js'; -import { useAudioPlayerActions } from '../ducks/audioPlayer.js'; -import { useComposerActions } from '../ducks/composer.js'; -import { useConversationsActions } from '../ducks/conversations.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; -import { useLinkPreviewActions } from '../ducks/linkPreviews.js'; -import { useStoriesActions } from '../ducks/stories.js'; -import { useStoryDistributionListsActions } from '../ducks/storyDistributionLists.js'; +} from '../selectors/items.dom.js'; +import { imageToBlurHash } from '../../util/imageToBlurHash.dom.js'; +import { processAttachment } from '../../util/processAttachment.preload.js'; +import { useEmojisActions } from '../ducks/emojis.preload.js'; +import { useAudioPlayerActions } from '../ducks/audioPlayer.preload.js'; +import { useComposerActions } from '../ducks/composer.preload.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; +import { useLinkPreviewActions } from '../ducks/linkPreviews.preload.js'; +import { useStoriesActions } from '../ducks/stories.preload.js'; +import { useStoryDistributionListsActions } from '../ducks/storyDistributionLists.preload.js'; export type PropsType = { file?: File; diff --git a/ts/state/smart/StoryViewer.tsx b/ts/state/smart/StoryViewer.tsx index beabfb9cdd..ba4f1c96a6 100644 --- a/ts/state/smart/StoryViewer.tsx +++ b/ts/state/smart/StoryViewer.tsx @@ -3,41 +3,41 @@ import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import { StoryViewer } from '../../components/StoryViewer.js'; -import { ToastType } from '../../types/Toast.js'; -import { useToastActions } from '../ducks/toast.js'; -import { getConversationSelector } from '../selectors/conversations.js'; +import { StoryViewer } from '../../components/StoryViewer.dom.js'; +import { ToastType } from '../../types/Toast.dom.js'; +import { useToastActions } from '../ducks/toast.preload.js'; +import { getConversationSelector } from '../selectors/conversations.dom.js'; import { getEmojiSkinToneDefault, getHasStoryViewReceiptSetting, getPreferredReactionEmoji, getTextFormattingEnabled, isInternalUser, -} from '../selectors/items.js'; +} from '../selectors/items.dom.js'; import { getIntl, getPlatform, getUserConversationId, -} from '../selectors/user.js'; -import { getPreferredBadgeSelector } from '../selectors/badges.js'; +} from '../selectors/user.std.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.preload.js'; import { getSelectedStoryData, getStoryReplies, getStoryByIdSelector, getHasAllStoriesUnmuted, -} from '../selectors/stories.js'; -import { isInFullScreenCall } from '../selectors/calling.js'; -import { isSignalConversation as getIsSignalConversation } from '../../util/isSignalConversation.js'; -import { strictAssert } from '../../util/assert.js'; -import { asyncShouldNeverBeCalled } from '../../util/shouldNeverBeCalled.js'; -import { useEmojisActions } from '../ducks/emojis.js'; -import { useConversationsActions } from '../ducks/conversations.js'; -import { useAudioPlayerActions } from '../ducks/audioPlayer.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; -import { useStoriesActions } from '../ducks/stories.js'; -import { useIsWindowActive } from '../../hooks/useIsWindowActive.js'; -import type { DraftBodyRanges } from '../../types/BodyRange.js'; -import type { StoryViewType } from '../../types/Stories.js'; +} from '../selectors/stories.preload.js'; +import { isInFullScreenCall } from '../selectors/calling.std.js'; +import { isSignalConversation as getIsSignalConversation } from '../../util/isSignalConversation.dom.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { asyncShouldNeverBeCalled } from '../../util/shouldNeverBeCalled.std.js'; +import { useEmojisActions } from '../ducks/emojis.preload.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; +import { useAudioPlayerActions } from '../ducks/audioPlayer.preload.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; +import { useStoriesActions } from '../ducks/stories.preload.js'; +import { useIsWindowActive } from '../../hooks/useIsWindowActive.dom.js'; +import type { DraftBodyRanges } from '../../types/BodyRange.std.js'; +import type { StoryViewType } from '../../types/Stories.std.js'; export const SmartStoryViewer = memo(function SmartStoryViewer() { const { diff --git a/ts/state/smart/Timeline.tsx b/ts/state/smart/Timeline.tsx index 5f1088d9d2..b847f2d887 100644 --- a/ts/state/smart/Timeline.tsx +++ b/ts/state/smart/Timeline.tsx @@ -5,23 +5,23 @@ import lodash from 'lodash'; import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; import type { ReadonlyDeep } from 'type-fest'; -import type { WarningType as TimelineWarningType } from '../../components/conversation/Timeline.js'; -import { Timeline } from '../../components/conversation/Timeline.js'; -import { ContactSpoofingType } from '../../util/contactSpoofing.js'; -import { getGroupMemberships } from '../../util/getGroupMemberships.js'; +import type { WarningType as TimelineWarningType } from '../../components/conversation/Timeline.dom.js'; +import { Timeline } from '../../components/conversation/Timeline.dom.js'; +import { ContactSpoofingType } from '../../util/contactSpoofing.std.js'; +import { getGroupMemberships } from '../../util/getGroupMemberships.dom.js'; import { dehydrateCollisionsWithConversations, getCollisionsFromMemberships, -} from '../../util/groupMemberNameCollisions.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; -import { useCallingActions } from '../ducks/calling.js'; +} from '../../util/groupMemberNameCollisions.std.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; +import { useCallingActions } from '../ducks/calling.preload.js'; import { useConversationsActions, type ConversationType, -} from '../ducks/conversations.js'; -import type { StateType } from '../reducer.js'; -import { selectAudioPlayerActive } from '../selectors/audioPlayer.js'; -import { getPreferredBadgeSelector } from '../selectors/badges.js'; +} from '../ducks/conversations.preload.js'; +import type { StateType } from '../reducer.preload.js'; +import { selectAudioPlayerActive } from '../selectors/audioPlayer.preload.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.preload.js'; import { getConversationByServiceIdSelector, getConversationMessagesSelector, @@ -32,21 +32,21 @@ import { getSafeConversationWithSameTitle, getSelectedConversationId, getTargetedMessage, -} from '../selectors/conversations.js'; -import { getIntl, getTheme } from '../selectors/user.js'; -import type { PropsType as SmartCollidingAvatarsPropsType } from './CollidingAvatars.js'; -import { SmartCollidingAvatars } from './CollidingAvatars.js'; -import type { PropsType as SmartContactSpoofingReviewDialogPropsType } from './ContactSpoofingReviewDialog.js'; -import { SmartContactSpoofingReviewDialog } from './ContactSpoofingReviewDialog.js'; -import { SmartHeroRow } from './HeroRow.js'; -import { SmartMiniPlayer } from './MiniPlayer.js'; +} from '../selectors/conversations.dom.js'; +import { getIntl, getTheme } from '../selectors/user.std.js'; +import type { PropsType as SmartCollidingAvatarsPropsType } from './CollidingAvatars.dom.js'; +import { SmartCollidingAvatars } from './CollidingAvatars.dom.js'; +import type { PropsType as SmartContactSpoofingReviewDialogPropsType } from './ContactSpoofingReviewDialog.preload.js'; +import { SmartContactSpoofingReviewDialog } from './ContactSpoofingReviewDialog.preload.js'; +import { SmartHeroRow } from './HeroRow.preload.js'; +import { SmartMiniPlayer } from './MiniPlayer.preload.js'; import { SmartTimelineItem, type SmartTimelineItemProps, -} from './TimelineItem.js'; -import { SmartTypingBubble } from './TypingBubble.js'; -import { AttachmentDownloadManager } from '../../jobs/AttachmentDownloadManager.js'; -import { isInFullScreenCall as getIsInFullScreenCall } from '../selectors/calling.js'; +} from './TimelineItem.preload.js'; +import { SmartTypingBubble } from './TypingBubble.preload.js'; +import { AttachmentDownloadManager } from '../../jobs/AttachmentDownloadManager.preload.js'; +import { isInFullScreenCall as getIsInFullScreenCall } from '../selectors/calling.std.js'; const { isEmpty } = lodash; diff --git a/ts/state/smart/TimelineItem.tsx b/ts/state/smart/TimelineItem.tsx index 0d186e9796..3559bda603 100644 --- a/ts/state/smart/TimelineItem.tsx +++ b/ts/state/smart/TimelineItem.tsx @@ -5,36 +5,36 @@ import type { RefObject } from 'react'; import React, { useCallback, memo } from 'react'; import { useSelector } from 'react-redux'; -import { TimelineItem } from '../../components/conversation/TimelineItem.js'; -import type { WidthBreakpoint } from '../../components/_util.js'; -import { useConversationsActions } from '../ducks/conversations.js'; -import { useComposerActions } from '../ducks/composer.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; -import { useAccountsActions } from '../ducks/accounts.js'; -import { useLightboxActions } from '../ducks/lightbox.js'; -import { useStoriesActions } from '../ducks/stories.js'; -import { useCallingActions } from '../ducks/calling.js'; -import { getPreferredBadgeSelector } from '../selectors/badges.js'; +import { TimelineItem } from '../../components/conversation/TimelineItem.dom.js'; +import type { WidthBreakpoint } from '../../components/_util.std.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; +import { useComposerActions } from '../ducks/composer.preload.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; +import { useAccountsActions } from '../ducks/accounts.preload.js'; +import { useLightboxActions } from '../ducks/lightbox.preload.js'; +import { useStoriesActions } from '../ducks/stories.preload.js'; +import { useCallingActions } from '../ducks/calling.preload.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.preload.js'; import { getIntl, getInteractionMode, getTheme, getPlatform, -} from '../selectors/user.js'; -import { getTargetedMessage } from '../selectors/conversations.js'; -import { useTimelineItem } from '../selectors/timeline.js'; +} from '../selectors/user.std.js'; +import { getTargetedMessage } from '../selectors/conversations.dom.js'; +import { useTimelineItem } from '../selectors/timeline.preload.js'; import { areMessagesInSameGroup, shouldCurrentMessageHideMetadata, UnreadIndicatorPlacement, -} from '../../util/timelineUtil.js'; +} from '../../util/timelineUtil.std.js'; -import { SmartContactName } from './ContactName.js'; -import { SmartUniversalTimerNotification } from './UniversalTimerNotification.js'; -import { isSameDay } from '../../util/timestamp.js'; -import { renderAudioAttachment } from './renderAudioAttachment.js'; -import { renderReactionPicker } from './renderReactionPicker.js'; -import type { MessageRequestState } from '../../components/conversation/MessageRequestActionsConfirmation.js'; +import { SmartContactName } from './ContactName.preload.js'; +import { SmartUniversalTimerNotification } from './UniversalTimerNotification.dom.js'; +import { isSameDay } from '../../util/timestamp.std.js'; +import { renderAudioAttachment } from './renderAudioAttachment.preload.js'; +import { renderReactionPicker } from './renderReactionPicker.dom.js'; +import type { MessageRequestState } from '../../components/conversation/MessageRequestActionsConfirmation.dom.js'; export type SmartTimelineItemProps = { containerElementRef: RefObject; diff --git a/ts/state/smart/ToastManager.tsx b/ts/state/smart/ToastManager.tsx index fd44cb1cda..9b054ad980 100644 --- a/ts/state/smart/ToastManager.tsx +++ b/ts/state/smart/ToastManager.tsx @@ -3,35 +3,35 @@ import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import type { AnyActionableMegaphone } from '../../types/Megaphone.js'; -import { MegaphoneType } from '../../types/Megaphone.js'; -import { UsernameOnboardingState } from '../../types/globalModals.js'; -import OS from '../../util/os/osMain.js'; -import { drop } from '../../util/drop.js'; -import { getIntl } from '../selectors/user.js'; +import type { AnyActionableMegaphone } from '../../types/Megaphone.std.js'; +import { MegaphoneType } from '../../types/Megaphone.std.js'; +import { UsernameOnboardingState } from '../../types/globalModals.std.js'; +import OS from '../../util/os/osMain.node.js'; +import { drop } from '../../util/drop.std.js'; +import { getIntl } from '../selectors/user.std.js'; import { getGlobalModalsState, isShowingAnyModal as getIsShowingAnyModal, -} from '../selectors/globalModals.js'; -import { hasSelectedStoryData } from '../selectors/stories.js'; -import { shouldShowLightbox } from '../selectors/lightbox.js'; -import { isInFullScreenCall as getIsInFullScreenCall } from '../selectors/calling.js'; -import { getSelectedNavTab } from '../selectors/nav.js'; +} from '../selectors/globalModals.std.js'; +import { hasSelectedStoryData } from '../selectors/stories.preload.js'; +import { shouldShowLightbox } from '../selectors/lightbox.std.js'; +import { isInFullScreenCall as getIsInFullScreenCall } from '../selectors/calling.std.js'; +import { getSelectedNavTab } from '../selectors/nav.preload.js'; import { getMe, getSelectedConversationId, -} from '../selectors/conversations.js'; -import { useConversationsActions } from '../ducks/conversations.js'; -import { useToastActions } from '../ducks/toast.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; -import { useNavActions } from '../ducks/nav.js'; -import { NavTab } from '../../types/Nav.js'; -import { getHasCompletedUsernameOnboarding } from '../selectors/items.js'; -import { ToastManager } from '../../components/ToastManager.js'; -import type { WidthBreakpoint } from '../../components/_util.js'; -import { getToast } from '../selectors/toast.js'; -import { useDonationsActions } from '../ducks/donations.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +} from '../selectors/conversations.dom.js'; +import { useConversationsActions } from '../ducks/conversations.preload.js'; +import { useToastActions } from '../ducks/toast.preload.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; +import { useNavActions } from '../ducks/nav.std.js'; +import { NavTab } from '../../types/Nav.std.js'; +import { getHasCompletedUsernameOnboarding } from '../selectors/items.dom.js'; +import { ToastManager } from '../../components/ToastManager.dom.js'; +import type { WidthBreakpoint } from '../../components/_util.std.js'; +import { getToast } from '../selectors/toast.std.js'; +import { useDonationsActions } from '../ducks/donations.preload.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; export type SmartPropsType = Readonly<{ disableMegaphone?: boolean; diff --git a/ts/state/smart/TypingBubble.tsx b/ts/state/smart/TypingBubble.tsx index f1724c89fc..5e7d7e9686 100644 --- a/ts/state/smart/TypingBubble.tsx +++ b/ts/state/smart/TypingBubble.tsx @@ -4,15 +4,15 @@ import lodash from 'lodash'; import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { TypingBubble } from '../../components/conversation/TypingBubble.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; -import { getIntl, getTheme } from '../selectors/user.js'; -import { useTimelineItem } from '../selectors/timeline.js'; +import { TypingBubble } from '../../components/conversation/TypingBubble.dom.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; +import { getIntl, getTheme } from '../selectors/user.std.js'; +import { useTimelineItem } from '../selectors/timeline.preload.js'; import { getConversationSelector, getConversationMessagesSelector, -} from '../selectors/conversations.js'; -import { getPreferredBadgeSelector } from '../selectors/badges.js'; +} from '../selectors/conversations.dom.js'; +import { getPreferredBadgeSelector } from '../selectors/badges.preload.js'; const { last } = lodash; diff --git a/ts/state/smart/UniversalTimerNotification.tsx b/ts/state/smart/UniversalTimerNotification.tsx index e20edcf775..91669cc8bb 100644 --- a/ts/state/smart/UniversalTimerNotification.tsx +++ b/ts/state/smart/UniversalTimerNotification.tsx @@ -3,9 +3,9 @@ import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { UniversalTimerNotification } from '../../components/conversation/UniversalTimerNotification.js'; -import { getIntl } from '../selectors/user.js'; -import { getUniversalExpireTimer } from '../selectors/items.js'; +import { UniversalTimerNotification } from '../../components/conversation/UniversalTimerNotification.dom.js'; +import { getIntl } from '../selectors/user.std.js'; +import { getUniversalExpireTimer } from '../selectors/items.dom.js'; export const SmartUniversalTimerNotification = memo( function SmartUniversalTimerNotification() { diff --git a/ts/state/smart/UnsupportedOSDialog.tsx b/ts/state/smart/UnsupportedOSDialog.tsx index 40774954ef..0b9c510e5c 100644 --- a/ts/state/smart/UnsupportedOSDialog.tsx +++ b/ts/state/smart/UnsupportedOSDialog.tsx @@ -3,11 +3,11 @@ import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { UnsupportedOSDialog } from '../../components/UnsupportedOSDialog.js'; -import { getIntl } from '../selectors/user.js'; -import { getExpirationTimestamp } from '../selectors/expiration.js'; -import type { WidthBreakpoint } from '../../components/_util.js'; -import OS from '../../util/os/osMain.js'; +import { UnsupportedOSDialog } from '../../components/UnsupportedOSDialog.dom.js'; +import { getIntl } from '../selectors/user.std.js'; +import { getExpirationTimestamp } from '../selectors/expiration.dom.js'; +import type { WidthBreakpoint } from '../../components/_util.std.js'; +import OS from '../../util/os/osMain.node.js'; export type PropsType = Readonly<{ type: 'warning' | 'error'; diff --git a/ts/state/smart/UpdateDialog.tsx b/ts/state/smart/UpdateDialog.tsx index bda3e0aa19..a6f7307412 100644 --- a/ts/state/smart/UpdateDialog.tsx +++ b/ts/state/smart/UpdateDialog.tsx @@ -3,17 +3,17 @@ import { useSelector } from 'react-redux'; import React, { memo } from 'react'; -import { DialogUpdate } from '../../components/DialogUpdate.js'; -import { getIntl } from '../selectors/user.js'; -import type { WidthBreakpoint } from '../../components/_util.js'; -import { useUpdatesActions } from '../ducks/updates.js'; +import { DialogUpdate } from '../../components/DialogUpdate.dom.js'; +import { getIntl } from '../selectors/user.std.js'; +import type { WidthBreakpoint } from '../../components/_util.std.js'; +import { useUpdatesActions } from '../ducks/updates.preload.js'; import { getUpdateDialogType, getUpdateDownloadSize, getUpdateDownloadedSize, getUpdateVersion, -} from '../selectors/updates.js'; -import { DialogType } from '../../types/Dialogs.js'; +} from '../selectors/updates.std.js'; +import { DialogType } from '../../types/Dialogs.std.js'; type SmartUpdateDialogProps = Readonly<{ containerWidthBreakpoint: WidthBreakpoint; diff --git a/ts/state/smart/UsernameEditor.tsx b/ts/state/smart/UsernameEditor.tsx index 962a65cdac..12d956318a 100644 --- a/ts/state/smart/UsernameEditor.tsx +++ b/ts/state/smart/UsernameEditor.tsx @@ -2,19 +2,19 @@ // SPDX-License-Identifier: AGPL-3.0-only import React, { memo } from 'react'; import { useSelector } from 'react-redux'; -import { UsernameEditor } from '../../components/UsernameEditor.js'; -import { getMinNickname, getMaxNickname } from '../../util/Username.js'; -import { getIntl } from '../selectors/user.js'; +import { UsernameEditor } from '../../components/UsernameEditor.dom.js'; +import { getMinNickname, getMaxNickname } from '../../util/Username.dom.js'; +import { getIntl } from '../selectors/user.std.js'; import { getUsernameReservationState, getUsernameReservationObject, getUsernameReservationError, getRecoveredUsername, -} from '../selectors/username.js'; -import { getUsernameCorrupted } from '../selectors/items.js'; -import { getMe } from '../selectors/conversations.js'; -import { useUsernameActions } from '../ducks/username.js'; -import { useToastActions } from '../ducks/toast.js'; +} from '../selectors/username.std.js'; +import { getUsernameCorrupted } from '../selectors/items.dom.js'; +import { getMe } from '../selectors/conversations.dom.js'; +import { useUsernameActions } from '../ducks/username.preload.js'; +import { useToastActions } from '../ducks/toast.preload.js'; export type SmartUsernameEditorProps = Readonly<{ onClose(): void; diff --git a/ts/state/smart/UsernameOnboardingModal.tsx b/ts/state/smart/UsernameOnboardingModal.tsx index 7f1c027473..0513343594 100644 --- a/ts/state/smart/UsernameOnboardingModal.tsx +++ b/ts/state/smart/UsernameOnboardingModal.tsx @@ -4,13 +4,17 @@ import React, { memo, useCallback } from 'react'; import { useSelector } from 'react-redux'; -import { UsernameOnboardingModal } from '../../components/UsernameOnboardingModal.js'; -import { getIntl } from '../selectors/user.js'; -import { useGlobalModalActions } from '../ducks/globalModals.js'; -import { useUsernameActions } from '../ducks/username.js'; -import { useNavActions } from '../ducks/nav.js'; -import { NavTab, SettingsPage, ProfileEditorPage } from '../../types/Nav.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +import { UsernameOnboardingModal } from '../../components/UsernameOnboardingModal.dom.js'; +import { getIntl } from '../selectors/user.std.js'; +import { useGlobalModalActions } from '../ducks/globalModals.preload.js'; +import { useUsernameActions } from '../ducks/username.preload.js'; +import { useNavActions } from '../ducks/nav.std.js'; +import { + NavTab, + SettingsPage, + ProfileEditorPage, +} from '../../types/Nav.std.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; export const SmartUsernameOnboardingModal = memo( function SmartUsernameOnboardingModal(): JSX.Element { diff --git a/ts/state/smart/VoiceNotesPlaybackProvider.tsx b/ts/state/smart/VoiceNotesPlaybackProvider.tsx index d5e74a2a89..50f60f541c 100644 --- a/ts/state/smart/VoiceNotesPlaybackProvider.tsx +++ b/ts/state/smart/VoiceNotesPlaybackProvider.tsx @@ -3,23 +3,23 @@ import React, { memo, useEffect } from 'react'; import { useSelector } from 'react-redux'; -import type { VoiceNotesPlaybackProps } from '../../components/VoiceNotesPlaybackContext.js'; -import { VoiceNotesPlaybackProvider } from '../../components/VoiceNotesPlaybackContext.js'; -import { selectAudioPlayerActive } from '../selectors/audioPlayer.js'; +import type { VoiceNotesPlaybackProps } from '../../components/VoiceNotesPlaybackContext.dom.js'; +import { VoiceNotesPlaybackProvider } from '../../components/VoiceNotesPlaybackContext.dom.js'; +import { selectAudioPlayerActive } from '../selectors/audioPlayer.preload.js'; import { AudioPlayerContent, useAudioPlayerActions, -} from '../ducks/audioPlayer.js'; -import { globalMessageAudio } from '../../services/globalMessageAudio.js'; -import { strictAssert } from '../../util/assert.js'; -import { drop } from '../../util/drop.js'; -import { createLogger } from '../../logging/log.js'; -import { Sound, SoundType } from '../../util/Sound.js'; -import { getConversations } from '../selectors/conversations.js'; -import { SeenStatus } from '../../MessageSeenStatus.js'; -import { markViewed } from '../ducks/conversations.js'; -import * as Errors from '../../types/errors.js'; -import { usePrevious } from '../../hooks/usePrevious.js'; +} from '../ducks/audioPlayer.preload.js'; +import { globalMessageAudio } from '../../services/globalMessageAudio.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { drop } from '../../util/drop.std.js'; +import { createLogger } from '../../logging/log.std.js'; +import { Sound, SoundType } from '../../util/Sound.std.js'; +import { getConversations } from '../selectors/conversations.dom.js'; +import { SeenStatus } from '../../MessageSeenStatus.std.js'; +import { markViewed } from '../ducks/conversations.preload.js'; +import * as Errors from '../../types/errors.std.js'; +import { usePrevious } from '../../hooks/usePrevious.std.js'; const log = createLogger('VoiceNotesPlaybackProvider'); diff --git a/ts/state/smart/Waveform.tsx b/ts/state/smart/Waveform.tsx index 13d86e47e2..5c540e6f5a 100644 --- a/ts/state/smart/Waveform.tsx +++ b/ts/state/smart/Waveform.tsx @@ -3,10 +3,10 @@ import lodash from 'lodash'; import React, { memo, useEffect, useState } from 'react'; -import { Waveform } from '../../components/conversation/Waveform.js'; -import type { ComputePeaksResult } from '../../components/VoiceNotesPlaybackContext.js'; -import { VoiceNotesPlaybackContext } from '../../components/VoiceNotesPlaybackContext.js'; -import { createLogger } from '../../logging/log.js'; +import { Waveform } from '../../components/conversation/Waveform.dom.js'; +import type { ComputePeaksResult } from '../../components/VoiceNotesPlaybackContext.dom.js'; +import { VoiceNotesPlaybackContext } from '../../components/VoiceNotesPlaybackContext.dom.js'; +import { createLogger } from '../../logging/log.std.js'; const { noop } = lodash; diff --git a/ts/state/smart/renderAudioAttachment.tsx b/ts/state/smart/renderAudioAttachment.tsx index 6c45d028ca..5248c9bdf6 100644 --- a/ts/state/smart/renderAudioAttachment.tsx +++ b/ts/state/smart/renderAudioAttachment.tsx @@ -3,9 +3,9 @@ import type { ReactElement } from 'react'; import React from 'react'; -import { VoiceNotesPlaybackContext } from '../../components/VoiceNotesPlaybackContext.js'; -import type { Props as MessageAudioProps } from './MessageAudio.js'; -import { SmartMessageAudio } from './MessageAudio.js'; +import { VoiceNotesPlaybackContext } from '../../components/VoiceNotesPlaybackContext.dom.js'; +import type { Props as MessageAudioProps } from './MessageAudio.preload.js'; +import { SmartMessageAudio } from './MessageAudio.preload.js'; type AudioAttachmentProps = Omit; diff --git a/ts/state/smart/renderReactionPicker.tsx b/ts/state/smart/renderReactionPicker.tsx index c8ae37fad6..e58bd3a8e5 100644 --- a/ts/state/smart/renderReactionPicker.tsx +++ b/ts/state/smart/renderReactionPicker.tsx @@ -4,7 +4,7 @@ import type { ComponentProps } from 'react'; import React from 'react'; -import { SmartReactionPicker } from './ReactionPicker.js'; +import { SmartReactionPicker } from './ReactionPicker.dom.js'; export const renderReactionPicker = ( props: ComponentProps diff --git a/ts/state/types.ts b/ts/state/types.ts index 39061ce58a..e5049fbd36 100644 --- a/ts/state/types.ts +++ b/ts/state/types.ts @@ -2,41 +2,41 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { Selector } from 'reselect'; -import type { StateType } from './reducer.js'; -import type { actions as accounts } from './ducks/accounts.js'; -import type { actions as app } from './ducks/app.js'; -import type { actions as audioPlayer } from './ducks/audioPlayer.js'; -import type { actions as audioRecorder } from './ducks/audioRecorder.js'; -import type { actions as badges } from './ducks/badges.js'; -import type { actions as callHistory } from './ducks/callHistory.js'; -import type { actions as calling } from './ducks/calling.js'; -import type { actions as chatFolders } from './ducks/chatFolders.js'; -import type { actions as composer } from './ducks/composer.js'; -import type { actions as conversations } from './ducks/conversations.js'; -import type { actions as crashReports } from './ducks/crashReports.js'; -import type { actions as donations } from './ducks/donations.js'; -import type { actions as emojis } from './ducks/emojis.js'; -import type { actions as expiration } from './ducks/expiration.js'; -import type { actions as gifs } from './ducks/gifs.js'; -import type { actions as globalModals } from './ducks/globalModals.js'; -import type { actions as inbox } from './ducks/inbox.js'; -import type { actions as installer } from './ducks/installer.js'; -import type { actions as items } from './ducks/items.js'; -import type { actions as lightbox } from './ducks/lightbox.js'; -import type { actions as linkPreviews } from './ducks/linkPreviews.js'; -import type { actions as mediaGallery } from './ducks/mediaGallery.js'; -import type { actions as nav } from './ducks/nav.js'; -import type { actions as network } from './ducks/network.js'; -import type { actions as notificationProfiles } from './ducks/notificationProfiles.js'; -import type { actions as safetyNumber } from './ducks/safetyNumber.js'; -import type { actions as search } from './ducks/search.js'; -import type { actions as stickers } from './ducks/stickers.js'; -import type { actions as stories } from './ducks/stories.js'; -import type { actions as storyDistributionLists } from './ducks/storyDistributionLists.js'; -import type { actions as toast } from './ducks/toast.js'; -import type { actions as updates } from './ducks/updates.js'; -import type { actions as user } from './ducks/user.js'; -import type { actions as username } from './ducks/username.js'; +import type { StateType } from './reducer.preload.js'; +import type { actions as accounts } from './ducks/accounts.preload.js'; +import type { actions as app } from './ducks/app.preload.js'; +import type { actions as audioPlayer } from './ducks/audioPlayer.preload.js'; +import type { actions as audioRecorder } from './ducks/audioRecorder.preload.js'; +import type { actions as badges } from './ducks/badges.preload.js'; +import type { actions as callHistory } from './ducks/callHistory.preload.js'; +import type { actions as calling } from './ducks/calling.preload.js'; +import type { actions as chatFolders } from './ducks/chatFolders.preload.js'; +import type { actions as composer } from './ducks/composer.preload.js'; +import type { actions as conversations } from './ducks/conversations.preload.js'; +import type { actions as crashReports } from './ducks/crashReports.preload.js'; +import type { actions as donations } from './ducks/donations.preload.js'; +import type { actions as emojis } from './ducks/emojis.preload.js'; +import type { actions as expiration } from './ducks/expiration.std.js'; +import type { actions as gifs } from './ducks/gifs.preload.js'; +import type { actions as globalModals } from './ducks/globalModals.preload.js'; +import type { actions as inbox } from './ducks/inbox.std.js'; +import type { actions as installer } from './ducks/installer.preload.js'; +import type { actions as items } from './ducks/items.preload.js'; +import type { actions as lightbox } from './ducks/lightbox.preload.js'; +import type { actions as linkPreviews } from './ducks/linkPreviews.preload.js'; +import type { actions as mediaGallery } from './ducks/mediaGallery.preload.js'; +import type { actions as nav } from './ducks/nav.std.js'; +import type { actions as network } from './ducks/network.dom.js'; +import type { actions as notificationProfiles } from './ducks/notificationProfiles.preload.js'; +import type { actions as safetyNumber } from './ducks/safetyNumber.preload.js'; +import type { actions as search } from './ducks/search.preload.js'; +import type { actions as stickers } from './ducks/stickers.preload.js'; +import type { actions as stories } from './ducks/stories.preload.js'; +import type { actions as storyDistributionLists } from './ducks/storyDistributionLists.preload.js'; +import type { actions as toast } from './ducks/toast.preload.js'; +import type { actions as updates } from './ducks/updates.preload.js'; +import type { actions as user } from './ducks/user.preload.js'; +import type { actions as username } from './ducks/username.preload.js'; export type ReduxActions = { accounts: typeof accounts; diff --git a/ts/test-electron/ContactsParser_test.ts b/ts/test-electron/ContactsParser_test.ts index c8e7dd4772..bc70137380 100644 --- a/ts/test-electron/ContactsParser_test.ts +++ b/ts/test-electron/ContactsParser_test.ts @@ -2,36 +2,42 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { createReadStream, unlinkSync, writeFileSync } from 'node:fs'; +import { + createReadStream, + unlinkSync, + writeFileSync, + mkdtempSync, +} from 'node:fs'; +import { tmpdir } from 'node:os'; import { v4 as generateGuid } from 'uuid'; import { join } from 'node:path'; import { pipeline } from 'node:stream/promises'; import { Transform } from 'node:stream'; +import fse from 'fs-extra'; -import protobuf from '../protobuf/wrap.js'; -import { createLogger } from '../logging/log.js'; -import * as Bytes from '../Bytes.js'; -import * as Errors from '../types/errors.js'; +import protobuf from '../protobuf/wrap.node.js'; +import { createLogger } from '../logging/log.std.js'; +import * as Bytes from '../Bytes.std.js'; +import * as Errors from '../types/errors.std.js'; import { getAbsoluteAttachmentPath, deleteAttachmentData, readAttachmentData, -} from '../util/migrations.js'; -import { APPLICATION_OCTET_STREAM } from '../types/MIME.js'; -import { type AciString, generateAci } from '../types/ServiceId.js'; -import { SignalService as Proto } from '../protobuf/index.js'; +} from '../util/migrations.preload.js'; +import { APPLICATION_OCTET_STREAM } from '../types/MIME.std.js'; +import { type AciString, generateAci } from '../types/ServiceId.std.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; import { ParseContactsTransform, parseContactsV2, -} from '../textsecure/ContactsParser.js'; -import type { ContactDetailsWithAvatar } from '../textsecure/ContactsParser.js'; -import { createTempDir, deleteTempDir } from '../updater/common.js'; -import { strictAssert } from '../util/assert.js'; -import { toAciObject } from '../util/ServiceId.js'; +} from '../textsecure/ContactsParser.preload.js'; +import type { ContactDetailsWithAvatar } from '../textsecure/ContactsParser.preload.js'; +import { strictAssert } from '../util/assert.std.js'; +import { toAciObject } from '../util/ServiceId.node.js'; import { generateKeys, encryptAttachmentV2ToDisk, -} from '../AttachmentCrypto.js'; +} from '../AttachmentCrypto.node.js'; const log = createLogger('ContactsParser_test'); @@ -43,10 +49,10 @@ describe('ContactsParser', () => { let tempDir: string; beforeEach(async () => { - tempDir = await createTempDir(); + tempDir = mkdtempSync(join(tmpdir(), 'Signal')); }); afterEach(async () => { - await deleteTempDir(log, tempDir); + await fse.remove(tempDir); }); describe('parseContactsV2', () => { diff --git a/ts/test-electron/ConversationController_test.ts b/ts/test-electron/ConversationController_test.ts index 22c76ef4f3..468eacb0ab 100644 --- a/ts/test-electron/ConversationController_test.ts +++ b/ts/test-electron/ConversationController_test.ts @@ -3,18 +3,18 @@ import { assert } from 'chai'; -import { strictAssert } from '../util/assert.js'; -import { DataWriter } from '../sql/Client.js'; +import { strictAssert } from '../util/assert.std.js'; +import { DataWriter } from '../sql/Client.preload.js'; -import type { ConversationModel } from '../models/conversations.js'; +import type { ConversationModel } from '../models/conversations.preload.js'; import type { AciString, PniString, ServiceIdString, -} from '../types/ServiceId.js'; -import { generateAci, generatePni } from '../types/ServiceId.js'; -import type { SafeCombineConversationsParams } from '../ConversationController.js'; -import { signalProtocolStore } from '../SignalProtocolStore.js'; +} from '../types/ServiceId.std.js'; +import { generateAci, generatePni } from '../types/ServiceId.std.js'; +import type { SafeCombineConversationsParams } from '../ConversationController.preload.js'; +import { signalProtocolStore } from '../SignalProtocolStore.preload.js'; const ACI_1 = generateAci(); const ACI_2 = generateAci(); diff --git a/ts/test-electron/Crypto_test.ts b/ts/test-electron/Crypto_test.ts index 3edacf2e4a..a960516734 100644 --- a/ts/test-electron/Crypto_test.ts +++ b/ts/test-electron/Crypto_test.ts @@ -1,17 +1,17 @@ // Copyright 2015 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { readFileSync, unlinkSync, writeFileSync } from 'node:fs'; +import { readFileSync, unlinkSync, writeFileSync, mkdtempSync } from 'node:fs'; import { join } from 'node:path'; +import { tmpdir } from 'node:os'; import { createCipheriv } from 'node:crypto'; import { PassThrough } from 'node:stream'; import fsExtra from 'fs-extra'; import { assert } from 'chai'; import lodash from 'lodash'; -import { createLogger } from '../logging/log.js'; -import * as Bytes from '../Bytes.js'; -import * as Curve from '../Curve.js'; +import * as Bytes from '../Bytes.std.js'; +import * as Curve from '../Curve.node.js'; import { PaddedLengths, encryptProfileItemWithPadding, @@ -38,7 +38,7 @@ import { decryptAttachmentV1, padAndEncryptAttachment, CipherType, -} from '../Crypto.js'; +} from '../Crypto.node.js'; import { _generateAttachmentIv, decryptAttachmentV2, @@ -47,25 +47,22 @@ import { generateAttachmentKeys, type DecryptedAttachmentV2, decryptAttachmentV2ToSink, -} from '../AttachmentCrypto.js'; -import type { AciString, PniString } from '../types/ServiceId.js'; -import { createTempDir, deleteTempDir } from '../updater/common.js'; -import { getAbsoluteAttachmentPath } from '../util/migrations.js'; -import { uuidToBytes, bytesToUuid } from '../util/uuidToBytes.js'; +} from '../AttachmentCrypto.node.js'; +import type { AciString, PniString } from '../types/ServiceId.std.js'; +import { getAbsoluteAttachmentPath } from '../util/migrations.preload.js'; +import { uuidToBytes, bytesToUuid } from '../util/uuidToBytes.std.js'; import { getAesCbcCiphertextSize, getAttachmentCiphertextSize, -} from '../util/AttachmentCrypto.js'; -import { getPath } from '../windows/main/attachments.js'; -import { MediaTier } from '../types/AttachmentDownload.js'; -import { deriveAccessKeyFromProfileKey } from '../util/zkgroup.js'; +} from '../util/AttachmentCrypto.std.js'; +import { getPath } from '../windows/main/attachments.preload.js'; +import { MediaTier } from '../types/AttachmentDownload.std.js'; +import { deriveAccessKeyFromProfileKey } from '../util/zkgroup.node.js'; const { emptyDir } = fsExtra; const { isNumber } = lodash; -const log = createLogger('Crypto_test'); - const GHOST_KITTY_HASH = '7bc77f27d92d00b4a1d57c480ca86dacc43d57bc318339c92119d1fbf6b557a5'; @@ -554,12 +551,10 @@ describe('Crypto', () => { let tempDir: string; beforeEach(async () => { - tempDir = await createTempDir(); + tempDir = mkdtempSync(join(tmpdir(), 'Signal')); }); afterEach(async () => { - if (tempDir) { - await deleteTempDir(log, tempDir); - } + await fsExtra.remove(tempDir); }); it('v1 roundtrips (memory only)', () => { diff --git a/ts/test-electron/Curve_test.ts b/ts/test-electron/Curve_test.ts index cfc2b9966d..a837beb743 100644 --- a/ts/test-electron/Curve_test.ts +++ b/ts/test-electron/Curve_test.ts @@ -3,8 +3,8 @@ import { assert } from 'chai'; -import * as Bytes from '../Bytes.js'; -import { constantTimeEqual } from '../Crypto.js'; +import * as Bytes from '../Bytes.std.js'; +import { constantTimeEqual } from '../Crypto.node.js'; import { calculateSignature, clampPrivateKey, @@ -15,7 +15,7 @@ import { generateSignedPreKey, isNonNegativeInteger, verifySignature, -} from '../Curve.js'; +} from '../Curve.node.js'; describe('Curve', () => { it('verifySignature roundtrip', () => { diff --git a/ts/test-electron/MessageReceipts_test.ts b/ts/test-electron/MessageReceipts_test.ts index 153199162b..613a1bba91 100644 --- a/ts/test-electron/MessageReceipts_test.ts +++ b/ts/test-electron/MessageReceipts_test.ts @@ -4,20 +4,20 @@ import { v4 as uuid } from 'uuid'; import { assert } from 'chai'; -import { type AciString, generateAci } from '../types/ServiceId.js'; -import type { MessageAttributesType } from '../model-types.js'; -import { DataReader, DataWriter } from '../sql/Client.js'; -import { SendStatus } from '../messages/MessageSendState.js'; +import { type AciString, generateAci } from '../types/ServiceId.std.js'; +import type { MessageAttributesType } from '../model-types.d.ts'; +import { DataReader, DataWriter } from '../sql/Client.preload.js'; +import { SendStatus } from '../messages/MessageSendState.std.js'; import type { MessageReceiptAttributesType, MessageReceiptType, -} from '../messageModifiers/MessageReceipts.js'; +} from '../messageModifiers/MessageReceipts.preload.js'; import { onReceipt, messageReceiptTypeSchema, -} from '../messageModifiers/MessageReceipts.js'; -import { ReadStatus } from '../messages/MessageReadStatus.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from '../messageModifiers/MessageReceipts.preload.js'; +import { ReadStatus } from '../messages/MessageReadStatus.std.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; describe('MessageReceipts', () => { let ourAci: AciString; diff --git a/ts/test-electron/MessageReceiver_test.ts b/ts/test-electron/MessageReceiver_test.ts index 000fc486ce..ea93cf2c56 100644 --- a/ts/test-electron/MessageReceiver_test.ts +++ b/ts/test-electron/MessageReceiver_test.ts @@ -6,17 +6,17 @@ import { assert } from 'chai'; import Long from 'long'; -import MessageReceiver from '../textsecure/MessageReceiver.js'; -import { IncomingWebSocketRequestLegacy } from '../textsecure/WebsocketResources.js'; -import type { DecryptionErrorEvent } from '../textsecure/messageReceiverEvents.js'; -import { generateAci } from '../types/ServiceId.js'; -import type { AciString } from '../types/ServiceId.js'; -import { toAciObject } from '../util/ServiceId.js'; -import { SignalService as Proto } from '../protobuf/index.js'; -import * as Crypto from '../Crypto.js'; -import { toBase64 } from '../Bytes.js'; -import { signalProtocolStore } from '../SignalProtocolStore.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import MessageReceiver from '../textsecure/MessageReceiver.preload.js'; +import { IncomingWebSocketRequestLegacy } from '../textsecure/WebsocketResources.preload.js'; +import type { DecryptionErrorEvent } from '../textsecure/messageReceiverEvents.std.js'; +import { generateAci } from '../types/ServiceId.std.js'; +import type { AciString } from '../types/ServiceId.std.js'; +import { toAciObject } from '../util/ServiceId.node.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; +import * as Crypto from '../Crypto.node.js'; +import { toBase64 } from '../Bytes.std.js'; +import { signalProtocolStore } from '../SignalProtocolStore.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; describe('MessageReceiver', () => { const someAci = generateAci(); diff --git a/ts/test-electron/SignalProtocolStore_test.ts b/ts/test-electron/SignalProtocolStore_test.ts index 154812dcc4..5bebfba836 100644 --- a/ts/test-electron/SignalProtocolStore_test.ts +++ b/ts/test-electron/SignalProtocolStore_test.ts @@ -14,28 +14,31 @@ import { } from '@signalapp/libsignal-client'; import { v4 as generateUuid } from 'uuid'; -import { DataReader, DataWriter } from '../sql/Client.js'; +import { DataReader, DataWriter } from '../sql/Client.preload.js'; import { signal } from '../protobuf/compiled.js'; -import { sessionStructureToBytes } from '../util/sessionTranslation.js'; -import * as durations from '../util/durations/index.js'; -import { explodePromise } from '../util/explodePromise.js'; -import { Zone } from '../util/Zone.js'; +import { sessionStructureToBytes } from '../util/sessionTranslation.node.js'; +import * as durations from '../util/durations/index.std.js'; +import { explodePromise } from '../util/explodePromise.std.js'; +import { Zone } from '../util/Zone.std.js'; -import * as Bytes from '../Bytes.js'; -import { getRandomBytes, constantTimeEqual } from '../Crypto.js'; +import * as Bytes from '../Bytes.std.js'; +import { getRandomBytes, constantTimeEqual } from '../Crypto.node.js'; import { clampPrivateKey, setPublicKeyTypeByte, generateSignedPreKey, generateKyberPreKey, -} from '../Curve.js'; -import type { SignalProtocolStore } from '../SignalProtocolStore.js'; -import { GLOBAL_ZONE, signalProtocolStore } from '../SignalProtocolStore.js'; -import { Address } from '../types/Address.js'; -import { QualifiedAddress } from '../types/QualifiedAddress.js'; -import { generateAci, generatePni } from '../types/ServiceId.js'; +} from '../Curve.node.js'; +import type { SignalProtocolStore } from '../SignalProtocolStore.preload.js'; +import { + GLOBAL_ZONE, + signalProtocolStore, +} from '../SignalProtocolStore.preload.js'; +import { Address } from '../types/Address.std.js'; +import { QualifiedAddress } from '../types/QualifiedAddress.std.js'; +import { generateAci, generatePni } from '../types/ServiceId.std.js'; import type { IdentityKeyType, KeyPairType } from '../textsecure/Types.d.ts'; -import { itemStorage } from '../textsecure/Storage.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const { clone } = lodash; diff --git a/ts/test-electron/WebsocketResources_test.ts b/ts/test-electron/WebsocketResources_test.ts index dd5e2f62fb..fcd12f659e 100644 --- a/ts/test-electron/WebsocketResources_test.ts +++ b/ts/test-electron/WebsocketResources_test.ts @@ -13,12 +13,12 @@ import EventEmitter from 'node:events'; import type { connection as WebSocket } from 'websocket'; import Long from 'long'; -import { dropNull } from '../util/dropNull.js'; -import { SignalService as Proto } from '../protobuf/index.js'; +import { dropNull } from '../util/dropNull.std.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; import WebSocketResource, { ServerRequestType, -} from '../textsecure/WebsocketResources.js'; +} from '../textsecure/WebsocketResources.preload.js'; describe('WebSocket-Resource', () => { class FakeSocket extends EventEmitter { diff --git a/ts/test-electron/background_test.ts b/ts/test-electron/background_test.ts index 46689f89f3..d06a978abd 100644 --- a/ts/test-electron/background_test.ts +++ b/ts/test-electron/background_test.ts @@ -4,9 +4,12 @@ import { assert } from 'chai'; import lodash from 'lodash'; -import { isOverHourIntoPast, cleanupSessionResets } from '../background.js'; -import { DataWriter } from '../sql/Client.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import { + isOverHourIntoPast, + cleanupSessionResets, +} from '../background.preload.js'; +import { DataWriter } from '../sql/Client.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const { pick } = lodash; diff --git a/ts/test-electron/backup/attachments_test.ts b/ts/test-electron/backup/attachments_test.ts index 686c0efcc8..549d822b33 100644 --- a/ts/test-electron/backup/attachments_test.ts +++ b/ts/test-electron/backup/attachments_test.ts @@ -6,13 +6,13 @@ import { BackupLevel } from '@signalapp/libsignal-client/zkgroup.js'; import lodash from 'lodash'; import { assert } from 'chai'; -import type { ConversationModel } from '../../models/conversations.js'; -import * as Bytes from '../../Bytes.js'; -import { DataWriter } from '../../sql/Client.js'; -import { type AciString, generateAci } from '../../types/ServiceId.js'; -import { ReadStatus } from '../../messages/MessageReadStatus.js'; -import { SeenStatus } from '../../MessageSeenStatus.js'; -import { setupBasics, asymmetricRoundtripHarness } from './helpers.js'; +import type { ConversationModel } from '../../models/conversations.preload.js'; +import * as Bytes from '../../Bytes.std.js'; +import { DataWriter } from '../../sql/Client.preload.js'; +import { type AciString, generateAci } from '../../types/ServiceId.std.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.std.js'; +import { SeenStatus } from '../../MessageSeenStatus.std.js'; +import { setupBasics, asymmetricRoundtripHarness } from './helpers.preload.js'; import { AUDIO_MP3, IMAGE_JPEG, @@ -20,27 +20,27 @@ import { IMAGE_WEBP, LONG_MESSAGE, VIDEO_MP4, -} from '../../types/MIME.js'; +} from '../../types/MIME.std.js'; import type { MessageAttributesType, QuotedMessageType, -} from '../../model-types.js'; +} from '../../model-types.d.ts'; import { hasRequiredInformationForBackup, isVoiceMessage, -} from '../../util/Attachment.js'; -import type { AttachmentType } from '../../types/Attachment.js'; -import { strictAssert } from '../../util/assert.js'; -import { SignalService } from '../../protobuf/index.js'; -import { getRandomBytes } from '../../Crypto.js'; -import { loadAllAndReinitializeRedux } from '../../services/allLoaders.js'; +} from '../../util/Attachment.std.js'; +import type { AttachmentType } from '../../types/Attachment.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { SignalService } from '../../protobuf/index.std.js'; +import { getRandomBytes } from '../../Crypto.node.js'; +import { loadAllAndReinitializeRedux } from '../../services/allLoaders.preload.js'; import { generateAttachmentKeys, generateKeys, getPlaintextHashForInMemoryAttachment, -} from '../../AttachmentCrypto.js'; -import { KIBIBYTE } from '../../types/AttachmentSize.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +} from '../../AttachmentCrypto.node.js'; +import { KIBIBYTE } from '../../types/AttachmentSize.std.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; const { omit } = lodash; diff --git a/ts/test-electron/backup/backup_groupv2_notifications_test.ts b/ts/test-electron/backup/backup_groupv2_notifications_test.ts index b8936a9b03..e6417195a1 100644 --- a/ts/test-electron/backup/backup_groupv2_notifications_test.ts +++ b/ts/test-electron/backup/backup_groupv2_notifications_test.ts @@ -3,27 +3,27 @@ import { v4 as generateGuid } from 'uuid'; -import { DataWriter } from '../../sql/Client.js'; -import { SignalService as Proto } from '../../protobuf/index.js'; +import { DataWriter } from '../../sql/Client.preload.js'; +import { SignalService as Proto } from '../../protobuf/index.std.js'; -import { generateAci, generatePni } from '../../types/ServiceId.js'; -import type { MessageAttributesType } from '../../model-types.js'; -import type { GroupV2ChangeType } from '../../types/groups.ts'; -import { getRandomBytes } from '../../Crypto.js'; -import * as Bytes from '../../Bytes.js'; -import { strictAssert } from '../../util/assert.js'; -import { DurationInSeconds } from '../../util/durations/index.js'; +import { generateAci, generatePni } from '../../types/ServiceId.std.js'; +import type { MessageAttributesType } from '../../model-types.d.ts'; +import type { GroupV2ChangeType } from '../../types/groups.std.js'; +import { getRandomBytes } from '../../Crypto.node.js'; +import * as Bytes from '../../Bytes.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { DurationInSeconds } from '../../util/durations/index.std.js'; import { OUR_ACI, OUR_PNI, setupBasics, asymmetricRoundtripHarness, symmetricRoundtripHarness, -} from './helpers.js'; -import { ReadStatus } from '../../messages/MessageReadStatus.js'; -import { SeenStatus } from '../../MessageSeenStatus.js'; -import { loadAllAndReinitializeRedux } from '../../services/allLoaders.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +} from './helpers.preload.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.std.js'; +import { SeenStatus } from '../../MessageSeenStatus.std.js'; +import { loadAllAndReinitializeRedux } from '../../services/allLoaders.preload.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; // Note: this should be kept up to date with GroupV2Change.stories.tsx, to // maintain the comprehensive set of GroupV2 notifications we need to handle diff --git a/ts/test-electron/backup/bubble_test.ts b/ts/test-electron/backup/bubble_test.ts index 7b51a5e741..8666e932dd 100644 --- a/ts/test-electron/backup/bubble_test.ts +++ b/ts/test-electron/backup/bubble_test.ts @@ -3,31 +3,31 @@ import { v4 as generateGuid } from 'uuid'; -import { SendStatus } from '../../messages/MessageSendState.js'; -import type { ConversationModel } from '../../models/conversations.js'; -import { GiftBadgeStates } from '../../types/GiftBadgeStates.js'; +import { SendStatus } from '../../messages/MessageSendState.std.js'; +import type { ConversationModel } from '../../models/conversations.preload.js'; +import { GiftBadgeStates } from '../../types/GiftBadgeStates.std.js'; -import { DataWriter } from '../../sql/Client.js'; -import { getRandomBytes } from '../../Crypto.js'; -import * as Bytes from '../../Bytes.js'; -import { generateAci } from '../../types/ServiceId.js'; -import { ReadStatus } from '../../messages/MessageReadStatus.js'; -import { SeenStatus } from '../../MessageSeenStatus.js'; -import { ID_V1_LENGTH } from '../../types/groups.js'; -import { DurationInSeconds, WEEK } from '../../util/durations/index.js'; +import { DataWriter } from '../../sql/Client.preload.js'; +import { getRandomBytes } from '../../Crypto.node.js'; +import * as Bytes from '../../Bytes.std.js'; +import { generateAci } from '../../types/ServiceId.std.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.std.js'; +import { SeenStatus } from '../../MessageSeenStatus.std.js'; +import { ID_V1_LENGTH } from '../../types/groups.std.js'; +import { DurationInSeconds, WEEK } from '../../util/durations/index.std.js'; import { setupBasics, asymmetricRoundtripHarness, symmetricRoundtripHarness, OUR_ACI, -} from './helpers.js'; -import { loadAllAndReinitializeRedux } from '../../services/allLoaders.js'; -import { strictAssert } from '../../util/assert.js'; -import type { MessageAttributesType } from '../../model-types.js'; -import { IMAGE_PNG, TEXT_ATTACHMENT } from '../../types/MIME.js'; -import { MY_STORY_ID } from '../../types/Stories.js'; -import { generateAttachmentKeys } from '../../AttachmentCrypto.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +} from './helpers.preload.js'; +import { loadAllAndReinitializeRedux } from '../../services/allLoaders.preload.js'; +import { strictAssert } from '../../util/assert.std.js'; +import type { MessageAttributesType } from '../../model-types.d.ts'; +import { IMAGE_PNG, TEXT_ATTACHMENT } from '../../types/MIME.std.js'; +import { MY_STORY_ID } from '../../types/Stories.std.js'; +import { generateAttachmentKeys } from '../../AttachmentCrypto.node.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; const CONTACT_A = generateAci(); const CONTACT_B = generateAci(); diff --git a/ts/test-electron/backup/calling_test.ts b/ts/test-electron/backup/calling_test.ts index 6d8744ac15..0cd0f1aaae 100644 --- a/ts/test-electron/backup/calling_test.ts +++ b/ts/test-electron/backup/calling_test.ts @@ -5,16 +5,16 @@ import assert from 'node:assert'; import { v4 as generateGuid } from 'uuid'; import { CallLinkRootKey } from '@signalapp/ringrtc'; -import type { ConversationModel } from '../../models/conversations.js'; -import type { MessageAttributesType } from '../../model-types.js'; -import type { CallHistoryDetails } from '../../types/CallDisposition.js'; -import type { CallLinkType } from '../../types/CallLink.js'; +import type { ConversationModel } from '../../models/conversations.preload.js'; +import type { MessageAttributesType } from '../../model-types.d.ts'; +import type { CallHistoryDetails } from '../../types/CallDisposition.std.js'; +import type { CallLinkType } from '../../types/CallLink.std.js'; -import * as Bytes from '../../Bytes.js'; -import { getRandomBytes } from '../../Crypto.js'; -import { DataReader, DataWriter } from '../../sql/Client.js'; -import { generateAci } from '../../types/ServiceId.js'; -import { setupBasics, symmetricRoundtripHarness } from './helpers.js'; +import * as Bytes from '../../Bytes.std.js'; +import { getRandomBytes } from '../../Crypto.node.js'; +import { DataReader, DataWriter } from '../../sql/Client.preload.js'; +import { generateAci } from '../../types/ServiceId.std.js'; +import { setupBasics, symmetricRoundtripHarness } from './helpers.preload.js'; import { AdhocCallStatus, CallDirection, @@ -22,15 +22,18 @@ import { CallType, DirectCallStatus, GroupCallStatus, -} from '../../types/CallDisposition.js'; -import { CallLinkRestrictions } from '../../types/CallLink.js'; -import { getRoomIdFromRootKey } from '../../util/callLinksRingrtc.js'; -import { fromAdminKeyBytes } from '../../util/callLinks.js'; -import { ReadStatus } from '../../messages/MessageReadStatus.js'; -import { SeenStatus } from '../../MessageSeenStatus.js'; -import { deriveGroupID, deriveGroupSecretParams } from '../../util/zkgroup.js'; -import { loadAllAndReinitializeRedux } from '../../services/allLoaders.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +} from '../../types/CallDisposition.std.js'; +import { CallLinkRestrictions } from '../../types/CallLink.std.js'; +import { getRoomIdFromRootKey } from '../../util/callLinksRingrtc.node.js'; +import { fromAdminKeyBytes } from '../../util/callLinks.std.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.std.js'; +import { SeenStatus } from '../../MessageSeenStatus.std.js'; +import { + deriveGroupID, + deriveGroupSecretParams, +} from '../../util/zkgroup.node.js'; +import { loadAllAndReinitializeRedux } from '../../services/allLoaders.preload.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; const CONTACT_A = generateAci(); const GROUP_MASTER_KEY = getRandomBytes(32); diff --git a/ts/test-electron/backup/conversations_test.ts b/ts/test-electron/backup/conversations_test.ts index 9e5e23e72b..078ebf671c 100644 --- a/ts/test-electron/backup/conversations_test.ts +++ b/ts/test-electron/backup/conversations_test.ts @@ -3,16 +3,19 @@ import { assert } from 'chai'; import { randomBytes } from 'node:crypto'; -import { getRandomBytes } from '../../Crypto.js'; -import * as Bytes from '../../Bytes.js'; -import { setupBasics, symmetricRoundtripHarness } from './helpers.js'; -import { loadAllAndReinitializeRedux } from '../../services/allLoaders.js'; -import { deriveGroupID, deriveGroupSecretParams } from '../../util/zkgroup.js'; -import { DataWriter } from '../../sql/Client.js'; -import { generateAci, generatePni } from '../../types/ServiceId.js'; -import type { ConversationAttributesType } from '../../model-types.js'; -import { strictAssert } from '../../util/assert.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +import { getRandomBytes } from '../../Crypto.node.js'; +import * as Bytes from '../../Bytes.std.js'; +import { setupBasics, symmetricRoundtripHarness } from './helpers.preload.js'; +import { loadAllAndReinitializeRedux } from '../../services/allLoaders.preload.js'; +import { + deriveGroupID, + deriveGroupSecretParams, +} from '../../util/zkgroup.node.js'; +import { DataWriter } from '../../sql/Client.preload.js'; +import { generateAci, generatePni } from '../../types/ServiceId.std.js'; +import type { ConversationAttributesType } from '../../model-types.d.ts'; +import { strictAssert } from '../../util/assert.std.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; function getGroupTestInfo() { const masterKey = getRandomBytes(32); diff --git a/ts/test-electron/backup/filePointer_test.ts b/ts/test-electron/backup/filePointer_test.ts index 7bae0ca6d8..bd1feac3e2 100644 --- a/ts/test-electron/backup/filePointer_test.ts +++ b/ts/test-electron/backup/filePointer_test.ts @@ -7,21 +7,21 @@ import { BackupLevel } from '@signalapp/libsignal-client/zkgroup.js'; import { randomBytes } from 'node:crypto'; import { join } from 'node:path'; -import { Backups } from '../../protobuf/index.js'; +import { Backups } from '../../protobuf/index.std.js'; import { getFilePointerForAttachment, convertFilePointerToAttachment, -} from '../../services/backups/util/filePointers.js'; -import { IMAGE_PNG } from '../../types/MIME.js'; -import * as Bytes from '../../Bytes.js'; -import type { AttachmentType } from '../../types/Attachment.js'; -import { MASTER_KEY, MEDIA_ROOT_KEY } from './helpers.js'; -import { generateKeys } from '../../AttachmentCrypto.js'; -import type { GetBackupCdnInfoType } from '../../services/backups/util/mediaId.js'; -import { strictAssert } from '../../util/assert.js'; -import { isValidAttachmentKey } from '../../types/Crypto.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +} from '../../services/backups/util/filePointers.preload.js'; +import { IMAGE_PNG } from '../../types/MIME.std.js'; +import * as Bytes from '../../Bytes.std.js'; +import type { AttachmentType } from '../../types/Attachment.std.js'; +import { MASTER_KEY, MEDIA_ROOT_KEY } from './helpers.preload.js'; +import { generateKeys } from '../../AttachmentCrypto.node.js'; +import type { GetBackupCdnInfoType } from '../../services/backups/util/mediaId.preload.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { isValidAttachmentKey } from '../../types/Crypto.std.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; describe('convertFilePointerToAttachment', () => { const commonFilePointerProps = { diff --git a/ts/test-electron/backup/helpers.ts b/ts/test-electron/backup/helpers.ts index d86153323c..f2c662f6a8 100644 --- a/ts/test-electron/backup/helpers.ts +++ b/ts/test-electron/backup/helpers.ts @@ -15,20 +15,20 @@ import type { EditHistoryType, MessageAttributesType, MessageReactionType, -} from '../../model-types.js'; +} from '../../model-types.d.ts'; import type { SendStateByConversationId, SendState, -} from '../../messages/MessageSendState.js'; +} from '../../messages/MessageSendState.std.js'; -import { backupsService } from '../../services/backups/index.js'; -import { isUnsupportedMessage } from '../../state/selectors/message.js'; -import { generateAci, generatePni } from '../../types/ServiceId.js'; -import { DataReader, DataWriter } from '../../sql/Client.js'; -import { getRandomBytes } from '../../Crypto.js'; -import * as Bytes from '../../Bytes.js'; -import { postSaveUpdates } from '../../util/cleanup.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +import { backupsService } from '../../services/backups/index.preload.js'; +import { isUnsupportedMessage } from '../../state/selectors/message.preload.js'; +import { generateAci, generatePni } from '../../types/ServiceId.std.js'; +import { DataReader, DataWriter } from '../../sql/Client.preload.js'; +import { getRandomBytes } from '../../Crypto.node.js'; +import * as Bytes from '../../Bytes.std.js'; +import { postSaveUpdates } from '../../util/cleanup.preload.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; const { omit, sortBy } = lodash; diff --git a/ts/test-electron/backup/integration_test.ts b/ts/test-electron/backup/integration_test.ts index 9bcfb8555f..13e3d67287 100644 --- a/ts/test-electron/backup/integration_test.ts +++ b/ts/test-electron/backup/integration_test.ts @@ -12,11 +12,14 @@ import { } from '@signalapp/libsignal-client/dist/MessageBackup.js'; import { assert } from 'chai'; -import { clearData } from './helpers.js'; -import { loadAllAndReinitializeRedux } from '../../services/allLoaders.js'; -import { backupsService, BackupType } from '../../services/backups/index.js'; -import { initialize as initializeExpiringMessageService } from '../../services/expiringMessagesDeletion.js'; -import { MemoryStream } from '../../util/MemoryStream.js'; +import { clearData } from './helpers.preload.js'; +import { loadAllAndReinitializeRedux } from '../../services/allLoaders.preload.js'; +import { + backupsService, + BackupType, +} from '../../services/backups/index.preload.js'; +import { initialize as initializeExpiringMessageService } from '../../services/expiringMessagesDeletion.preload.js'; +import { MemoryStream } from '../../util/MemoryStream.node.js'; const { BACKUP_INTEGRATION_DIR } = process.env; diff --git a/ts/test-electron/backup/non_bubble_test.ts b/ts/test-electron/backup/non_bubble_test.ts index 05bdc178af..3fecbb577f 100644 --- a/ts/test-electron/backup/non_bubble_test.ts +++ b/ts/test-electron/backup/non_bubble_test.ts @@ -4,28 +4,28 @@ import { v4 as generateGuid } from 'uuid'; import Long from 'long'; -import type { ConversationModel } from '../../models/conversations.js'; +import type { ConversationModel } from '../../models/conversations.preload.js'; -import { getRandomBytes } from '../../Crypto.js'; -import * as Bytes from '../../Bytes.js'; -import { SignalService as Proto, Backups } from '../../protobuf/index.js'; -import { DataWriter } from '../../sql/Client.js'; -import { APPLICATION_OCTET_STREAM } from '../../types/MIME.js'; -import { generateAci } from '../../types/ServiceId.js'; -import { PaymentEventKind } from '../../types/Payment.js'; -import { ContactFormType } from '../../types/EmbeddedContact.js'; -import { MessageRequestResponseEvent } from '../../types/MessageRequestResponseEvent.js'; -import { DurationInSeconds } from '../../util/durations/index.js'; -import { ReadStatus } from '../../messages/MessageReadStatus.js'; -import { SeenStatus } from '../../MessageSeenStatus.js'; +import { getRandomBytes } from '../../Crypto.node.js'; +import * as Bytes from '../../Bytes.std.js'; +import { SignalService as Proto, Backups } from '../../protobuf/index.std.js'; +import { DataWriter } from '../../sql/Client.preload.js'; +import { APPLICATION_OCTET_STREAM } from '../../types/MIME.std.js'; +import { generateAci } from '../../types/ServiceId.std.js'; +import { PaymentEventKind } from '../../types/Payment.std.js'; +import { ContactFormType } from '../../types/EmbeddedContact.std.js'; +import { MessageRequestResponseEvent } from '../../types/MessageRequestResponseEvent.std.js'; +import { DurationInSeconds } from '../../util/durations/index.std.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.std.js'; +import { SeenStatus } from '../../MessageSeenStatus.std.js'; import { setupBasics, asymmetricRoundtripHarness, symmetricRoundtripHarness, OUR_ACI, -} from './helpers.js'; -import { loadAllAndReinitializeRedux } from '../../services/allLoaders.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +} from './helpers.preload.js'; +import { loadAllAndReinitializeRedux } from '../../services/allLoaders.preload.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; const CONTACT_A = generateAci(); const GROUP_ID = Bytes.toBase64(getRandomBytes(32)); diff --git a/ts/test-electron/cleanupOrphanedAttachments_test.ts b/ts/test-electron/cleanupOrphanedAttachments_test.ts index 9ed68414c9..1291734cdf 100644 --- a/ts/test-electron/cleanupOrphanedAttachments_test.ts +++ b/ts/test-electron/cleanupOrphanedAttachments_test.ts @@ -7,22 +7,22 @@ import { v4 as generateUuid } from 'uuid'; import { readdirSync } from 'node:fs'; import { dirname } from 'node:path'; -import { DataWriter } from '../sql/Client.js'; -import { missingCaseError } from '../util/missingCaseError.js'; +import { DataWriter } from '../sql/Client.preload.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; import { getAbsoluteAttachmentPath, getAbsoluteDownloadsPath, getAbsoluteDraftPath, -} from '../util/migrations.js'; +} from '../util/migrations.preload.js'; import { getDownloadsPath, getDraftPath, getPath, -} from '../windows/main/attachments.js'; +} from '../windows/main/attachments.preload.js'; -import { generateAci } from '../types/ServiceId.js'; -import { IMAGE_JPEG, LONG_MESSAGE } from '../types/MIME.js'; -import type { MessageAttributesType } from '../model-types.js'; +import { generateAci } from '../types/ServiceId.std.js'; +import { IMAGE_JPEG, LONG_MESSAGE } from '../types/MIME.std.js'; +import type { MessageAttributesType } from '../model-types.d.ts'; const { emptyDir, ensureFile } = fsExtra; diff --git a/ts/test-electron/components/Avatar_test.tsx b/ts/test-electron/components/Avatar_test.tsx index 3208bfefd7..f3388fb0ec 100644 --- a/ts/test-electron/components/Avatar_test.tsx +++ b/ts/test-electron/components/Avatar_test.tsx @@ -3,7 +3,10 @@ import { assert } from 'chai'; -import { _getBadgeSize, _getBadgePlacement } from '../../components/Avatar.js'; +import { + _getBadgeSize, + _getBadgePlacement, +} from '../../components/Avatar.dom.js'; describe('', () => { describe('_getBadgeSize', () => { diff --git a/ts/test-electron/context/Crypto_test.ts b/ts/test-electron/context/Crypto_test.ts index 70aff6450f..0d0f0cc9fc 100644 --- a/ts/test-electron/context/Crypto_test.ts +++ b/ts/test-electron/context/Crypto_test.ts @@ -11,7 +11,7 @@ import { sign, encrypt, decrypt, -} from '../../Crypto.js'; +} from '../../Crypto.node.js'; describe('SignalContext.Crypto', () => { describe('hash', () => { diff --git a/ts/test-electron/context/createNativeThemeListener_test.ts b/ts/test-electron/context/createNativeThemeListener_test.ts index cd13f4f2fe..658bce80cd 100644 --- a/ts/test-electron/context/createNativeThemeListener_test.ts +++ b/ts/test-electron/context/createNativeThemeListener_test.ts @@ -7,10 +7,10 @@ import { EventEmitter } from 'node:events'; import type { MinimalIPC, SystemThemeHolder, -} from '../../context/createNativeThemeListener.js'; -import { createNativeThemeListener } from '../../context/createNativeThemeListener.js'; +} from '../../context/createNativeThemeListener.std.js'; +import { createNativeThemeListener } from '../../context/createNativeThemeListener.std.js'; import type { NativeThemeState } from '../../types/NativeThemeNotifier.d.ts'; -import { SystemThemeType } from '../../types/Util.js'; +import { SystemThemeType } from '../../types/Util.std.js'; class FakeIPC extends EventEmitter implements MinimalIPC { constructor(private readonly state: NativeThemeState) { diff --git a/ts/test-electron/deleteMessageAttachments_test.ts b/ts/test-electron/deleteMessageAttachments_test.ts index 0e8395ed7c..582836461e 100644 --- a/ts/test-electron/deleteMessageAttachments_test.ts +++ b/ts/test-electron/deleteMessageAttachments_test.ts @@ -7,13 +7,16 @@ import { v4 as generateUuid } from 'uuid'; import { readdirSync } from 'node:fs'; import { dirname } from 'node:path'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { getDownloadsPath, getPath } from '../windows/main/attachments.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { + getDownloadsPath, + getPath, +} from '../windows/main/attachments.preload.js'; -import { IMAGE_JPEG, LONG_MESSAGE } from '../types/MIME.js'; -import type { MessageAttributesType } from '../model-types.js'; -import type { AttachmentType } from '../types/Attachment.js'; -import { deleteAllAttachmentFilesOnDisk } from '../util/Attachment.js'; +import { IMAGE_JPEG, LONG_MESSAGE } from '../types/MIME.std.js'; +import type { MessageAttributesType } from '../model-types.d.ts'; +import type { AttachmentType } from '../types/Attachment.std.js'; +import { deleteAllAttachmentFilesOnDisk } from '../util/Attachment.std.js'; import { getAbsoluteAttachmentPath, getAbsoluteDownloadsPath, @@ -21,8 +24,8 @@ import { deleteAttachmentData, deleteDownloadData, deleteExternalMessageFiles, -} from '../util/migrations.js'; -import { strictAssert } from '../util/assert.js'; +} from '../util/migrations.preload.js'; +import { strictAssert } from '../util/assert.std.js'; const { emptyDir, ensureFile } = fsExtra; diff --git a/ts/test-electron/linkPreviews/linkPreviewFetch_test.ts b/ts/test-electron/linkPreviews/linkPreviewFetch_test.ts index 747a0597ae..85639cbe27 100644 --- a/ts/test-electron/linkPreviews/linkPreviewFetch_test.ts +++ b/ts/test-electron/linkPreviews/linkPreviewFetch_test.ts @@ -6,13 +6,17 @@ import { Response } from 'node-fetch'; import * as sinon from 'sinon'; import * as fs from 'node:fs'; import * as path from 'node:path'; -import { IMAGE_JPEG, IMAGE_WEBP, stringToMIMEType } from '../../types/MIME.js'; -import type { LoggerType } from '../../types/Logging.js'; +import { + IMAGE_JPEG, + IMAGE_WEBP, + stringToMIMEType, +} from '../../types/MIME.std.js'; +import type { LoggerType } from '../../types/Logging.std.js'; import { fetchLinkPreviewImage, fetchLinkPreviewMetadata, -} from '../../linkPreviews/linkPreviewFetch.js'; +} from '../../linkPreviews/linkPreviewFetch.preload.js'; async function readFixtureImage(filename: string): Promise { const result = await fs.promises.readFile( diff --git a/ts/test-electron/models/conversations_test.ts b/ts/test-electron/models/conversations_test.ts index 5e0da3c0bd..f397924fe9 100644 --- a/ts/test-electron/models/conversations_test.ts +++ b/ts/test-electron/models/conversations_test.ts @@ -4,14 +4,14 @@ import { assert } from 'chai'; import { v7 as generateUuid } from 'uuid'; -import { DataWriter } from '../../sql/Client.js'; -import { SendStatus } from '../../messages/MessageSendState.js'; -import { IMAGE_PNG } from '../../types/MIME.js'; -import { generateAci, generatePni } from '../../types/ServiceId.js'; -import { MessageModel } from '../../models/messages.js'; -import { DurationInSeconds } from '../../util/durations/index.js'; -import { ConversationModel } from '../../models/conversations.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +import { DataWriter } from '../../sql/Client.preload.js'; +import { SendStatus } from '../../messages/MessageSendState.std.js'; +import { IMAGE_PNG } from '../../types/MIME.std.js'; +import { generateAci, generatePni } from '../../types/ServiceId.std.js'; +import { MessageModel } from '../../models/messages.preload.js'; +import { DurationInSeconds } from '../../util/durations/index.std.js'; +import { ConversationModel } from '../../models/conversations.preload.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; describe('Conversations', () => { async function resetConversationController(): Promise { diff --git a/ts/test-electron/models/messages_test.ts b/ts/test-electron/models/messages_test.ts index 0c8463c621..18df7d81a1 100644 --- a/ts/test-electron/models/messages_test.ts +++ b/ts/test-electron/models/messages_test.ts @@ -5,19 +5,19 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; import { v4 as generateUuid } from 'uuid'; -import type { AttachmentType } from '../../types/Attachment.js'; +import type { AttachmentType } from '../../types/Attachment.std.js'; import type { CallbackResultType } from '../../textsecure/Types.d.ts'; -import type { ConversationModel } from '../../models/conversations.js'; +import type { ConversationModel } from '../../models/conversations.preload.js'; import type { MessageAttributesType } from '../../model-types.d.ts'; -import { MessageModel } from '../../models/messages.js'; -import type { RawBodyRange } from '../../types/BodyRange.js'; -import { DataWriter } from '../../sql/Client.js'; +import { MessageModel } from '../../models/messages.preload.js'; +import type { RawBodyRange } from '../../types/BodyRange.std.js'; +import { DataWriter } from '../../sql/Client.preload.js'; import enMessages from '../../../_locales/en/messages.json'; -import { SendStatus } from '../../messages/MessageSendState.js'; -import { SignalService as Proto } from '../../protobuf/index.js'; -import { generateAci } from '../../types/ServiceId.js'; -import { getAuthor } from '../../messages/sources.js'; -import { setupI18n } from '../../util/setupI18n.js'; +import { SendStatus } from '../../messages/MessageSendState.std.js'; +import { SignalService as Proto } from '../../protobuf/index.std.js'; +import { generateAci } from '../../types/ServiceId.std.js'; +import { getAuthor } from '../../messages/sources.preload.js'; +import { setupI18n } from '../../util/setupI18n.dom.js'; import { APPLICATION_JSON, AUDIO_MP3, @@ -26,12 +26,12 @@ import { LONG_MESSAGE, TEXT_ATTACHMENT, VIDEO_MP4, -} from '../../types/MIME.js'; -import { getNotificationDataForMessage } from '../../util/getNotificationDataForMessage.js'; -import { getNotificationTextForMessage } from '../../util/getNotificationTextForMessage.js'; -import { send } from '../../messages/send.js'; -import { messageSender } from '../../textsecure/SendMessage.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +} from '../../types/MIME.std.js'; +import { getNotificationDataForMessage } from '../../util/getNotificationDataForMessage.preload.js'; +import { getNotificationTextForMessage } from '../../util/getNotificationTextForMessage.preload.js'; +import { send } from '../../messages/send.preload.js'; +import { messageSender } from '../../textsecure/SendMessage.preload.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; describe('Message', () => { const i18n = setupI18n('en', enMessages); diff --git a/ts/test-electron/normalizedAttachments_test.ts b/ts/test-electron/normalizedAttachments_test.ts index 9ec7c28a5e..9c973ef7b6 100644 --- a/ts/test-electron/normalizedAttachments_test.ts +++ b/ts/test-electron/normalizedAttachments_test.ts @@ -4,27 +4,27 @@ import { assert } from 'chai'; import { v4 as generateGuid } from 'uuid'; -import * as Bytes from '../Bytes.js'; +import * as Bytes from '../Bytes.std.js'; import type { EphemeralAttachmentFields, ScreenshotType, AttachmentType, ThumbnailType, BackupThumbnailType, -} from '../types/Attachment.js'; +} from '../types/Attachment.std.js'; import { APPLICATION_OCTET_STREAM, IMAGE_JPEG, IMAGE_PNG, LONG_MESSAGE, -} from '../types/MIME.js'; -import type { MessageAttributesType } from '../model-types.js'; -import { generateAci } from '../types/ServiceId.js'; -import { ReadStatus } from '../messages/MessageReadStatus.js'; -import { SeenStatus } from '../MessageSeenStatus.js'; -import { DataWriter, DataReader } from '../sql/Client.js'; -import { strictAssert } from '../util/assert.js'; -import { HOUR, MINUTE } from '../util/durations/index.js'; +} from '../types/MIME.std.js'; +import type { MessageAttributesType } from '../model-types.d.ts'; +import { generateAci } from '../types/ServiceId.std.js'; +import { ReadStatus } from '../messages/MessageReadStatus.std.js'; +import { SeenStatus } from '../MessageSeenStatus.std.js'; +import { DataWriter, DataReader } from '../sql/Client.preload.js'; +import { strictAssert } from '../util/assert.std.js'; +import { HOUR, MINUTE } from '../util/durations/index.std.js'; const CONTACT_A = generateAci(); const contactAConversationId = generateGuid(); diff --git a/ts/test-electron/quill/emoji/completion_test.tsx b/ts/test-electron/quill/emoji/completion_test.tsx index b092d5a370..a25e4f50a3 100644 --- a/ts/test-electron/quill/emoji/completion_test.tsx +++ b/ts/test-electron/quill/emoji/completion_test.tsx @@ -4,26 +4,26 @@ import { assert } from 'chai'; import sinon from 'sinon'; -import { EmojiCompletion } from '../../../quill/emoji/completion.js'; +import { EmojiCompletion } from '../../../quill/emoji/completion.dom.js'; import type { EmojiCompletionOptions, InsertEmojiOptionsType, -} from '../../../quill/emoji/completion.js'; +} from '../../../quill/emoji/completion.dom.js'; import { EMOJI_VARIANT_KEY_CONSTANTS, EmojiSkinTone, getEmojiParentKeyByVariantKey, getEmojiVariantByKey, -} from '../../../components/fun/data/emojis.js'; +} from '../../../components/fun/data/emojis.std.js'; import { _createFunEmojiSearch, createFunEmojiSearchIndex, -} from '../../../components/fun/useFunEmojiSearch.js'; +} from '../../../components/fun/useFunEmojiSearch.dom.js'; import { _createFunEmojiLocalizer, createFunEmojiLocalizerIndex, -} from '../../../components/fun/useFunEmojiLocalizer.js'; -import type { LocaleEmojiListType } from '../../../types/emoji.js'; +} from '../../../components/fun/useFunEmojiLocalizer.dom.js'; +import type { LocaleEmojiListType } from '../../../types/emoji.std.js'; const EMOJI_VARIANTS = { SMILE: getEmojiVariantByKey( diff --git a/ts/test-electron/quill/memberRepository_test.ts b/ts/test-electron/quill/memberRepository_test.ts index 1f4a321f08..efa5420f58 100644 --- a/ts/test-electron/quill/memberRepository_test.ts +++ b/ts/test-electron/quill/memberRepository_test.ts @@ -3,11 +3,14 @@ import { assert } from 'chai'; -import { generateAci } from '../../types/ServiceId.js'; -import { isAciString } from '../../util/isAciString.js'; -import type { ConversationType } from '../../state/ducks/conversations.js'; -import { MemberRepository, _toMembers } from '../../quill/memberRepository.js'; -import { getDefaultConversationWithServiceId } from '../../test-helpers/getDefaultConversation.js'; +import { generateAci } from '../../types/ServiceId.std.js'; +import { isAciString } from '../../util/isAciString.std.js'; +import type { ConversationType } from '../../state/ducks/conversations.preload.js'; +import { + MemberRepository, + _toMembers, +} from '../../quill/memberRepository.std.js'; +import { getDefaultConversationWithServiceId } from '../../test-helpers/getDefaultConversation.std.js'; const UNKNOWN_SERVICE_ID = generateAci(); diff --git a/ts/test-electron/quill/mentions/completion_test.tsx b/ts/test-electron/quill/mentions/completion_test.tsx index 7a45e1ac68..d5bb88a215 100644 --- a/ts/test-electron/quill/mentions/completion_test.tsx +++ b/ts/test-electron/quill/mentions/completion_test.tsx @@ -9,17 +9,17 @@ import type Quill from '@signalapp/quill-cjs'; import type Keyboard from '@signalapp/quill-cjs/modules/keyboard.js'; import type { MutableRefObject } from 'react'; -import type { MentionCompletionOptions } from '../../../quill/mentions/completion.js'; -import { MentionCompletion } from '../../../quill/mentions/completion.js'; -import type { ConversationType } from '../../../state/ducks/conversations.js'; +import type { MentionCompletionOptions } from '../../../quill/mentions/completion.dom.js'; +import { MentionCompletion } from '../../../quill/mentions/completion.dom.js'; +import type { ConversationType } from '../../../state/ducks/conversations.preload.js'; import { MemberRepository, _toMembers, -} from '../../../quill/memberRepository.js'; -import type { MemberType } from '../../../quill/memberRepository.js'; -import { ThemeType } from '../../../types/Util.js'; -import { getDefaultConversationWithServiceId } from '../../../test-helpers/getDefaultConversation.js'; -import { setupI18n } from '../../../util/setupI18n.js'; +} from '../../../quill/memberRepository.std.js'; +import type { MemberType } from '../../../quill/memberRepository.std.js'; +import { ThemeType } from '../../../types/Util.std.js'; +import { getDefaultConversationWithServiceId } from '../../../test-helpers/getDefaultConversation.std.js'; +import { setupI18n } from '../../../util/setupI18n.dom.js'; type MiniLeafBlot = { value: () => string; diff --git a/ts/test-electron/quill/mentions/matchers_test.ts b/ts/test-electron/quill/mentions/matchers_test.ts index 6788dd72ff..b37e678b3c 100644 --- a/ts/test-electron/quill/mentions/matchers_test.ts +++ b/ts/test-electron/quill/mentions/matchers_test.ts @@ -5,12 +5,12 @@ import { assert } from 'chai'; import type { RefObject } from 'react'; import { Delta } from '@signalapp/quill-cjs'; -import type { AciString } from '../../../types/ServiceId.js'; -import { generateAci } from '../../../types/ServiceId.js'; -import { matchMention } from '../../../quill/mentions/matchers.js'; -import { MemberRepository } from '../../../quill/memberRepository.js'; -import type { ConversationType } from '../../../state/ducks/conversations.js'; -import { getDefaultConversationWithServiceId } from '../../../test-helpers/getDefaultConversation.js'; +import type { AciString } from '../../../types/ServiceId.std.js'; +import { generateAci } from '../../../types/ServiceId.std.js'; +import { matchMention } from '../../../quill/mentions/matchers.std.js'; +import { MemberRepository } from '../../../quill/memberRepository.std.js'; +import type { ConversationType } from '../../../state/ducks/conversations.preload.js'; +import { getDefaultConversationWithServiceId } from '../../../test-helpers/getDefaultConversation.std.js'; const ACI_1 = generateAci(); diff --git a/ts/test-electron/quill/util_test.ts b/ts/test-electron/quill/util_test.ts index cf40bc7e75..3fb83cc531 100644 --- a/ts/test-electron/quill/util_test.ts +++ b/ts/test-electron/quill/util_test.ts @@ -7,9 +7,9 @@ import { getDeltaToRemoveStaleMentions, getTextAndRangesFromOps, getDeltaToRestartMention, -} from '../../quill/util.js'; -import { BodyRange } from '../../types/BodyRange.js'; -import { generateAci } from '../../types/ServiceId.js'; +} from '../../quill/util.dom.js'; +import { BodyRange } from '../../types/BodyRange.std.js'; +import { generateAci } from '../../types/ServiceId.std.js'; const SERVICE_ID_1 = generateAci(); const SERVICE_ID_2 = generateAci(); diff --git a/ts/test-electron/routineProfileRefresh_test.ts b/ts/test-electron/routineProfileRefresh_test.ts index 6ba093ef72..46e198a455 100644 --- a/ts/test-electron/routineProfileRefresh_test.ts +++ b/ts/test-electron/routineProfileRefresh_test.ts @@ -5,13 +5,13 @@ import * as sinon from 'sinon'; import { v4 as generateUuid } from 'uuid'; import lodash from 'lodash'; -import { ConversationModel } from '../models/conversations.js'; +import { ConversationModel } from '../models/conversations.preload.js'; import type { ConversationAttributesType } from '../model-types.d.ts'; -import { generateAci } from '../types/ServiceId.js'; -import { DAY, HOUR, MINUTE, MONTH } from '../util/durations/index.js'; +import { generateAci } from '../types/ServiceId.std.js'; +import { DAY, HOUR, MINUTE, MONTH } from '../util/durations/index.std.js'; -import { routineProfileRefresh } from '../routineProfileRefresh.js'; -import type { getProfile } from '../util/getProfile.js'; +import { routineProfileRefresh } from '../routineProfileRefresh.preload.js'; +import type { getProfile } from '../util/getProfile.preload.js'; const { times } = lodash; diff --git a/ts/test-electron/scrollUtil_test.ts b/ts/test-electron/scrollUtil_test.ts index dd7b8c138d..a59b1a98b3 100644 --- a/ts/test-electron/scrollUtil_test.ts +++ b/ts/test-electron/scrollUtil_test.ts @@ -7,7 +7,7 @@ import { getScrollBottom, scrollToBottom, setScrollBottom, -} from '../util/scrollUtil.js'; +} from '../util/scrollUtil.std.js'; describe('scroll utilities', () => { let sandbox: HTMLDivElement; diff --git a/ts/test-electron/services/ActiveWindowService_test.ts b/ts/test-electron/services/ActiveWindowService_test.ts index 751c70fdd9..b8e886f1fd 100644 --- a/ts/test-electron/services/ActiveWindowService_test.ts +++ b/ts/test-electron/services/ActiveWindowService_test.ts @@ -5,7 +5,7 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; import { EventEmitter } from 'node:events'; -import { getActiveWindowService } from '../../services/ActiveWindowService.js'; +import { getActiveWindowService } from '../../services/ActiveWindowService.std.js'; describe('ActiveWindowService', () => { const fakeIpcEvent = {}; diff --git a/ts/test-electron/services/AttachmentBackupManager_test.ts b/ts/test-electron/services/AttachmentBackupManager_test.ts index 6405a32b5d..e9623416f4 100644 --- a/ts/test-electron/services/AttachmentBackupManager_test.ts +++ b/ts/test-electron/services/AttachmentBackupManager_test.ts @@ -7,27 +7,30 @@ import { join } from 'node:path'; import { createWriteStream } from 'node:fs'; import fsExtra from 'fs-extra'; -import * as Bytes from '../../Bytes.js'; +import * as Bytes from '../../Bytes.std.js'; import { AttachmentBackupManager, FILE_NOT_FOUND_ON_TRANSIT_TIER_STATUS, runAttachmentBackupJob, -} from '../../jobs/AttachmentBackupManager.js'; +} from '../../jobs/AttachmentBackupManager.preload.js'; import type { AttachmentBackupJobType, CoreAttachmentBackupJobType, StandardAttachmentBackupJobType, ThumbnailAttachmentBackupJobType, -} from '../../types/AttachmentBackup.js'; -import { DataWriter } from '../../sql/Client.js'; -import { getRandomBytes } from '../../Crypto.js'; -import { APPLICATION_OCTET_STREAM, VIDEO_MP4 } from '../../types/MIME.js'; -import { createName, getRelativePath } from '../../util/attachmentPath.js'; -import { getAbsoluteAttachmentPath } from '../../util/migrations.js'; -import { encryptAttachmentV2, generateKeys } from '../../AttachmentCrypto.js'; -import { SECOND } from '../../util/durations/index.js'; -import { HTTPError } from '../../types/HTTPError.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +} from '../../types/AttachmentBackup.std.js'; +import { DataWriter } from '../../sql/Client.preload.js'; +import { getRandomBytes } from '../../Crypto.node.js'; +import { APPLICATION_OCTET_STREAM, VIDEO_MP4 } from '../../types/MIME.std.js'; +import { createName, getRelativePath } from '../../util/attachmentPath.node.js'; +import { getAbsoluteAttachmentPath } from '../../util/migrations.preload.js'; +import { + encryptAttachmentV2, + generateKeys, +} from '../../AttachmentCrypto.node.js'; +import { SECOND } from '../../util/durations/index.std.js'; +import { HTTPError } from '../../types/HTTPError.std.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; const { ensureFile } = fsExtra; diff --git a/ts/test-electron/services/AttachmentDownloadManager_test.ts b/ts/test-electron/services/AttachmentDownloadManager_test.ts index fec7f5ae16..7a118fc580 100644 --- a/ts/test-electron/services/AttachmentDownloadManager_test.ts +++ b/ts/test-electron/services/AttachmentDownloadManager_test.ts @@ -8,39 +8,39 @@ import { assert } from 'chai'; import lodash from 'lodash'; import type { StatsFs } from 'node:fs'; -import * as MIME from '../../types/MIME.js'; +import * as MIME from '../../types/MIME.std.js'; import { AttachmentDownloadManager, runDownloadAttachmentJob, runDownloadAttachmentJobInner, type NewAttachmentDownloadJobType, -} from '../../jobs/AttachmentDownloadManager.js'; +} from '../../jobs/AttachmentDownloadManager.preload.js'; import { type AttachmentDownloadJobType, AttachmentDownloadUrgency, MediaTier, -} from '../../types/AttachmentDownload.js'; -import { DataReader, DataWriter } from '../../sql/Client.js'; -import { DAY, MINUTE, MONTH } from '../../util/durations/index.js'; +} from '../../types/AttachmentDownload.std.js'; +import { DataReader, DataWriter } from '../../sql/Client.preload.js'; +import { DAY, MINUTE, MONTH } from '../../util/durations/index.std.js'; import { type AttachmentType, AttachmentVariant, -} from '../../types/Attachment.js'; -import { strictAssert } from '../../util/assert.js'; -import type { downloadAttachment as downloadAttachmentUtil } from '../../util/downloadAttachment.js'; -import { AttachmentDownloadSource } from '../../sql/Interface.js'; -import { generateAttachmentKeys } from '../../AttachmentCrypto.js'; -import { getAttachmentCiphertextSize } from '../../util/AttachmentCrypto.js'; -import { MEBIBYTE } from '../../types/AttachmentSize.js'; -import { generateAci } from '../../types/ServiceId.js'; -import { toBase64, toHex } from '../../Bytes.js'; -import { getRandomBytes } from '../../Crypto.js'; -import { JobCancelReason } from '../../jobs/types.js'; +} from '../../types/Attachment.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import type { downloadAttachment as downloadAttachmentUtil } from '../../util/downloadAttachment.preload.js'; +import { AttachmentDownloadSource } from '../../sql/Interface.std.js'; +import { generateAttachmentKeys } from '../../AttachmentCrypto.node.js'; +import { getAttachmentCiphertextSize } from '../../util/AttachmentCrypto.std.js'; +import { MEBIBYTE } from '../../types/AttachmentSize.std.js'; +import { generateAci } from '../../types/ServiceId.std.js'; +import { toBase64, toHex } from '../../Bytes.std.js'; +import { getRandomBytes } from '../../Crypto.node.js'; +import { JobCancelReason } from '../../jobs/types.std.js'; import { explodePromise, type ExplodePromiseResultType, -} from '../../util/explodePromise.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +} from '../../util/explodePromise.std.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; const { omit } = lodash; diff --git a/ts/test-electron/services/MessageCache_test.ts b/ts/test-electron/services/MessageCache_test.ts index 4476646fd2..02986f291b 100644 --- a/ts/test-electron/services/MessageCache_test.ts +++ b/ts/test-electron/services/MessageCache_test.ts @@ -3,13 +3,13 @@ import { assert } from 'chai'; import { v4 as uuid } from 'uuid'; -import { MessageModel } from '../../models/messages.js'; -import { strictAssert } from '../../util/assert.js'; +import { MessageModel } from '../../models/messages.preload.js'; +import { strictAssert } from '../../util/assert.std.js'; -import { MessageCache } from '../../services/MessageCache.js'; -import { generateAci } from '../../types/ServiceId.js'; -import { DataWriter } from '../../sql/Client.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +import { MessageCache } from '../../services/MessageCache.preload.js'; +import { generateAci } from '../../types/ServiceId.std.js'; +import { DataWriter } from '../../sql/Client.preload.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; describe('MessageCache', () => { beforeEach(async () => { diff --git a/ts/test-electron/services/ReleaseNotesFetcher_test.ts b/ts/test-electron/services/ReleaseNotesFetcher_test.ts index a33c77d47f..df6345fe15 100644 --- a/ts/test-electron/services/ReleaseNotesFetcher_test.ts +++ b/ts/test-electron/services/ReleaseNotesFetcher_test.ts @@ -6,13 +6,13 @@ import * as sinon from 'sinon'; import { EventEmitter } from 'node:events'; import { v4 as uuid } from 'uuid'; -import { ReleaseNotesFetcher } from '../../services/releaseNotesFetcher.js'; -import * as durations from '../../util/durations/index.js'; -import { generateAci } from '../../types/ServiceId.js'; -import { saveNewMessageBatcher } from '../../util/messageBatcher.js'; -import type { CIType } from '../../CI.js'; -import type { ConversationModel } from '../../models/conversations.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +import { ReleaseNotesFetcher } from '../../services/releaseNotesFetcher.preload.js'; +import * as durations from '../../util/durations/index.std.js'; +import { generateAci } from '../../types/ServiceId.std.js'; +import { saveNewMessageBatcher } from '../../util/messageBatcher.preload.js'; +import type { CIType } from '../../CI.preload.js'; +import type { ConversationModel } from '../../models/conversations.preload.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; const waitUntil = ( condition: () => boolean, diff --git a/ts/test-electron/services/areWeASubscriber_test.ts b/ts/test-electron/services/areWeASubscriber_test.ts index d2c9489ec0..e08c6231be 100644 --- a/ts/test-electron/services/areWeASubscriber_test.ts +++ b/ts/test-electron/services/areWeASubscriber_test.ts @@ -3,8 +3,8 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import { AreWeASubscriberService } from '../../services/areWeASubscriber.js'; -import { explodePromise } from '../../util/explodePromise.js'; +import { AreWeASubscriberService } from '../../services/areWeASubscriber.dom.js'; +import { explodePromise } from '../../util/explodePromise.std.js'; describe('"are we a subscriber?" service', () => { const subscriberId = new Uint8Array([1, 2, 3]); diff --git a/ts/test-electron/services/profiles_test.ts b/ts/test-electron/services/profiles_test.ts index 8d3904c7ae..60a51295d9 100644 --- a/ts/test-electron/services/profiles_test.ts +++ b/ts/test-electron/services/profiles_test.ts @@ -2,13 +2,13 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { sleep } from '../../util/sleep.js'; -import { MINUTE } from '../../util/durations/index.js'; -import { drop } from '../../util/drop.js'; +import { sleep } from '../../util/sleep.std.js'; +import { MINUTE } from '../../util/durations/index.std.js'; +import { drop } from '../../util/drop.std.js'; -import { ProfileService } from '../../services/profiles.js'; -import { generateAci } from '../../types/ServiceId.js'; -import { HTTPError } from '../../types/HTTPError.js'; +import { ProfileService } from '../../services/profiles.preload.js'; +import { generateAci } from '../../types/ServiceId.std.js'; +import { HTTPError } from '../../types/HTTPError.std.js'; describe('util/profiles', () => { const SERVICE_ID_1 = generateAci(); diff --git a/ts/test-electron/services/senderCertificate_test.ts b/ts/test-electron/services/senderCertificate_test.ts index 6e6459f3ba..b298b0a78c 100644 --- a/ts/test-electron/services/senderCertificate_test.ts +++ b/ts/test-electron/services/senderCertificate_test.ts @@ -13,15 +13,15 @@ import { ServerCertificate, } from '@signalapp/libsignal-client'; -import { drop } from '../../util/drop.js'; -import * as Bytes from '../../Bytes.js'; -import { SenderCertificateMode } from '../../textsecure/OutgoingMessage.js'; +import { drop } from '../../util/drop.std.js'; +import * as Bytes from '../../Bytes.std.js'; +import { SenderCertificateMode } from '../../textsecure/OutgoingMessage.preload.js'; import { SENDER_CERTIFICATE_EXPIRATION_BUFFER, SenderCertificateService, -} from '../../services/senderCertificate.js'; -import { DAY } from '../../util/durations/constants.js'; +} from '../../services/senderCertificate.preload.js'; +import { DAY } from '../../util/durations/constants.std.js'; describe('SenderCertificateService', () => { let fakeValidCertificate: SenderCertificate; diff --git a/ts/test-electron/sql/attachment_download_backup_stats_test.ts b/ts/test-electron/sql/attachment_download_backup_stats_test.ts index f52d7ea21f..e8faee93d6 100644 --- a/ts/test-electron/sql/attachment_download_backup_stats_test.ts +++ b/ts/test-electron/sql/attachment_download_backup_stats_test.ts @@ -2,13 +2,13 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { DataReader, DataWriter } from '../../sql/Client.js'; +import { DataReader, DataWriter } from '../../sql/Client.preload.js'; -import { createAttachmentDownloadJob } from '../../test-helpers/attachmentDownloads.js'; -import type { MessageAttributesType } from '../../model-types.js'; -import { generateAci } from '../../types/ServiceId.js'; -import { AttachmentDownloadSource } from '../../sql/Interface.js'; -import { cleanupMessages } from '../../util/cleanup.js'; +import { createAttachmentDownloadJob } from '../../test-helpers/attachmentDownloads.std.js'; +import type { MessageAttributesType } from '../../model-types.d.ts'; +import { generateAci } from '../../types/ServiceId.std.js'; +import { AttachmentDownloadSource } from '../../sql/Interface.std.js'; +import { cleanupMessages } from '../../util/cleanup.preload.js'; describe('sql/AttachmentDownloadBackupStats', () => { beforeEach(async () => { diff --git a/ts/test-electron/sql/callLinks_test.ts b/ts/test-electron/sql/callLinks_test.ts index e3244ba89c..d6210b62da 100644 --- a/ts/test-electron/sql/callLinks_test.ts +++ b/ts/test-electron/sql/callLinks_test.ts @@ -3,12 +3,12 @@ import { assert } from 'chai'; -import { DataReader, DataWriter } from '../../sql/Client.js'; +import { DataReader, DataWriter } from '../../sql/Client.preload.js'; import { FAKE_CALL_LINK, FAKE_CALL_LINK_WITH_ADMIN_KEY, -} from '../../test-helpers/fakeCallLink.js'; +} from '../../test-helpers/fakeCallLink.std.js'; const { getCallLinkByRoomId } = DataReader; const { removeAll, insertCallLink, insertOrUpdateCallLinkFromSync } = diff --git a/ts/test-electron/sql/conversationSummary_test.ts b/ts/test-electron/sql/conversationSummary_test.ts index 7533e9ee8e..a35f261a24 100644 --- a/ts/test-electron/sql/conversationSummary_test.ts +++ b/ts/test-electron/sql/conversationSummary_test.ts @@ -4,12 +4,12 @@ import { assert } from 'chai'; import { v4 as generateUuid } from 'uuid'; -import { DataReader, DataWriter } from '../../sql/Client.js'; -import { generateAci } from '../../types/ServiceId.js'; -import { DurationInSeconds } from '../../util/durations/index.js'; +import { DataReader, DataWriter } from '../../sql/Client.preload.js'; +import { generateAci } from '../../types/ServiceId.std.js'; +import { DurationInSeconds } from '../../util/durations/index.std.js'; import type { MessageAttributesType } from '../../model-types.d.ts'; -import { postSaveUpdates } from '../../util/cleanup.js'; +import { postSaveUpdates } from '../../util/cleanup.preload.js'; const { _getAllMessages, getConversationMessageStats } = DataReader; const { removeAll, saveMessages } = DataWriter; diff --git a/ts/test-electron/sql/donationReceipts_test.ts b/ts/test-electron/sql/donationReceipts_test.ts index d785d8c2b3..40c84665b6 100644 --- a/ts/test-electron/sql/donationReceipts_test.ts +++ b/ts/test-electron/sql/donationReceipts_test.ts @@ -4,9 +4,9 @@ import { assert } from 'chai'; import { v1 as getGuid } from 'uuid'; -import { DataReader, DataWriter } from '../../sql/Client.js'; +import { DataReader, DataWriter } from '../../sql/Client.preload.js'; -import type { DonationReceipt } from '../../types/Donations.js'; +import type { DonationReceipt } from '../../types/Donations.std.js'; const { getAllDonationReceipts, getDonationReceiptById } = DataReader; const { diff --git a/ts/test-electron/sql/fullTextSearch_test.ts b/ts/test-electron/sql/fullTextSearch_test.ts index 4a32ed832d..016b042be4 100644 --- a/ts/test-electron/sql/fullTextSearch_test.ts +++ b/ts/test-electron/sql/fullTextSearch_test.ts @@ -4,11 +4,11 @@ import { assert } from 'chai'; import { v4 as generateUuid } from 'uuid'; -import { DataReader, DataWriter } from '../../sql/Client.js'; -import { generateAci } from '../../types/ServiceId.js'; +import { DataReader, DataWriter } from '../../sql/Client.preload.js'; +import { generateAci } from '../../types/ServiceId.std.js'; import type { MessageAttributesType } from '../../model-types.d.ts'; -import { postSaveUpdates } from '../../util/cleanup.js'; +import { postSaveUpdates } from '../../util/cleanup.preload.js'; const { _getAllMessages, searchMessages } = DataReader; const { removeAll, saveMessages, saveMessage } = DataWriter; diff --git a/ts/test-electron/sql/getCallHistoryGroups_test.ts b/ts/test-electron/sql/getCallHistoryGroups_test.ts index 7e1289a0bc..d6b395df49 100644 --- a/ts/test-electron/sql/getCallHistoryGroups_test.ts +++ b/ts/test-electron/sql/getCallHistoryGroups_test.ts @@ -4,7 +4,7 @@ import { assert } from 'chai'; import { v4 as generateUuid } from 'uuid'; -import { DataReader, DataWriter } from '../../sql/Client.js'; +import { DataReader, DataWriter } from '../../sql/Client.preload.js'; import { CallMode, @@ -13,20 +13,20 @@ import { CallHistoryFilterStatus, CallType, DirectCallStatus, -} from '../../types/CallDisposition.js'; -import { generateAci } from '../../types/ServiceId.js'; -import type { ServiceIdString } from '../../types/ServiceId.js'; +} from '../../types/CallDisposition.std.js'; +import { generateAci } from '../../types/ServiceId.std.js'; +import type { ServiceIdString } from '../../types/ServiceId.std.js'; import type { CallHistoryDetails, CallHistoryGroup, CallStatus, -} from '../../types/CallDisposition.js'; -import { strictAssert } from '../../util/assert.js'; -import type { ConversationAttributesType } from '../../model-types.js'; +} from '../../types/CallDisposition.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import type { ConversationAttributesType } from '../../model-types.d.ts'; import { FAKE_CALL_LINK, FAKE_CALL_LINK_WITH_ADMIN_KEY, -} from '../../test-helpers/fakeCallLink.js'; +} from '../../test-helpers/fakeCallLink.std.js'; const { getCallHistoryGroups, getCallHistoryGroupsCount } = DataReader; const { removeAll, insertCallLink, saveCallHistory, saveConversation } = diff --git a/ts/test-electron/sql/getCallHistoryMessageByCallId_test.ts b/ts/test-electron/sql/getCallHistoryMessageByCallId_test.ts index 402eeb1b4a..acd3b9b2fe 100644 --- a/ts/test-electron/sql/getCallHistoryMessageByCallId_test.ts +++ b/ts/test-electron/sql/getCallHistoryMessageByCallId_test.ts @@ -4,11 +4,11 @@ import { assert } from 'chai'; import { v4 as generateUuid } from 'uuid'; -import { DataReader, DataWriter } from '../../sql/Client.js'; -import { generateAci } from '../../types/ServiceId.js'; +import { DataReader, DataWriter } from '../../sql/Client.preload.js'; +import { generateAci } from '../../types/ServiceId.std.js'; import type { MessageAttributesType } from '../../model-types.d.ts'; -import { postSaveUpdates } from '../../util/cleanup.js'; +import { postSaveUpdates } from '../../util/cleanup.preload.js'; const { _getAllMessages, getCallHistoryMessageByCallId } = DataReader; const { removeAll, saveMessages } = DataWriter; diff --git a/ts/test-electron/sql/getMessagesBetween_test.ts b/ts/test-electron/sql/getMessagesBetween_test.ts index e1bdd5a8c0..76fc32150d 100644 --- a/ts/test-electron/sql/getMessagesBetween_test.ts +++ b/ts/test-electron/sql/getMessagesBetween_test.ts @@ -4,11 +4,11 @@ import { assert } from 'chai'; import { v4 as generateUuid } from 'uuid'; -import { generateAci } from '../../types/ServiceId.js'; -import { DataReader, DataWriter } from '../../sql/Client.js'; +import { generateAci } from '../../types/ServiceId.std.js'; +import { DataReader, DataWriter } from '../../sql/Client.preload.js'; -import type { MessageAttributesType } from '../../model-types.js'; -import { postSaveUpdates } from '../../util/cleanup.js'; +import type { MessageAttributesType } from '../../model-types.d.ts'; +import { postSaveUpdates } from '../../util/cleanup.preload.js'; const { _getAllMessages, getMessagesBetween } = DataReader; const { saveMessages, _removeAllMessages } = DataWriter; diff --git a/ts/test-electron/sql/getNearbyMessageFromDeletedSet_test.ts b/ts/test-electron/sql/getNearbyMessageFromDeletedSet_test.ts index d4bdbbe2f2..ae181aabdb 100644 --- a/ts/test-electron/sql/getNearbyMessageFromDeletedSet_test.ts +++ b/ts/test-electron/sql/getNearbyMessageFromDeletedSet_test.ts @@ -4,11 +4,11 @@ import { assert } from 'chai'; import { v4 as generateUuid } from 'uuid'; -import { DataReader, DataWriter } from '../../sql/Client.js'; -import { generateAci } from '../../types/ServiceId.js'; +import { DataReader, DataWriter } from '../../sql/Client.preload.js'; +import { generateAci } from '../../types/ServiceId.std.js'; -import type { MessageAttributesType } from '../../model-types.js'; -import { postSaveUpdates } from '../../util/cleanup.js'; +import type { MessageAttributesType } from '../../model-types.d.ts'; +import { postSaveUpdates } from '../../util/cleanup.preload.js'; const { _getAllMessages, getNearbyMessageFromDeletedSet } = DataReader; const { saveMessages, _removeAllMessages } = DataWriter; diff --git a/ts/test-electron/sql/getRecentStaleRingsAndMarkOlderMissed_test.ts b/ts/test-electron/sql/getRecentStaleRingsAndMarkOlderMissed_test.ts index 8226d216e9..34f814bc32 100644 --- a/ts/test-electron/sql/getRecentStaleRingsAndMarkOlderMissed_test.ts +++ b/ts/test-electron/sql/getRecentStaleRingsAndMarkOlderMissed_test.ts @@ -5,17 +5,17 @@ import { assert } from 'chai'; import { v4 as generateUuid } from 'uuid'; import lodash from 'lodash'; -import { DataReader, DataWriter } from '../../sql/Client.js'; +import { DataReader, DataWriter } from '../../sql/Client.preload.js'; import { CallMode, CallDirection, CallType, GroupCallStatus, -} from '../../types/CallDisposition.js'; -import { generateAci } from '../../types/ServiceId.js'; -import type { CallHistoryDetails } from '../../types/CallDisposition.js'; -import type { MaybeStaleCallHistory } from '../../sql/Interface.js'; +} from '../../types/CallDisposition.std.js'; +import { generateAci } from '../../types/ServiceId.std.js'; +import type { CallHistoryDetails } from '../../types/CallDisposition.std.js'; +import type { MaybeStaleCallHistory } from '../../sql/Interface.std.js'; const { times } = lodash; diff --git a/ts/test-electron/sql/getRecentStoryReplies_test.ts b/ts/test-electron/sql/getRecentStoryReplies_test.ts index 772b7847ac..f0a0a5596f 100644 --- a/ts/test-electron/sql/getRecentStoryReplies_test.ts +++ b/ts/test-electron/sql/getRecentStoryReplies_test.ts @@ -4,11 +4,11 @@ import { assert } from 'chai'; import { v4 as generateUuid } from 'uuid'; -import { DataReader, DataWriter } from '../../sql/Client.js'; -import { generateAci } from '../../types/ServiceId.js'; +import { DataReader, DataWriter } from '../../sql/Client.preload.js'; +import { generateAci } from '../../types/ServiceId.std.js'; import type { MessageAttributesType } from '../../model-types.d.ts'; -import { postSaveUpdates } from '../../util/cleanup.js'; +import { postSaveUpdates } from '../../util/cleanup.preload.js'; const { _getAllMessages, getRecentStoryReplies } = DataReader; const { removeAll, saveMessages } = DataWriter; diff --git a/ts/test-electron/sql/markRead_test.ts b/ts/test-electron/sql/markRead_test.ts index 1f58726246..f3dc4b5212 100644 --- a/ts/test-electron/sql/markRead_test.ts +++ b/ts/test-electron/sql/markRead_test.ts @@ -4,15 +4,15 @@ import { assert } from 'chai'; import { v4 as generateUuid } from 'uuid'; -import { DataReader, DataWriter } from '../../sql/Client.js'; -import { generateAci } from '../../types/ServiceId.js'; +import { DataReader, DataWriter } from '../../sql/Client.preload.js'; +import { generateAci } from '../../types/ServiceId.std.js'; -import type { ReactionType } from '../../types/Reactions.js'; -import { ReactionReadStatus } from '../../types/Reactions.js'; -import { DurationInSeconds } from '../../util/durations/index.js'; +import type { ReactionType } from '../../types/Reactions.std.js'; +import { ReactionReadStatus } from '../../types/Reactions.std.js'; +import { DurationInSeconds } from '../../util/durations/index.std.js'; import type { MessageAttributesType } from '../../model-types.d.ts'; -import { ReadStatus } from '../../messages/MessageReadStatus.js'; -import { postSaveUpdates } from '../../util/cleanup.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.std.js'; +import { postSaveUpdates } from '../../util/cleanup.preload.js'; const { _getAllReactions, _getAllMessages, getTotalUnreadForConversation } = DataReader; diff --git a/ts/test-electron/sql/notificationProfiles_test.ts b/ts/test-electron/sql/notificationProfiles_test.ts index 187fa35879..c2cff10356 100644 --- a/ts/test-electron/sql/notificationProfiles_test.ts +++ b/ts/test-electron/sql/notificationProfiles_test.ts @@ -3,12 +3,12 @@ import { assert } from 'chai'; -import { DataReader, DataWriter } from '../../sql/Client.js'; +import { DataReader, DataWriter } from '../../sql/Client.preload.js'; -import { DayOfWeek } from '../../types/NotificationProfile.js'; -import { generateNotificationProfileId } from '../../types/NotificationProfile-node.js'; +import { DayOfWeek } from '../../types/NotificationProfile.std.js'; +import { generateNotificationProfileId } from '../../types/NotificationProfile-node.node.js'; -import type { NotificationProfileType } from '../../types/NotificationProfile.js'; +import type { NotificationProfileType } from '../../types/NotificationProfile.std.js'; const { getAllNotificationProfiles } = DataReader; const { diff --git a/ts/test-electron/sql/removeAllConfiguration_test.ts b/ts/test-electron/sql/removeAllConfiguration_test.ts index 54b5031a8a..c637e4f81a 100644 --- a/ts/test-electron/sql/removeAllConfiguration_test.ts +++ b/ts/test-electron/sql/removeAllConfiguration_test.ts @@ -4,7 +4,7 @@ import { assert } from 'chai'; import { v4 as generateGuid } from 'uuid'; -import { DataWriter, DataReader } from '../../sql/Client.js'; +import { DataWriter, DataReader } from '../../sql/Client.preload.js'; describe('Remove all configuration test', () => { beforeEach(async () => { diff --git a/ts/test-electron/sql/sendLog_test.ts b/ts/test-electron/sql/sendLog_test.ts index 7cc1149f09..2565f9b349 100644 --- a/ts/test-electron/sql/sendLog_test.ts +++ b/ts/test-electron/sql/sendLog_test.ts @@ -4,10 +4,13 @@ import { assert } from 'chai'; import { v4 as generateUuid } from 'uuid'; -import { DataReader, DataWriter } from '../../sql/Client.js'; -import { generateAci } from '../../types/ServiceId.js'; -import { constantTimeEqual, getRandomBytes } from '../../Crypto.js'; -import { cleanupMessages, postSaveUpdates } from '../../util/cleanup.js'; +import { DataReader, DataWriter } from '../../sql/Client.preload.js'; +import { generateAci } from '../../types/ServiceId.std.js'; +import { constantTimeEqual, getRandomBytes } from '../../Crypto.node.js'; +import { + cleanupMessages, + postSaveUpdates, +} from '../../util/cleanup.preload.js'; const { _getAllSentProtoMessageIds, diff --git a/ts/test-electron/sql/stories_test.ts b/ts/test-electron/sql/stories_test.ts index 002ed1211a..f0704c35e7 100644 --- a/ts/test-electron/sql/stories_test.ts +++ b/ts/test-electron/sql/stories_test.ts @@ -4,11 +4,11 @@ import { assert } from 'chai'; import { v4 as generateUuid } from 'uuid'; -import { DataReader, DataWriter } from '../../sql/Client.js'; -import { generateAci } from '../../types/ServiceId.js'; +import { DataReader, DataWriter } from '../../sql/Client.preload.js'; +import { generateAci } from '../../types/ServiceId.std.js'; import type { MessageAttributesType } from '../../model-types.d.ts'; -import { postSaveUpdates } from '../../util/cleanup.js'; +import { postSaveUpdates } from '../../util/cleanup.preload.js'; const { _getAllMessages, getAllStories } = DataReader; const { removeAll, saveMessages } = DataWriter; diff --git a/ts/test-electron/sql/storyDistribution_test.ts b/ts/test-electron/sql/storyDistribution_test.ts index 873ec9ede2..6f883f6ddf 100644 --- a/ts/test-electron/sql/storyDistribution_test.ts +++ b/ts/test-electron/sql/storyDistribution_test.ts @@ -4,11 +4,11 @@ import { assert } from 'chai'; import { v4 as generateUuid } from 'uuid'; -import { DataReader, DataWriter } from '../../sql/Client.js'; -import { generateAci } from '../../types/ServiceId.js'; -import { generateStoryDistributionId } from '../../types/StoryDistributionId.js'; +import { DataReader, DataWriter } from '../../sql/Client.preload.js'; +import { generateAci } from '../../types/ServiceId.std.js'; +import { generateStoryDistributionId } from '../../types/StoryDistributionId.std.js'; -import type { StoryDistributionWithMembersType } from '../../sql/Interface.js'; +import type { StoryDistributionWithMembersType } from '../../sql/Interface.std.js'; const { _getAllStoryDistributionMembers, diff --git a/ts/test-electron/sql/storyReads_test.ts b/ts/test-electron/sql/storyReads_test.ts index 2020b33759..4f0ac34411 100644 --- a/ts/test-electron/sql/storyReads_test.ts +++ b/ts/test-electron/sql/storyReads_test.ts @@ -4,10 +4,10 @@ import { assert } from 'chai'; import { v4 as generateUuid } from 'uuid'; -import { DataReader, DataWriter } from '../../sql/Client.js'; -import { generateAci } from '../../types/ServiceId.js'; +import { DataReader, DataWriter } from '../../sql/Client.preload.js'; +import { generateAci } from '../../types/ServiceId.std.js'; -import type { StoryReadType } from '../../sql/Interface.js'; +import type { StoryReadType } from '../../sql/Interface.std.js'; const { _getAllStoryReads, getLastStoryReadsForAuthor } = DataReader; diff --git a/ts/test-electron/sql/timelineFetches_test.ts b/ts/test-electron/sql/timelineFetches_test.ts index 524f705b83..9c49a914ed 100644 --- a/ts/test-electron/sql/timelineFetches_test.ts +++ b/ts/test-electron/sql/timelineFetches_test.ts @@ -4,12 +4,12 @@ import { assert } from 'chai'; import { v4 as generateUuid } from 'uuid'; -import { DataReader, DataWriter } from '../../sql/Client.js'; -import { generateAci } from '../../types/ServiceId.js'; +import { DataReader, DataWriter } from '../../sql/Client.preload.js'; +import { generateAci } from '../../types/ServiceId.std.js'; import type { MessageAttributesType } from '../../model-types.d.ts'; -import { ReadStatus } from '../../messages/MessageReadStatus.js'; -import { postSaveUpdates } from '../../util/cleanup.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.std.js'; +import { postSaveUpdates } from '../../util/cleanup.preload.js'; const { _getAllMessages, diff --git a/ts/test-electron/sql/utils_test.ts b/ts/test-electron/sql/utils_test.ts index 39f02dbb22..6df232742f 100644 --- a/ts/test-electron/sql/utils_test.ts +++ b/ts/test-electron/sql/utils_test.ts @@ -4,7 +4,7 @@ import { assert } from 'chai'; import type { Database } from '@signalapp/sqlcipher'; import SQL from '@signalapp/sqlcipher'; -import { sql, sqlFragment, sqlJoin } from '../../sql/util.js'; +import { sql, sqlFragment, sqlJoin } from '../../sql/util.std.js'; describe('sql/utils/sql', () => { let db: Database; diff --git a/ts/test-electron/state/ducks/calling_test.ts b/ts/test-electron/state/ducks/calling_test.ts index 4ef31dc5c4..d817929299 100644 --- a/ts/test-electron/state/ducks/calling_test.ts +++ b/ts/test-electron/state/ducks/calling_test.ts @@ -8,9 +8,9 @@ import type { PeekInfo } from '@signalapp/ringrtc'; import type { StateType as RootStateType, StateType, -} from '../../../state/reducer.js'; -import { reducer as rootReducer } from '../../../state/reducer.js'; -import { noopAction } from '../../../state/ducks/noop.js'; +} from '../../../state/reducer.preload.js'; +import { reducer as rootReducer } from '../../../state/reducer.preload.js'; +import { noopAction } from '../../../state/ducks/noop.std.js'; import type { ActiveCallStateType, CallingActionType, @@ -22,35 +22,35 @@ import type { HandleCallLinkUpdateType, SendGroupCallReactionActionType, StartCallLinkLobbyType, -} from '../../../state/ducks/calling.js'; +} from '../../../state/ducks/calling.preload.js'; import { actions, getActiveCall, getEmptyState, reducer, -} from '../../../state/ducks/calling.js'; -import { isAnybodyElseInGroupCall } from '../../../state/ducks/callingHelpers.js'; -import { truncateAudioLevel } from '../../../calling/truncateAudioLevel.js'; -import { calling as callingService } from '../../../services/calling.js'; +} from '../../../state/ducks/calling.preload.js'; +import { isAnybodyElseInGroupCall } from '../../../state/ducks/callingHelpers.std.js'; +import { truncateAudioLevel } from '../../../calling/truncateAudioLevel.std.js'; +import { calling as callingService } from '../../../services/calling.preload.js'; import { CallState, CallViewMode, GroupCallConnectionState, GroupCallJoinState, -} from '../../../types/Calling.js'; -import { CallMode } from '../../../types/CallDisposition.js'; -import { generateAci } from '../../../types/ServiceId.js'; -import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.js'; -import type { UnwrapPromise } from '../../../types/Util.js'; +} from '../../../types/Calling.std.js'; +import { CallMode } from '../../../types/CallDisposition.std.js'; +import { generateAci } from '../../../types/ServiceId.std.js'; +import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.std.js'; +import type { UnwrapPromise } from '../../../types/Util.std.js'; import { FAKE_CALL_LINK, FAKE_CALL_LINK_WITH_ADMIN_KEY, getCallLinkState, -} from '../../../test-helpers/fakeCallLink.js'; -import { strictAssert } from '../../../util/assert.js'; -import { callLinkRefreshJobQueue } from '../../../jobs/callLinkRefreshJobQueue.js'; -import { CALL_LINK_DEFAULT_STATE } from '../../../util/callLinks.js'; -import { DataWriter } from '../../../sql/Client.js'; +} from '../../../test-helpers/fakeCallLink.std.js'; +import { strictAssert } from '../../../util/assert.std.js'; +import { callLinkRefreshJobQueue } from '../../../jobs/callLinkRefreshJobQueue.preload.js'; +import { CALL_LINK_DEFAULT_STATE } from '../../../util/callLinks.std.js'; +import { DataWriter } from '../../../sql/Client.preload.js'; const { cloneDeep, noop } = lodash; diff --git a/ts/test-electron/state/ducks/conversations_test.ts b/ts/test-electron/state/ducks/conversations_test.ts index 8fe02ad45f..90a4a4522a 100644 --- a/ts/test-electron/state/ducks/conversations_test.ts +++ b/ts/test-electron/state/ducks/conversations_test.ts @@ -7,13 +7,13 @@ import { v4 as generateUuid } from 'uuid'; import lodash from 'lodash'; import type { ReadonlyDeep } from 'type-fest'; -import { reducer as rootReducer } from '../../../state/reducer.js'; -import { noopAction } from '../../../state/ducks/noop.js'; +import { reducer as rootReducer } from '../../../state/reducer.preload.js'; +import { noopAction } from '../../../state/ducks/noop.std.js'; import { ComposerStep, ConversationVerificationState, OneTimeModalState, -} from '../../../state/ducks/conversationsEnums.js'; +} from '../../../state/ducks/conversationsEnums.std.js'; import type { CancelVerificationDataByConversationActionType, ConversationMessageType, @@ -24,7 +24,7 @@ import type { ToggleConversationInChooseMembersActionType, MessageChangedActionType, ConversationsUpdatedActionType, -} from '../../../state/ducks/conversations.js'; +} from '../../../state/ducks/conversations.preload.js'; import { TARGETED_CONVERSATION_CHANGED, actions, @@ -34,42 +34,42 @@ import { getEmptyState, reducer, updateConversationLookups, -} from '../../../state/ducks/conversations.js'; -import { ReadStatus } from '../../../messages/MessageReadStatus.js'; -import type { SingleServePromiseIdString } from '../../../services/singleServePromise.js'; -import { CallMode } from '../../../types/CallDisposition.js'; +} from '../../../state/ducks/conversations.preload.js'; +import { ReadStatus } from '../../../messages/MessageReadStatus.std.js'; +import type { SingleServePromiseIdString } from '../../../services/singleServePromise.std.js'; +import { CallMode } from '../../../types/CallDisposition.std.js'; import { type AciString, type PniString, generateAci, getAciFromPrefix, -} from '../../../types/ServiceId.js'; -import { generateStoryDistributionId } from '../../../types/StoryDistributionId.js'; +} from '../../../types/ServiceId.std.js'; +import { generateStoryDistributionId } from '../../../types/StoryDistributionId.std.js'; import { getDefaultConversation, getDefaultConversationWithServiceId, getDefaultGroup, -} from '../../../test-helpers/getDefaultConversation.js'; -import { getDefaultAvatars } from '../../../types/Avatar.js'; +} from '../../../test-helpers/getDefaultConversation.std.js'; +import { getDefaultAvatars } from '../../../types/Avatar.std.js'; import { defaultStartDirectConversationComposerState, defaultChooseGroupMembersComposerState, defaultSetGroupMetadataComposerState, -} from '../../../test-helpers/defaultComposerStates.js'; -import { updateRemoteConfig } from '../../../test-helpers/RemoteConfigStub.js'; -import type { ShowSendAnywayDialogActionType } from '../../../state/ducks/globalModals.js'; -import { SHOW_SEND_ANYWAY_DIALOG } from '../../../state/ducks/globalModals.js'; -import type { StoryDistributionListsActionType } from '../../../state/ducks/storyDistributionLists.js'; +} from '../../../test-helpers/defaultComposerStates.std.js'; +import { updateRemoteConfig } from '../../../test-helpers/RemoteConfigStub.dom.js'; +import type { ShowSendAnywayDialogActionType } from '../../../state/ducks/globalModals.preload.js'; +import { SHOW_SEND_ANYWAY_DIALOG } from '../../../state/ducks/globalModals.preload.js'; +import type { StoryDistributionListsActionType } from '../../../state/ducks/storyDistributionLists.preload.js'; import { DELETE_LIST, HIDE_MY_STORIES_FROM, MODIFY_LIST, VIEWERS_CHANGED, -} from '../../../state/ducks/storyDistributionLists.js'; -import { MY_STORY_ID } from '../../../types/Stories.js'; +} from '../../../state/ducks/storyDistributionLists.preload.js'; +import { MY_STORY_ID } from '../../../types/Stories.std.js'; import type { ReadonlyMessageAttributesType } from '../../../model-types.d.ts'; -import { strictAssert } from '../../../util/assert.js'; -import { itemStorage } from '../../../textsecure/Storage.js'; +import { strictAssert } from '../../../util/assert.std.js'; +import { itemStorage } from '../../../textsecure/Storage.preload.js'; const { times } = lodash; diff --git a/ts/test-electron/state/ducks/stories_test.ts b/ts/test-electron/state/ducks/stories_test.ts index eefb95b45f..d041c028e8 100644 --- a/ts/test-electron/state/ducks/stories_test.ts +++ b/ts/test-electron/state/ducks/stories_test.ts @@ -8,27 +8,30 @@ import { v4 as generateUuid } from 'uuid'; import type { DispatchableViewStoryType, StoryDataType, -} from '../../../state/ducks/stories.js'; -import type { ConversationType } from '../../../state/ducks/conversations.js'; +} from '../../../state/ducks/stories.preload.js'; +import type { ConversationType } from '../../../state/ducks/conversations.preload.js'; import type { MessageAttributesType } from '../../../model-types.d.ts'; -import type { StateType as RootStateType } from '../../../state/reducer.js'; -import { DurationInSeconds } from '../../../util/durations/index.js'; -import { TEXT_ATTACHMENT, IMAGE_JPEG } from '../../../types/MIME.js'; -import { ReadStatus } from '../../../messages/MessageReadStatus.js'; +import type { StateType as RootStateType } from '../../../state/reducer.preload.js'; +import { DurationInSeconds } from '../../../util/durations/index.std.js'; +import { TEXT_ATTACHMENT, IMAGE_JPEG } from '../../../types/MIME.std.js'; +import { ReadStatus } from '../../../messages/MessageReadStatus.std.js'; import { StoryViewDirectionType, StoryViewModeType, -} from '../../../types/Stories.js'; -import type { StoryDistributionIdString } from '../../../types/StoryDistributionId.js'; -import { generateAci, generatePni } from '../../../types/ServiceId.js'; -import { generateStoryDistributionId } from '../../../types/StoryDistributionId.js'; -import { actions, getEmptyState } from '../../../state/ducks/stories.js'; -import { noopAction } from '../../../state/ducks/noop.js'; -import { reducer as rootReducer } from '../../../state/reducer.js'; -import { dropNull } from '../../../util/dropNull.js'; -import { MessageModel } from '../../../models/messages.js'; -import { DataWriter } from '../../../sql/Client.js'; -import { itemStorage } from '../../../textsecure/Storage.js'; +} from '../../../types/Stories.std.js'; +import type { StoryDistributionIdString } from '../../../types/StoryDistributionId.std.js'; +import { generateAci, generatePni } from '../../../types/ServiceId.std.js'; +import { generateStoryDistributionId } from '../../../types/StoryDistributionId.std.js'; +import { + actions, + getEmptyState, +} from '../../../state/ducks/stories.preload.js'; +import { noopAction } from '../../../state/ducks/noop.std.js'; +import { reducer as rootReducer } from '../../../state/reducer.preload.js'; +import { dropNull } from '../../../util/dropNull.std.js'; +import { MessageModel } from '../../../models/messages.preload.js'; +import { DataWriter } from '../../../sql/Client.preload.js'; +import { itemStorage } from '../../../textsecure/Storage.preload.js'; describe('both/state/ducks/stories', () => { const ourAci = generateAci(); diff --git a/ts/test-electron/state/ducks/username_test.ts b/ts/test-electron/state/ducks/username_test.ts index fe7d1e09c6..0c988469b5 100644 --- a/ts/test-electron/state/ducks/username_test.ts +++ b/ts/test-electron/state/ducks/username_test.ts @@ -4,26 +4,26 @@ import * as sinon from 'sinon'; import { assert } from 'chai'; -import type { UsernameStateType } from '../../../state/ducks/username.js'; +import type { UsernameStateType } from '../../../state/ducks/username.preload.js'; import { getUsernameEditState, getUsernameReservationState, getUsernameReservationError, getUsernameReservationObject, -} from '../../../state/selectors/username.js'; +} from '../../../state/selectors/username.std.js'; import { UsernameEditState, UsernameReservationState, UsernameReservationError, -} from '../../../state/ducks/usernameEnums.js'; -import { actions } from '../../../state/ducks/username.js'; -import { ToastType } from '../../../types/Toast.js'; -import { noopAction } from '../../../state/ducks/noop.js'; -import { reducer } from '../../../state/reducer.js'; +} from '../../../state/ducks/usernameEnums.std.js'; +import { actions } from '../../../state/ducks/username.preload.js'; +import { ToastType } from '../../../types/Toast.dom.js'; +import { noopAction } from '../../../state/ducks/noop.std.js'; +import { reducer } from '../../../state/reducer.preload.js'; import { ReserveUsernameError, ConfirmUsernameResult, -} from '../../../types/Username.js'; +} from '../../../types/Username.std.js'; const DEFAULT_RESERVATION = { username: 'abc.12', diff --git a/ts/test-electron/state/selectors/audioPlayer_test.ts b/ts/test-electron/state/selectors/audioPlayer_test.ts index 658be76231..0db97fa4f0 100644 --- a/ts/test-electron/state/selectors/audioPlayer_test.ts +++ b/ts/test-electron/state/selectors/audioPlayer_test.ts @@ -2,12 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { noopAction } from '../../../state/ducks/noop.js'; -import type { VoiceNoteAndConsecutiveForPlayback } from '../../../state/selectors/audioPlayer.js'; -import { isPaused } from '../../../state/selectors/audioPlayer.js'; -import { actions } from '../../../state/ducks/audioPlayer.js'; -import type { StateType } from '../../../state/reducer.js'; -import { reducer as rootReducer } from '../../../state/reducer.js'; +import { noopAction } from '../../../state/ducks/noop.std.js'; +import type { VoiceNoteAndConsecutiveForPlayback } from '../../../state/selectors/audioPlayer.preload.js'; +import { isPaused } from '../../../state/selectors/audioPlayer.preload.js'; +import { actions } from '../../../state/ducks/audioPlayer.preload.js'; +import type { StateType } from '../../../state/reducer.preload.js'; +import { reducer as rootReducer } from '../../../state/reducer.preload.js'; function voiceNoteDataForMessage( messageId: string diff --git a/ts/test-electron/state/selectors/calling_test.ts b/ts/test-electron/state/selectors/calling_test.ts index e50f81bd5f..44c8ab5645 100644 --- a/ts/test-electron/state/selectors/calling_test.ts +++ b/ts/test-electron/state/selectors/calling_test.ts @@ -2,34 +2,34 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { reducer as rootReducer } from '../../../state/reducer.js'; -import { noopAction } from '../../../state/ducks/noop.js'; -import { actions as userActions } from '../../../state/ducks/user.js'; +import { reducer as rootReducer } from '../../../state/reducer.preload.js'; +import { noopAction } from '../../../state/ducks/noop.std.js'; +import { actions as userActions } from '../../../state/ducks/user.preload.js'; import { CallState, CallViewMode, GroupCallConnectionState, GroupCallJoinState, -} from '../../../types/Calling.js'; -import { CallMode } from '../../../types/CallDisposition.js'; -import { generateAci } from '../../../types/ServiceId.js'; +} from '../../../types/Calling.std.js'; +import { CallMode } from '../../../types/CallDisposition.std.js'; +import { generateAci } from '../../../types/ServiceId.std.js'; import { getCallsByConversation, getCallSelector, getHasAnyAdminCallLinks, getRingingCall, isInCall, -} from '../../../state/selectors/calling.js'; +} from '../../../state/selectors/calling.std.js'; import type { CallingStateType, DirectCallStateType, GroupCallStateType, -} from '../../../state/ducks/calling.js'; -import { getEmptyState } from '../../../state/ducks/calling.js'; +} from '../../../state/ducks/calling.preload.js'; +import { getEmptyState } from '../../../state/ducks/calling.preload.js'; import { FAKE_CALL_LINK, FAKE_CALL_LINK_WITH_ADMIN_KEY, -} from '../../../test-helpers/fakeCallLink.js'; +} from '../../../test-helpers/fakeCallLink.std.js'; const OUR_ACI = generateAci(); const ACI_1 = generateAci(); diff --git a/ts/test-electron/state/selectors/conversations-extra_test.ts b/ts/test-electron/state/selectors/conversations-extra_test.ts index 1416b0c5b4..5c6c014e92 100644 --- a/ts/test-electron/state/selectors/conversations-extra_test.ts +++ b/ts/test-electron/state/selectors/conversations-extra_test.ts @@ -3,23 +3,23 @@ import { assert } from 'chai'; -import type { StateType } from '../../../state/reducer.js'; -import type { ConversationType } from '../../../state/ducks/conversations.js'; -import type { StoryDistributionListDataType } from '../../../state/ducks/storyDistributionLists.js'; -import type { StoryDistributionIdString } from '../../../types/StoryDistributionId.js'; -import type { ServiceIdString } from '../../../types/ServiceId.js'; -import type { ContactsByStory } from '../../../components/SafetyNumberChangeDialog.js'; +import type { StateType } from '../../../state/reducer.preload.js'; +import type { ConversationType } from '../../../state/ducks/conversations.preload.js'; +import type { StoryDistributionListDataType } from '../../../state/ducks/storyDistributionLists.preload.js'; +import type { StoryDistributionIdString } from '../../../types/StoryDistributionId.std.js'; +import type { ServiceIdString } from '../../../types/ServiceId.std.js'; +import type { ContactsByStory } from '../../../components/SafetyNumberChangeDialog.dom.js'; -import * as Bytes from '../../../Bytes.js'; -import { reducer as rootReducer } from '../../../state/reducer.js'; -import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.js'; -import { getEmptyState } from '../../../state/ducks/conversations.js'; -import { getByDistributionListConversationsStoppingSend } from '../../../state/selectors/conversations-extra.js'; -import { generateAci } from '../../../types/ServiceId.js'; -import { generateStoryDistributionId } from '../../../types/StoryDistributionId.js'; -import { noopAction } from '../../../state/ducks/noop.js'; -import { ID_LENGTH } from '../../../types/groups.js'; -import { ConversationVerificationState } from '../../../state/ducks/conversationsEnums.js'; +import * as Bytes from '../../../Bytes.std.js'; +import { reducer as rootReducer } from '../../../state/reducer.preload.js'; +import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.std.js'; +import { getEmptyState } from '../../../state/ducks/conversations.preload.js'; +import { getByDistributionListConversationsStoppingSend } from '../../../state/selectors/conversations-extra.preload.js'; +import { generateAci } from '../../../types/ServiceId.std.js'; +import { generateStoryDistributionId } from '../../../types/StoryDistributionId.std.js'; +import { noopAction } from '../../../state/ducks/noop.std.js'; +import { ID_LENGTH } from '../../../types/groups.std.js'; +import { ConversationVerificationState } from '../../../state/ducks/conversationsEnums.std.js'; describe('both/state/selectors/conversations-extra', () => { const SERVICE_ID_1 = generateAci(); diff --git a/ts/test-electron/state/selectors/messages_test.ts b/ts/test-electron/state/selectors/messages_test.ts index 003b8ef1ef..9c99b02bd2 100644 --- a/ts/test-electron/state/selectors/messages_test.ts +++ b/ts/test-electron/state/selectors/messages_test.ts @@ -4,16 +4,16 @@ import { assert } from 'chai'; import * as moment from 'moment'; import { v4 as uuid } from 'uuid'; -import { SendStatus } from '../../../messages/MessageSendState.js'; +import { SendStatus } from '../../../messages/MessageSendState.std.js'; import type { MessageAttributesType, ShallowChallengeError, } from '../../../model-types.d.ts'; -import type { ConversationType } from '../../../state/ducks/conversations.js'; +import type { ConversationType } from '../../../state/ducks/conversations.preload.js'; import { getDefaultConversation, getDefaultGroup, -} from '../../../test-helpers/getDefaultConversation.js'; +} from '../../../test-helpers/getDefaultConversation.std.js'; import { canDeleteForEveryone, @@ -25,7 +25,7 @@ import { isGroupUpdate, isIncoming, isOutgoing, -} from '../../../state/selectors/message.js'; +} from '../../../state/selectors/message.preload.js'; describe('state/selectors/messages', () => { let ourConversationId: string; diff --git a/ts/test-electron/textsecure/AccountManager_test.ts b/ts/test-electron/textsecure/AccountManager_test.ts index d3f4a4c5e7..19fe5f9782 100644 --- a/ts/test-electron/textsecure/AccountManager_test.ts +++ b/ts/test-electron/textsecure/AccountManager_test.ts @@ -5,9 +5,9 @@ import { assert } from 'chai'; import lodash from 'lodash'; import * as sinon from 'sinon'; -import { getRandomBytes } from '../../Crypto.js'; -import { generateKeyPair } from '../../Curve.js'; -import AccountManager from '../../textsecure/AccountManager.js'; +import { getRandomBytes } from '../../Crypto.node.js'; +import { generateKeyPair } from '../../Curve.node.js'; +import AccountManager from '../../textsecure/AccountManager.preload.js'; import type { KyberPreKeyType, OuterSignedPrekeyType, @@ -17,10 +17,10 @@ import { ServiceIdKind, generateAci, generatePni, -} from '../../types/ServiceId.js'; -import { DAY } from '../../util/durations/index.js'; -import { signalProtocolStore } from '../../SignalProtocolStore.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +} from '../../types/ServiceId.std.js'; +import { DAY } from '../../util/durations/index.std.js'; +import { signalProtocolStore } from '../../SignalProtocolStore.preload.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; const { range } = lodash; diff --git a/ts/test-electron/textsecure/KeyChangeListener_test.ts b/ts/test-electron/textsecure/KeyChangeListener_test.ts index 84147844a8..db160b2f4e 100644 --- a/ts/test-electron/textsecure/KeyChangeListener_test.ts +++ b/ts/test-electron/textsecure/KeyChangeListener_test.ts @@ -3,17 +3,17 @@ import { assert } from 'chai'; -import { DataWriter } from '../../sql/Client.js'; -import { getRandomBytes } from '../../Crypto.js'; -import { Address } from '../../types/Address.js'; -import { generateAci } from '../../types/ServiceId.js'; -import { explodePromise } from '../../util/explodePromise.js'; -import { SignalProtocolStore } from '../../SignalProtocolStore.js'; -import type { ConversationModel } from '../../models/conversations.js'; -import * as KeyChangeListener from '../../textsecure/KeyChangeListener.js'; -import { itemStorage } from '../../textsecure/Storage.js'; -import * as Bytes from '../../Bytes.js'; -import { cleanupMessages } from '../../util/cleanup.js'; +import { DataWriter } from '../../sql/Client.preload.js'; +import { getRandomBytes } from '../../Crypto.node.js'; +import { Address } from '../../types/Address.std.js'; +import { generateAci } from '../../types/ServiceId.std.js'; +import { explodePromise } from '../../util/explodePromise.std.js'; +import { SignalProtocolStore } from '../../SignalProtocolStore.preload.js'; +import type { ConversationModel } from '../../models/conversations.preload.js'; +import * as KeyChangeListener from '../../textsecure/KeyChangeListener.dom.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; +import * as Bytes from '../../Bytes.std.js'; +import { cleanupMessages } from '../../util/cleanup.preload.js'; describe('KeyChangeListener', () => { let oldNumberId: string | undefined; diff --git a/ts/test-electron/textsecure/WebAPI_test.ts b/ts/test-electron/textsecure/WebAPI_test.ts index ac5169fd1f..bf3b3c56fa 100644 --- a/ts/test-electron/textsecure/WebAPI_test.ts +++ b/ts/test-electron/textsecure/WebAPI_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { makeKeysLowercase } from '../../textsecure/WebAPI.js'; +import { makeKeysLowercase } from '../../textsecure/WebAPI.preload.js'; describe('WebAPI', () => { describe('makeKeysLowercase', () => { diff --git a/ts/test-electron/textsecure/generate_keys_test.ts b/ts/test-electron/textsecure/generate_keys_test.ts index 28c00edc9a..61507ac8f2 100644 --- a/ts/test-electron/textsecure/generate_keys_test.ts +++ b/ts/test-electron/textsecure/generate_keys_test.ts @@ -3,18 +3,18 @@ import { assert } from 'chai'; -import { constantTimeEqual } from '../../Crypto.js'; -import { generateKeyPair } from '../../Curve.js'; +import { constantTimeEqual } from '../../Crypto.node.js'; +import { generateKeyPair } from '../../Curve.node.js'; import type { UploadKeysType, UploadPreKeyType, -} from '../../textsecure/WebAPI.js'; -import AccountManager from '../../textsecure/AccountManager.js'; -import { ServiceIdKind } from '../../types/ServiceId.js'; -import { normalizeAci } from '../../util/normalizeAci.js'; -import { DataWriter } from '../../sql/Client.js'; -import { signalProtocolStore } from '../../SignalProtocolStore.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +} from '../../textsecure/WebAPI.preload.js'; +import AccountManager from '../../textsecure/AccountManager.preload.js'; +import { ServiceIdKind } from '../../types/ServiceId.std.js'; +import { normalizeAci } from '../../util/normalizeAci.std.js'; +import { DataWriter } from '../../sql/Client.preload.js'; +import { signalProtocolStore } from '../../SignalProtocolStore.preload.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; const assertEqualBuffers = (a: Uint8Array, b: Uint8Array) => { assert.isTrue(constantTimeEqual(a, b)); diff --git a/ts/test-electron/updateConversationsWithUuidLookup_test.ts b/ts/test-electron/updateConversationsWithUuidLookup_test.ts index ee6d35b538..2d9e6fd0b9 100644 --- a/ts/test-electron/updateConversationsWithUuidLookup_test.ts +++ b/ts/test-electron/updateConversationsWithUuidLookup_test.ts @@ -6,16 +6,16 @@ import { assert } from 'chai'; import { v4 as generateUuid } from 'uuid'; import sinon from 'sinon'; -import { DataWriter } from '../sql/Client.js'; -import { ConversationModel } from '../models/conversations.js'; +import { DataWriter } from '../sql/Client.preload.js'; +import { ConversationModel } from '../models/conversations.preload.js'; import type { ConversationAttributesType } from '../model-types.d.ts'; -import { generateAci, normalizeServiceId } from '../types/ServiceId.js'; -import { normalizeAci } from '../util/normalizeAci.js'; +import { generateAci, normalizeServiceId } from '../types/ServiceId.std.js'; +import { normalizeAci } from '../util/normalizeAci.std.js'; import { updateConversationsWithUuidLookup, type ServerType, -} from '../updateConversationsWithUuidLookup.js'; +} from '../updateConversationsWithUuidLookup.dom.js'; describe('updateConversationsWithUuidLookup', () => { class FakeConversationController { diff --git a/ts/test-electron/util/Username_test.ts b/ts/test-electron/util/Username_test.ts index a02aba970d..4dde16bdc7 100644 --- a/ts/test-electron/util/Username_test.ts +++ b/ts/test-electron/util/Username_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import * as Username from '../../util/Username.js'; +import * as Username from '../../util/Username.dom.js'; describe('Username', () => { describe('getUsernameFromSearch', () => { diff --git a/ts/test-electron/util/canvasToBlob_test.ts b/ts/test-electron/util/canvasToBlob_test.ts index 134bdbf480..e94e240d1b 100644 --- a/ts/test-electron/util/canvasToBlob_test.ts +++ b/ts/test-electron/util/canvasToBlob_test.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { IMAGE_JPEG, IMAGE_PNG } from '../../types/MIME.js'; -import { sniffImageMimeType } from '../../util/sniffImageMimeType.js'; +import { IMAGE_JPEG, IMAGE_PNG } from '../../types/MIME.std.js'; +import { sniffImageMimeType } from '../../util/sniffImageMimeType.std.js'; -import { canvasToBlob } from '../../util/canvasToBlob.js'; +import { canvasToBlob } from '../../util/canvasToBlob.std.js'; describe('canvasToBlob', () => { let canvas: HTMLCanvasElement; diff --git a/ts/test-electron/util/canvasToBytes_test.ts b/ts/test-electron/util/canvasToBytes_test.ts index 17a629522e..f64e21d6c4 100644 --- a/ts/test-electron/util/canvasToBytes_test.ts +++ b/ts/test-electron/util/canvasToBytes_test.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { IMAGE_JPEG, IMAGE_PNG } from '../../types/MIME.js'; -import { sniffImageMimeType } from '../../util/sniffImageMimeType.js'; +import { IMAGE_JPEG, IMAGE_PNG } from '../../types/MIME.std.js'; +import { sniffImageMimeType } from '../../util/sniffImageMimeType.std.js'; -import { canvasToBytes } from '../../util/canvasToBytes.js'; +import { canvasToBytes } from '../../util/canvasToBytes.std.js'; describe('canvasToBytes', () => { let canvas: HTMLCanvasElement; diff --git a/ts/test-electron/util/downloadAttachment_test.ts b/ts/test-electron/util/downloadAttachment_test.ts index d2d3b7afe5..c005ce39d4 100644 --- a/ts/test-electron/util/downloadAttachment_test.ts +++ b/ts/test-electron/util/downloadAttachment_test.ts @@ -5,23 +5,23 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; import lodash from 'lodash'; -import { DataWriter } from '../../sql/Client.js'; -import { IMAGE_PNG } from '../../types/MIME.js'; -import { downloadAttachment } from '../../util/downloadAttachment.js'; -import { MediaTier } from '../../types/AttachmentDownload.js'; -import { HTTPError } from '../../types/HTTPError.js'; -import { getCdnNumberForBackupTier } from '../../textsecure/downloadAttachment.js'; -import { MASTER_KEY, MEDIA_ROOT_KEY } from '../backup/helpers.js'; -import { getMediaIdFromMediaName } from '../../services/backups/util/mediaId.js'; +import { DataWriter } from '../../sql/Client.preload.js'; +import { IMAGE_PNG } from '../../types/MIME.std.js'; +import { downloadAttachment } from '../../util/downloadAttachment.preload.js'; +import { MediaTier } from '../../types/AttachmentDownload.std.js'; +import { HTTPError } from '../../types/HTTPError.std.js'; +import { getCdnNumberForBackupTier } from '../../textsecure/downloadAttachment.preload.js'; +import { MASTER_KEY, MEDIA_ROOT_KEY } from '../backup/helpers.preload.js'; +import { getMediaIdFromMediaName } from '../../services/backups/util/mediaId.preload.js'; import { AttachmentVariant, AttachmentPermanentlyUndownloadableError, -} from '../../types/Attachment.js'; -import { updateRemoteConfig } from '../../test-helpers/RemoteConfigStub.js'; -import { toHex, toBase64 } from '../../Bytes.js'; -import { generateAttachmentKeys } from '../../AttachmentCrypto.js'; -import { getRandomBytes } from '../../Crypto.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +} from '../../types/Attachment.std.js'; +import { updateRemoteConfig } from '../../test-helpers/RemoteConfigStub.dom.js'; +import { toHex, toBase64 } from '../../Bytes.std.js'; +import { generateAttachmentKeys } from '../../AttachmentCrypto.node.js'; +import { getRandomBytes } from '../../Crypto.node.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; const { noop } = lodash; diff --git a/ts/test-electron/util/encryptProfileData_test.ts b/ts/test-electron/util/encryptProfileData_test.ts index b05ac0eedf..26b2bd15fe 100644 --- a/ts/test-electron/util/encryptProfileData_test.ts +++ b/ts/test-electron/util/encryptProfileData_test.ts @@ -3,16 +3,16 @@ import { assert } from 'chai'; -import * as Bytes from '../../Bytes.js'; +import * as Bytes from '../../Bytes.std.js'; import { trimForDisplay, getRandomBytes, decryptProfileName, decryptProfile, -} from '../../Crypto.js'; -import type { ConversationType } from '../../state/ducks/conversations.js'; -import { generateAci } from '../../types/ServiceId.js'; -import { encryptProfileData } from '../../util/encryptProfileData.js'; +} from '../../Crypto.node.js'; +import type { ConversationType } from '../../state/ducks/conversations.preload.js'; +import { generateAci } from '../../types/ServiceId.std.js'; +import { encryptProfileData } from '../../util/encryptProfileData.preload.js'; describe('encryptProfileData', () => { let keyBuffer: Uint8Array; diff --git a/ts/test-electron/util/formatTimestamp_test.ts b/ts/test-electron/util/formatTimestamp_test.ts new file mode 100644 index 0000000000..afbaf432ae --- /dev/null +++ b/ts/test-electron/util/formatTimestamp_test.ts @@ -0,0 +1,249 @@ +// Copyright 2023 Signal Messenger, LLC +// SPDX-License-Identifier: AGPL-3.0-only + +import { assert } from 'chai'; +import * as sinon from 'sinon'; +import moment from 'moment'; +import { + formatTimestamp, + formatDate, + formatDateTimeLong, + formatDateTimeShort, + formatTime, +} from '../../util/formatTimestamp.dom.js'; +import { HourCyclePreference } from '../../types/I18N.std.js'; +import i18n from '../../test-node/util/i18n.node.js'; + +const min = new Date(2023, 0, 1, 0).getTime(); +const max = new Date(2023, 0, 1, 23).getTime(); + +const FAKE_NOW = new Date('2020-01-23T04:56:00.000'); + +describe('formatTimestamp', () => { + let sandbox: sinon.SinonSandbox; + let localesStub: sinon.SinonStub; + let localeOverrideStub: sinon.SinonStub; + let hourCycleStub: sinon.SinonStub; + + beforeEach(() => { + sandbox = sinon.createSandbox(); + sandbox.useFakeTimers({ now: FAKE_NOW }); + localesStub = sandbox.stub( + window.SignalContext, + 'getPreferredSystemLocales' + ); + localeOverrideStub = sandbox.stub( + window.SignalContext, + 'getLocaleOverride' + ); + hourCycleStub = sandbox.stub( + window.SignalContext, + 'getHourCyclePreference' + ); + }); + + afterEach(() => { + sandbox.restore(); + }); + + function testCase( + locale: string, + preference: HourCyclePreference, + time: number, + expected: string + ) { + const timeFmt = new Intl.DateTimeFormat('en', { + timeStyle: 'medium', + }).format(time); + it(`should format with locale: ${locale} (${HourCyclePreference[preference]}) @ ${timeFmt})`, () => { + localesStub.returns([locale]); + localeOverrideStub.returns(null); + hourCycleStub.returns(preference); + assert.equal(formatTimestamp(time, { timeStyle: 'medium' }), expected); + }); + } + + testCase('en', HourCyclePreference.UnknownPreference, min, '12:00:00 AM'); + testCase('en', HourCyclePreference.UnknownPreference, max, '11:00:00 PM'); + testCase('en', HourCyclePreference.Prefer12, min, '12:00:00 AM'); + testCase('en', HourCyclePreference.Prefer12, max, '11:00:00 PM'); + testCase('en', HourCyclePreference.Prefer24, min, '00:00:00'); + testCase('en', HourCyclePreference.Prefer24, max, '23:00:00'); + + testCase('nb', HourCyclePreference.UnknownPreference, min, '00:00:00'); + testCase('nb', HourCyclePreference.UnknownPreference, max, '23:00:00'); + testCase('nb', HourCyclePreference.Prefer12, min, '12:00:00 a.m.'); + testCase('nb', HourCyclePreference.Prefer12, max, '11:00:00 p.m.'); + testCase('nb', HourCyclePreference.Prefer24, min, '00:00:00'); + testCase('nb', HourCyclePreference.Prefer24, max, '23:00:00'); + + testCase('ja', HourCyclePreference.UnknownPreference, min, '0:00:00'); + testCase('ja', HourCyclePreference.UnknownPreference, max, '23:00:00'); + testCase('ja', HourCyclePreference.Prefer12, min, '午前0:00:00'); + testCase('ja', HourCyclePreference.Prefer12, max, '午後11:00:00'); + testCase('ja', HourCyclePreference.Prefer24, min, '0:00:00'); + testCase('ja', HourCyclePreference.Prefer24, max, '23:00:00'); + + describe('formatDate', () => { + beforeEach(() => { + localesStub.returns(['en']); + }); + + it('returns "Today" for times today', () => { + [moment(), moment().endOf('day'), moment().startOf('day')].forEach(m => { + assert.strictEqual(formatDate(i18n, m), 'Today'); + }); + }); + + it('returns "Yesterday" for times yesterday', () => { + const minus24Hours = moment().subtract(1, 'day'); + [ + minus24Hours, + minus24Hours.clone().endOf('day'), + minus24Hours.clone().startOf('day'), + ].forEach(m => { + assert.strictEqual(formatDate(i18n, m), 'Yesterday'); + }); + }); + + it('returns a formatted timestamp for dates more recent than six months', () => { + const m = moment().subtract(2, 'months'); + const result = formatDate(i18n, m); + assert.include(result, m.format('ddd')); + assert.include(result, m.format('MMM')); + assert.include(result, m.format('D')); + assert.notInclude(result, m.format('YYYY')); + }); + + it('returns a formatted timestamp for dates older than six months', () => { + assert.strictEqual(formatDate(i18n, moment('2017-03-03')), 'Mar 3, 2017'); + }); + }); + + describe('formatDateTimeLong', () => { + beforeEach(() => { + localesStub.returns(['en']); + }); + + it('includes "Today" and the time for times today', () => { + const rx = /Today \d+:\d+ [A|P]M/; + const datetime = formatDateTimeLong(i18n, FAKE_NOW); + assert.isTrue(rx.test(datetime)); + }); + + it('includes "Yesterday" and the time for times yesterday', () => { + const rx = /Yesterday \d+:\d+ [A|P]M/; + const datetime = formatDateTimeLong(i18n, moment().subtract(1, 'day')); + assert.isTrue(rx.test(datetime)); + }); + + it('formats month name, day of month, year, and time for other times', () => { + const rx = /Apr (19|20|21), 2000, \d+:\d+ [A|P]M/; + const datetime = formatDateTimeLong(i18n, new Date(956216013000)); + assert.isTrue(rx.test(datetime)); + }); + }); + + describe('formatDateTimeShort', () => { + beforeEach(() => { + localesStub.returns(['en']); + }); + + it('returns "Now" for times within the last minute, including unexpected times in the future', () => { + [ + Date.now(), + moment().subtract(1, 'second'), + moment().subtract(59, 'seconds'), + moment().add(1, 'minute'), + moment().add(1, 'year'), + ].forEach(timestamp => { + assert.strictEqual(formatDateTimeShort(i18n, timestamp), 'Now'); + }); + }); + + it('returns "X minutes ago" for times in the last hour, but older than 1 minute', () => { + assert.strictEqual( + formatDateTimeShort(i18n, moment().subtract(1, 'minute')), + '1m' + ); + assert.strictEqual( + formatDateTimeShort(i18n, moment().subtract(30, 'minutes')), + '30m' + ); + assert.strictEqual( + formatDateTimeShort(i18n, moment().subtract(59, 'minutes')), + '59m' + ); + }); + + it('returns hh:mm-like times for times older than 1 hour from now, but still today', () => { + const oneHourAgo = new Date('2020-01-23T03:56:00.000'); + const rx = /\d+:\d+ [A|P]M/; + const datetime = formatDateTimeLong(i18n, oneHourAgo); + assert.isTrue(rx.test(datetime)); + }); + + it('returns the day of the week for dates in the last week, but still this month', () => { + const yesterday = new Date('2020-01-22T23:56:00.000'); + assert.deepEqual(formatDateTimeShort(i18n, yesterday), 'Wed'); + + const twoDaysAgo = new Date('2020-01-21T05:56:00.000'); + assert.deepEqual(formatDateTimeShort(i18n, twoDaysAgo), 'Tue'); + }); + + it('returns the month and day for dates older than this week, but still this year', () => { + const earlier = new Date('2020-01-03T04:56:00.000'); + assert.deepEqual(formatDateTimeShort(i18n, earlier), 'Jan 3'); + }); + + it('returns the year, month, and day for dates older than a year ago', () => { + const longAgo = new Date('1998-11-23T12:34:00.000'); + assert.deepEqual(formatDateTimeShort(i18n, longAgo), 'Nov 23, 1998'); + }); + }); + + describe('formatTime', () => { + beforeEach(() => { + localesStub.returns(['en']); + }); + + it('returns "Now" for times within the last minute, including unexpected times in the future', () => { + [ + FAKE_NOW, + moment(FAKE_NOW).subtract(1, 'second'), + moment(FAKE_NOW).subtract(59, 'seconds'), + moment(FAKE_NOW).add(1, 'minute'), + moment(FAKE_NOW).add(1, 'year'), + ].forEach(timestamp => { + assert.strictEqual(formatTime(i18n, timestamp, FAKE_NOW), 'Now'); + }); + }); + + it('returns "X minutes ago" for times in the last hour, but older than 1 minute', () => { + assert.strictEqual( + formatTime(i18n, moment(FAKE_NOW).subtract(1, 'minute'), FAKE_NOW), + '1m' + ); + assert.strictEqual( + formatTime(i18n, moment(FAKE_NOW).subtract(30, 'minutes'), FAKE_NOW), + '30m' + ); + assert.strictEqual( + formatTime(i18n, moment(FAKE_NOW).subtract(59, 'minutes'), FAKE_NOW), + '59m' + ); + }); + + it('returns hh:mm-like times for times older than 1 hour from now', () => { + const rx = /\d+:\d+ [A|P]M/; + const oneHourAgo = new Date('2020-01-23T03:56:00.000'); + assert.isTrue(rx.test(formatTime(i18n, oneHourAgo, FAKE_NOW))); + + const oneDayAgo = new Date('2020-01-22T04:56:00.000'); + assert.isTrue(rx.test(formatTime(i18n, oneDayAgo, FAKE_NOW))); + + const oneYearAgo = new Date('2019-01-23T04:56:00.000'); + assert.isTrue(rx.test(formatTime(i18n, oneYearAgo, FAKE_NOW))); + }); + }); +}); diff --git a/ts/test-electron/util/imagePathToBytes_test.ts b/ts/test-electron/util/imagePathToBytes_test.ts index 28caa32a8b..792ee45289 100644 --- a/ts/test-electron/util/imagePathToBytes_test.ts +++ b/ts/test-electron/util/imagePathToBytes_test.ts @@ -4,7 +4,7 @@ import { assert } from 'chai'; import path from 'node:path'; -import { imagePathToBytes } from '../../util/imagePathToBytes.js'; +import { imagePathToBytes } from '../../util/imagePathToBytes.dom.js'; describe('imagePathToBytes', () => { it('converts an image to an Bytes', async () => { diff --git a/ts/test-electron/util/isWindowDragElement_test.ts b/ts/test-electron/util/isWindowDragElement_test.ts index 91265f9533..11a78deac2 100644 --- a/ts/test-electron/util/isWindowDragElement_test.ts +++ b/ts/test-electron/util/isWindowDragElement_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { isWindowDragElement } from '../../util/isWindowDragElement.js'; +import { isWindowDragElement } from '../../util/isWindowDragElement.std.js'; describe('isWindowDragElement', () => { const crel = (tagName: string, appRegion?: string): Element => { diff --git a/ts/test-electron/util/migrateMessageData_test.ts b/ts/test-electron/util/migrateMessageData_test.ts index 58701151f8..4524cf8b31 100644 --- a/ts/test-electron/util/migrateMessageData_test.ts +++ b/ts/test-electron/util/migrateMessageData_test.ts @@ -3,13 +3,13 @@ import assert from 'node:assert'; import { v7 as uuid } from 'uuid'; -import { _migrateMessageData as migrateMessageData } from '../../messages/migrateMessageData.js'; -import type { MessageAttributesType } from '../../model-types.js'; -import { DataReader, DataWriter } from '../../sql/Client.js'; -import { generateAci } from '../../types/ServiceId.js'; -import { postSaveUpdates } from '../../util/cleanup.js'; -import { upgradeMessageSchema } from '../../util/migrations.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +import { _migrateMessageData as migrateMessageData } from '../../messages/migrateMessageData.preload.js'; +import type { MessageAttributesType } from '../../model-types.d.ts'; +import { DataReader, DataWriter } from '../../sql/Client.preload.js'; +import { generateAci } from '../../types/ServiceId.std.js'; +import { postSaveUpdates } from '../../util/cleanup.preload.js'; +import { upgradeMessageSchema } from '../../util/migrations.preload.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; function composeMessage(timestamp: number): MessageAttributesType { return { diff --git a/ts/test-electron/util/reactions_test.ts b/ts/test-electron/util/reactions_test.ts index 7770eecc4c..5d7605598b 100644 --- a/ts/test-electron/util/reactions_test.ts +++ b/ts/test-electron/util/reactions_test.ts @@ -3,15 +3,15 @@ import { assert } from 'chai'; import { v4 as generateGuid } from 'uuid'; -import { DataWriter } from '../../sql/Client.js'; -import { generateAci, generatePni } from '../../types/ServiceId.js'; -import { isMessageAMatchForReaction } from '../../messageModifiers/Reactions.js'; -import { generateMessageId } from '../../util/generateMessageId.js'; -import { incrementMessageCounter } from '../../util/incrementMessageCounter.js'; -import type { ConversationModel } from '../../models/conversations.js'; -import type { MessageAttributesType } from '../../model-types.js'; -import { SendStatus } from '../../messages/MessageSendState.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +import { DataWriter } from '../../sql/Client.preload.js'; +import { generateAci, generatePni } from '../../types/ServiceId.std.js'; +import { isMessageAMatchForReaction } from '../../messageModifiers/Reactions.preload.js'; +import { generateMessageId } from '../../util/generateMessageId.node.js'; +import { incrementMessageCounter } from '../../util/incrementMessageCounter.preload.js'; +import type { ConversationModel } from '../../models/conversations.preload.js'; +import type { MessageAttributesType } from '../../model-types.d.ts'; +import { SendStatus } from '../../messages/MessageSendState.std.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; describe('isMessageAMatchForReaction', () => { let contactA: ConversationModel; diff --git a/ts/test-electron/util/scaleImageToLevel_test.ts b/ts/test-electron/util/scaleImageToLevel_test.ts index ed425c00a6..4c8f5d6a54 100644 --- a/ts/test-electron/util/scaleImageToLevel_test.ts +++ b/ts/test-electron/util/scaleImageToLevel_test.ts @@ -3,9 +3,9 @@ import { assert } from 'chai'; import loadImage from 'blueimp-load-image'; -import { IMAGE_JPEG, IMAGE_PNG } from '../../types/MIME.js'; +import { IMAGE_JPEG, IMAGE_PNG } from '../../types/MIME.std.js'; -import { scaleImageToLevel } from '../../util/scaleImageToLevel.js'; +import { scaleImageToLevel } from '../../util/scaleImageToLevel.preload.js'; describe('scaleImageToLevel', () => { // NOTE: These tests are incomplete. diff --git a/ts/test-electron/util/sendToGroup_test.ts b/ts/test-electron/util/sendToGroup_test.ts index 19bd4531c6..d69fd7cd76 100644 --- a/ts/test-electron/util/sendToGroup_test.ts +++ b/ts/test-electron/util/sendToGroup_test.ts @@ -7,8 +7,8 @@ import { LibSignalErrorBase } from '@signalapp/libsignal-client'; import { _analyzeSenderKeyDevices, _shouldFailSend, -} from '../../util/sendToGroup.js'; -import { generateAci } from '../../types/ServiceId.js'; +} from '../../util/sendToGroup.preload.js'; +import { generateAci } from '../../types/ServiceId.std.js'; import type { DeviceType } from '../../textsecure/Types.d.ts'; import { @@ -22,8 +22,8 @@ import { SendMessageProtoError, UnknownRecipientError, UnregisteredUserError, -} from '../../textsecure/Errors.js'; -import { HTTPError } from '../../types/HTTPError.js'; +} from '../../textsecure/Errors.std.js'; +import { HTTPError } from '../../types/HTTPError.std.js'; describe('sendToGroup', () => { const serviceIdOne = generateAci(); diff --git a/ts/test-electron/util/waitForOnline_test.ts b/ts/test-electron/util/waitForOnline_test.ts index 5e79d2cf5e..e96357b726 100644 --- a/ts/test-electron/util/waitForOnline_test.ts +++ b/ts/test-electron/util/waitForOnline_test.ts @@ -5,7 +5,7 @@ import { assert } from 'chai'; import { EventEmitter } from 'node:events'; import * as sinon from 'sinon'; -import { waitForOnline } from '../../util/waitForOnline.js'; +import { waitForOnline } from '../../util/waitForOnline.dom.js'; describe('waitForOnline', () => { let sandbox: sinon.SinonSandbox; diff --git a/ts/test-electron/windows/attachments_test.ts b/ts/test-electron/windows/attachments_test.ts index cbe1478ac9..817636ad9e 100644 --- a/ts/test-electron/windows/attachments_test.ts +++ b/ts/test-electron/windows/attachments_test.ts @@ -6,9 +6,9 @@ import path from 'node:path'; import fs from 'node:fs'; import os from 'node:os'; import fse from 'fs-extra'; -import * as Attachments from '../../windows/main/attachments.js'; -import * as Bytes from '../../Bytes.js'; -import { createName, getRelativePath } from '../../util/attachmentPath.js'; +import * as Attachments from '../../windows/main/attachments.preload.js'; +import * as Bytes from '../../Bytes.std.js'; +import { createName, getRelativePath } from '../../util/attachmentPath.node.js'; const PREFIX_LENGTH = 2; const NUM_SEPARATORS = 1; diff --git a/ts/test-helpers/FakeLeftPaneContainer.tsx b/ts/test-helpers/FakeLeftPaneContainer.tsx index fea2b47025..2504e6d022 100644 --- a/ts/test-helpers/FakeLeftPaneContainer.tsx +++ b/ts/test-helpers/FakeLeftPaneContainer.tsx @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import { WidthBreakpoint } from '../components/_util.js'; +import { WidthBreakpoint } from '../components/_util.std.js'; type PropsType = { children?: React.ReactNode; diff --git a/ts/test-helpers/RemoteConfigStub.ts b/ts/test-helpers/RemoteConfigStub.ts index 6d141bc4fe..0cf7ca920f 100644 --- a/ts/test-helpers/RemoteConfigStub.ts +++ b/ts/test-helpers/RemoteConfigStub.ts @@ -1,8 +1,8 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { _refreshRemoteConfig } from '../RemoteConfig.js'; -import type { RemoteConfigResponseType } from '../textsecure/WebAPI.js'; +import { _refreshRemoteConfig } from '../RemoteConfig.dom.js'; +import type { RemoteConfigResponseType } from '../textsecure/WebAPI.preload.js'; export async function updateRemoteConfig( newConfig: Array<{ name: string; value: string }> diff --git a/ts/test-helpers/attachmentDownloads.ts b/ts/test-helpers/attachmentDownloads.ts index c996b468b7..44355c51b5 100644 --- a/ts/test-helpers/attachmentDownloads.ts +++ b/ts/test-helpers/attachmentDownloads.ts @@ -1,9 +1,9 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { AttachmentDownloadSource } from '../sql/Interface.js'; -import { IMAGE_JPEG, IMAGE_PNG } from '../types/MIME.js'; -import type { AttachmentDownloadJobType } from '../types/AttachmentDownload.js'; +import { AttachmentDownloadSource } from '../sql/Interface.std.js'; +import { IMAGE_JPEG, IMAGE_PNG } from '../types/MIME.std.js'; +import type { AttachmentDownloadJobType } from '../types/AttachmentDownload.std.js'; export function createAttachmentDownloadJob( index: number, diff --git a/ts/test-helpers/createCallParticipant.ts b/ts/test-helpers/createCallParticipant.ts index 2873a87764..5b24f6d39b 100644 --- a/ts/test-helpers/createCallParticipant.ts +++ b/ts/test-helpers/createCallParticipant.ts @@ -3,11 +3,11 @@ import lodash from 'lodash'; -import { AvatarColors } from '../types/Colors.js'; -import type { GroupCallRemoteParticipantType } from '../types/Calling.js'; -import { generateAci } from '../types/ServiceId.js'; +import { AvatarColors } from '../types/Colors.std.js'; +import type { GroupCallRemoteParticipantType } from '../types/Calling.std.js'; +import { generateAci } from '../types/ServiceId.std.js'; -import { getDefaultConversationWithServiceId } from './getDefaultConversation.js'; +import { getDefaultConversationWithServiceId } from './getDefaultConversation.std.js'; const { sample } = lodash; diff --git a/ts/test-helpers/defaultComposerStates.ts b/ts/test-helpers/defaultComposerStates.ts index 9c13d8d166..95927f332e 100644 --- a/ts/test-helpers/defaultComposerStates.ts +++ b/ts/test-helpers/defaultComposerStates.ts @@ -1,9 +1,9 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { ComposerStep } from '../state/ducks/conversationsEnums.js'; -import { OneTimeModalState } from '../groups/toggleSelectedContactForGroupAddition.js'; -import { DurationInSeconds } from '../util/durations/index.js'; +import { ComposerStep } from '../state/ducks/conversationsEnums.std.js'; +import { OneTimeModalState } from '../groups/toggleSelectedContactForGroupAddition.std.js'; +import { DurationInSeconds } from '../util/durations/index.std.js'; export const defaultStartDirectConversationComposerState = { step: ComposerStep.StartDirectConversation as const, diff --git a/ts/test-helpers/expireTimers.ts b/ts/test-helpers/expireTimers.ts index dfca459eba..8668216bd3 100644 --- a/ts/test-helpers/expireTimers.ts +++ b/ts/test-helpers/expireTimers.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as durations from '../util/durations/index.js'; -import { DurationInSeconds } from '../util/durations/index.js'; +import * as durations from '../util/durations/index.std.js'; +import { DurationInSeconds } from '../util/durations/index.std.js'; export type TestExpireTimer = Readonly<{ value: DurationInSeconds; diff --git a/ts/test-helpers/fakeAttachment.ts b/ts/test-helpers/fakeAttachment.ts index 41729ee9d9..9a05d023fc 100644 --- a/ts/test-helpers/fakeAttachment.ts +++ b/ts/test-helpers/fakeAttachment.ts @@ -7,8 +7,8 @@ import type { AttachmentDraftType, ThumbnailType, AttachmentForUIType, -} from '../types/Attachment.js'; -import { IMAGE_JPEG } from '../types/MIME.js'; +} from '../types/Attachment.std.js'; +import { IMAGE_JPEG } from '../types/MIME.std.js'; export const fakeAttachment = ( overrides: Partial = {} diff --git a/ts/test-helpers/fakeCallLink.ts b/ts/test-helpers/fakeCallLink.ts index e66a038621..a8cf47886b 100644 --- a/ts/test-helpers/fakeCallLink.ts +++ b/ts/test-helpers/fakeCallLink.ts @@ -1,9 +1,9 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { CallLinkStateType, CallLinkType } from '../types/CallLink.js'; -import type { CallingConversationType } from '../types/Calling.js'; -import { CallLinkRestrictions } from '../types/CallLink.js'; -import { MONTH } from '../util/durations/constants.js'; +import type { CallLinkStateType, CallLinkType } from '../types/CallLink.std.js'; +import type { CallingConversationType } from '../types/Calling.std.js'; +import { CallLinkRestrictions } from '../types/CallLink.std.js'; +import { MONTH } from '../util/durations/constants.std.js'; export const FAKE_CALL_LINK: CallLinkType = { adminKey: null, diff --git a/ts/test-helpers/fakeLookupConversationWithoutServiceId.ts b/ts/test-helpers/fakeLookupConversationWithoutServiceId.ts index dc7a8e1d7f..c1eceadca3 100644 --- a/ts/test-helpers/fakeLookupConversationWithoutServiceId.ts +++ b/ts/test-helpers/fakeLookupConversationWithoutServiceId.ts @@ -6,12 +6,12 @@ import { useState } from 'react'; import type { UUIDFetchStateType, UUIDFetchStateKeyType, -} from '../util/uuidFetchState.js'; -import type { lookupConversationWithoutServiceId } from '../util/lookupConversationWithoutServiceId.js'; -import { sleep } from '../util/sleep.js'; -import * as durations from '../util/durations/index.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import { getDefaultConversation } from './getDefaultConversation.js'; +} from '../util/uuidFetchState.std.js'; +import type { lookupConversationWithoutServiceId } from '../util/lookupConversationWithoutServiceId.preload.js'; +import { sleep } from '../util/sleep.std.js'; +import * as durations from '../util/durations/index.std.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import { getDefaultConversation } from './getDefaultConversation.std.js'; const VALID_IDENTIFIERS = new Set([ 'e164:+12125551234', diff --git a/ts/test-helpers/generateBackup.ts b/ts/test-helpers/generateBackup.ts index d4b4bd7f15..1c80d5b801 100644 --- a/ts/test-helpers/generateBackup.ts +++ b/ts/test-helpers/generateBackup.ts @@ -12,15 +12,15 @@ import { } from '@signalapp/libsignal-client/dist/AccountKeys.js'; import { MessageBackupKey } from '@signalapp/libsignal-client/dist/MessageBackup.js'; -import type { AciString } from '../types/ServiceId.js'; -import { generateAci } from '../types/ServiceId.js'; -import { CipherType } from '../types/Crypto.js'; -import { appendPaddingStream } from '../util/logPadding.js'; -import { prependStream } from '../util/prependStream.js'; -import { appendMacStream } from '../util/appendMacStream.js'; -import { toAciObject } from '../util/ServiceId.js'; -import { BACKUP_VERSION } from '../services/backups/constants.js'; -import { Backups } from '../protobuf/index.js'; +import type { AciString } from '../types/ServiceId.std.js'; +import { generateAci } from '../types/ServiceId.std.js'; +import { CipherType } from '../types/Crypto.std.js'; +import { appendPaddingStream } from '../util/logPadding.node.js'; +import { prependStream } from '../util/prependStream.node.js'; +import { appendMacStream } from '../util/appendMacStream.node.js'; +import { toAciObject } from '../util/ServiceId.node.js'; +import { BACKUP_VERSION } from '../services/backups/constants.std.js'; +import { Backups } from '../protobuf/index.std.js'; export type BackupGeneratorConfigType = Readonly< { diff --git a/ts/test-helpers/getDefaultConversation.ts b/ts/test-helpers/getDefaultConversation.ts index 323c29cc05..2c5852e503 100644 --- a/ts/test-helpers/getDefaultConversation.ts +++ b/ts/test-helpers/getDefaultConversation.ts @@ -5,14 +5,14 @@ import casual from 'casual'; import lodash from 'lodash'; import { v4 as generateUuid } from 'uuid'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import type { ServiceIdString } from '../types/ServiceId.js'; -import { generateAci } from '../types/ServiceId.js'; -import type { GroupListItemConversationType } from '../components/conversationList/GroupListItem.js'; -import { getRandomColor } from './getRandomColor.js'; -import { ConversationColors } from '../types/Colors.js'; -import { StorySendMode } from '../types/Stories.js'; -import { getAvatarPlaceholderGradient } from '../utils/getAvatarPlaceholderGradient.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; +import { generateAci } from '../types/ServiceId.std.js'; +import type { GroupListItemConversationType } from '../components/conversationList/GroupListItem.dom.js'; +import { getRandomColor } from './getRandomColor.std.js'; +import { ConversationColors } from '../types/Colors.std.js'; +import { StorySendMode } from '../types/Stories.std.js'; +import { getAvatarPlaceholderGradient } from '../utils/getAvatarPlaceholderGradient.std.js'; const { sample } = lodash; diff --git a/ts/test-helpers/getFakeBadge.ts b/ts/test-helpers/getFakeBadge.ts index 34548d1c49..8ef4f7a3a8 100644 --- a/ts/test-helpers/getFakeBadge.ts +++ b/ts/test-helpers/getFakeBadge.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import lodash from 'lodash'; -import type { BadgeType } from '../badges/types.js'; -import { BadgeCategory } from '../badges/BadgeCategory.js'; -import { BadgeImageTheme } from '../badges/BadgeImageTheme.js'; -import { repeat, zipObject } from '../util/iterables.js'; +import type { BadgeType } from '../badges/types.std.js'; +import { BadgeCategory } from '../badges/BadgeCategory.std.js'; +import { BadgeImageTheme } from '../badges/BadgeImageTheme.std.js'; +import { repeat, zipObject } from '../util/iterables.std.js'; const { times } = lodash; diff --git a/ts/test-helpers/getFakeCallHistoryGroup.ts b/ts/test-helpers/getFakeCallHistoryGroup.ts index fdbdc8e765..174c42ff2b 100644 --- a/ts/test-helpers/getFakeCallHistoryGroup.ts +++ b/ts/test-helpers/getFakeCallHistoryGroup.ts @@ -1,15 +1,15 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { CallHistoryGroup } from '../types/CallDisposition.js'; +import type { CallHistoryGroup } from '../types/CallDisposition.std.js'; import { AdhocCallStatus, CallDirection, CallType, DirectCallStatus, CallMode, -} from '../types/CallDisposition.js'; -import { DurationInSeconds } from '../util/durations/index.js'; +} from '../types/CallDisposition.std.js'; +import { DurationInSeconds } from '../util/durations/index.std.js'; function mins(n: number) { return DurationInSeconds.toMillis(DurationInSeconds.fromMinutes(n)); diff --git a/ts/test-helpers/getFakeDistributionLists.ts b/ts/test-helpers/getFakeDistributionLists.ts index f72757d7e4..0133a787c2 100644 --- a/ts/test-helpers/getFakeDistributionLists.ts +++ b/ts/test-helpers/getFakeDistributionLists.ts @@ -3,12 +3,12 @@ import casual from 'casual'; -import type { StoryDistributionListDataType } from '../state/ducks/storyDistributionLists.js'; -import type { StoryDistributionListWithMembersDataType } from '../types/Stories.js'; -import { MY_STORY_ID } from '../types/Stories.js'; -import { generateStoryDistributionId } from '../types/StoryDistributionId.js'; -import { generateAci } from '../types/ServiceId.js'; -import { getDefaultConversation } from './getDefaultConversation.js'; +import type { StoryDistributionListDataType } from '../state/ducks/storyDistributionLists.preload.js'; +import type { StoryDistributionListWithMembersDataType } from '../types/Stories.std.js'; +import { MY_STORY_ID } from '../types/Stories.std.js'; +import { generateStoryDistributionId } from '../types/StoryDistributionId.std.js'; +import { generateAci } from '../types/ServiceId.std.js'; +import { getDefaultConversation } from './getDefaultConversation.std.js'; export function getFakeDistributionListsWithMembers(): Array { return [ diff --git a/ts/test-helpers/getFakeStory.tsx b/ts/test-helpers/getFakeStory.tsx index defbfbfca4..79730f4ea2 100644 --- a/ts/test-helpers/getFakeStory.tsx +++ b/ts/test-helpers/getFakeStory.tsx @@ -4,17 +4,17 @@ import casual from 'casual'; import { v4 as generateUuid } from 'uuid'; -import type { AttachmentType } from '../types/Attachment.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; +import type { AttachmentType } from '../types/Attachment.std.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; import type { ConversationStoryType, MyStoryType, StoryViewType, -} from '../types/Stories.js'; -import * as durations from '../util/durations/index.js'; -import { getDefaultConversation } from './getDefaultConversation.js'; -import { fakeAttachment, fakeThumbnail } from './fakeAttachment.js'; -import { MY_STORY_ID, ResolvedSendStatus } from '../types/Stories.js'; +} from '../types/Stories.std.js'; +import * as durations from '../util/durations/index.std.js'; +import { getDefaultConversation } from './getDefaultConversation.std.js'; +import { fakeAttachment, fakeThumbnail } from './fakeAttachment.std.js'; +import { MY_STORY_ID, ResolvedSendStatus } from '../types/Stories.std.js'; function getAttachmentWithThumbnail(url: string): AttachmentType { return fakeAttachment({ diff --git a/ts/test-helpers/getRandomColor.ts b/ts/test-helpers/getRandomColor.ts index 1f2b2cc29d..f4913309bb 100644 --- a/ts/test-helpers/getRandomColor.ts +++ b/ts/test-helpers/getRandomColor.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import lodash from 'lodash'; -import type { AvatarColorType } from '../types/Colors.js'; -import { AvatarColors } from '../types/Colors.js'; +import type { AvatarColorType } from '../types/Colors.std.js'; +import { AvatarColors } from '../types/Colors.std.js'; const { sample } = lodash; diff --git a/ts/test-helpers/getStickerPacks.ts b/ts/test-helpers/getStickerPacks.ts index b599e77ed0..662e766315 100644 --- a/ts/test-helpers/getStickerPacks.ts +++ b/ts/test-helpers/getStickerPacks.ts @@ -1,7 +1,10 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { StickerPackType, StickerType } from '../state/ducks/stickers.js'; +import type { + StickerPackType, + StickerType, +} from '../state/ducks/stickers.preload.js'; export const createPack = ( props: Partial, diff --git a/ts/test-mock/backups/backups_test.ts b/ts/test-mock/backups/backups_test.ts index 6e7edff129..f1881fec87 100644 --- a/ts/test-mock/backups/backups_test.ts +++ b/ts/test-mock/backups/backups_test.ts @@ -11,25 +11,25 @@ import { assert } from 'chai'; import { expect } from 'playwright/test'; import Long from 'long'; -import * as Bytes from '../../Bytes.js'; -import { generateStoryDistributionId } from '../../types/StoryDistributionId.js'; -import { MY_STORY_ID } from '../../types/Stories.js'; -import { generateAci } from '../../types/ServiceId.js'; -import { generateBackup } from '../../test-helpers/generateBackup.js'; -import { IMAGE_JPEG } from '../../types/MIME.js'; -import { uuidToBytes } from '../../util/uuidToBytes.js'; -import * as durations from '../../util/durations/index.js'; -import type { App } from '../playwright.js'; -import { Bootstrap, type LinkOptionsType } from '../bootstrap.js'; +import * as Bytes from '../../Bytes.std.js'; +import { generateStoryDistributionId } from '../../types/StoryDistributionId.std.js'; +import { MY_STORY_ID } from '../../types/Stories.std.js'; +import { generateAci } from '../../types/ServiceId.std.js'; +import { generateBackup } from '../../test-helpers/generateBackup.node.js'; +import { IMAGE_JPEG } from '../../types/MIME.std.js'; +import { uuidToBytes } from '../../util/uuidToBytes.std.js'; +import * as durations from '../../util/durations/index.std.js'; +import type { App } from '../playwright.node.js'; +import { Bootstrap, type LinkOptionsType } from '../bootstrap.node.js'; import { getMessageInTimelineByTimestamp, sendTextMessage, sendReaction, -} from '../helpers.js'; -import { toBase64 } from '../../Bytes.js'; -import { strictAssert } from '../../util/assert.js'; -import { BackupLevel } from '../../services/backups/types.js'; -import { generateNotificationProfileId } from '../../types/NotificationProfile-node.js'; +} from '../helpers.node.js'; +import { toBase64 } from '../../Bytes.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { BackupLevel } from '../../services/backups/types.std.js'; +import { generateNotificationProfileId } from '../../types/NotificationProfile-node.node.js'; export const debug = createDebug('mock:test:backups'); diff --git a/ts/test-mock/benchmarks/backup_bench.ts b/ts/test-mock/benchmarks/backup_bench.ts index f9292071f7..0509764df5 100644 --- a/ts/test-mock/benchmarks/backup_bench.ts +++ b/ts/test-mock/benchmarks/backup_bench.ts @@ -1,9 +1,9 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { Bootstrap, MAX_CYCLES } from './fixtures.js'; -import { type RegressionSample } from '../bootstrap.js'; -import { generateBackup } from '../../test-helpers/generateBackup.js'; +import { Bootstrap, MAX_CYCLES } from './fixtures.node.js'; +import { type RegressionSample } from '../bootstrap.node.js'; +import { generateBackup } from '../../test-helpers/generateBackup.node.js'; const INITIAL_MESSAGE_COUNT = 10000; const FINAL_MESSAGE_COUNT = 30000; diff --git a/ts/test-mock/benchmarks/call_history_search_bench.ts b/ts/test-mock/benchmarks/call_history_search_bench.ts index d90454c341..3c4a063e2c 100644 --- a/ts/test-mock/benchmarks/call_history_search_bench.ts +++ b/ts/test-mock/benchmarks/call_history_search_bench.ts @@ -7,11 +7,11 @@ import { Proto, StorageState } from '@signalapp/mock-server'; import Long from 'long'; import lodash from 'lodash'; import { expect } from 'playwright/test'; -import { Bootstrap, debug, RUN_COUNT, DISCARD_COUNT } from './fixtures.js'; -import { stats } from '../../util/benchmark/stats.js'; -import { uuidToBytes } from '../../util/uuidToBytes.js'; -import { strictAssert } from '../../util/assert.js'; -import { typeIntoInput } from '../helpers.js'; +import { Bootstrap, debug, RUN_COUNT, DISCARD_COUNT } from './fixtures.node.js'; +import { stats } from '../../util/benchmark/stats.std.js'; +import { uuidToBytes } from '../../util/uuidToBytes.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { typeIntoInput } from '../helpers.node.js'; const { sample } = lodash; diff --git a/ts/test-mock/benchmarks/convo_open_bench.ts b/ts/test-mock/benchmarks/convo_open_bench.ts index f956beeeb5..1af2cd57c0 100644 --- a/ts/test-mock/benchmarks/convo_open_bench.ts +++ b/ts/test-mock/benchmarks/convo_open_bench.ts @@ -5,9 +5,9 @@ import assert from 'node:assert'; import type { PrimaryDevice } from '@signalapp/mock-server'; -import { Bootstrap, debug, RUN_COUNT, DISCARD_COUNT } from './fixtures.js'; -import { stats } from '../../util/benchmark/stats.js'; -import { sleep } from '../../util/sleep.js'; +import { Bootstrap, debug, RUN_COUNT, DISCARD_COUNT } from './fixtures.node.js'; +import { stats } from '../../util/benchmark/stats.std.js'; +import { sleep } from '../../util/sleep.std.js'; const CONVERSATION_SIZE = 1000; // messages const DELAY = 50; // milliseconds diff --git a/ts/test-mock/benchmarks/fixtures.ts b/ts/test-mock/benchmarks/fixtures.ts index 234aff162a..775158a5f0 100644 --- a/ts/test-mock/benchmarks/fixtures.ts +++ b/ts/test-mock/benchmarks/fixtures.ts @@ -4,12 +4,12 @@ import createDebug from 'debug'; -import { Bootstrap } from '../bootstrap.js'; +import { Bootstrap } from '../bootstrap.node.js'; export const debug = createDebug('mock:benchmarks'); export { Bootstrap }; -export { App } from '../playwright.js'; +export { App } from '../playwright.node.js'; export const RUN_COUNT = process.env.RUN_COUNT ? parseInt(process.env.RUN_COUNT, 10) diff --git a/ts/test-mock/benchmarks/group_send_bench.ts b/ts/test-mock/benchmarks/group_send_bench.ts index 36212b40e2..0de6310ae0 100644 --- a/ts/test-mock/benchmarks/group_send_bench.ts +++ b/ts/test-mock/benchmarks/group_send_bench.ts @@ -18,11 +18,11 @@ import { DISCARD_COUNT, GROUP_DELIVERY_RECEIPTS, BLOCKED_COUNT, -} from './fixtures.js'; -import { stats } from '../../util/benchmark/stats.js'; -import { sleep } from '../../util/sleep.js'; -import { typeIntoInput, waitForEnabledComposer } from '../helpers.js'; -import { MINUTE } from '../../util/durations/index.js'; +} from './fixtures.node.js'; +import { stats } from '../../util/benchmark/stats.std.js'; +import { sleep } from '../../util/sleep.std.js'; +import { typeIntoInput, waitForEnabledComposer } from '../helpers.node.js'; +import { MINUTE } from '../../util/durations/index.std.js'; const LAST_MESSAGE = 'start sending messages now'; diff --git a/ts/test-mock/benchmarks/send_bench.ts b/ts/test-mock/benchmarks/send_bench.ts index ffa9f8565f..79cab7736c 100644 --- a/ts/test-mock/benchmarks/send_bench.ts +++ b/ts/test-mock/benchmarks/send_bench.ts @@ -6,9 +6,9 @@ import assert from 'node:assert'; import { ReceiptType } from '@signalapp/mock-server'; -import { Bootstrap, debug, RUN_COUNT, DISCARD_COUNT } from './fixtures.js'; -import { stats } from '../../util/benchmark/stats.js'; -import { typeIntoInput, waitForEnabledComposer } from '../helpers.js'; +import { Bootstrap, debug, RUN_COUNT, DISCARD_COUNT } from './fixtures.node.js'; +import { stats } from '../../util/benchmark/stats.std.js'; +import { typeIntoInput, waitForEnabledComposer } from '../helpers.node.js'; const CONVERSATION_SIZE = 500; // messages diff --git a/ts/test-mock/benchmarks/startup_bench.ts b/ts/test-mock/benchmarks/startup_bench.ts index 6b12eb2ec5..fb96a0fe2b 100644 --- a/ts/test-mock/benchmarks/startup_bench.ts +++ b/ts/test-mock/benchmarks/startup_bench.ts @@ -4,8 +4,8 @@ import { ReceiptType } from '@signalapp/mock-server'; import lodash from 'lodash'; -import { debug, Bootstrap, MAX_CYCLES } from './fixtures.js'; -import { type RegressionSample } from '../bootstrap.js'; +import { debug, Bootstrap, MAX_CYCLES } from './fixtures.node.js'; +import { type RegressionSample } from '../bootstrap.node.js'; const { omit } = lodash; diff --git a/ts/test-mock/benchmarks/storage_sync_bench.ts b/ts/test-mock/benchmarks/storage_sync_bench.ts index ca18baa501..0d421f92e5 100644 --- a/ts/test-mock/benchmarks/storage_sync_bench.ts +++ b/ts/test-mock/benchmarks/storage_sync_bench.ts @@ -5,7 +5,7 @@ import type { PrimaryDevice } from '@signalapp/mock-server'; import { StorageState } from '@signalapp/mock-server'; -import { Bootstrap } from './fixtures.js'; +import { Bootstrap } from './fixtures.node.js'; const CONTACT_COUNT = 1000; diff --git a/ts/test-mock/bootstrap.ts b/ts/test-mock/bootstrap.ts index 36fbdc85fe..d5ecf86514 100644 --- a/ts/test-mock/bootstrap.ts +++ b/ts/test-mock/bootstrap.ts @@ -21,20 +21,20 @@ import { ServiceIdKind, loadCertificates, } from '@signalapp/mock-server'; -import { MAX_READ_KEYS as MAX_STORAGE_READ_KEYS } from '../services/storageConstants.js'; -import { SECOND, MINUTE, WEEK, MONTH } from '../util/durations/index.js'; -import { drop } from '../util/drop.js'; -import { regress } from '../util/benchmark/stats.js'; -import type { RendererConfigType } from '../types/RendererConfig.js'; -import type { MIMEType } from '../types/MIME.js'; -import { App } from './playwright.js'; -import { CONTACT_COUNT } from './benchmarks/fixtures.js'; -import { strictAssert } from '../util/assert.js'; +import { MAX_READ_KEYS as MAX_STORAGE_READ_KEYS } from '../services/storageConstants.std.js'; +import { SECOND, MINUTE, WEEK, MONTH } from '../util/durations/index.std.js'; +import { drop } from '../util/drop.std.js'; +import { regress } from '../util/benchmark/stats.std.js'; +import type { RendererConfigType } from '../types/RendererConfig.std.js'; +import type { MIMEType } from '../types/MIME.std.js'; +import { App } from './playwright.node.js'; +import { CONTACT_COUNT } from './benchmarks/fixtures.node.js'; +import { strictAssert } from '../util/assert.std.js'; import { encryptAttachmentV2, generateAttachmentKeys, -} from '../AttachmentCrypto.js'; -import { isVideoTypeSupported } from '../util/GoogleChrome.js'; +} from '../AttachmentCrypto.node.js'; +import { isVideoTypeSupported } from '../util/GoogleChrome.std.js'; export { App }; diff --git a/ts/test-mock/calling/callLinkAdmin_test.ts b/ts/test-mock/calling/callLinkAdmin_test.ts index 436d760ed4..765ac62cb3 100644 --- a/ts/test-mock/calling/callLinkAdmin_test.ts +++ b/ts/test-mock/calling/callLinkAdmin_test.ts @@ -1,10 +1,10 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import { expect } from 'playwright/test'; -import * as durations from '../../util/durations/index.js'; -import type { App } from '../playwright.js'; -import { Bootstrap } from '../bootstrap.js'; -import { createCallLink } from '../helpers.js'; +import * as durations from '../../util/durations/index.std.js'; +import type { App } from '../playwright.node.js'; +import { Bootstrap } from '../bootstrap.node.js'; +import { createCallLink } from '../helpers.node.js'; describe('calling/callLinkAdmin', function (this: Mocha.Suite) { this.timeout(durations.MINUTE); diff --git a/ts/test-mock/calling/callMessages_test.docker.ts b/ts/test-mock/calling/callMessages_test.docker.ts index 1e7746c3ba..34003e5ac1 100644 --- a/ts/test-mock/calling/callMessages_test.docker.ts +++ b/ts/test-mock/calling/callMessages_test.docker.ts @@ -8,10 +8,10 @@ import { StorageState } from '@signalapp/mock-server'; import { expect } from 'playwright/test'; import type { Page } from 'playwright'; import { promisify } from 'node:util'; -import * as durations from '../../util/durations/index.js'; -import type { App } from '../playwright.js'; -import { Bootstrap } from '../bootstrap.js'; -import { runTurnInContainer, tearDownTurnContainer } from './helpers.js'; +import * as durations from '../../util/durations/index.std.js'; +import type { App } from '../playwright.node.js'; +import { Bootstrap } from '../bootstrap.node.js'; +import { runTurnInContainer, tearDownTurnContainer } from './helpers.node.js'; const FIXTURES = join(__dirname, '..', '..', '..', 'fixtures'); const VIRTUAL_AUDIO = join( diff --git a/ts/test-mock/helpers.ts b/ts/test-mock/helpers.ts index 529bb68d4e..d7213593b4 100644 --- a/ts/test-mock/helpers.ts +++ b/ts/test-mock/helpers.ts @@ -13,8 +13,8 @@ import { assert } from 'chai'; import Long from 'long'; import type { Locator, Page } from 'playwright'; import { expect } from 'playwright/test'; -import type { SignalService } from '../protobuf/index.js'; -import { strictAssert } from '../util/assert.js'; +import type { SignalService } from '../protobuf/index.std.js'; +import { strictAssert } from '../util/assert.std.js'; const debug = createDebug('mock:test:helpers'); diff --git a/ts/test-mock/messaging/attachments_test.ts b/ts/test-mock/messaging/attachments_test.ts index 75bc847e68..dfd2c1ad6e 100644 --- a/ts/test-mock/messaging/attachments_test.ts +++ b/ts/test-mock/messaging/attachments_test.ts @@ -8,18 +8,18 @@ import { type PrimaryDevice, StorageState } from '@signalapp/mock-server'; import * as path from 'node:path'; import { readFile } from 'node:fs/promises'; -import type { App } from '../playwright.js'; -import { Bootstrap } from '../bootstrap.js'; +import type { App } from '../playwright.node.js'; +import { Bootstrap } from '../bootstrap.node.js'; import { getMessageInTimelineByTimestamp, getTimelineMessageWithText, sendMessageWithAttachments, sendTextMessage, -} from '../helpers.js'; -import * as durations from '../../util/durations/index.js'; -import { strictAssert } from '../../util/assert.js'; -import { VIDEO_MP4 } from '../../types/MIME.js'; -import { toBase64 } from '../../Bytes.js'; +} from '../helpers.node.js'; +import * as durations from '../../util/durations/index.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { VIDEO_MP4 } from '../../types/MIME.std.js'; +import { toBase64 } from '../../Bytes.std.js'; export const debug = createDebug('mock:test:attachments'); diff --git a/ts/test-mock/messaging/backfill_test.ts b/ts/test-mock/messaging/backfill_test.ts index 18fc90ca61..80de2d5281 100644 --- a/ts/test-mock/messaging/backfill_test.ts +++ b/ts/test-mock/messaging/backfill_test.ts @@ -10,11 +10,14 @@ import type { Page } from 'playwright'; import assert from 'node:assert'; import Long from 'long'; -import { LONG_MESSAGE, IMAGE_JPEG } from '../../types/MIME.js'; -import * as durations from '../../util/durations/index.js'; -import type { App } from '../playwright.js'; -import { Bootstrap } from '../bootstrap.js'; -import { sendTextMessage, getTimelineMessageWithText } from '../helpers.js'; +import { LONG_MESSAGE, IMAGE_JPEG } from '../../types/MIME.std.js'; +import * as durations from '../../util/durations/index.std.js'; +import type { App } from '../playwright.node.js'; +import { Bootstrap } from '../bootstrap.node.js'; +import { + sendTextMessage, + getTimelineMessageWithText, +} from '../helpers.node.js'; export const debug = createDebug('mock:test:backfill'); diff --git a/ts/test-mock/messaging/edit_test.ts b/ts/test-mock/messaging/edit_test.ts index 0f057b1161..f0397dbdaa 100644 --- a/ts/test-mock/messaging/edit_test.ts +++ b/ts/test-mock/messaging/edit_test.ts @@ -8,18 +8,21 @@ import createDebug from 'debug'; import Long from 'long'; import type { Page } from 'playwright'; -import type { App } from '../playwright.js'; -import * as durations from '../../util/durations/index.js'; -import { Bootstrap } from '../bootstrap.js'; -import { RECEIPT_BATCHER_WAIT_MS, ReceiptType } from '../../types/Receipt.js'; -import { SendStatus } from '../../messages/MessageSendState.js'; -import { drop } from '../../util/drop.js'; -import { strictAssert } from '../../util/assert.js'; -import { generateAci } from '../../types/ServiceId.js'; -import { IMAGE_GIF } from '../../types/MIME.js'; -import { typeIntoInput, waitForEnabledComposer } from '../helpers.js'; -import type { MessageAttributesType } from '../../model-types.js'; -import { sleep } from '../../util/sleep.js'; +import type { App } from '../playwright.node.js'; +import * as durations from '../../util/durations/index.std.js'; +import { Bootstrap } from '../bootstrap.node.js'; +import { + RECEIPT_BATCHER_WAIT_MS, + ReceiptType, +} from '../../types/Receipt.std.js'; +import { SendStatus } from '../../messages/MessageSendState.std.js'; +import { drop } from '../../util/drop.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { generateAci } from '../../types/ServiceId.std.js'; +import { IMAGE_GIF } from '../../types/MIME.std.js'; +import { typeIntoInput, waitForEnabledComposer } from '../helpers.node.js'; +import type { MessageAttributesType } from '../../model-types.d.ts'; +import { sleep } from '../../util/sleep.std.js'; export const debug = createDebug('mock:test:edit'); diff --git a/ts/test-mock/messaging/expire_timer_version_test.ts b/ts/test-mock/messaging/expire_timer_version_test.ts index 9e98cd6462..a0d83078ea 100644 --- a/ts/test-mock/messaging/expire_timer_version_test.ts +++ b/ts/test-mock/messaging/expire_timer_version_test.ts @@ -10,16 +10,16 @@ import { import createDebug from 'debug'; import Long from 'long'; -import * as durations from '../../util/durations/index.js'; -import { uuidToBytes } from '../../util/uuidToBytes.js'; -import { MY_STORY_ID } from '../../types/Stories.js'; -import { Bootstrap } from '../bootstrap.js'; -import type { App } from '../bootstrap.js'; +import * as durations from '../../util/durations/index.std.js'; +import { uuidToBytes } from '../../util/uuidToBytes.std.js'; +import { MY_STORY_ID } from '../../types/Stories.std.js'; +import { Bootstrap } from '../bootstrap.node.js'; +import type { App } from '../bootstrap.node.js'; import { expectSystemMessages, typeIntoInput, waitForEnabledComposer, -} from '../helpers.js'; +} from '../helpers.node.js'; export const debug = createDebug('mock:test:messaging'); diff --git a/ts/test-mock/messaging/lightbox_test.ts b/ts/test-mock/messaging/lightbox_test.ts index 5f7504c2ba..41e29f82b1 100644 --- a/ts/test-mock/messaging/lightbox_test.ts +++ b/ts/test-mock/messaging/lightbox_test.ts @@ -5,17 +5,17 @@ import createDebug from 'debug'; import { expect } from 'playwright/test'; import { type PrimaryDevice, StorageState } from '@signalapp/mock-server'; import * as path from 'node:path'; -import type { App } from '../playwright.js'; -import { Bootstrap } from '../bootstrap.js'; +import type { App } from '../playwright.node.js'; +import { Bootstrap } from '../bootstrap.node.js'; import { getMessageInTimelineByTimestamp, getTimelineMessageWithText, sendMessageWithAttachments, sendTextMessage, -} from '../helpers.js'; -import * as durations from '../../util/durations/index.js'; -import { strictAssert } from '../../util/assert.js'; -import type { SignalService } from '../../protobuf/index.js'; +} from '../helpers.node.js'; +import * as durations from '../../util/durations/index.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import type { SignalService } from '../../protobuf/index.std.js'; const debug = createDebug('mock:test:lightbox'); diff --git a/ts/test-mock/messaging/reaction_test.ts b/ts/test-mock/messaging/reaction_test.ts index 15a870c771..38becb8645 100644 --- a/ts/test-mock/messaging/reaction_test.ts +++ b/ts/test-mock/messaging/reaction_test.ts @@ -7,17 +7,17 @@ import { type Page } from 'playwright'; import { expect } from 'playwright/test'; import { assert } from 'chai'; -import type { App } from '../playwright.js'; -import { Bootstrap } from '../bootstrap.js'; -import { MINUTE } from '../../util/durations/index.js'; -import { strictAssert } from '../../util/assert.js'; +import type { App } from '../playwright.node.js'; +import { Bootstrap } from '../bootstrap.node.js'; +import { MINUTE } from '../../util/durations/index.std.js'; +import { strictAssert } from '../../util/assert.std.js'; import { clickOnConversation, getMessageInTimelineByTimestamp, sendTextMessage, sendReaction, createGroup, -} from '../helpers.js'; +} from '../helpers.node.js'; export const debug = createDebug('mock:test:reactions'); diff --git a/ts/test-mock/messaging/readSync_test.ts b/ts/test-mock/messaging/readSync_test.ts index c6487f9b62..a5523c2445 100644 --- a/ts/test-mock/messaging/readSync_test.ts +++ b/ts/test-mock/messaging/readSync_test.ts @@ -4,9 +4,9 @@ import createDebug from 'debug'; import Long from 'long'; -import type { App } from '../playwright.js'; -import * as durations from '../../util/durations/index.js'; -import { Bootstrap } from '../bootstrap.js'; +import type { App } from '../playwright.node.js'; +import * as durations from '../../util/durations/index.std.js'; +import { Bootstrap } from '../bootstrap.node.js'; export const debug = createDebug('mock:test:readSync'); diff --git a/ts/test-mock/messaging/relink_test.ts b/ts/test-mock/messaging/relink_test.ts index dcb63300d2..3dbd584e5f 100644 --- a/ts/test-mock/messaging/relink_test.ts +++ b/ts/test-mock/messaging/relink_test.ts @@ -4,10 +4,10 @@ import createDebug from 'debug'; import { Proto, StorageState } from '@signalapp/mock-server'; -import * as durations from '../../util/durations/index.js'; -import type { App } from '../playwright.js'; -import { Bootstrap } from '../bootstrap.js'; -import { expectSystemMessages } from '../helpers.js'; +import * as durations from '../../util/durations/index.std.js'; +import type { App } from '../playwright.node.js'; +import { Bootstrap } from '../bootstrap.node.js'; +import { expectSystemMessages } from '../helpers.node.js'; export const debug = createDebug('mock:test:relink'); diff --git a/ts/test-mock/messaging/retries_test.ts b/ts/test-mock/messaging/retries_test.ts index d9fe469720..d05a9fce2a 100644 --- a/ts/test-mock/messaging/retries_test.ts +++ b/ts/test-mock/messaging/retries_test.ts @@ -5,10 +5,10 @@ import { assert } from 'chai'; import createDebug from 'debug'; import { EnvelopeType, StorageState } from '@signalapp/mock-server'; -import type { App } from '../playwright.js'; -import * as durations from '../../util/durations/index.js'; -import { Bootstrap } from '../bootstrap.js'; -import { sleep } from '../../util/sleep.js'; +import type { App } from '../playwright.node.js'; +import * as durations from '../../util/durations/index.std.js'; +import { Bootstrap } from '../bootstrap.node.js'; +import { sleep } from '../../util/sleep.std.js'; export const debug = createDebug('mock:test:retries'); diff --git a/ts/test-mock/messaging/safety_number_test.ts b/ts/test-mock/messaging/safety_number_test.ts index 1616cc864f..851055996a 100644 --- a/ts/test-mock/messaging/safety_number_test.ts +++ b/ts/test-mock/messaging/safety_number_test.ts @@ -5,17 +5,17 @@ import createDebug from 'debug'; import { StorageState, Proto } from '@signalapp/mock-server'; import { assert } from 'chai'; -import type { App } from '../playwright.js'; -import { Bootstrap } from '../bootstrap.js'; -import { MINUTE } from '../../util/durations/index.js'; -import { uuidToBytes } from '../../util/uuidToBytes.js'; -import { MY_STORY_ID } from '../../types/Stories.js'; +import type { App } from '../playwright.node.js'; +import { Bootstrap } from '../bootstrap.node.js'; +import { MINUTE } from '../../util/durations/index.std.js'; +import { uuidToBytes } from '../../util/uuidToBytes.std.js'; +import { MY_STORY_ID } from '../../types/Stories.std.js'; import { clickOnConversation, typeIntoInput, expectSystemMessages, waitForEnabledComposer, -} from '../helpers.js'; +} from '../helpers.node.js'; export const debug = createDebug('mock:test:safetyNumber'); diff --git a/ts/test-mock/messaging/sendSync_test.ts b/ts/test-mock/messaging/sendSync_test.ts index 8465996bfc..707eb0e360 100644 --- a/ts/test-mock/messaging/sendSync_test.ts +++ b/ts/test-mock/messaging/sendSync_test.ts @@ -5,9 +5,9 @@ import createDebug from 'debug'; import Long from 'long'; import { StorageState } from '@signalapp/mock-server'; -import type { App } from '../playwright.js'; -import * as durations from '../../util/durations/index.js'; -import { Bootstrap } from '../bootstrap.js'; +import type { App } from '../playwright.node.js'; +import * as durations from '../../util/durations/index.std.js'; +import { Bootstrap } from '../bootstrap.node.js'; export const debug = createDebug('mock:test:sendSync'); diff --git a/ts/test-mock/messaging/sender_key_test.ts b/ts/test-mock/messaging/sender_key_test.ts index e6c8f170a5..adf5022a94 100644 --- a/ts/test-mock/messaging/sender_key_test.ts +++ b/ts/test-mock/messaging/sender_key_test.ts @@ -5,9 +5,9 @@ import createDebug from 'debug'; import { StorageState } from '@signalapp/mock-server'; import type { Group } from '@signalapp/mock-server'; -import * as durations from '../../util/durations/index.js'; -import type { App } from '../playwright.js'; -import { Bootstrap } from '../bootstrap.js'; +import * as durations from '../../util/durations/index.std.js'; +import type { App } from '../playwright.node.js'; +import { Bootstrap } from '../bootstrap.node.js'; export const debug = createDebug('mock:test:senderKey'); diff --git a/ts/test-mock/messaging/stories_test.ts b/ts/test-mock/messaging/stories_test.ts index 72fa813d7a..a0afe6eeb4 100644 --- a/ts/test-mock/messaging/stories_test.ts +++ b/ts/test-mock/messaging/stories_test.ts @@ -6,12 +6,12 @@ import Long from 'long'; import { Proto, StorageState } from '@signalapp/mock-server'; import type { Group } from '@signalapp/mock-server'; -import * as durations from '../../util/durations/index.js'; -import { uuidToBytes } from '../../util/uuidToBytes.js'; -import { MY_STORY_ID } from '../../types/Stories.js'; -import { generateStoryDistributionId } from '../../types/StoryDistributionId.js'; -import type { App } from '../playwright.js'; -import { Bootstrap } from '../bootstrap.js'; +import * as durations from '../../util/durations/index.std.js'; +import { uuidToBytes } from '../../util/uuidToBytes.std.js'; +import { MY_STORY_ID } from '../../types/Stories.std.js'; +import { generateStoryDistributionId } from '../../types/StoryDistributionId.std.js'; +import type { App } from '../playwright.node.js'; +import { Bootstrap } from '../bootstrap.node.js'; export const debug = createDebug('mock:test:stories'); diff --git a/ts/test-mock/messaging/twoClients_test.ts b/ts/test-mock/messaging/twoClients_test.ts index 47fff4aba1..a0ed52a4ff 100644 --- a/ts/test-mock/messaging/twoClients_test.ts +++ b/ts/test-mock/messaging/twoClients_test.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import { StorageState } from '@signalapp/mock-server'; -import * as durations from '../../util/durations/index.js'; -import type { App } from '../playwright.js'; -import { Bootstrap } from '../bootstrap.js'; -import { typeIntoInput, waitForEnabledComposer } from '../helpers.js'; +import * as durations from '../../util/durations/index.std.js'; +import type { App } from '../playwright.node.js'; +import { Bootstrap } from '../bootstrap.node.js'; +import { typeIntoInput, waitForEnabledComposer } from '../helpers.node.js'; describe('twoClients', function twoClients(this: Mocha.Suite) { this.timeout(durations.MINUTE); diff --git a/ts/test-mock/messaging/unknown_contact_test.ts b/ts/test-mock/messaging/unknown_contact_test.ts index 46f2e62688..1f67ba38c6 100644 --- a/ts/test-mock/messaging/unknown_contact_test.ts +++ b/ts/test-mock/messaging/unknown_contact_test.ts @@ -7,10 +7,10 @@ import createDebug from 'debug'; import Long from 'long'; import type { Page } from 'playwright'; import assert from 'node:assert'; -import * as durations from '../../util/durations/index.js'; -import type { App } from '../playwright.js'; -import { Bootstrap } from '../bootstrap.js'; -import { acceptConversation } from '../helpers.js'; +import * as durations from '../../util/durations/index.std.js'; +import type { App } from '../playwright.node.js'; +import { Bootstrap } from '../bootstrap.node.js'; +import { acceptConversation } from '../helpers.node.js'; export const debug = createDebug('mock:test:edit'); diff --git a/ts/test-mock/messaging/unprocessed_test.ts b/ts/test-mock/messaging/unprocessed_test.ts index f120eb4f85..6a80474384 100644 --- a/ts/test-mock/messaging/unprocessed_test.ts +++ b/ts/test-mock/messaging/unprocessed_test.ts @@ -4,9 +4,9 @@ import createDebug from 'debug'; import { StorageState } from '@signalapp/mock-server'; -import * as durations from '../../util/durations/index.js'; -import type { App } from '../playwright.js'; -import { Bootstrap } from '../bootstrap.js'; +import * as durations from '../../util/durations/index.std.js'; +import type { App } from '../playwright.node.js'; +import { Bootstrap } from '../bootstrap.node.js'; export const debug = createDebug('mock:test:unprocessed'); diff --git a/ts/test-mock/network/serverAlerts_test.ts b/ts/test-mock/network/serverAlerts_test.ts index 10ddd9287f..2cf7f403a6 100644 --- a/ts/test-mock/network/serverAlerts_test.ts +++ b/ts/test-mock/network/serverAlerts_test.ts @@ -4,10 +4,10 @@ import createDebug from 'debug'; import type { Page } from 'playwright'; import { StorageState, type PrimaryDevice } from '@signalapp/mock-server'; -import type { App } from '../playwright.js'; -import { Bootstrap } from '../bootstrap.js'; -import { getLeftPane } from '../helpers.js'; -import { MINUTE } from '../../util/durations/index.js'; +import type { App } from '../playwright.node.js'; +import { Bootstrap } from '../bootstrap.node.js'; +import { getLeftPane } from '../helpers.node.js'; +import { MINUTE } from '../../util/durations/index.std.js'; export const debug = createDebug('mock:test:serverAlerts'); diff --git a/ts/test-mock/playwright.ts b/ts/test-mock/playwright.ts index 21d970a2e2..37bc7d91b2 100644 --- a/ts/test-mock/playwright.ts +++ b/ts/test-mock/playwright.ts @@ -9,12 +9,12 @@ import pTimeout from 'p-timeout'; import type { IPCRequest as ChallengeRequestType, IPCResponse as ChallengeResponseType, -} from '../challenge.js'; -import type { ReceiptType } from '../types/Receipt.js'; -import { SECOND } from '../util/durations/index.js'; -import { drop } from '../util/drop.js'; -import type { MessageAttributesType } from '../model-types.js'; -import type { SocketStatuses } from '../textsecure/SocketManager.js'; +} from '../challenge.dom.js'; +import type { ReceiptType } from '../types/Receipt.std.js'; +import { SECOND } from '../util/durations/index.std.js'; +import { drop } from '../util/drop.std.js'; +import type { MessageAttributesType } from '../model-types.d.ts'; +import type { SocketStatuses } from '../textsecure/SocketManager.preload.js'; export type AppLoadedInfoType = Readonly<{ loadTime: number; diff --git a/ts/test-mock/pnp/accept_gv2_invite_test.ts b/ts/test-mock/pnp/accept_gv2_invite_test.ts index 719a9dcfa7..1c7e8eefb2 100644 --- a/ts/test-mock/pnp/accept_gv2_invite_test.ts +++ b/ts/test-mock/pnp/accept_gv2_invite_test.ts @@ -6,14 +6,14 @@ import type { Group, PrimaryDevice } from '@signalapp/mock-server'; import { Proto, ServiceIdKind, StorageState } from '@signalapp/mock-server'; import createDebug from 'debug'; -import * as durations from '../../util/durations/index.js'; +import * as durations from '../../util/durations/index.std.js'; import { parseAndFormatPhoneNumber, PhoneNumberFormat, -} from '../../util/libphonenumberInstance.js'; -import { Bootstrap } from '../bootstrap.js'; -import type { App } from '../bootstrap.js'; -import { acceptConversation, expectSystemMessages } from '../helpers.js'; +} from '../../util/libphonenumberInstance.std.js'; +import { Bootstrap } from '../bootstrap.node.js'; +import type { App } from '../bootstrap.node.js'; +import { acceptConversation, expectSystemMessages } from '../helpers.node.js'; export const debug = createDebug('mock:test:gv2'); diff --git a/ts/test-mock/pnp/calling_test.ts b/ts/test-mock/pnp/calling_test.ts index 51013d4e60..626ea5d103 100644 --- a/ts/test-mock/pnp/calling_test.ts +++ b/ts/test-mock/pnp/calling_test.ts @@ -6,10 +6,10 @@ import chaiAsPromised from 'chai-as-promised'; import { type PrimaryDevice, ServiceIdKind } from '@signalapp/mock-server'; import createDebug from 'debug'; -import * as durations from '../../util/durations/index.js'; -import { Bootstrap } from '../bootstrap.js'; -import type { App } from '../bootstrap.js'; -import { acceptConversation } from '../helpers.js'; +import * as durations from '../../util/durations/index.std.js'; +import { Bootstrap } from '../bootstrap.node.js'; +import type { App } from '../bootstrap.node.js'; +import { acceptConversation } from '../helpers.node.js'; chai.use(chaiAsPromised); diff --git a/ts/test-mock/pnp/change_number_test.ts b/ts/test-mock/pnp/change_number_test.ts index 48831d9f82..a397bd962e 100644 --- a/ts/test-mock/pnp/change_number_test.ts +++ b/ts/test-mock/pnp/change_number_test.ts @@ -4,9 +4,9 @@ import { ServiceIdKind } from '@signalapp/mock-server'; import createDebug from 'debug'; -import * as durations from '../../util/durations/index.js'; -import { Bootstrap } from '../bootstrap.js'; -import type { App } from '../bootstrap.js'; +import * as durations from '../../util/durations/index.std.js'; +import { Bootstrap } from '../bootstrap.node.js'; +import type { App } from '../bootstrap.node.js'; export const debug = createDebug('mock:test:change-number'); diff --git a/ts/test-mock/pnp/merge_test.ts b/ts/test-mock/pnp/merge_test.ts index d15dded714..d4a9cc2c86 100644 --- a/ts/test-mock/pnp/merge_test.ts +++ b/ts/test-mock/pnp/merge_test.ts @@ -8,17 +8,17 @@ import type { PrimaryDevice } from '@signalapp/mock-server'; import createDebug from 'debug'; import Long from 'long'; -import * as durations from '../../util/durations/index.js'; -import { uuidToBytes } from '../../util/uuidToBytes.js'; -import { generateConfigMatrix } from '../../util/generateConfigMatrix.js'; -import { MY_STORY_ID } from '../../types/Stories.js'; -import { Bootstrap } from '../bootstrap.js'; -import type { App } from '../bootstrap.js'; +import * as durations from '../../util/durations/index.std.js'; +import { uuidToBytes } from '../../util/uuidToBytes.std.js'; +import { generateConfigMatrix } from '../../util/generateConfigMatrix.std.js'; +import { MY_STORY_ID } from '../../types/Stories.std.js'; +import { Bootstrap } from '../bootstrap.node.js'; +import type { App } from '../bootstrap.node.js'; import { expectSystemMessages, typeIntoInput, waitForEnabledComposer, -} from '../helpers.js'; +} from '../helpers.node.js'; export const debug = createDebug('mock:test:merge'); diff --git a/ts/test-mock/pnp/phone_discovery_test.ts b/ts/test-mock/pnp/phone_discovery_test.ts index 1b46ef4905..9cb9c08979 100644 --- a/ts/test-mock/pnp/phone_discovery_test.ts +++ b/ts/test-mock/pnp/phone_discovery_test.ts @@ -6,16 +6,16 @@ import { ServiceIdKind, Proto, StorageState } from '@signalapp/mock-server'; import type { PrimaryDevice } from '@signalapp/mock-server'; import createDebug from 'debug'; -import * as durations from '../../util/durations/index.js'; -import { uuidToBytes } from '../../util/uuidToBytes.js'; -import { MY_STORY_ID } from '../../types/Stories.js'; -import { Bootstrap } from '../bootstrap.js'; -import type { App } from '../bootstrap.js'; +import * as durations from '../../util/durations/index.std.js'; +import { uuidToBytes } from '../../util/uuidToBytes.std.js'; +import { MY_STORY_ID } from '../../types/Stories.std.js'; +import { Bootstrap } from '../bootstrap.node.js'; +import type { App } from '../bootstrap.node.js'; import { expectSystemMessages, typeIntoInput, waitForEnabledComposer, -} from '../helpers.js'; +} from '../helpers.node.js'; export const debug = createDebug('mock:test:merge'); diff --git a/ts/test-mock/pnp/pni_change_test.ts b/ts/test-mock/pnp/pni_change_test.ts index c922947581..d087140e29 100644 --- a/ts/test-mock/pnp/pni_change_test.ts +++ b/ts/test-mock/pnp/pni_change_test.ts @@ -7,16 +7,16 @@ import { ServiceIdKind, StorageState, Proto } from '@signalapp/mock-server'; import type { PrimaryDevice } from '@signalapp/mock-server'; import createDebug from 'debug'; -import * as durations from '../../util/durations/index.js'; -import { generatePni } from '../../types/ServiceId.js'; -import { toPniObject } from '../../util/ServiceId.js'; -import { Bootstrap } from '../bootstrap.js'; -import type { App } from '../bootstrap.js'; +import * as durations from '../../util/durations/index.std.js'; +import { generatePni } from '../../types/ServiceId.std.js'; +import { toPniObject } from '../../util/ServiceId.node.js'; +import { Bootstrap } from '../bootstrap.node.js'; +import type { App } from '../bootstrap.node.js'; import { expectSystemMessages, typeIntoInput, waitForEnabledComposer, -} from '../helpers.js'; +} from '../helpers.node.js'; export const debug = createDebug('mock:test:pni-change'); diff --git a/ts/test-mock/pnp/pni_signature_test.ts b/ts/test-mock/pnp/pni_signature_test.ts index 7ac2e70097..484477e3e2 100644 --- a/ts/test-mock/pnp/pni_signature_test.ts +++ b/ts/test-mock/pnp/pni_signature_test.ts @@ -12,22 +12,22 @@ import { } from '@signalapp/mock-server'; import createDebug from 'debug'; -import * as durations from '../../util/durations/index.js'; -import { uuidToBytes } from '../../util/uuidToBytes.js'; -import { MY_STORY_ID } from '../../types/Stories.js'; -import { Bootstrap } from '../bootstrap.js'; -import type { App } from '../bootstrap.js'; +import * as durations from '../../util/durations/index.std.js'; +import { uuidToBytes } from '../../util/uuidToBytes.std.js'; +import { MY_STORY_ID } from '../../types/Stories.std.js'; +import { Bootstrap } from '../bootstrap.node.js'; +import type { App } from '../bootstrap.node.js'; import { DELETE_SENT_PROTO_BATCHER_WAIT_MS, RECEIPT_BATCHER_WAIT_MS, -} from '../../types/Receipt.js'; -import { sleep } from '../../util/sleep.js'; +} from '../../types/Receipt.std.js'; +import { sleep } from '../../util/sleep.std.js'; import { acceptConversation, expectSystemMessages, typeIntoInput, waitForEnabledComposer, -} from '../helpers.js'; +} from '../helpers.node.js'; export const debug = createDebug('mock:test:pni-signature'); diff --git a/ts/test-mock/pnp/pni_unlink_test.ts b/ts/test-mock/pnp/pni_unlink_test.ts index 8a373dc18a..024b2af2d6 100644 --- a/ts/test-mock/pnp/pni_unlink_test.ts +++ b/ts/test-mock/pnp/pni_unlink_test.ts @@ -11,10 +11,10 @@ import { } from '@signalapp/libsignal-client'; import createDebug from 'debug'; -import * as durations from '../../util/durations/index.js'; -import { generatePni } from '../../types/ServiceId.js'; -import { Bootstrap } from '../bootstrap.js'; -import type { App } from '../bootstrap.js'; +import * as durations from '../../util/durations/index.std.js'; +import { generatePni } from '../../types/ServiceId.std.js'; +import { Bootstrap } from '../bootstrap.node.js'; +import type { App } from '../bootstrap.node.js'; export const debug = createDebug('mock:test:pni-unlink'); diff --git a/ts/test-mock/pnp/send_gv2_invite_test.ts b/ts/test-mock/pnp/send_gv2_invite_test.ts index 8d7e1ec602..24c8955cee 100644 --- a/ts/test-mock/pnp/send_gv2_invite_test.ts +++ b/ts/test-mock/pnp/send_gv2_invite_test.ts @@ -6,11 +6,11 @@ import type { PrimaryDevice, Group } from '@signalapp/mock-server'; import { StorageState, Proto, ServiceIdKind } from '@signalapp/mock-server'; import createDebug from 'debug'; -import * as durations from '../../util/durations/index.js'; -import { Bootstrap } from '../bootstrap.js'; -import type { App } from '../bootstrap.js'; -import { MY_STORY_ID } from '../../types/Stories.js'; -import { uuidToBytes } from '../../util/uuidToBytes.js'; +import * as durations from '../../util/durations/index.std.js'; +import { Bootstrap } from '../bootstrap.node.js'; +import type { App } from '../bootstrap.node.js'; +import { MY_STORY_ID } from '../../types/Stories.std.js'; +import { uuidToBytes } from '../../util/uuidToBytes.std.js'; const IdentifierType = Proto.ManifestRecord.Identifier.Type; diff --git a/ts/test-mock/pnp/username_test.ts b/ts/test-mock/pnp/username_test.ts index 139904ce1a..f5d04aa59a 100644 --- a/ts/test-mock/pnp/username_test.ts +++ b/ts/test-mock/pnp/username_test.ts @@ -7,17 +7,17 @@ import type { PrimaryDevice } from '@signalapp/mock-server'; import { usernames } from '@signalapp/libsignal-client'; import createDebug from 'debug'; -import * as durations from '../../util/durations/index.js'; -import { uuidToBytes } from '../../util/uuidToBytes.js'; -import { MY_STORY_ID } from '../../types/Stories.js'; -import { Bootstrap } from '../bootstrap.js'; -import type { App } from '../bootstrap.js'; +import * as durations from '../../util/durations/index.std.js'; +import { uuidToBytes } from '../../util/uuidToBytes.std.js'; +import { MY_STORY_ID } from '../../types/Stories.std.js'; +import { Bootstrap } from '../bootstrap.node.js'; +import type { App } from '../bootstrap.node.js'; import { bufferToUuid, typeIntoInput, waitForEnabledComposer, -} from '../helpers.js'; -import { contactByEncryptedUsernameRoute } from '../../util/signalRoutes.js'; +} from '../helpers.node.js'; +import { contactByEncryptedUsernameRoute } from '../../util/signalRoutes.std.js'; export const debug = createDebug('mock:test:username'); diff --git a/ts/test-mock/rate-limit/story_test.ts b/ts/test-mock/rate-limit/story_test.ts index 7dda3bab11..7cf14a50f8 100644 --- a/ts/test-mock/rate-limit/story_test.ts +++ b/ts/test-mock/rate-limit/story_test.ts @@ -5,11 +5,11 @@ import { assert } from 'chai'; import createDebug from 'debug'; import { Proto, StorageState } from '@signalapp/mock-server'; -import * as durations from '../../util/durations/index.js'; -import { uuidToBytes } from '../../util/uuidToBytes.js'; -import { MY_STORY_ID } from '../../types/Stories.js'; -import { Bootstrap } from '../bootstrap.js'; -import type { App } from '../bootstrap.js'; +import * as durations from '../../util/durations/index.std.js'; +import { uuidToBytes } from '../../util/uuidToBytes.std.js'; +import { MY_STORY_ID } from '../../types/Stories.std.js'; +import { Bootstrap } from '../bootstrap.node.js'; +import type { App } from '../bootstrap.node.js'; export const debug = createDebug('mock:test:rate-limit'); diff --git a/ts/test-mock/rate-limit/viewed_test.ts b/ts/test-mock/rate-limit/viewed_test.ts index 6e53c0616a..d08792f76d 100644 --- a/ts/test-mock/rate-limit/viewed_test.ts +++ b/ts/test-mock/rate-limit/viewed_test.ts @@ -5,15 +5,15 @@ import { assert } from 'chai'; import type { PrimaryDevice } from '@signalapp/mock-server'; import { StorageState, ServiceIdKind } from '@signalapp/mock-server'; import createDebug from 'debug'; -import * as durations from '../../util/durations/index.js'; -import { Bootstrap } from '../bootstrap.js'; -import type { App } from '../bootstrap.js'; -import { ReceiptType } from '../../types/Receipt.js'; +import * as durations from '../../util/durations/index.std.js'; +import { Bootstrap } from '../bootstrap.node.js'; +import type { App } from '../bootstrap.node.js'; +import { ReceiptType } from '../../types/Receipt.std.js'; import { acceptConversation, typeIntoInput, waitForEnabledComposer, -} from '../helpers.js'; +} from '../helpers.node.js'; export const debug = createDebug('mock:test:challenge:receipts'); diff --git a/ts/test-mock/release-notes/release_notes_test.ts b/ts/test-mock/release-notes/release_notes_test.ts index 518f991c81..7fac05fbbb 100644 --- a/ts/test-mock/release-notes/release_notes_test.ts +++ b/ts/test-mock/release-notes/release_notes_test.ts @@ -5,15 +5,15 @@ import createDebug from 'debug'; import { expect } from 'playwright/test'; import { assert } from 'chai'; -import type { App } from '../playwright.js'; -import { Bootstrap } from '../bootstrap.js'; -import { MINUTE } from '../../util/durations/index.js'; +import type { App } from '../playwright.node.js'; +import { Bootstrap } from '../bootstrap.node.js'; +import { MINUTE } from '../../util/durations/index.std.js'; -import { SIGNAL_ACI } from '../../types/SignalConversation.js'; +import { SIGNAL_ACI } from '../../types/SignalConversation.std.js'; import { clickOnConversationWithAci, getTimelineMessageWithText, -} from '../helpers.js'; +} from '../helpers.node.js'; export const debug = createDebug('mock:test:releaseNotes'); diff --git a/ts/test-mock/routing/routing_test.ts b/ts/test-mock/routing/routing_test.ts index 1d3c6d67fe..35ef8ba34b 100644 --- a/ts/test-mock/routing/routing_test.ts +++ b/ts/test-mock/routing/routing_test.ts @@ -3,18 +3,18 @@ import { assert } from 'chai'; -import * as durations from '../../util/durations/index.js'; -import type { Bootstrap, App } from '../bootstrap.js'; +import * as durations from '../../util/durations/index.std.js'; +import type { Bootstrap, App } from '../bootstrap.node.js'; import { artAddStickersRoute, showConversationRoute, -} from '../../util/signalRoutes.js'; +} from '../../util/signalRoutes.std.js'; import { initStorage, STICKER_PACKS, storeStickerPacks, -} from '../storage/fixtures.js'; -import { strictAssert } from '../../util/assert.js'; +} from '../storage/fixtures.node.js'; +import { strictAssert } from '../../util/assert.std.js'; describe('routing', function (this: Mocha.Suite) { this.timeout(durations.MINUTE); diff --git a/ts/test-mock/settings/language_test.ts b/ts/test-mock/settings/language_test.ts index fb8b67d5b4..792f214257 100644 --- a/ts/test-mock/settings/language_test.ts +++ b/ts/test-mock/settings/language_test.ts @@ -6,9 +6,9 @@ import createDebug from 'debug'; import type { Locator } from 'playwright/test'; import { expect } from 'playwright/test'; import { writeFile } from 'node:fs/promises'; -import * as durations from '../../util/durations/index.js'; -import type { App } from '../playwright.js'; -import { Bootstrap } from '../bootstrap.js'; +import * as durations from '../../util/durations/index.std.js'; +import type { App } from '../playwright.node.js'; +import { Bootstrap } from '../bootstrap.node.js'; export const debug = createDebug('mock:test:language'); diff --git a/ts/test-mock/settings/settings_test.ts b/ts/test-mock/settings/settings_test.ts index 6e379fe56f..4df2fa6382 100644 --- a/ts/test-mock/settings/settings_test.ts +++ b/ts/test-mock/settings/settings_test.ts @@ -3,9 +3,9 @@ import createDebug from 'debug'; -import * as durations from '../../util/durations/index.js'; -import type { App } from '../playwright.js'; -import { Bootstrap } from '../bootstrap.js'; +import * as durations from '../../util/durations/index.std.js'; +import type { App } from '../playwright.node.js'; +import { Bootstrap } from '../bootstrap.node.js'; export const debug = createDebug('mock:test:settings'); diff --git a/ts/test-mock/setup-ci.ts b/ts/test-mock/setup-ci.ts index 34bee0ec52..0e2590028b 100644 --- a/ts/test-mock/setup-ci.ts +++ b/ts/test-mock/setup-ci.ts @@ -3,7 +3,7 @@ import createDebug from 'debug'; -import { Bootstrap } from './bootstrap.js'; +import { Bootstrap } from './bootstrap.node.js'; const debug = createDebug('mock:test:setup-ci'); diff --git a/ts/test-mock/storage/archive_test.ts b/ts/test-mock/storage/archive_test.ts index c50e46bfd9..7422c99d25 100644 --- a/ts/test-mock/storage/archive_test.ts +++ b/ts/test-mock/storage/archive_test.ts @@ -3,9 +3,9 @@ import { assert } from 'chai'; -import * as durations from '../../util/durations/index.js'; -import type { App, Bootstrap } from './fixtures.js'; -import { initStorage, debug } from './fixtures.js'; +import * as durations from '../../util/durations/index.std.js'; +import type { App, Bootstrap } from './fixtures.node.js'; +import { initStorage, debug } from './fixtures.node.js'; describe('storage service', function (this: Mocha.Suite) { this.timeout(durations.MINUTE); diff --git a/ts/test-mock/storage/call_links_test.ts b/ts/test-mock/storage/call_links_test.ts index a5ec3f5feb..d18817bdbf 100644 --- a/ts/test-mock/storage/call_links_test.ts +++ b/ts/test-mock/storage/call_links_test.ts @@ -4,12 +4,16 @@ import { assert } from 'chai'; import Long from 'long'; import { Proto, StorageState } from '@signalapp/mock-server'; -import * as durations from '../../util/durations/index.js'; -import type { App } from './fixtures.js'; -import { Bootstrap, debug, getCallLinkRecordPredicate } from './fixtures.js'; -import { createCallLink } from '../helpers.js'; -import { uuidToBytes } from '../../util/uuidToBytes.js'; -import { MY_STORY_ID } from '../../types/Stories.js'; +import * as durations from '../../util/durations/index.std.js'; +import type { App } from './fixtures.node.js'; +import { + Bootstrap, + debug, + getCallLinkRecordPredicate, +} from './fixtures.node.js'; +import { createCallLink } from '../helpers.node.js'; +import { uuidToBytes } from '../../util/uuidToBytes.std.js'; +import { MY_STORY_ID } from '../../types/Stories.std.js'; const IdentifierType = Proto.ManifestRecord.Identifier.Type; diff --git a/ts/test-mock/storage/chat_folder_test.ts b/ts/test-mock/storage/chat_folder_test.ts index 83cf0b0417..a859b80131 100644 --- a/ts/test-mock/storage/chat_folder_test.ts +++ b/ts/test-mock/storage/chat_folder_test.ts @@ -6,12 +6,16 @@ import { Proto, StorageState } from '@signalapp/mock-server'; import type { Page } from 'playwright/test'; import { expect } from 'playwright/test'; import type { StorageStateNewRecord } from '@signalapp/mock-server/src/api/storage-state.js'; -import * as durations from '../../util/durations/index.js'; -import type { App } from './fixtures.js'; -import { Bootstrap, debug, getChatFolderRecordPredicate } from './fixtures.js'; -import { bytesToUuid, uuidToBytes } from '../../util/uuidToBytes.js'; -import { CHAT_FOLDER_DELETED_POSITION } from '../../types/ChatFolder.js'; -import { strictAssert } from '../../util/assert.js'; +import * as durations from '../../util/durations/index.std.js'; +import type { App } from './fixtures.node.js'; +import { + Bootstrap, + debug, + getChatFolderRecordPredicate, +} from './fixtures.node.js'; +import { bytesToUuid, uuidToBytes } from '../../util/uuidToBytes.std.js'; +import { CHAT_FOLDER_DELETED_POSITION } from '../../types/ChatFolder.std.js'; +import { strictAssert } from '../../util/assert.std.js'; const IdentifierType = Proto.ManifestRecord.Identifier.Type; diff --git a/ts/test-mock/storage/conflict_test.ts b/ts/test-mock/storage/conflict_test.ts index a3e81f35cb..4f58c6438d 100644 --- a/ts/test-mock/storage/conflict_test.ts +++ b/ts/test-mock/storage/conflict_test.ts @@ -7,10 +7,14 @@ import { expect } from 'playwright/test'; import type { Group, StorageState } from '@signalapp/mock-server'; import { Proto } from '@signalapp/mock-server'; -import * as durations from '../../util/durations/index.js'; -import { createCallLink } from '../helpers.js'; -import type { App, Bootstrap } from './fixtures.js'; -import { initStorage, debug, getCallLinkRecordPredicate } from './fixtures.js'; +import * as durations from '../../util/durations/index.std.js'; +import { createCallLink } from '../helpers.node.js'; +import type { App, Bootstrap } from './fixtures.node.js'; +import { + initStorage, + debug, + getCallLinkRecordPredicate, +} from './fixtures.node.js'; const IdentifierType = Proto.ManifestRecord.Identifier.Type; diff --git a/ts/test-mock/storage/drop_test.ts b/ts/test-mock/storage/drop_test.ts index a3770e396f..a0603f7969 100644 --- a/ts/test-mock/storage/drop_test.ts +++ b/ts/test-mock/storage/drop_test.ts @@ -4,9 +4,9 @@ import { assert } from 'chai'; import { Proto } from '@signalapp/mock-server'; -import * as durations from '../../util/durations/index.js'; -import type { App, Bootstrap } from './fixtures.js'; -import { initStorage, debug } from './fixtures.js'; +import * as durations from '../../util/durations/index.std.js'; +import type { App, Bootstrap } from './fixtures.node.js'; +import { initStorage, debug } from './fixtures.node.js'; const IdentifierType = Proto.ManifestRecord.Identifier.Type; diff --git a/ts/test-mock/storage/fixtures.ts b/ts/test-mock/storage/fixtures.ts index c1723a627f..8397cc5fcc 100644 --- a/ts/test-mock/storage/fixtures.ts +++ b/ts/test-mock/storage/fixtures.ts @@ -14,13 +14,13 @@ import path from 'node:path'; import fs from 'node:fs/promises'; import lodash from 'lodash'; import { CallLinkRootKey } from '@signalapp/ringrtc'; -import { App } from '../playwright.js'; -import { Bootstrap } from '../bootstrap.js'; -import type { BootstrapOptions } from '../bootstrap.js'; -import { MY_STORY_ID } from '../../types/Stories.js'; -import { uuidToBytes } from '../../util/uuidToBytes.js'; -import { artAddStickersRoute } from '../../util/signalRoutes.js'; -import { getRoomIdFromRootKey } from '../../util/callLinksRingrtc.js'; +import { App } from '../playwright.node.js'; +import { Bootstrap } from '../bootstrap.node.js'; +import type { BootstrapOptions } from '../bootstrap.node.js'; +import { MY_STORY_ID } from '../../types/Stories.std.js'; +import { uuidToBytes } from '../../util/uuidToBytes.std.js'; +import { artAddStickersRoute } from '../../util/signalRoutes.std.js'; +import { getRoomIdFromRootKey } from '../../util/callLinksRingrtc.node.js'; const { range } = lodash; diff --git a/ts/test-mock/storage/max_read_keys_test.ts b/ts/test-mock/storage/max_read_keys_test.ts index 933bda97f5..d586ae7f97 100644 --- a/ts/test-mock/storage/max_read_keys_test.ts +++ b/ts/test-mock/storage/max_read_keys_test.ts @@ -4,12 +4,12 @@ import { assert } from 'chai'; import { Proto } from '@signalapp/mock-server'; -import * as durations from '../../util/durations/index.js'; -import { generateAci } from '../../types/ServiceId.js'; -import { toAciObject } from '../../util/ServiceId.js'; -import { MAX_READ_KEYS } from '../../services/storageConstants.js'; -import type { App, Bootstrap } from './fixtures.js'; -import { initStorage, debug } from './fixtures.js'; +import * as durations from '../../util/durations/index.std.js'; +import { generateAci } from '../../types/ServiceId.std.js'; +import { toAciObject } from '../../util/ServiceId.node.js'; +import { MAX_READ_KEYS } from '../../services/storageConstants.std.js'; +import type { App, Bootstrap } from './fixtures.node.js'; +import { initStorage, debug } from './fixtures.node.js'; const IdentifierType = Proto.ManifestRecord.Identifier.Type; diff --git a/ts/test-mock/storage/message_request_test.ts b/ts/test-mock/storage/message_request_test.ts index 5cfb79d50c..00ce3db791 100644 --- a/ts/test-mock/storage/message_request_test.ts +++ b/ts/test-mock/storage/message_request_test.ts @@ -3,14 +3,14 @@ import { assert } from 'chai'; -import * as durations from '../../util/durations/index.js'; -import type { App, Bootstrap } from './fixtures.js'; -import { initStorage, debug } from './fixtures.js'; +import * as durations from '../../util/durations/index.std.js'; +import type { App, Bootstrap } from './fixtures.node.js'; +import { initStorage, debug } from './fixtures.node.js'; import { acceptConversation, typeIntoInput, waitForEnabledComposer, -} from '../helpers.js'; +} from '../helpers.node.js'; describe('storage service', function (this: Mocha.Suite) { this.timeout(durations.MINUTE); diff --git a/ts/test-mock/storage/notification_profiles_test.ts b/ts/test-mock/storage/notification_profiles_test.ts index e4651743bb..8029158a3d 100644 --- a/ts/test-mock/storage/notification_profiles_test.ts +++ b/ts/test-mock/storage/notification_profiles_test.ts @@ -6,16 +6,16 @@ import { Proto, StorageState } from '@signalapp/mock-server'; import { expect } from 'playwright/test'; import Long from 'long'; -import * as Bytes from '../../Bytes.js'; -import * as durations from '../../util/durations/index.js'; -import { dropNull } from '../../util/dropNull.js'; -import { constantTimeEqual } from '../../Crypto.js'; -import { generateNotificationProfileId } from '../../types/NotificationProfile-node.js'; -import { Bootstrap, debug } from './fixtures.js'; -import { typeIntoInput } from '../helpers.js'; +import * as Bytes from '../../Bytes.std.js'; +import * as durations from '../../util/durations/index.std.js'; +import { dropNull } from '../../util/dropNull.std.js'; +import { constantTimeEqual } from '../../Crypto.node.js'; +import { generateNotificationProfileId } from '../../types/NotificationProfile-node.node.js'; +import { Bootstrap, debug } from './fixtures.node.js'; +import { typeIntoInput } from '../helpers.node.js'; -import type { App } from './fixtures.js'; -import { DayOfWeek } from '../../types/NotificationProfile.js'; +import type { App } from './fixtures.node.js'; +import { DayOfWeek } from '../../types/NotificationProfile.std.js'; const IdentifierType = Proto.ManifestRecord.Identifier.Type; diff --git a/ts/test-mock/storage/pin_unpin_test.ts b/ts/test-mock/storage/pin_unpin_test.ts index 7194c789de..dfedb6546e 100644 --- a/ts/test-mock/storage/pin_unpin_test.ts +++ b/ts/test-mock/storage/pin_unpin_test.ts @@ -6,9 +6,9 @@ import { assert } from 'chai'; import type { Group } from '@signalapp/mock-server'; -import * as durations from '../../util/durations/index.js'; -import type { App, Bootstrap } from './fixtures.js'; -import { initStorage, debug } from './fixtures.js'; +import * as durations from '../../util/durations/index.std.js'; +import type { App, Bootstrap } from './fixtures.node.js'; +import { initStorage, debug } from './fixtures.node.js'; describe('storage service', function (this: Mocha.Suite) { this.timeout(durations.MINUTE); diff --git a/ts/test-mock/storage/sticker_test.ts b/ts/test-mock/storage/sticker_test.ts index 936c8a8428..0783532856 100644 --- a/ts/test-mock/storage/sticker_test.ts +++ b/ts/test-mock/storage/sticker_test.ts @@ -3,8 +3,8 @@ import { assert } from 'chai'; import { Proto } from '@signalapp/mock-server'; -import * as durations from '../../util/durations/index.js'; -import type { App, Bootstrap } from './fixtures.js'; +import * as durations from '../../util/durations/index.std.js'; +import type { App, Bootstrap } from './fixtures.node.js'; import { initStorage, debug, @@ -13,7 +13,7 @@ import { storeStickerPacks, getStickerPackRecordPredicate, getStickerPackLink, -} from './fixtures.js'; +} from './fixtures.node.js'; const { StickerPackOperation } = Proto.SyncMessage; diff --git a/ts/test-node/AsyncQueue_test.ts b/ts/test-node/AsyncQueue_test.ts index d5d6f83722..3b7208b748 100644 --- a/ts/test-node/AsyncQueue_test.ts +++ b/ts/test-node/AsyncQueue_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { AsyncQueue } from '../util/AsyncQueue.js'; +import { AsyncQueue } from '../util/AsyncQueue.std.js'; describe('AsyncQueue', () => { it('yields values as they are added, even if they were added before consuming', async () => { diff --git a/ts/test-node/RemoteConfig_test.ts b/ts/test-node/RemoteConfig_test.ts index 6789a498ac..7ff5769e92 100644 --- a/ts/test-node/RemoteConfig_test.ts +++ b/ts/test-node/RemoteConfig_test.ts @@ -5,8 +5,8 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; import lodash from 'lodash'; -import { normalizeAci } from '../util/normalizeAci.js'; -import type { ConfigKeyType, ConfigListenerType } from '../RemoteConfig.js'; +import { normalizeAci } from '../util/normalizeAci.std.js'; +import type { ConfigKeyType, ConfigListenerType } from '../RemoteConfig.dom.js'; import { getCountryCodeValue, getBucketValue, @@ -14,8 +14,8 @@ import { onChange, getValue, isEnabled, -} from '../RemoteConfig.js'; -import { updateRemoteConfig } from '../test-helpers/RemoteConfigStub.js'; +} from '../RemoteConfig.dom.js'; +import { updateRemoteConfig } from '../test-helpers/RemoteConfigStub.dom.js'; const { omit } = lodash; diff --git a/ts/test-node/TaskWithTimeout_test.ts b/ts/test-node/TaskWithTimeout_test.ts index a4326e4f5d..f200f1135b 100644 --- a/ts/test-node/TaskWithTimeout_test.ts +++ b/ts/test-node/TaskWithTimeout_test.ts @@ -4,12 +4,12 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import { sleep } from '../util/sleep.js'; -import { explodePromise } from '../util/explodePromise.js'; +import { sleep } from '../util/sleep.std.js'; +import { explodePromise } from '../util/explodePromise.std.js'; import createTaskWithTimeout, { suspendTasksWithTimeout, resumeTasksWithTimeout, -} from '../textsecure/TaskWithTimeout.js'; +} from '../textsecure/TaskWithTimeout.std.js'; describe('createTaskWithTimeout', () => { let sandbox: sinon.SinonSandbox; diff --git a/ts/test-node/app/PreventDisplaySleepService_test.ts b/ts/test-node/app/PreventDisplaySleepService_test.ts index a504806440..2822a3a58a 100644 --- a/ts/test-node/app/PreventDisplaySleepService_test.ts +++ b/ts/test-node/app/PreventDisplaySleepService_test.ts @@ -5,7 +5,7 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; import type { PowerSaveBlocker } from 'electron'; -import { PreventDisplaySleepService } from '../../../app/PreventDisplaySleepService.js'; +import { PreventDisplaySleepService } from '../../../app/PreventDisplaySleepService.std.js'; describe('PreventDisplaySleepService', () => { class FakePowerSaveBlocker implements PowerSaveBlocker { diff --git a/ts/test-node/app/SystemTrayService_test.ts b/ts/test-node/app/SystemTrayService_test.ts index 0fadbb3e48..33cd7fbb41 100644 --- a/ts/test-node/app/SystemTrayService_test.ts +++ b/ts/test-node/app/SystemTrayService_test.ts @@ -5,11 +5,11 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; import type { MenuItem } from 'electron'; import { BrowserWindow, Tray, nativeImage } from 'electron'; -import { MINUTE } from '../../util/durations/index.js'; +import { MINUTE } from '../../util/durations/index.std.js'; -import type { SystemTrayServiceOptionsType } from '../../../app/SystemTrayService.js'; -import { SystemTrayService } from '../../../app/SystemTrayService.js'; -import i18n from '../util/i18n.js'; +import type { SystemTrayServiceOptionsType } from '../../../app/SystemTrayService.main.js'; +import { SystemTrayService } from '../../../app/SystemTrayService.main.js'; +import i18n from '../util/i18n.node.js'; describe('SystemTrayService', function (this: Mocha.Suite) { // These tests take more time on CI in some cases, so we increase the timeout. diff --git a/ts/test-node/app/SystemTraySettingCache_test.ts b/ts/test-node/app/SystemTraySettingCache_test.ts index 74b0b9d0f3..6d0f18ec16 100644 --- a/ts/test-node/app/SystemTraySettingCache_test.ts +++ b/ts/test-node/app/SystemTraySettingCache_test.ts @@ -3,10 +3,10 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import { SystemTraySetting } from '../../types/SystemTraySetting.js'; +import { SystemTraySetting } from '../../types/SystemTraySetting.std.js'; -import type { ConfigType } from '../../../app/base_config.js'; -import { SystemTraySettingCache } from '../../../app/SystemTraySettingCache.js'; +import type { ConfigType } from '../../../app/base_config.node.js'; +import { SystemTraySettingCache } from '../../../app/SystemTraySettingCache.node.js'; describe('SystemTraySettingCache', () => { let sandbox: sinon.SinonSandbox; diff --git a/ts/test-node/app/base_config_test.ts b/ts/test-node/app/base_config_test.ts index 74b39ac025..f5b60a73ea 100644 --- a/ts/test-node/app/base_config_test.ts +++ b/ts/test-node/app/base_config_test.ts @@ -9,8 +9,8 @@ import fsExtra from 'fs-extra'; import { v4 as generateGuid } from 'uuid'; import { assert } from 'chai'; -import type { ConfigType } from '../../../app/base_config.js'; -import { start } from '../../../app/base_config.js'; +import type { ConfigType } from '../../../app/base_config.node.js'; +import { start } from '../../../app/base_config.node.js'; const { pathExists, readJsonSync } = fsExtra; diff --git a/ts/test-node/app/locale_test.ts b/ts/test-node/app/locale_test.ts index 02a579384b..424d798c83 100644 --- a/ts/test-node/app/locale_test.ts +++ b/ts/test-node/app/locale_test.ts @@ -4,9 +4,9 @@ import { assert } from 'chai'; import { stub } from 'sinon'; import * as LocaleMatcher from '@formatjs/intl-localematcher'; -import { load, _getAvailableLocales } from '../../../app/locale.js'; -import { FAKE_DEFAULT_LOCALE } from '../../../app/spell_check.js'; -import { HourCyclePreference } from '../../types/I18N.js'; +import { load, _getAvailableLocales } from '../../../app/locale.main.js'; +import { FAKE_DEFAULT_LOCALE } from '../../../app/spell_check.main.js'; +import { HourCyclePreference } from '../../types/I18N.std.js'; describe('locale', async () => { describe('load', () => { diff --git a/ts/test-node/app/menu_test.ts b/ts/test-node/app/menu_test.ts index fc96eb8d6c..4f022e0c65 100644 --- a/ts/test-node/app/menu_test.ts +++ b/ts/test-node/app/menu_test.ts @@ -6,12 +6,12 @@ import { stub } from 'sinon'; import type { MenuItemConstructorOptions } from 'electron'; import type pino from 'pino'; -import type { CreateTemplateOptionsType } from '../../../app/menu.js'; -import { createTemplate } from '../../../app/menu.js'; -import { load as loadLocale } from '../../../app/locale.js'; -import type { MenuListType } from '../../types/menu.js'; -import type { LoggerType } from '../../types/Logging.js'; -import { HourCyclePreference } from '../../types/I18N.js'; +import type { CreateTemplateOptionsType } from '../../../app/menu.std.js'; +import { createTemplate } from '../../../app/menu.std.js'; +import { load as loadLocale } from '../../../app/locale.main.js'; +import type { MenuListType } from '../../types/menu.std.js'; +import type { LoggerType } from '../../types/Logging.std.js'; +import { HourCyclePreference } from '../../types/I18N.std.js'; const forceUpdate = stub(); const openArtCreator = stub(); diff --git a/ts/test-node/app/protocol_filter_test.ts b/ts/test-node/app/protocol_filter_test.ts index 556d163328..2ab31d7705 100644 --- a/ts/test-node/app/protocol_filter_test.ts +++ b/ts/test-node/app/protocol_filter_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { _urlToPath } from '../../../app/protocol_filter.js'; +import { _urlToPath } from '../../../app/protocol_filter.node.js'; describe('Protocol Filter', () => { describe('_urlToPath', () => { diff --git a/ts/test-node/app/renderWindowsToast_test.tsx b/ts/test-node/app/renderWindowsToast_test.tsx index 028ea25986..f08c4b37d6 100644 --- a/ts/test-node/app/renderWindowsToast_test.tsx +++ b/ts/test-node/app/renderWindowsToast_test.tsx @@ -3,8 +3,8 @@ import { assert } from 'chai'; -import { renderWindowsToast } from '../../../app/renderWindowsToast.js'; -import { NotificationType } from '../../services/notifications.js'; +import { renderWindowsToast } from '../../../app/renderWindowsToast.dom.js'; +import { NotificationType } from '../../types/notifications.std.js'; describe('renderWindowsToast', () => { it('handles toast with image', () => { diff --git a/ts/test-node/app/spell_check_test.ts b/ts/test-node/app/spell_check_test.ts index 755a8b7b10..db4517033f 100644 --- a/ts/test-node/app/spell_check_test.ts +++ b/ts/test-node/app/spell_check_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { getLanguages } from '../../../app/spell_check.js'; +import { getLanguages } from '../../../app/spell_check.main.js'; describe('SpellCheck', () => { describe('getLanguages', () => { diff --git a/ts/test-node/app/updateDefaultSession_test.ts b/ts/test-node/app/updateDefaultSession_test.ts index e025017f46..1448526739 100644 --- a/ts/test-node/app/updateDefaultSession_test.ts +++ b/ts/test-node/app/updateDefaultSession_test.ts @@ -5,7 +5,7 @@ import * as sinon from 'sinon'; import { session } from 'electron'; import { v4 as uuid } from 'uuid'; -import { updateDefaultSession } from '../../../app/updateDefaultSession.js'; +import { updateDefaultSession } from '../../../app/updateDefaultSession.main.js'; describe('updateDefaultSession', () => { let sandbox: sinon.SinonSandbox; diff --git a/ts/test-node/badges/getBadgeImageFileLocalPath_test.ts b/ts/test-node/badges/getBadgeImageFileLocalPath_test.ts index 3796b793ab..c468f94ff9 100644 --- a/ts/test-node/badges/getBadgeImageFileLocalPath_test.ts +++ b/ts/test-node/badges/getBadgeImageFileLocalPath_test.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { BadgeCategory } from '../../badges/BadgeCategory.js'; -import { BadgeImageTheme } from '../../badges/BadgeImageTheme.js'; +import { BadgeCategory } from '../../badges/BadgeCategory.std.js'; +import { BadgeImageTheme } from '../../badges/BadgeImageTheme.std.js'; -import { getBadgeImageFileLocalPath } from '../../badges/getBadgeImageFileLocalPath.js'; +import { getBadgeImageFileLocalPath } from '../../badges/getBadgeImageFileLocalPath.std.js'; describe('getBadgeImageFileLocalPath', () => { const image = (localPath?: string) => ({ diff --git a/ts/test-node/badges/isBadgeImageFileUrlValid_test.ts b/ts/test-node/badges/isBadgeImageFileUrlValid_test.ts index 743d790119..d279dc740c 100644 --- a/ts/test-node/badges/isBadgeImageFileUrlValid_test.ts +++ b/ts/test-node/badges/isBadgeImageFileUrlValid_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { isBadgeImageFileUrlValid } from '../../badges/isBadgeImageFileUrlValid.js'; +import { isBadgeImageFileUrlValid } from '../../badges/isBadgeImageFileUrlValid.std.js'; describe('isBadgeImageFileUrlValid', () => { const UPDATES_URL = 'https://updates2.signal.org/desktop'; diff --git a/ts/test-node/badges/isBadgeVisible_test.ts b/ts/test-node/badges/isBadgeVisible_test.ts index b4ee86dcca..e290db9e33 100644 --- a/ts/test-node/badges/isBadgeVisible_test.ts +++ b/ts/test-node/badges/isBadgeVisible_test.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import type { BadgeType } from '../../badges/types.js'; +import type { BadgeType } from '../../badges/types.std.js'; -import { isBadgeVisible } from '../../badges/isBadgeVisible.js'; -import { BadgeCategory } from '../../badges/BadgeCategory.js'; +import { isBadgeVisible } from '../../badges/isBadgeVisible.std.js'; +import { BadgeCategory } from '../../badges/BadgeCategory.std.js'; describe('isBadgeVisible', () => { const fakeBadge = (isVisible?: boolean): BadgeType => ({ diff --git a/ts/test-node/badges/parseBadgesFromServer_test.ts b/ts/test-node/badges/parseBadgesFromServer_test.ts index 478fabc34c..72f7021309 100644 --- a/ts/test-node/badges/parseBadgesFromServer_test.ts +++ b/ts/test-node/badges/parseBadgesFromServer_test.ts @@ -3,10 +3,10 @@ import { assert } from 'chai'; import lodash from 'lodash'; -import { BadgeCategory } from '../../badges/BadgeCategory.js'; -import { BadgeImageTheme } from '../../badges/BadgeImageTheme.js'; +import { BadgeCategory } from '../../badges/BadgeCategory.std.js'; +import { BadgeImageTheme } from '../../badges/BadgeImageTheme.std.js'; -import { parseBadgesFromServer } from '../../badges/parseBadgesFromServer.js'; +import { parseBadgesFromServer } from '../../badges/parseBadgesFromServer.std.js'; const { omit } = lodash; diff --git a/ts/test-node/calling/findBestMatchingDevice_test.ts b/ts/test-node/calling/findBestMatchingDevice_test.ts index 2e654fcae0..6223347321 100644 --- a/ts/test-node/calling/findBestMatchingDevice_test.ts +++ b/ts/test-node/calling/findBestMatchingDevice_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { findBestMatchingAudioDeviceIndex } from '../../calling/findBestMatchingDevice.js'; +import { findBestMatchingAudioDeviceIndex } from '../../calling/findBestMatchingDevice.std.js'; describe('"find best matching device" helpers', () => { describe('findBestMatchingAudioDeviceIndex', () => { diff --git a/ts/test-node/challenge_test.ts b/ts/test-node/challenge_test.ts index 6b7840f19a..aef188c1bf 100644 --- a/ts/test-node/challenge_test.ts +++ b/ts/test-node/challenge_test.ts @@ -7,9 +7,9 @@ import { assert } from 'chai'; import lodash from 'lodash'; import * as sinon from 'sinon'; -import { STORAGE_KEY, ChallengeHandler } from '../challenge.js'; -import type { RegisteredChallengeType } from '../challenge.js'; -import { DAY, SECOND } from '../util/durations/index.js'; +import { STORAGE_KEY, ChallengeHandler } from '../challenge.dom.js'; +import type { RegisteredChallengeType } from '../challenge.dom.js'; +import { DAY, SECOND } from '../util/durations/index.std.js'; const { noop } = lodash; diff --git a/ts/test-node/components/fun/emojis_test.ts b/ts/test-node/components/fun/emojis_test.ts index ac6f926b30..b8ff0d3cde 100644 --- a/ts/test-node/components/fun/emojis_test.ts +++ b/ts/test-node/components/fun/emojis_test.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import assert from 'node:assert/strict'; -import { getEmojifyData } from '../../../components/fun/data/emojis.js'; +import { getEmojifyData } from '../../../components/fun/data/emojis.std.js'; describe('getEmojifyData', () => { function check(text: string, emojiCount: number, isEmojiOnlyText: boolean) { diff --git a/ts/test-node/components/fun/segments_test.ts b/ts/test-node/components/fun/segments_test.ts index e4e853ae89..f19075e715 100644 --- a/ts/test-node/components/fun/segments_test.ts +++ b/ts/test-node/components/fun/segments_test.ts @@ -6,7 +6,7 @@ import { _getSegmentSize, _SEGMENT_SIZE_BUCKETS, type _SegmentRange, -} from '../../../components/fun/data/segments.js'; +} from '../../../components/fun/data/segments.std.js'; const SMALLEST_BUCKET = Math.min(..._SEGMENT_SIZE_BUCKETS); diff --git a/ts/test-node/components/leftPane/LeftPaneArchiveHelper_test.ts b/ts/test-node/components/leftPane/LeftPaneArchiveHelper_test.ts index a3e2aa1c89..9d907036ee 100644 --- a/ts/test-node/components/leftPane/LeftPaneArchiveHelper_test.ts +++ b/ts/test-node/components/leftPane/LeftPaneArchiveHelper_test.ts @@ -4,12 +4,12 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; import { v4 as uuid } from 'uuid'; -import { RowType } from '../../../components/ConversationList.js'; -import { FindDirection } from '../../../components/leftPane/LeftPaneHelper.js'; -import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.js'; -import { LeftPaneSearchHelper } from '../../../components/leftPane/LeftPaneSearchHelper.js'; +import { RowType } from '../../../components/ConversationList.dom.js'; +import { FindDirection } from '../../../components/leftPane/LeftPaneHelper.dom.js'; +import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.std.js'; +import { LeftPaneSearchHelper } from '../../../components/leftPane/LeftPaneSearchHelper.dom.js'; -import { LeftPaneArchiveHelper } from '../../../components/leftPane/LeftPaneArchiveHelper.js'; +import { LeftPaneArchiveHelper } from '../../../components/leftPane/LeftPaneArchiveHelper.dom.js'; describe('LeftPaneArchiveHelper', () => { let sandbox: sinon.SinonSandbox; diff --git a/ts/test-node/components/leftPane/LeftPaneChooseGroupMembersHelper_test.ts b/ts/test-node/components/leftPane/LeftPaneChooseGroupMembersHelper_test.ts index 018617967b..684cd529b7 100644 --- a/ts/test-node/components/leftPane/LeftPaneChooseGroupMembersHelper_test.ts +++ b/ts/test-node/components/leftPane/LeftPaneChooseGroupMembersHelper_test.ts @@ -7,11 +7,11 @@ import lodash from 'lodash'; import { RowType, _testHeaderText, -} from '../../../components/ConversationList.js'; -import { ContactCheckboxDisabledReason } from '../../../components/conversationList/ContactCheckbox.js'; -import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.js'; +} from '../../../components/ConversationList.dom.js'; +import { ContactCheckboxDisabledReason } from '../../../components/conversationList/ContactCheckbox.dom.js'; +import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.std.js'; -import { LeftPaneChooseGroupMembersHelper } from '../../../components/leftPane/LeftPaneChooseGroupMembersHelper.js'; +import { LeftPaneChooseGroupMembersHelper } from '../../../components/leftPane/LeftPaneChooseGroupMembersHelper.dom.js'; const { times } = lodash; diff --git a/ts/test-node/components/leftPane/LeftPaneComposeHelper_test.ts b/ts/test-node/components/leftPane/LeftPaneComposeHelper_test.ts index c732c7fdd4..102e53c25a 100644 --- a/ts/test-node/components/leftPane/LeftPaneComposeHelper_test.ts +++ b/ts/test-node/components/leftPane/LeftPaneComposeHelper_test.ts @@ -6,14 +6,14 @@ import * as sinon from 'sinon'; import { RowType, _testHeaderText, -} from '../../../components/ConversationList.js'; -import { FindDirection } from '../../../components/leftPane/LeftPaneHelper.js'; +} from '../../../components/ConversationList.dom.js'; +import { FindDirection } from '../../../components/leftPane/LeftPaneHelper.dom.js'; import { getDefaultConversation, getDefaultGroupListItem, -} from '../../../test-helpers/getDefaultConversation.js'; +} from '../../../test-helpers/getDefaultConversation.std.js'; -import { LeftPaneComposeHelper } from '../../../components/leftPane/LeftPaneComposeHelper.js'; +import { LeftPaneComposeHelper } from '../../../components/leftPane/LeftPaneComposeHelper.dom.js'; describe('LeftPaneComposeHelper', () => { let sinonSandbox: sinon.SinonSandbox; diff --git a/ts/test-node/components/leftPane/LeftPaneInboxHelper_test.tsx b/ts/test-node/components/leftPane/LeftPaneInboxHelper_test.tsx index 72315252c1..2396e8fea5 100644 --- a/ts/test-node/components/leftPane/LeftPaneInboxHelper_test.tsx +++ b/ts/test-node/components/leftPane/LeftPaneInboxHelper_test.tsx @@ -6,12 +6,12 @@ import * as sinon from 'sinon'; import { RowType, _testHeaderText, -} from '../../../components/ConversationList.js'; -import { FindDirection } from '../../../components/leftPane/LeftPaneHelper.js'; -import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.js'; +} from '../../../components/ConversationList.dom.js'; +import { FindDirection } from '../../../components/leftPane/LeftPaneHelper.dom.js'; +import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.std.js'; -import type { LeftPaneInboxPropsType } from '../../../components/leftPane/LeftPaneInboxHelper.js'; -import { LeftPaneInboxHelper } from '../../../components/leftPane/LeftPaneInboxHelper.js'; +import type { LeftPaneInboxPropsType } from '../../../components/leftPane/LeftPaneInboxHelper.dom.js'; +import { LeftPaneInboxHelper } from '../../../components/leftPane/LeftPaneInboxHelper.dom.js'; describe('LeftPaneInboxHelper', () => { const defaultProps: LeftPaneInboxPropsType = { diff --git a/ts/test-node/components/leftPane/LeftPaneSearchHelper_test.ts b/ts/test-node/components/leftPane/LeftPaneSearchHelper_test.ts index 4371c0800a..fe45057c87 100644 --- a/ts/test-node/components/leftPane/LeftPaneSearchHelper_test.ts +++ b/ts/test-node/components/leftPane/LeftPaneSearchHelper_test.ts @@ -7,10 +7,10 @@ import { v4 as uuid } from 'uuid'; import { RowType, _testHeaderText, -} from '../../../components/ConversationList.js'; -import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.js'; +} from '../../../components/ConversationList.dom.js'; +import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.std.js'; -import { LeftPaneSearchHelper } from '../../../components/leftPane/LeftPaneSearchHelper.js'; +import { LeftPaneSearchHelper } from '../../../components/leftPane/LeftPaneSearchHelper.dom.js'; const baseSearchHelperArgs = { conversationResults: { isLoading: false, results: [] }, diff --git a/ts/test-node/components/leftPane/LeftPaneSetGroupMetadataHelper_test.ts b/ts/test-node/components/leftPane/LeftPaneSetGroupMetadataHelper_test.ts index d86a0f943b..a773dd0bcf 100644 --- a/ts/test-node/components/leftPane/LeftPaneSetGroupMetadataHelper_test.ts +++ b/ts/test-node/components/leftPane/LeftPaneSetGroupMetadataHelper_test.ts @@ -6,11 +6,11 @@ import * as sinon from 'sinon'; import { RowType, _testHeaderText, -} from '../../../components/ConversationList.js'; -import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.js'; -import { DurationInSeconds } from '../../../util/durations/index.js'; +} from '../../../components/ConversationList.dom.js'; +import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.std.js'; +import { DurationInSeconds } from '../../../util/durations/index.std.js'; -import { LeftPaneSetGroupMetadataHelper } from '../../../components/leftPane/LeftPaneSetGroupMetadataHelper.js'; +import { LeftPaneSetGroupMetadataHelper } from '../../../components/leftPane/LeftPaneSetGroupMetadataHelper.dom.js'; function getComposeState() { return { diff --git a/ts/test-node/components/leftPane/getConversationInDirection_test.ts b/ts/test-node/components/leftPane/getConversationInDirection_test.ts index 158d4592b7..c7b2ed0516 100644 --- a/ts/test-node/components/leftPane/getConversationInDirection_test.ts +++ b/ts/test-node/components/leftPane/getConversationInDirection_test.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import type { ToFindType } from '../../../components/leftPane/LeftPaneHelper.js'; -import { FindDirection } from '../../../components/leftPane/LeftPaneHelper.js'; -import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.js'; +import type { ToFindType } from '../../../components/leftPane/LeftPaneHelper.dom.js'; +import { FindDirection } from '../../../components/leftPane/LeftPaneHelper.dom.js'; +import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.std.js'; -import { getConversationInDirection } from '../../../components/leftPane/getConversationInDirection.js'; +import { getConversationInDirection } from '../../../components/leftPane/getConversationInDirection.dom.js'; describe('getConversationInDirection', () => { const fakeConversation = (markedUnread = false) => diff --git a/ts/test-node/components/media-gallery/groupMediaItemsByDate.ts b/ts/test-node/components/media-gallery/groupMediaItemsByDate.ts index ad84c8eeb3..1811834edb 100644 --- a/ts/test-node/components/media-gallery/groupMediaItemsByDate.ts +++ b/ts/test-node/components/media-gallery/groupMediaItemsByDate.ts @@ -4,10 +4,10 @@ import { assert } from 'chai'; import lodash from 'lodash'; -import { IMAGE_JPEG } from '../../../types/MIME.js'; -import { groupMediaItemsByDate } from '../../../components/conversation/media-gallery/groupMediaItemsByDate.js'; -import type { MediaItemType } from '../../../types/MediaItem.js'; -import { fakeAttachment } from '../../../test-helpers/fakeAttachment.js'; +import { IMAGE_JPEG } from '../../../types/MIME.std.js'; +import { groupMediaItemsByDate } from '../../../components/conversation/media-gallery/groupMediaItemsByDate.std.js'; +import type { MediaItemType } from '../../../types/MediaItem.std.js'; +import { fakeAttachment } from '../../../test-helpers/fakeAttachment.std.js'; const { shuffle } = lodash; diff --git a/ts/test-node/conversations/isConversationTooBigToRing_test.ts b/ts/test-node/conversations/isConversationTooBigToRing_test.ts index c5faca731a..75db50dac4 100644 --- a/ts/test-node/conversations/isConversationTooBigToRing_test.ts +++ b/ts/test-node/conversations/isConversationTooBigToRing_test.ts @@ -3,10 +3,10 @@ import { assert } from 'chai'; import lodash from 'lodash'; -import { updateRemoteConfig } from '../../test-helpers/RemoteConfigStub.js'; -import { generateAci } from '../../types/ServiceId.js'; +import { updateRemoteConfig } from '../../test-helpers/RemoteConfigStub.dom.js'; +import { generateAci } from '../../types/ServiceId.std.js'; -import { isConversationTooBigToRing } from '../../conversations/isConversationTooBigToRing.js'; +import { isConversationTooBigToRing } from '../../conversations/isConversationTooBigToRing.dom.js'; const { times } = lodash; diff --git a/ts/test-node/environment_test.ts b/ts/test-node/environment_test.ts index 783cded304..a2a3474e25 100644 --- a/ts/test-node/environment_test.ts +++ b/ts/test-node/environment_test.ts @@ -7,7 +7,7 @@ import { Environment, isTestEnvironment, parseEnvironment, -} from '../environment.js'; +} from '../environment.std.js'; describe('environment utilities', () => { describe('parseEnvironment', () => { diff --git a/ts/test-node/groups/add_banned_member_test.ts b/ts/test-node/groups/add_banned_member_test.ts index c024996c17..6ba994daac 100644 --- a/ts/test-node/groups/add_banned_member_test.ts +++ b/ts/test-node/groups/add_banned_member_test.ts @@ -3,13 +3,13 @@ import { assert } from 'chai'; -import { generateAci } from '../../types/ServiceId.js'; -import { _maybeBuildAddBannedMemberActions } from '../../groups.js'; +import { generateAci } from '../../types/ServiceId.std.js'; +import { _maybeBuildAddBannedMemberActions } from '../../groups.preload.js'; import { getClientZkGroupCipher, decryptServiceId, -} from '../../util/zkgroup.js'; -import { updateRemoteConfig } from '../../test-helpers/RemoteConfigStub.js'; +} from '../../util/zkgroup.node.js'; +import { updateRemoteConfig } from '../../test-helpers/RemoteConfigStub.dom.js'; const HARD_LIMIT_KEY = 'global.groupsv2.groupSizeHardLimit'; diff --git a/ts/test-node/groups/limits_test.ts b/ts/test-node/groups/limits_test.ts index 0b244e07c5..2e7aa4dcb0 100644 --- a/ts/test-node/groups/limits_test.ts +++ b/ts/test-node/groups/limits_test.ts @@ -2,12 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { updateRemoteConfig } from '../../test-helpers/RemoteConfigStub.js'; +import { updateRemoteConfig } from '../../test-helpers/RemoteConfigStub.dom.js'; import { getGroupSizeRecommendedLimit, getGroupSizeHardLimit, -} from '../../groups/limits.js'; +} from '../../groups/limits.dom.js'; const RECOMMENDED_SIZE_KEY = 'global.groupsv2.maxGroupSize'; const HARD_LIMIT_KEY = 'global.groupsv2.groupSizeHardLimit'; diff --git a/ts/test-node/groups/message_merge_test.ts b/ts/test-node/groups/message_merge_test.ts index bb4dc186ec..183f9ecf09 100644 --- a/ts/test-node/groups/message_merge_test.ts +++ b/ts/test-node/groups/message_merge_test.ts @@ -4,11 +4,11 @@ import { assert } from 'chai'; import { v4 as generateUuid } from 'uuid'; -import { generateAci } from '../../types/ServiceId.js'; +import { generateAci } from '../../types/ServiceId.std.js'; import { _isGroupChangeMessageBounceable, _mergeGroupChangeMessages, -} from '../../groups.js'; +} from '../../groups.preload.js'; describe('group message merging', () => { const defaultMessage = { diff --git a/ts/test-node/jobs/JobError_test.ts b/ts/test-node/jobs/JobError_test.ts index 4570c724b4..1ec2326424 100644 --- a/ts/test-node/jobs/JobError_test.ts +++ b/ts/test-node/jobs/JobError_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { JobError } from '../../jobs/JobError.js'; +import { JobError } from '../../jobs/JobError.std.js'; describe('JobError', () => { it('stores the provided argument as a property', () => { diff --git a/ts/test-node/jobs/JobLogger_test.ts b/ts/test-node/jobs/JobLogger_test.ts index a2b6b5f6b3..109df51a14 100644 --- a/ts/test-node/jobs/JobLogger_test.ts +++ b/ts/test-node/jobs/JobLogger_test.ts @@ -3,7 +3,7 @@ import * as sinon from 'sinon'; -import { JobLogger } from '../../jobs/JobLogger.js'; +import { JobLogger } from '../../jobs/JobLogger.std.js'; describe('JobLogger', () => { const LEVELS = ['fatal', 'error', 'warn', 'info', 'debug', 'trace'] as const; diff --git a/ts/test-node/jobs/JobQueueDatabaseStore_test.ts b/ts/test-node/jobs/JobQueueDatabaseStore_test.ts index e54a0ce560..e51906f168 100644 --- a/ts/test-node/jobs/JobQueueDatabaseStore_test.ts +++ b/ts/test-node/jobs/JobQueueDatabaseStore_test.ts @@ -5,9 +5,9 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; import lodash from 'lodash'; -import type { StoredJob } from '../../jobs/types.js'; +import type { StoredJob } from '../../jobs/types.std.js'; -import { JobQueueDatabaseStore } from '../../jobs/JobQueueDatabaseStore.js'; +import { JobQueueDatabaseStore } from '../../jobs/JobQueueDatabaseStore.preload.js'; const { noop } = lodash; diff --git a/ts/test-node/jobs/JobQueue_test.ts b/ts/test-node/jobs/JobQueue_test.ts index 8c524982f6..e31dca5317 100644 --- a/ts/test-node/jobs/JobQueue_test.ts +++ b/ts/test-node/jobs/JobQueue_test.ts @@ -10,17 +10,21 @@ import { z } from 'zod'; import lodash from 'lodash'; import { v4 as uuid } from 'uuid'; import PQueue from 'p-queue'; -import { JobError } from '../../jobs/JobError.js'; -import { TestJobQueueStore } from './TestJobQueueStore.js'; -import { missingCaseError } from '../../util/missingCaseError.js'; -import { drop } from '../../util/drop.js'; -import type { LoggerType } from '../../types/Logging.js'; +import { JobError } from '../../jobs/JobError.std.js'; +import { TestJobQueueStore } from './TestJobQueueStore.node.js'; +import { missingCaseError } from '../../util/missingCaseError.std.js'; +import { drop } from '../../util/drop.std.js'; +import type { LoggerType } from '../../types/Logging.std.js'; -import type { JOB_STATUS } from '../../jobs/JobQueue.js'; -import { JobQueue } from '../../jobs/JobQueue.js'; -import type { ParsedJob, StoredJob, JobQueueStore } from '../../jobs/types.js'; -import { sleep } from '../../util/sleep.js'; -import { parseUnknown } from '../../util/schemas.js'; +import type { JOB_STATUS } from '../../jobs/JobQueue.std.js'; +import { JobQueue } from '../../jobs/JobQueue.std.js'; +import type { + ParsedJob, + StoredJob, + JobQueueStore, +} from '../../jobs/types.std.js'; +import { sleep } from '../../util/sleep.std.js'; +import { parseUnknown } from '../../util/schemas.std.js'; const { noop, groupBy } = lodash; diff --git a/ts/test-node/jobs/Job_test.ts b/ts/test-node/jobs/Job_test.ts index 0186605dba..b280b86834 100644 --- a/ts/test-node/jobs/Job_test.ts +++ b/ts/test-node/jobs/Job_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { Job } from '../../jobs/Job.js'; +import { Job } from '../../jobs/Job.std.js'; describe('Job', () => { it('stores its arguments', () => { diff --git a/ts/test-node/jobs/TestJobQueueStore.ts b/ts/test-node/jobs/TestJobQueueStore.ts index cfc5fc7e69..c97a51d477 100644 --- a/ts/test-node/jobs/TestJobQueueStore.ts +++ b/ts/test-node/jobs/TestJobQueueStore.ts @@ -6,9 +6,9 @@ import EventEmitter, { once } from 'node:events'; -import type { JobQueueStore, StoredJob } from '../../jobs/types.js'; -import { sleep } from '../../util/sleep.js'; -import { drop } from '../../util/drop.js'; +import type { JobQueueStore, StoredJob } from '../../jobs/types.std.js'; +import { sleep } from '../../util/sleep.std.js'; +import { drop } from '../../util/drop.std.js'; export class TestJobQueueStore implements JobQueueStore { events = new EventEmitter(); diff --git a/ts/test-node/jobs/formatJobForInsert_test.ts b/ts/test-node/jobs/formatJobForInsert_test.ts index e8255eec93..c74382d015 100644 --- a/ts/test-node/jobs/formatJobForInsert_test.ts +++ b/ts/test-node/jobs/formatJobForInsert_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { formatJobForInsert } from '../../jobs/formatJobForInsert.js'; +import { formatJobForInsert } from '../../jobs/formatJobForInsert.std.js'; describe('formatJobForInsert', () => { it('removes non-essential properties', () => { diff --git a/ts/test-node/jobs/helpers/InMemoryQueues_test.ts b/ts/test-node/jobs/helpers/InMemoryQueues_test.ts index 1484f1767e..d94fb6db15 100644 --- a/ts/test-node/jobs/helpers/InMemoryQueues_test.ts +++ b/ts/test-node/jobs/helpers/InMemoryQueues_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { InMemoryQueues } from '../../../jobs/helpers/InMemoryQueues.js'; +import { InMemoryQueues } from '../../../jobs/helpers/InMemoryQueues.std.js'; describe('InMemoryQueues', () => { describe('get', () => { diff --git a/ts/test-node/jobs/helpers/addReportSpamJob_test.ts b/ts/test-node/jobs/helpers/addReportSpamJob_test.ts index a4ef178cd7..f68028fe37 100644 --- a/ts/test-node/jobs/helpers/addReportSpamJob_test.ts +++ b/ts/test-node/jobs/helpers/addReportSpamJob_test.ts @@ -1,10 +1,10 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import * as sinon from 'sinon'; -import { Job } from '../../../jobs/Job.js'; -import { addReportSpamJob } from '../../../jobs/helpers/addReportSpamJob.js'; -import type { ConversationType } from '../../../state/ducks/conversations.js'; -import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.js'; +import { Job } from '../../../jobs/Job.std.js'; +import { addReportSpamJob } from '../../../jobs/helpers/addReportSpamJob.dom.js'; +import type { ConversationType } from '../../../state/ducks/conversations.preload.js'; +import { getDefaultConversation } from '../../../test-helpers/getDefaultConversation.std.js'; describe('addReportSpamJob', () => { let getMessageServerGuidsForSpam: sinon.SinonStub; diff --git a/ts/test-node/jobs/helpers/findRetryAfterTimeFromError_test.ts b/ts/test-node/jobs/helpers/findRetryAfterTimeFromError_test.ts index 448e7edb03..330add3c9b 100644 --- a/ts/test-node/jobs/helpers/findRetryAfterTimeFromError_test.ts +++ b/ts/test-node/jobs/helpers/findRetryAfterTimeFromError_test.ts @@ -3,9 +3,9 @@ import { assert } from 'chai'; -import { findRetryAfterTimeFromError } from '../../../jobs/helpers/findRetryAfterTimeFromError.js'; -import { HTTPError } from '../../../types/HTTPError.js'; -import { MINUTE } from '../../../util/durations/index.js'; +import { findRetryAfterTimeFromError } from '../../../jobs/helpers/findRetryAfterTimeFromError.std.js'; +import { HTTPError } from '../../../types/HTTPError.std.js'; +import { MINUTE } from '../../../util/durations/index.std.js'; describe('findRetryAfterTimeFromError', () => { it('returns 1 minute or provided default if no Retry-After time is found', () => { diff --git a/ts/test-node/jobs/helpers/getHttpErrorCode_test.ts b/ts/test-node/jobs/helpers/getHttpErrorCode_test.ts index e0245206db..b70a8fc433 100644 --- a/ts/test-node/jobs/helpers/getHttpErrorCode_test.ts +++ b/ts/test-node/jobs/helpers/getHttpErrorCode_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { getHttpErrorCode } from '../../../jobs/helpers/getHttpErrorCode.js'; +import { getHttpErrorCode } from '../../../jobs/helpers/getHttpErrorCode.std.js'; describe('getHttpErrorCode', () => { it('returns -1 if not passed an object', () => { diff --git a/ts/test-node/jobs/helpers/handleMultipleSendErrors_test.ts b/ts/test-node/jobs/helpers/handleMultipleSendErrors_test.ts index a66b611709..dda421dad6 100644 --- a/ts/test-node/jobs/helpers/handleMultipleSendErrors_test.ts +++ b/ts/test-node/jobs/helpers/handleMultipleSendErrors_test.ts @@ -4,14 +4,14 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; import lodash from 'lodash'; -import { SendMessageProtoError } from '../../../textsecure/Errors.js'; -import { HTTPError } from '../../../types/HTTPError.js'; -import { SECOND } from '../../../util/durations/index.js'; +import { SendMessageProtoError } from '../../../textsecure/Errors.std.js'; +import { HTTPError } from '../../../types/HTTPError.std.js'; +import { SECOND } from '../../../util/durations/index.std.js'; import { handleMultipleSendErrors, maybeExpandErrors, -} from '../../../jobs/helpers/handleMultipleSendErrors.js'; +} from '../../../jobs/helpers/handleMultipleSendErrors.std.js'; const { noop, omit } = lodash; diff --git a/ts/test-node/jobs/helpers/sleepForRateLimitRetryAfterTime_test.ts b/ts/test-node/jobs/helpers/sleepForRateLimitRetryAfterTime_test.ts index 1b1cd17585..624a3ada9f 100644 --- a/ts/test-node/jobs/helpers/sleepForRateLimitRetryAfterTime_test.ts +++ b/ts/test-node/jobs/helpers/sleepForRateLimitRetryAfterTime_test.ts @@ -3,11 +3,11 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import { HTTPError } from '../../../types/HTTPError.js'; -import * as durations from '../../../util/durations/index.js'; -import { drop } from '../../../util/drop.js'; +import { HTTPError } from '../../../types/HTTPError.std.js'; +import * as durations from '../../../util/durations/index.std.js'; +import { drop } from '../../../util/drop.std.js'; -import { sleepForRateLimitRetryAfterTime } from '../../../jobs/helpers/sleepForRateLimitRetryAfterTime.js'; +import { sleepForRateLimitRetryAfterTime } from '../../../jobs/helpers/sleepForRateLimitRetryAfterTime.std.js'; describe('sleepFor413RetryAfterTimeIfApplicable', () => { const createLogger = () => ({ info: sinon.spy() }); diff --git a/ts/test-node/jobs/helpers/syncHelpers_test.ts b/ts/test-node/jobs/helpers/syncHelpers_test.ts index 19787f9fcc..ab134a0aac 100644 --- a/ts/test-node/jobs/helpers/syncHelpers_test.ts +++ b/ts/test-node/jobs/helpers/syncHelpers_test.ts @@ -3,8 +3,8 @@ import { assert } from 'chai'; -import { parseRawSyncDataArray } from '../../../jobs/helpers/syncHelpers.js'; -import { generateAci } from '../../../types/ServiceId.js'; +import { parseRawSyncDataArray } from '../../../jobs/helpers/syncHelpers.preload.js'; +import { generateAci } from '../../../types/ServiceId.std.js'; const SERVICE_ID_1 = generateAci(); const SERVICE_ID_2 = generateAci(); diff --git a/ts/test-node/linkPreviews/isLinkPreviewDateValid_test.ts b/ts/test-node/linkPreviews/isLinkPreviewDateValid_test.ts index 88b548ba1e..37e001e2bc 100644 --- a/ts/test-node/linkPreviews/isLinkPreviewDateValid_test.ts +++ b/ts/test-node/linkPreviews/isLinkPreviewDateValid_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { isLinkPreviewDateValid } from '../../linkPreviews/isLinkPreviewDateValid.js'; +import { isLinkPreviewDateValid } from '../../linkPreviews/isLinkPreviewDateValid.std.js'; describe('isLinkPreviewDateValid', () => { it('returns false for non-numbers', () => { diff --git a/ts/test-node/linkPreviews/shouldUseFullSizeLinkPreviewImage_test.ts b/ts/test-node/linkPreviews/shouldUseFullSizeLinkPreviewImage_test.ts index dcde53cd36..fe18903f3c 100644 --- a/ts/test-node/linkPreviews/shouldUseFullSizeLinkPreviewImage_test.ts +++ b/ts/test-node/linkPreviews/shouldUseFullSizeLinkPreviewImage_test.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { VIDEO_MP4 } from '../../types/MIME.js'; +import { VIDEO_MP4 } from '../../types/MIME.std.js'; -import { fakeAttachment } from '../../test-helpers/fakeAttachment.js'; +import { fakeAttachment } from '../../test-helpers/fakeAttachment.std.js'; -import { shouldUseFullSizeLinkPreviewImage } from '../../linkPreviews/shouldUseFullSizeLinkPreviewImage.js'; +import { shouldUseFullSizeLinkPreviewImage } from '../../linkPreviews/shouldUseFullSizeLinkPreviewImage.std.js'; describe('shouldUseFullSizeLinkPreviewImage', () => { const baseLinkPreview = { diff --git a/ts/test-node/logging/formatCountForLogging_test.ts b/ts/test-node/logging/formatCountForLogging_test.ts index 2e56238b00..9215f5519a 100644 --- a/ts/test-node/logging/formatCountForLogging_test.ts +++ b/ts/test-node/logging/formatCountForLogging_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { formatCountForLogging } from '../../logging/formatCountForLogging.js'; +import { formatCountForLogging } from '../../logging/formatCountForLogging.std.js'; describe('formatCountForLogging', () => { it('returns "0" if passed zero', () => { diff --git a/ts/test-node/logging/uploadDebugLogs_test.ts b/ts/test-node/logging/uploadDebugLogs_test.ts index d71c224682..a3715da799 100644 --- a/ts/test-node/logging/uploadDebugLogs_test.ts +++ b/ts/test-node/logging/uploadDebugLogs_test.ts @@ -8,9 +8,9 @@ import FormData from 'form-data'; import * as util from 'node:util'; import * as zlib from 'node:zlib'; -import * as durations from '../../util/durations/index.js'; -import { upload } from '../../logging/uploadDebugLog.js'; -import { createLogger } from '../../logging/log.js'; +import * as durations from '../../util/durations/index.std.js'; +import { upload } from '../../logging/uploadDebugLog.node.js'; +import { createLogger } from '../../logging/log.std.js'; const logger = createLogger('uploadDebugLogs_test'); diff --git a/ts/test-node/logging_test.ts b/ts/test-node/logging_test.ts index c360b77d01..add6aa77c3 100644 --- a/ts/test-node/logging_test.ts +++ b/ts/test-node/logging_test.ts @@ -16,7 +16,7 @@ import { isLineAfterDate, fetchLog, fetchLogs, -} from '../logging/main_process_logging.js'; +} from '../logging/main_process_logging.main.js'; describe('logging', () => { const fakeLogEntry = ({ diff --git a/ts/test-node/messages/MessageReadStatus_test.ts b/ts/test-node/messages/MessageReadStatus_test.ts index 7ed22dbbf8..36f3a2bd45 100644 --- a/ts/test-node/messages/MessageReadStatus_test.ts +++ b/ts/test-node/messages/MessageReadStatus_test.ts @@ -3,7 +3,10 @@ import { assert } from 'chai'; -import { ReadStatus, maxReadStatus } from '../../messages/MessageReadStatus.js'; +import { + ReadStatus, + maxReadStatus, +} from '../../messages/MessageReadStatus.std.js'; describe('message read status utilities', () => { describe('maxReadStatus', () => { diff --git a/ts/test-node/messages/MessageSendState_test.ts b/ts/test-node/messages/MessageSendState_test.ts index 4d4c6e0806..6454d75fd4 100644 --- a/ts/test-node/messages/MessageSendState_test.ts +++ b/ts/test-node/messages/MessageSendState_test.ts @@ -9,7 +9,7 @@ import type { SendAction, SendState, SendStateByConversationId, -} from '../../messages/MessageSendState.js'; +} from '../../messages/MessageSendState.std.js'; import { SendActionType, SendStatus, @@ -24,7 +24,7 @@ import { sendStateReducer, someRecipientSendStatus, someSendStatus, -} from '../../messages/MessageSendState.js'; +} from '../../messages/MessageSendState.std.js'; const { sampleSize, times } = lodash; diff --git a/ts/test-node/messages/migrateLegacyReadStatus_test.ts b/ts/test-node/messages/migrateLegacyReadStatus_test.ts index aa7f2803a8..23805c63a8 100644 --- a/ts/test-node/messages/migrateLegacyReadStatus_test.ts +++ b/ts/test-node/messages/migrateLegacyReadStatus_test.ts @@ -5,9 +5,9 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import { assert } from 'chai'; -import { ReadStatus } from '../../messages/MessageReadStatus.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.std.js'; -import { migrateLegacyReadStatus } from '../../messages/migrateLegacyReadStatus.js'; +import { migrateLegacyReadStatus } from '../../messages/migrateLegacyReadStatus.std.js'; describe('migrateLegacyReadStatus', () => { it("doesn't migrate messages that already have the modern read state", () => { diff --git a/ts/test-node/messages/migrateLegacySendAttributes_test.ts b/ts/test-node/messages/migrateLegacySendAttributes_test.ts index b697e9ef90..6504560cb2 100644 --- a/ts/test-node/messages/migrateLegacySendAttributes_test.ts +++ b/ts/test-node/messages/migrateLegacySendAttributes_test.ts @@ -3,11 +3,11 @@ import { assert } from 'chai'; import { v4 as uuid } from 'uuid'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; -import type { ConversationType } from '../../state/ducks/conversations.js'; -import { SendStatus } from '../../messages/MessageSendState.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.std.js'; +import type { ConversationType } from '../../state/ducks/conversations.preload.js'; +import { SendStatus } from '../../messages/MessageSendState.std.js'; -import { migrateLegacySendAttributes } from '../../messages/migrateLegacySendAttributes.js'; +import { migrateLegacySendAttributes } from '../../messages/migrateLegacySendAttributes.preload.js'; describe('migrateLegacySendAttributes', () => { const defaultMessage = { diff --git a/ts/test-node/processDataMessage_test.ts b/ts/test-node/processDataMessage_test.ts index aa0ec5d49c..e6a6c22b5b 100644 --- a/ts/test-node/processDataMessage_test.ts +++ b/ts/test-node/processDataMessage_test.ts @@ -8,13 +8,13 @@ import { v4 as generateUuid } from 'uuid'; import { processDataMessage, ATTACHMENT_MAX, -} from '../textsecure/processDataMessage.js'; +} from '../textsecure/processDataMessage.preload.js'; import type { ProcessedAttachment } from '../textsecure/Types.d.ts'; -import { SignalService as Proto } from '../protobuf/index.js'; -import { IMAGE_GIF, IMAGE_JPEG, LONG_MESSAGE } from '../types/MIME.js'; -import { generateAci } from '../types/ServiceId.js'; -import { toAciObject } from '../util/ServiceId.js'; -import { uuidToBytes } from '../util/uuidToBytes.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; +import { IMAGE_GIF, IMAGE_JPEG, LONG_MESSAGE } from '../types/MIME.std.js'; +import { generateAci } from '../types/ServiceId.std.js'; +import { toAciObject } from '../util/ServiceId.node.js'; +import { uuidToBytes } from '../util/uuidToBytes.std.js'; const ACI_1 = generateAci(); const ACI_BINARY_1 = toAciObject(ACI_1).getRawUuidBytes(); diff --git a/ts/test-node/processSyncMessage_test.ts b/ts/test-node/processSyncMessage_test.ts index 13610a1a5f..92b0506083 100644 --- a/ts/test-node/processSyncMessage_test.ts +++ b/ts/test-node/processSyncMessage_test.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { generateAci } from '../types/ServiceId.js'; +import { generateAci } from '../types/ServiceId.std.js'; -import { processSyncMessage } from '../textsecure/processSyncMessage.js'; +import { processSyncMessage } from '../textsecure/processSyncMessage.node.js'; describe('processSyncMessage', () => { const destinationServiceId = generateAci(); diff --git a/ts/test-node/reactions/isValidReactionEmoji_test.ts b/ts/test-node/reactions/isValidReactionEmoji_test.ts index 2df7f2a181..70ad129160 100644 --- a/ts/test-node/reactions/isValidReactionEmoji_test.ts +++ b/ts/test-node/reactions/isValidReactionEmoji_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { isValidReactionEmoji } from '../../reactions/isValidReactionEmoji.js'; +import { isValidReactionEmoji } from '../../reactions/isValidReactionEmoji.std.js'; describe('isValidReactionEmoji', () => { it('returns false for non-strings', () => { diff --git a/ts/test-node/reactions/preferredReactionEmoji_test.ts b/ts/test-node/reactions/preferredReactionEmoji_test.ts index 62e18a08ab..7da7c24de4 100644 --- a/ts/test-node/reactions/preferredReactionEmoji_test.ts +++ b/ts/test-node/reactions/preferredReactionEmoji_test.ts @@ -6,8 +6,8 @@ import { assert } from 'chai'; import { canBeSynced, getPreferredReactionEmoji, -} from '../../reactions/preferredReactionEmoji.js'; -import { EmojiSkinTone } from '../../components/fun/data/emojis.js'; +} from '../../reactions/preferredReactionEmoji.std.js'; +import { EmojiSkinTone } from '../../components/fun/data/emojis.std.js'; describe('preferred reaction emoji utilities', () => { describe('getPreferredReactionEmoji', () => { diff --git a/ts/test-node/reactions/util_test.ts b/ts/test-node/reactions/util_test.ts index 7c87d9fee7..233e225259 100644 --- a/ts/test-node/reactions/util_test.ts +++ b/ts/test-node/reactions/util_test.ts @@ -5,7 +5,7 @@ import { assert } from 'chai'; import { v4 as uuid } from 'uuid'; import lodash from 'lodash'; import type { MessageReactionType } from '../../model-types.d.ts'; -import { isEmpty } from '../../util/iterables.js'; +import { isEmpty } from '../../util/iterables.std.js'; import { addOutgoingReaction, @@ -13,7 +13,7 @@ import { getUnsentConversationIds, markOutgoingReactionFailed, markOutgoingReactionSent, -} from '../../reactions/util.js'; +} from '../../reactions/util.std.js'; const { omit } = lodash; diff --git a/ts/test-node/services/donations_test.ts b/ts/test-node/services/donations_test.ts index f179a33990..59f20133ae 100644 --- a/ts/test-node/services/donations_test.ts +++ b/ts/test-node/services/donations_test.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { phoneNumberToCurrencyCode } from '../../services/donations.js'; +import { phoneNumberToCurrencyCode } from '../../services/donations.preload.js'; describe('donations', () => { describe('phoneNumberToCurrency', () => { diff --git a/ts/test-node/services/expiring/createExpiringEntityCleanupService_test.ts b/ts/test-node/services/expiring/createExpiringEntityCleanupService_test.ts index 20d2f09ce5..3514791941 100644 --- a/ts/test-node/services/expiring/createExpiringEntityCleanupService_test.ts +++ b/ts/test-node/services/expiring/createExpiringEntityCleanupService_test.ts @@ -4,8 +4,8 @@ import assert from 'node:assert/strict'; import type { ExpiringEntity, ExpiringEntityCleanupService, -} from '../../../services/expiring/createExpiringEntityCleanupService.js'; -import { createExpiringEntityCleanupService } from '../../../services/expiring/createExpiringEntityCleanupService.js'; +} from '../../../services/expiring/createExpiringEntityCleanupService.std.js'; +import { createExpiringEntityCleanupService } from '../../../services/expiring/createExpiringEntityCleanupService.std.js'; function waitForMicrotasks() { return new Promise(resolve => { diff --git a/ts/test-node/services/ourProfileKey_test.ts b/ts/test-node/services/ourProfileKey_test.ts index eb1b173896..d5ac5f5476 100644 --- a/ts/test-node/services/ourProfileKey_test.ts +++ b/ts/test-node/services/ourProfileKey_test.ts @@ -4,10 +4,10 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; import lodash from 'lodash'; -import { sleep } from '../../util/sleep.js'; +import { sleep } from '../../util/sleep.std.js'; -import { constantTimeEqual } from '../../Crypto.js'; -import { OurProfileKeyService } from '../../services/ourProfileKey.js'; +import { constantTimeEqual } from '../../Crypto.node.js'; +import { OurProfileKeyService } from '../../services/ourProfileKey.std.js'; const { noop } = lodash; diff --git a/ts/test-node/services/retryPlaceholders_test.ts b/ts/test-node/services/retryPlaceholders_test.ts index 64743359cb..a521a9ec07 100644 --- a/ts/test-node/services/retryPlaceholders_test.ts +++ b/ts/test-node/services/retryPlaceholders_test.ts @@ -4,13 +4,13 @@ import { assert } from 'chai'; import sinon from 'sinon'; -import { generateAci } from '../../types/ServiceId.js'; -import type { RetryItemType } from '../../services/retryPlaceholders.js'; +import { generateAci } from '../../types/ServiceId.std.js'; +import type { RetryItemType } from '../../services/retryPlaceholders.std.js'; import { getDeltaIntoPast, RetryPlaceholders, STORAGE_KEY, -} from '../../services/retryPlaceholders.js'; +} from '../../services/retryPlaceholders.std.js'; describe('RetryPlaceholders', () => { const NOW = 1_000_000; diff --git a/ts/test-node/sql/cleanDataForIpc_test.ts b/ts/test-node/sql/cleanDataForIpc_test.ts index 79e3c59e74..f2e688850a 100644 --- a/ts/test-node/sql/cleanDataForIpc_test.ts +++ b/ts/test-node/sql/cleanDataForIpc_test.ts @@ -4,7 +4,7 @@ import { assert } from 'chai'; import lodash from 'lodash'; -import { cleanDataForIpc } from '../../sql/cleanDataForIpc.js'; +import { cleanDataForIpc } from '../../sql/cleanDataForIpc.std.js'; const { noop } = lodash; diff --git a/ts/test-node/sql/cleanMessageData_test.ts b/ts/test-node/sql/cleanMessageData_test.ts index 6efce60d2e..1b496ded65 100644 --- a/ts/test-node/sql/cleanMessageData_test.ts +++ b/ts/test-node/sql/cleanMessageData_test.ts @@ -3,8 +3,8 @@ import { assert } from 'chai'; -import { _cleanMessageData } from '../../sql/Client.js'; -import { IMAGE_GIF } from '../../types/MIME.js'; +import { _cleanMessageData } from '../../sql/Client.preload.js'; +import { IMAGE_GIF } from '../../types/MIME.std.js'; describe('_cleanMessageData', () => { it('throws if message is missing received_at', () => { diff --git a/ts/test-node/sql/helpers.ts b/ts/test-node/sql/helpers.ts index 5db021edfa..1992147d9b 100644 --- a/ts/test-node/sql/helpers.ts +++ b/ts/test-node/sql/helpers.ts @@ -4,10 +4,10 @@ import lodash from 'lodash'; import SQL from '@signalapp/sqlcipher'; -import type { ReadableDB, WritableDB } from '../../sql/Interface.js'; -import type { QueryTemplate } from '../../sql/util.js'; -import { SCHEMA_VERSIONS } from '../../sql/migrations/index.js'; -import { consoleLogger } from '../../util/consoleLogger.js'; +import type { ReadableDB, WritableDB } from '../../sql/Interface.std.js'; +import type { QueryTemplate } from '../../sql/util.std.js'; +import { SCHEMA_VERSIONS } from '../../sql/migrations/index.node.js'; +import { consoleLogger } from '../../util/consoleLogger.std.js'; const { noop } = lodash; diff --git a/ts/test-node/sql/incrementMessagesMigrationAttempts_test.ts b/ts/test-node/sql/incrementMessagesMigrationAttempts_test.ts index d6e3929229..75da131285 100644 --- a/ts/test-node/sql/incrementMessagesMigrationAttempts_test.ts +++ b/ts/test-node/sql/incrementMessagesMigrationAttempts_test.ts @@ -3,12 +3,12 @@ import { assert } from 'chai'; -import type { WritableDB } from '../../sql/Interface.js'; +import type { WritableDB } from '../../sql/Interface.std.js'; import { incrementMessagesMigrationAttempts, setupTests, -} from '../../sql/Server.js'; -import { createDB, insertData, getTableData } from './helpers.js'; +} from '../../sql/Server.node.js'; +import { createDB, insertData, getTableData } from './helpers.node.js'; describe('SQL/incrementMessagesMigrationAttempts', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migrateConversationMessages_test.ts b/ts/test-node/sql/migrateConversationMessages_test.ts index ecffe77524..2d346b2a44 100644 --- a/ts/test-node/sql/migrateConversationMessages_test.ts +++ b/ts/test-node/sql/migrateConversationMessages_test.ts @@ -3,9 +3,12 @@ import { assert } from 'chai'; -import type { WritableDB } from '../../sql/Interface.js'; -import { migrateConversationMessages, setupTests } from '../../sql/Server.js'; -import { createDB, insertData, getTableData } from './helpers.js'; +import type { WritableDB } from '../../sql/Interface.std.js'; +import { + migrateConversationMessages, + setupTests, +} from '../../sql/Server.node.js'; +import { createDB, insertData, getTableData } from './helpers.node.js'; describe('SQL/migrateConversationMessages', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migration_1000_test.ts b/ts/test-node/sql/migration_1000_test.ts index 700d01ec65..9d4fffbb9d 100644 --- a/ts/test-node/sql/migration_1000_test.ts +++ b/ts/test-node/sql/migration_1000_test.ts @@ -4,11 +4,11 @@ import { assert } from 'chai'; import { v4 as generateGuid } from 'uuid'; -import { jsonToObject, sql } from '../../sql/util.js'; -import { createDB, updateToVersion } from './helpers.js'; -import type { WritableDB, MessageType } from '../../sql/Interface.js'; -import { ReadStatus } from '../../messages/MessageReadStatus.js'; -import { SeenStatus } from '../../MessageSeenStatus.js'; +import { jsonToObject, sql } from '../../sql/util.std.js'; +import { createDB, updateToVersion } from './helpers.node.js'; +import type { WritableDB, MessageType } from '../../sql/Interface.std.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.std.js'; +import { SeenStatus } from '../../MessageSeenStatus.std.js'; describe('SQL/updateToSchemaVersion1000', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migration_1020_test.ts b/ts/test-node/sql/migration_1020_test.ts index 945ef420d0..430a23ac53 100644 --- a/ts/test-node/sql/migration_1020_test.ts +++ b/ts/test-node/sql/migration_1020_test.ts @@ -4,14 +4,14 @@ import { assert } from 'chai'; import { v4 as generateGuid } from 'uuid'; -import { normalizeAci } from '../../util/normalizeAci.js'; -import type { WritableDB } from '../../sql/Interface.js'; +import { normalizeAci } from '../../util/normalizeAci.std.js'; +import type { WritableDB } from '../../sql/Interface.std.js'; import { createDB, insertData, getTableData, updateToVersion, -} from './helpers.js'; +} from './helpers.node.js'; describe('SQL/updateToSchemaVersion1020', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migration_1030_test.ts b/ts/test-node/sql/migration_1030_test.ts index 63990c63d5..07be8d69f9 100644 --- a/ts/test-node/sql/migration_1030_test.ts +++ b/ts/test-node/sql/migration_1030_test.ts @@ -3,10 +3,10 @@ import { assert } from 'chai'; import { v4 as generateGuid } from 'uuid'; -import { sql } from '../../sql/util.js'; -import { createDB, updateToVersion } from './helpers.js'; -import type { WritableDB, MessageType } from '../../sql/Interface.js'; -import { MessageRequestResponseEvent } from '../../types/MessageRequestResponseEvent.js'; +import { sql } from '../../sql/util.std.js'; +import { createDB, updateToVersion } from './helpers.node.js'; +import type { WritableDB, MessageType } from '../../sql/Interface.std.js'; +import { MessageRequestResponseEvent } from '../../types/MessageRequestResponseEvent.std.js'; describe('SQL/updateToSchemaVersion1030', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migration_1040_test.ts b/ts/test-node/sql/migration_1040_test.ts index 22cb5fceaf..a18f67f87d 100644 --- a/ts/test-node/sql/migration_1040_test.ts +++ b/ts/test-node/sql/migration_1040_test.ts @@ -3,15 +3,20 @@ import lodash from 'lodash'; import { assert } from 'chai'; -import type { ReadableDB, WritableDB } from '../../sql/Interface.js'; -import { jsonToObject, objectToJSON, sql, sqlJoin } from '../../sql/util.js'; -import { createDB, updateToVersion, explain } from './helpers.js'; +import type { ReadableDB, WritableDB } from '../../sql/Interface.std.js'; +import { + jsonToObject, + objectToJSON, + sql, + sqlJoin, +} from '../../sql/util.std.js'; +import { createDB, updateToVersion, explain } from './helpers.node.js'; import type { _AttachmentDownloadJobTypeV1030, _AttachmentDownloadJobTypeV1040, -} from '../../sql/migrations/1040-undownloaded-backed-up-media.js'; -import type { AttachmentType } from '../../types/Attachment.js'; -import { IMAGE_JPEG } from '../../types/MIME.js'; +} from '../../sql/migrations/1040-undownloaded-backed-up-media.std.js'; +import type { AttachmentType } from '../../types/Attachment.std.js'; +import { IMAGE_JPEG } from '../../types/MIME.std.js'; const { omit } = lodash; diff --git a/ts/test-node/sql/migration_1060_test.ts b/ts/test-node/sql/migration_1060_test.ts index 89e3299f1c..b588ebb8d7 100644 --- a/ts/test-node/sql/migration_1060_test.ts +++ b/ts/test-node/sql/migration_1060_test.ts @@ -8,19 +8,24 @@ import { dequeueOldestSyncTasks, removeSyncTaskById, saveSyncTasks, -} from '../../sql/Server.js'; +} from '../../sql/Server.node.js'; import type { WritableDB, ReadableDB, MessageType, -} from '../../sql/Interface.js'; -import { sql, jsonToObject } from '../../sql/util.js'; -import { insertData, updateToVersion, createDB, explain } from './helpers.js'; -import { MAX_SYNC_TASK_ATTEMPTS } from '../../util/syncTasks.types.js'; -import { WEEK } from '../../util/durations/index.js'; +} from '../../sql/Interface.std.js'; +import { sql, jsonToObject } from '../../sql/util.std.js'; +import { + insertData, + updateToVersion, + createDB, + explain, +} from './helpers.node.js'; +import { MAX_SYNC_TASK_ATTEMPTS } from '../../util/syncTasks.types.std.js'; +import { WEEK } from '../../util/durations/index.std.js'; -import type { MessageAttributesType } from '../../model-types.js'; -import type { SyncTaskType } from '../../util/syncTasks.js'; +import type { MessageAttributesType } from '../../model-types.d.ts'; +import type { SyncTaskType } from '../../util/syncTasks.preload.js'; /* eslint-disable camelcase */ diff --git a/ts/test-node/sql/migration_1080_test.ts b/ts/test-node/sql/migration_1080_test.ts index d32a8fd1ab..58752e233d 100644 --- a/ts/test-node/sql/migration_1080_test.ts +++ b/ts/test-node/sql/migration_1080_test.ts @@ -8,12 +8,17 @@ import type { WritableDB, ReadableDB, MessageType, -} from '../../sql/Interface.js'; -import { sql, jsonToObject } from '../../sql/util.js'; -import { createDB, insertData, updateToVersion, explain } from './helpers.js'; +} from '../../sql/Interface.std.js'; +import { sql, jsonToObject } from '../../sql/util.std.js'; +import { + createDB, + insertData, + updateToVersion, + explain, +} from './helpers.node.js'; -import type { MessageAttributesType } from '../../model-types.js'; -import { DurationInSeconds } from '../../util/durations/duration-in-seconds.js'; +import type { MessageAttributesType } from '../../model-types.d.ts'; +import { DurationInSeconds } from '../../util/durations/duration-in-seconds.std.js'; /* eslint-disable camelcase */ diff --git a/ts/test-node/sql/migration_1090_test.ts b/ts/test-node/sql/migration_1090_test.ts index 1f7458b768..05f4ba7601 100644 --- a/ts/test-node/sql/migration_1090_test.ts +++ b/ts/test-node/sql/migration_1090_test.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import type { WritableDB } from '../../sql/Interface.js'; -import { sql } from '../../sql/util.js'; -import { createDB, updateToVersion, explain } from './helpers.js'; +import type { WritableDB } from '../../sql/Interface.std.js'; +import { sql } from '../../sql/util.std.js'; +import { createDB, updateToVersion, explain } from './helpers.node.js'; describe('SQL/updateToSchemaVersion1090', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migration_1100_test.ts b/ts/test-node/sql/migration_1100_test.ts index 7d74028435..3b83da02ce 100644 --- a/ts/test-node/sql/migration_1100_test.ts +++ b/ts/test-node/sql/migration_1100_test.ts @@ -3,17 +3,17 @@ import { assert } from 'chai'; import lodash from 'lodash'; -import type { WritableDB } from '../../sql/Interface.js'; -import { markAllCallHistoryRead } from '../../sql/Server.js'; -import { SeenStatus } from '../../MessageSeenStatus.js'; +import type { WritableDB } from '../../sql/Interface.std.js'; +import { markAllCallHistoryRead } from '../../sql/Server.node.js'; +import { SeenStatus } from '../../MessageSeenStatus.std.js'; import { CallMode, CallDirection, CallType, DirectCallStatus, -} from '../../types/CallDisposition.js'; -import { strictAssert } from '../../util/assert.js'; -import { createDB, insertData, updateToVersion } from './helpers.js'; +} from '../../types/CallDisposition.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { createDB, insertData, updateToVersion } from './helpers.node.js'; const { findLast } = lodash; diff --git a/ts/test-node/sql/migration_1120_test.ts b/ts/test-node/sql/migration_1120_test.ts index c2d915ade9..07d7aca8e7 100644 --- a/ts/test-node/sql/migration_1120_test.ts +++ b/ts/test-node/sql/migration_1120_test.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import type { WritableDB } from '../../sql/Interface.js'; -import { sql } from '../../sql/util.js'; -import { createDB, updateToVersion, explain } from './helpers.js'; +import type { WritableDB } from '../../sql/Interface.std.js'; +import { sql } from '../../sql/util.std.js'; +import { createDB, updateToVersion, explain } from './helpers.node.js'; describe('SQL/updateToSchemaVersion1120', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migration_1130_test.ts b/ts/test-node/sql/migration_1130_test.ts index 747f340ba9..806685bfe9 100644 --- a/ts/test-node/sql/migration_1130_test.ts +++ b/ts/test-node/sql/migration_1130_test.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import type { WritableDB } from '../../sql/Interface.js'; -import { sql } from '../../sql/util.js'; -import { createDB, updateToVersion, explain } from './helpers.js'; +import type { WritableDB } from '../../sql/Interface.std.js'; +import { sql } from '../../sql/util.std.js'; +import { createDB, updateToVersion, explain } from './helpers.node.js'; describe('SQL/updateToSchemaVersion1130', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migration_1180_test.ts b/ts/test-node/sql/migration_1180_test.ts index 6ad88034dd..62ab331016 100644 --- a/ts/test-node/sql/migration_1180_test.ts +++ b/ts/test-node/sql/migration_1180_test.ts @@ -3,11 +3,11 @@ import { assert } from 'chai'; import lodash from 'lodash'; -import type { WritableDB } from '../../sql/Interface.js'; -import { createDB, updateToVersion, explain } from './helpers.js'; -import { jsonToObject, objectToJSON, sql } from '../../sql/util.js'; -import { IMAGE_BMP } from '../../types/MIME.js'; -import type { _AttachmentDownloadJobTypeV1040 } from '../../sql/migrations/1040-undownloaded-backed-up-media.js'; +import type { WritableDB } from '../../sql/Interface.std.js'; +import { createDB, updateToVersion, explain } from './helpers.node.js'; +import { jsonToObject, objectToJSON, sql } from '../../sql/util.std.js'; +import { IMAGE_BMP } from '../../types/MIME.std.js'; +import type { _AttachmentDownloadJobTypeV1040 } from '../../sql/migrations/1040-undownloaded-backed-up-media.std.js'; const { omit } = lodash; diff --git a/ts/test-node/sql/migration_1200_test.ts b/ts/test-node/sql/migration_1200_test.ts index 0fae1bdc76..acaec9c4f6 100644 --- a/ts/test-node/sql/migration_1200_test.ts +++ b/ts/test-node/sql/migration_1200_test.ts @@ -6,11 +6,11 @@ import { assert } from 'chai'; import { AttachmentDownloadSource, type WritableDB, -} from '../../sql/Interface.js'; -import { objectToJSON, sql } from '../../sql/util.js'; -import { createDB, updateToVersion, explain } from './helpers.js'; -import { IMAGE_JPEG } from '../../types/MIME.js'; -import type { _AttachmentDownloadJobTypeV1040 } from '../../sql/migrations/1040-undownloaded-backed-up-media.js'; +} from '../../sql/Interface.std.js'; +import { objectToJSON, sql } from '../../sql/util.std.js'; +import { createDB, updateToVersion, explain } from './helpers.node.js'; +import { IMAGE_JPEG } from '../../types/MIME.std.js'; +import type { _AttachmentDownloadJobTypeV1040 } from '../../sql/migrations/1040-undownloaded-backed-up-media.std.js'; type UnflattenedAttachmentDownloadJobType = Omit< _AttachmentDownloadJobTypeV1040, diff --git a/ts/test-node/sql/migration_1220_test.ts b/ts/test-node/sql/migration_1220_test.ts index c03f0f3135..da78956a81 100644 --- a/ts/test-node/sql/migration_1220_test.ts +++ b/ts/test-node/sql/migration_1220_test.ts @@ -3,18 +3,18 @@ import { assert } from 'chai'; -import { type WritableDB } from '../../sql/Interface.js'; +import { type WritableDB } from '../../sql/Interface.std.js'; import { sessionRecordToProtobuf, sessionStructureToBytes, -} from '../../util/sessionTranslation.js'; +} from '../../util/sessionTranslation.node.js'; import { createDB, updateToVersion, insertData, getTableData, -} from './helpers.js'; -import { SESSION_V1_RECORD } from '../util/sessionTranslation_test.js'; +} from './helpers.node.js'; +import { SESSION_V1_RECORD } from '../util/sessionTranslation_test.node.js'; const MAPS = [ { diff --git a/ts/test-node/sql/migration_1280_test.ts b/ts/test-node/sql/migration_1280_test.ts index f6f75ace0e..34b8ec75dd 100644 --- a/ts/test-node/sql/migration_1280_test.ts +++ b/ts/test-node/sql/migration_1280_test.ts @@ -3,15 +3,15 @@ import { assert } from 'chai'; -import { type WritableDB } from '../../sql/Interface.js'; -import { Migrations as Proto } from '../../protobuf/index.js'; -import { generateAci } from '../../types/ServiceId.js'; +import { type WritableDB } from '../../sql/Interface.std.js'; +import { Migrations as Proto } from '../../protobuf/index.std.js'; +import { generateAci } from '../../types/ServiceId.std.js'; import { createDB, updateToVersion, insertData, getTableData, -} from './helpers.js'; +} from './helpers.node.js'; describe('SQL/updateToSchemaVersion1280', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migration_1290_test.ts b/ts/test-node/sql/migration_1290_test.ts index 91c51fb2f0..13627772dc 100644 --- a/ts/test-node/sql/migration_1290_test.ts +++ b/ts/test-node/sql/migration_1290_test.ts @@ -3,13 +3,13 @@ import { assert } from 'chai'; -import { type WritableDB } from '../../sql/Interface.js'; +import { type WritableDB } from '../../sql/Interface.std.js'; import { createDB, updateToVersion, insertData, getTableData, -} from './helpers.js'; +} from './helpers.node.js'; const DEFAULTS = { id: 'id', diff --git a/ts/test-node/sql/migration_1310_test.ts b/ts/test-node/sql/migration_1310_test.ts index e3209418f5..bfc3dad7b3 100644 --- a/ts/test-node/sql/migration_1310_test.ts +++ b/ts/test-node/sql/migration_1310_test.ts @@ -3,13 +3,13 @@ import { assert } from 'chai'; -import { type WritableDB } from '../../sql/Interface.js'; +import { type WritableDB } from '../../sql/Interface.std.js'; import { createDB, updateToVersion, insertData, getTableData, -} from './helpers.js'; +} from './helpers.node.js'; describe('SQL/updateToSchemaVersion1310', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migration_1330_test.ts b/ts/test-node/sql/migration_1330_test.ts index e48f6aa934..7f995b038b 100644 --- a/ts/test-node/sql/migration_1330_test.ts +++ b/ts/test-node/sql/migration_1330_test.ts @@ -8,12 +8,12 @@ import { dequeueOldestSyncTasks, saveSyncTasks, incrementAllSyncTaskAttempts, -} from '../../sql/Server.js'; -import { sql } from '../../sql/util.js'; -import type { WritableDB } from '../../sql/Interface.js'; -import { updateToVersion, createDB, explain } from './helpers.js'; +} from '../../sql/Server.node.js'; +import { sql } from '../../sql/util.std.js'; +import type { WritableDB } from '../../sql/Interface.std.js'; +import { updateToVersion, createDB, explain } from './helpers.node.js'; -import type { SyncTaskType } from '../../util/syncTasks.js'; +import type { SyncTaskType } from '../../util/syncTasks.preload.js'; describe('SQL/updateToSchemaVersion1330', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migration_1350_test.ts b/ts/test-node/sql/migration_1350_test.ts index c518d0fafa..4f96fa2e7e 100644 --- a/ts/test-node/sql/migration_1350_test.ts +++ b/ts/test-node/sql/migration_1350_test.ts @@ -1,9 +1,9 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { sql } from '../../sql/util.js'; -import type { WritableDB } from '../../sql/Interface.js'; -import { updateToVersion, createDB } from './helpers.js'; +import { sql } from '../../sql/util.std.js'; +import type { WritableDB } from '../../sql/Interface.std.js'; +import { updateToVersion, createDB } from './helpers.node.js'; describe('SQL/updateToSchemaVersion1350', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migration_1360_test.ts b/ts/test-node/sql/migration_1360_test.ts index 74654df7f5..541db0b677 100644 --- a/ts/test-node/sql/migration_1360_test.ts +++ b/ts/test-node/sql/migration_1360_test.ts @@ -3,9 +3,9 @@ import { assert } from 'chai'; -import { sql } from '../../sql/util.js'; -import { createDB, explain, updateToVersion } from './helpers.js'; -import type { WritableDB } from '../../sql/Interface.js'; +import { sql } from '../../sql/util.std.js'; +import { createDB, explain, updateToVersion } from './helpers.node.js'; +import type { WritableDB } from '../../sql/Interface.std.js'; describe('SQL/updateToSchemaVersion1360', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migration_1380_test.ts b/ts/test-node/sql/migration_1380_test.ts index e60a421ad7..1356823792 100644 --- a/ts/test-node/sql/migration_1380_test.ts +++ b/ts/test-node/sql/migration_1380_test.ts @@ -4,16 +4,16 @@ import { assert } from 'chai'; import { v1 as getGuid } from 'uuid'; -import { sql } from '../../sql/util.js'; +import { sql } from '../../sql/util.std.js'; import { updateToVersion, createDB, explain, insertData, getTableData, -} from './helpers.js'; +} from './helpers.node.js'; -import type { WritableDB } from '../../sql/Interface.js'; +import type { WritableDB } from '../../sql/Interface.std.js'; describe('SQL/updateToSchemaVersion1380', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migration_1410_test.ts b/ts/test-node/sql/migration_1410_test.ts index 164f40a44c..07e343bf7a 100644 --- a/ts/test-node/sql/migration_1410_test.ts +++ b/ts/test-node/sql/migration_1410_test.ts @@ -3,14 +3,14 @@ import { assert } from 'chai'; -import { type WritableDB } from '../../sql/Interface.js'; +import { type WritableDB } from '../../sql/Interface.std.js'; import { createDB, updateToVersion, insertData, getTableData, -} from './helpers.js'; -import { createOrUpdate, getById } from '../../sql/util.js'; +} from './helpers.node.js'; +import { createOrUpdate, getById } from '../../sql/util.std.js'; describe('SQL/updateToSchemaVersion1410', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migration_1420_test.ts b/ts/test-node/sql/migration_1420_test.ts index 13836837c5..0682fcfe7f 100644 --- a/ts/test-node/sql/migration_1420_test.ts +++ b/ts/test-node/sql/migration_1420_test.ts @@ -6,11 +6,11 @@ import { assert } from 'chai'; import { AttachmentDownloadSource, type WritableDB, -} from '../../sql/Interface.js'; -import { objectToJSON, sql } from '../../sql/util.js'; -import { createDB, updateToVersion } from './helpers.js'; -import type { AttachmentDownloadJobType } from '../../types/AttachmentDownload.js'; -import { createAttachmentDownloadJob } from '../../test-helpers/attachmentDownloads.js'; +} from '../../sql/Interface.std.js'; +import { objectToJSON, sql } from '../../sql/util.std.js'; +import { createDB, updateToVersion } from './helpers.node.js'; +import type { AttachmentDownloadJobType } from '../../types/AttachmentDownload.std.js'; +import { createAttachmentDownloadJob } from '../../test-helpers/attachmentDownloads.std.js'; function createJobAndEnsureMessage( db: WritableDB, diff --git a/ts/test-node/sql/migration_87_test.ts b/ts/test-node/sql/migration_87_test.ts index d0f6b2b5eb..754a7df32d 100644 --- a/ts/test-node/sql/migration_87_test.ts +++ b/ts/test-node/sql/migration_87_test.ts @@ -5,20 +5,20 @@ import { assert } from 'chai'; import { v4 as generateGuid } from 'uuid'; import lodash from 'lodash'; -import { createDB, insertData, updateToVersion } from './helpers.js'; +import { createDB, insertData, updateToVersion } from './helpers.node.js'; import type { AciString, PniString, ServiceIdString, -} from '../../types/ServiceId.js'; -import { normalizePni } from '../../types/ServiceId.js'; -import { normalizeAci } from '../../util/normalizeAci.js'; +} from '../../types/ServiceId.std.js'; +import { normalizePni } from '../../types/ServiceId.std.js'; +import { normalizeAci } from '../../util/normalizeAci.std.js'; import type { WritableDB, KyberPreKeyType, PreKeyType, SignedPreKeyType, -} from '../../sql/Interface.js'; +} from '../../sql/Interface.std.js'; const { range } = lodash; diff --git a/ts/test-node/sql/migration_88_test.ts b/ts/test-node/sql/migration_88_test.ts index 1b7d281345..fb70fd31b5 100644 --- a/ts/test-node/sql/migration_88_test.ts +++ b/ts/test-node/sql/migration_88_test.ts @@ -4,13 +4,13 @@ import { assert } from 'chai'; import { v4 as generateGuid } from 'uuid'; -import type { WritableDB } from '../../sql/Interface.js'; +import type { WritableDB } from '../../sql/Interface.std.js'; import { createDB, updateToVersion, insertData, getTableData, -} from './helpers.js'; +} from './helpers.node.js'; const CONVO_ID = generateGuid(); const GROUP_ID = generateGuid(); diff --git a/ts/test-node/sql/migration_89_test.ts b/ts/test-node/sql/migration_89_test.ts index 46c843739d..5ad2e29e29 100644 --- a/ts/test-node/sql/migration_89_test.ts +++ b/ts/test-node/sql/migration_89_test.ts @@ -4,7 +4,7 @@ import { assert } from 'chai'; import { v4 as generateGuid } from 'uuid'; -import { jsonToObject, sql } from '../../sql/util.js'; +import { jsonToObject, sql } from '../../sql/util.std.js'; import { CallMode, CallDirection, @@ -12,17 +12,17 @@ import { DirectCallStatus, GroupCallStatus, callHistoryDetailsSchema, -} from '../../types/CallDisposition.js'; -import type { CallHistoryDetails } from '../../types/CallDisposition.js'; +} from '../../types/CallDisposition.std.js'; +import type { CallHistoryDetails } from '../../types/CallDisposition.std.js'; import type { CallHistoryDetailsFromDiskType, MessageWithCallHistoryDetails, -} from '../../sql/migrations/89-call-history.js'; -import { getCallIdFromEra } from '../../util/callDisposition.js'; -import { isValidUuid } from '../../util/isValidUuid.js'; -import { createDB, updateToVersion } from './helpers.js'; -import type { WritableDB, MessageType } from '../../sql/Interface.js'; -import { parsePartial } from '../../util/schemas.js'; +} from '../../sql/migrations/89-call-history.node.js'; +import { getCallIdFromEra } from '../../util/callDisposition.preload.js'; +import { isValidUuid } from '../../util/isValidUuid.std.js'; +import { createDB, updateToVersion } from './helpers.node.js'; +import type { WritableDB, MessageType } from '../../sql/Interface.std.js'; +import { parsePartial } from '../../util/schemas.std.js'; describe('SQL/updateToSchemaVersion89', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migration_90_test.ts b/ts/test-node/sql/migration_90_test.ts index 052f1d06c5..ff4c2d80ae 100644 --- a/ts/test-node/sql/migration_90_test.ts +++ b/ts/test-node/sql/migration_90_test.ts @@ -3,15 +3,15 @@ import { assert } from 'chai'; -import type { WritableDB } from '../../sql/Interface.js'; -import { sql } from '../../sql/util.js'; +import type { WritableDB } from '../../sql/Interface.std.js'; +import { sql } from '../../sql/util.std.js'; import { createDB, updateToVersion, insertData, getTableData, explain, -} from './helpers.js'; +} from './helpers.node.js'; describe('SQL/updateToSchemaVersion90', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migration_91_test.ts b/ts/test-node/sql/migration_91_test.ts index 7e4aee2f26..3f5cd977ee 100644 --- a/ts/test-node/sql/migration_91_test.ts +++ b/ts/test-node/sql/migration_91_test.ts @@ -10,11 +10,11 @@ import { getTableData, insertData, updateToVersion, -} from './helpers.js'; -import type { ServiceIdString } from '../../types/ServiceId.js'; -import { normalizePni } from '../../types/ServiceId.js'; -import { normalizeAci } from '../../util/normalizeAci.js'; -import type { WritableDB, PreKeyType } from '../../sql/Interface.js'; +} from './helpers.node.js'; +import type { ServiceIdString } from '../../types/ServiceId.std.js'; +import { normalizePni } from '../../types/ServiceId.std.js'; +import { normalizeAci } from '../../util/normalizeAci.std.js'; +import type { WritableDB, PreKeyType } from '../../sql/Interface.std.js'; const { range } = lodash; diff --git a/ts/test-node/sql/migration_920_test.ts b/ts/test-node/sql/migration_920_test.ts index 794e520e46..ab48ab8ea6 100644 --- a/ts/test-node/sql/migration_920_test.ts +++ b/ts/test-node/sql/migration_920_test.ts @@ -5,15 +5,15 @@ import { assert } from 'chai'; import { v4 as generateGuid } from 'uuid'; import lodash from 'lodash'; -import { createDB, insertData, updateToVersion } from './helpers.js'; -import type { ServiceIdString } from '../../types/ServiceId.js'; -import { normalizePni } from '../../types/ServiceId.js'; -import { normalizeAci } from '../../util/normalizeAci.js'; +import { createDB, insertData, updateToVersion } from './helpers.node.js'; +import type { ServiceIdString } from '../../types/ServiceId.std.js'; +import { normalizePni } from '../../types/ServiceId.std.js'; +import { normalizeAci } from '../../util/normalizeAci.std.js'; import type { WritableDB, KyberPreKeyType, SignedPreKeyType, -} from '../../sql/Interface.js'; +} from '../../sql/Interface.std.js'; const { range } = lodash; diff --git a/ts/test-node/sql/migration_960_test.ts b/ts/test-node/sql/migration_960_test.ts index 7e4c84dbdb..1de1392fc6 100644 --- a/ts/test-node/sql/migration_960_test.ts +++ b/ts/test-node/sql/migration_960_test.ts @@ -4,13 +4,13 @@ import { assert } from 'chai'; import { v4 as generateGuid } from 'uuid'; -import type { WritableDB } from '../../sql/Interface.js'; +import type { WritableDB } from '../../sql/Interface.std.js'; import { createDB, updateToVersion, insertData, getTableData, -} from './helpers.js'; +} from './helpers.node.js'; const CONVO_ID = generateGuid(); const OUR_ACI = generateGuid(); diff --git a/ts/test-node/sql/migration_990_test.ts b/ts/test-node/sql/migration_990_test.ts index 2e69b6770a..ae6a2366b5 100644 --- a/ts/test-node/sql/migration_990_test.ts +++ b/ts/test-node/sql/migration_990_test.ts @@ -3,13 +3,13 @@ import { assert } from 'chai'; -import type { WritableDB } from '../../sql/Interface.js'; +import type { WritableDB } from '../../sql/Interface.std.js'; import { createDB, updateToVersion, insertData, getTableData, -} from './helpers.js'; +} from './helpers.node.js'; describe('SQL/updateToSchemaVersion990', () => { let db: WritableDB; diff --git a/ts/test-node/sql/migrations_test.ts b/ts/test-node/sql/migrations_test.ts index adafdb79ce..eb306dae6d 100644 --- a/ts/test-node/sql/migrations_test.ts +++ b/ts/test-node/sql/migrations_test.ts @@ -8,15 +8,15 @@ import { _storyIdPredicate, getJobsInQueue, insertJob, -} from '../../sql/Server.js'; -import type { WritableDB } from '../../sql/Interface.js'; -import { ReadStatus } from '../../messages/MessageReadStatus.js'; -import { SeenStatus } from '../../MessageSeenStatus.js'; -import { objectToJSON, sql, sqlJoin } from '../../sql/util.js'; -import { BodyRange } from '../../types/BodyRange.js'; -import type { AciString } from '../../types/ServiceId.js'; -import { generateAci } from '../../types/ServiceId.js'; -import { createDB, updateToVersion, explain } from './helpers.js'; +} from '../../sql/Server.node.js'; +import type { WritableDB } from '../../sql/Interface.std.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.std.js'; +import { SeenStatus } from '../../MessageSeenStatus.std.js'; +import { objectToJSON, sql, sqlJoin } from '../../sql/util.std.js'; +import { BodyRange } from '../../types/BodyRange.std.js'; +import type { AciString } from '../../types/ServiceId.std.js'; +import { generateAci } from '../../types/ServiceId.std.js'; +import { createDB, updateToVersion, explain } from './helpers.node.js'; const OUR_UUID = generateGuid(); diff --git a/ts/test-node/state/ducks/audioPlayer_test.ts b/ts/test-node/state/ducks/audioPlayer_test.ts index 15720bfe75..85215172ee 100644 --- a/ts/test-node/state/ducks/audioPlayer_test.ts +++ b/ts/test-node/state/ducks/audioPlayer_test.ts @@ -3,20 +3,20 @@ import { assert } from 'chai'; -import type { TargetedConversationChangedActionType } from '../../../state/ducks/conversations.js'; +import type { TargetedConversationChangedActionType } from '../../../state/ducks/conversations.preload.js'; import { TARGETED_CONVERSATION_CHANGED, actions as conversationsActions, -} from '../../../state/ducks/conversations.js'; -import { noopAction } from '../../../state/ducks/noop.js'; +} from '../../../state/ducks/conversations.preload.js'; +import { noopAction } from '../../../state/ducks/noop.std.js'; -import type { StateType } from '../../../state/reducer.js'; -import { reducer as rootReducer } from '../../../state/reducer.js'; +import type { StateType } from '../../../state/reducer.preload.js'; +import { reducer as rootReducer } from '../../../state/reducer.preload.js'; import { actions, AudioPlayerContent, -} from '../../../state/ducks/audioPlayer.js'; -import type { VoiceNoteAndConsecutiveForPlayback } from '../../../state/selectors/audioPlayer.js'; +} from '../../../state/ducks/audioPlayer.preload.js'; +import type { VoiceNoteAndConsecutiveForPlayback } from '../../../state/selectors/audioPlayer.preload.js'; const { messageDeleted, messageChanged } = conversationsActions; diff --git a/ts/test-node/state/ducks/badges_test.ts b/ts/test-node/state/ducks/badges_test.ts index d877a112e0..70d7f71469 100644 --- a/ts/test-node/state/ducks/badges_test.ts +++ b/ts/test-node/state/ducks/badges_test.ts @@ -3,12 +3,12 @@ import { assert } from 'chai'; -import { getFakeBadge } from '../../../test-helpers/getFakeBadge.js'; -import { repeat, zipObject } from '../../../util/iterables.js'; -import { BadgeImageTheme } from '../../../badges/BadgeImageTheme.js'; +import { getFakeBadge } from '../../../test-helpers/getFakeBadge.std.js'; +import { repeat, zipObject } from '../../../util/iterables.std.js'; +import { BadgeImageTheme } from '../../../badges/BadgeImageTheme.std.js'; -import type { BadgesStateType } from '../../../state/ducks/badges.js'; -import { actions, reducer } from '../../../state/ducks/badges.js'; +import type { BadgesStateType } from '../../../state/ducks/badges.preload.js'; +import { actions, reducer } from '../../../state/ducks/badges.preload.js'; describe('both/state/ducks/badges', () => { describe('badgeImageFileDownloaded', () => { diff --git a/ts/test-node/state/ducks/composer_test.ts b/ts/test-node/state/ducks/composer_test.ts index 507f7cc525..ac3dcb4c23 100644 --- a/ts/test-node/state/ducks/composer_test.ts +++ b/ts/test-node/state/ducks/composer_test.ts @@ -6,19 +6,19 @@ import * as sinon from 'sinon'; import lodash from 'lodash'; import { v4 as generateUuid } from 'uuid'; -import type { ReduxActions } from '../../../state/types.js'; +import type { ReduxActions } from '../../../state/types.std.js'; import { actions, getComposerStateForConversation, getEmptyState, reducer, -} from '../../../state/ducks/composer.js'; -import { noopAction } from '../../../state/ducks/noop.js'; -import { reducer as rootReducer } from '../../../state/reducer.js'; +} from '../../../state/ducks/composer.preload.js'; +import { noopAction } from '../../../state/ducks/noop.std.js'; +import { reducer as rootReducer } from '../../../state/reducer.preload.js'; -import { IMAGE_JPEG } from '../../../types/MIME.js'; -import type { AttachmentDraftType } from '../../../types/Attachment.js'; -import { fakeDraftAttachment } from '../../../test-helpers/fakeAttachment.js'; +import { IMAGE_JPEG } from '../../../types/MIME.std.js'; +import type { AttachmentDraftType } from '../../../types/Attachment.std.js'; +import { fakeDraftAttachment } from '../../../test-helpers/fakeAttachment.std.js'; const { noop } = lodash; diff --git a/ts/test-node/state/ducks/donations_test.ts b/ts/test-node/state/ducks/donations_test.ts index 54279876da..a4b4ce3b20 100644 --- a/ts/test-node/state/ducks/donations_test.ts +++ b/ts/test-node/state/ducks/donations_test.ts @@ -4,15 +4,15 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import type { StateType } from '../../../state/reducer.js'; -import { reducer as rootReducer } from '../../../state/reducer.js'; -import { noopAction } from '../../../state/ducks/noop.js'; -import { applyDonationBadge } from '../../../state/ducks/donations.js'; -import * as conversations from '../../../state/ducks/conversations.js'; -import type { BadgeType } from '../../../badges/types.js'; -import { BadgeCategory } from '../../../badges/BadgeCategory.js'; -import type { ConversationType } from '../../../state/ducks/conversations.js'; -import { generateAci } from '../../../types/ServiceId.js'; +import type { StateType } from '../../../state/reducer.preload.js'; +import { reducer as rootReducer } from '../../../state/reducer.preload.js'; +import { noopAction } from '../../../state/ducks/noop.std.js'; +import { applyDonationBadge } from '../../../state/ducks/donations.preload.js'; +import * as conversations from '../../../state/ducks/conversations.preload.js'; +import type { BadgeType } from '../../../badges/types.std.js'; +import { BadgeCategory } from '../../../badges/BadgeCategory.std.js'; +import type { ConversationType } from '../../../state/ducks/conversations.preload.js'; +import { generateAci } from '../../../types/ServiceId.std.js'; describe('donations duck', () => { const getEmptyRootState = (): StateType => diff --git a/ts/test-node/state/ducks/globalModals_test.ts b/ts/test-node/state/ducks/globalModals_test.ts index 05d1fb4432..69bcb7ab01 100644 --- a/ts/test-node/state/ducks/globalModals_test.ts +++ b/ts/test-node/state/ducks/globalModals_test.ts @@ -7,7 +7,7 @@ import { actions, getEmptyState, reducer, -} from '../../../state/ducks/globalModals.js'; +} from '../../../state/ducks/globalModals.preload.js'; describe('both/state/ducks/globalModals', () => { describe('showWhatsNewModal/hideWhatsNewModal', () => { diff --git a/ts/test-node/state/ducks/linkPreviews_test.ts b/ts/test-node/state/ducks/linkPreviews_test.ts index c11f81d7c1..22c6231925 100644 --- a/ts/test-node/state/ducks/linkPreviews_test.ts +++ b/ts/test-node/state/ducks/linkPreviews_test.ts @@ -7,8 +7,8 @@ import { actions, getEmptyState, reducer, -} from '../../../state/ducks/linkPreviews.js'; -import type { LinkPreviewForUIType } from '../../../types/message/LinkPreviews.js'; +} from '../../../state/ducks/linkPreviews.preload.js'; +import type { LinkPreviewForUIType } from '../../../types/message/LinkPreviews.std.js'; describe('both/state/ducks/linkPreviews', () => { function getMockLinkPreview(): LinkPreviewForUIType { diff --git a/ts/test-node/state/ducks/network_test.ts b/ts/test-node/state/ducks/network_test.ts index cd3efe5ebc..befdeef3fe 100644 --- a/ts/test-node/state/ducks/network_test.ts +++ b/ts/test-node/state/ducks/network_test.ts @@ -7,7 +7,7 @@ import { actions, getEmptyState, reducer, -} from '../../../state/ducks/network.js'; +} from '../../../state/ducks/network.dom.js'; describe('both/state/ducks/network', () => { describe('setChallengeStatus', () => { diff --git a/ts/test-node/state/ducks/preferredReactions_test.ts b/ts/test-node/state/ducks/preferredReactions_test.ts index 6be9b1dc57..2b78f02f06 100644 --- a/ts/test-node/state/ducks/preferredReactions_test.ts +++ b/ts/test-node/state/ducks/preferredReactions_test.ts @@ -3,18 +3,18 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import type { StateType } from '../../../state/reducer.js'; -import { reducer as rootReducer } from '../../../state/reducer.js'; -import { noopAction } from '../../../state/ducks/noop.js'; +import type { StateType } from '../../../state/reducer.preload.js'; +import { reducer as rootReducer } from '../../../state/reducer.preload.js'; +import { noopAction } from '../../../state/ducks/noop.std.js'; -import type { PreferredReactionsStateType } from '../../../state/ducks/preferredReactions.js'; +import type { PreferredReactionsStateType } from '../../../state/ducks/preferredReactions.preload.js'; import { actions, getEmptyState, reducer, -} from '../../../state/ducks/preferredReactions.js'; -import { EmojiSkinTone } from '../../../components/fun/data/emojis.js'; -import { itemStorage } from '../../../textsecure/Storage.js'; +} from '../../../state/ducks/preferredReactions.preload.js'; +import { EmojiSkinTone } from '../../../components/fun/data/emojis.std.js'; +import { itemStorage } from '../../../textsecure/Storage.preload.js'; describe('preferred reactions duck', () => { const getEmptyRootState = (): StateType => diff --git a/ts/test-node/state/selectors/conversations_test.ts b/ts/test-node/state/selectors/conversations_test.ts index fa0d59bf2e..d920e97287 100644 --- a/ts/test-node/state/selectors/conversations_test.ts +++ b/ts/test-node/state/selectors/conversations_test.ts @@ -8,12 +8,12 @@ import { ComposerStep, ConversationVerificationState, OneTimeModalState, -} from '../../../state/ducks/conversationsEnums.js'; +} from '../../../state/ducks/conversationsEnums.std.js'; import type { ConversationLookupType, ConversationType, -} from '../../../state/ducks/conversations.js'; -import { getEmptyState } from '../../../state/ducks/conversations.js'; +} from '../../../state/ducks/conversations.preload.js'; +import { getEmptyState } from '../../../state/ducks/conversations.preload.js'; import { _getConversationComparator, _getLeftPaneLists, @@ -42,23 +42,23 @@ import { getSelectedConversationId, hasGroupCreationError, isCreatingGroup, -} from '../../../state/selectors/conversations.js'; -import { noopAction } from '../../../state/ducks/noop.js'; -import type { StateType } from '../../../state/reducer.js'; -import { reducer as rootReducer } from '../../../state/reducer.js'; -import i18n from '../../util/i18n.js'; -import type { ServiceIdString } from '../../../types/ServiceId.js'; -import { generateAci, getAciFromPrefix } from '../../../types/ServiceId.js'; +} from '../../../state/selectors/conversations.dom.js'; +import { noopAction } from '../../../state/ducks/noop.std.js'; +import type { StateType } from '../../../state/reducer.preload.js'; +import { reducer as rootReducer } from '../../../state/reducer.preload.js'; +import i18n from '../../util/i18n.node.js'; +import type { ServiceIdString } from '../../../types/ServiceId.std.js'; +import { generateAci, getAciFromPrefix } from '../../../types/ServiceId.std.js'; import { getDefaultConversation, getDefaultGroup, getDefaultConversationWithServiceId, -} from '../../../test-helpers/getDefaultConversation.js'; +} from '../../../test-helpers/getDefaultConversation.std.js'; import { defaultStartDirectConversationComposerState, defaultChooseGroupMembersComposerState, defaultSetGroupMetadataComposerState, -} from '../../../test-helpers/defaultComposerStates.js'; +} from '../../../test-helpers/defaultComposerStates.std.js'; describe('both/state/selectors/conversations-extra', () => { const SERVICE_ID_1 = generateAci(); diff --git a/ts/test-node/state/selectors/items_test.ts b/ts/test-node/state/selectors/items_test.ts index 1413c3d1cb..a37d5bc7b6 100644 --- a/ts/test-node/state/selectors/items_test.ts +++ b/ts/test-node/state/selectors/items_test.ts @@ -8,13 +8,13 @@ import { getPinnedConversationIds, getPreferredLeftPaneWidth, getPreferredReactionEmoji, -} from '../../../state/selectors/items.js'; -import type { StateType } from '../../../state/reducer.js'; -import type { ItemsStateType } from '../../../state/ducks/items.js'; +} from '../../../state/selectors/items.dom.js'; +import type { StateType } from '../../../state/reducer.preload.js'; +import type { ItemsStateType } from '../../../state/ducks/items.preload.js'; import { EMOJI_SKIN_TONE_ORDER, EmojiSkinTone, -} from '../../../components/fun/data/emojis.js'; +} from '../../../components/fun/data/emojis.std.js'; describe('both/state/selectors/items', () => { // Note: we would like to use the full reducer here, to get a real empty state object diff --git a/ts/test-node/state/selectors/preferredReactions_test.ts b/ts/test-node/state/selectors/preferredReactions_test.ts index 8faaee8726..d42b89edcd 100644 --- a/ts/test-node/state/selectors/preferredReactions_test.ts +++ b/ts/test-node/state/selectors/preferredReactions_test.ts @@ -2,12 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { reducer as rootReducer } from '../../../state/reducer.js'; -import { noopAction } from '../../../state/ducks/noop.js'; -import type { StateType } from '../../../state/reducer.js'; -import type { PreferredReactionsStateType } from '../../../state/ducks/preferredReactions.js'; +import { reducer as rootReducer } from '../../../state/reducer.preload.js'; +import { noopAction } from '../../../state/ducks/noop.std.js'; +import type { StateType } from '../../../state/reducer.preload.js'; +import type { PreferredReactionsStateType } from '../../../state/ducks/preferredReactions.preload.js'; -import { getIsCustomizingPreferredReactions } from '../../../state/selectors/preferredReactions.js'; +import { getIsCustomizingPreferredReactions } from '../../../state/selectors/preferredReactions.std.js'; describe('both/state/selectors/preferredReactions', () => { const getEmptyRootState = (): StateType => diff --git a/ts/test-node/state/selectors/search_test.ts b/ts/test-node/state/selectors/search_test.ts index 1b54cac0f3..b497c6ba29 100644 --- a/ts/test-node/state/selectors/search_test.ts +++ b/ts/test-node/state/selectors/search_test.ts @@ -7,29 +7,29 @@ import sinon from 'sinon'; import type { ConversationType, MessageType, -} from '../../../state/ducks/conversations.js'; -import { getEmptyState as getEmptyConversationState } from '../../../state/ducks/conversations.js'; -import { noopAction } from '../../../state/ducks/noop.js'; -import type { MessageSearchResultType } from '../../../state/ducks/search.js'; -import { getEmptyState as getEmptySearchState } from '../../../state/ducks/search.js'; -import { getEmptyState as getEmptyUserState } from '../../../state/ducks/user.js'; +} from '../../../state/ducks/conversations.preload.js'; +import { getEmptyState as getEmptyConversationState } from '../../../state/ducks/conversations.preload.js'; +import { noopAction } from '../../../state/ducks/noop.std.js'; +import type { MessageSearchResultType } from '../../../state/ducks/search.preload.js'; +import { getEmptyState as getEmptySearchState } from '../../../state/ducks/search.preload.js'; +import { getEmptyState as getEmptyUserState } from '../../../state/ducks/user.preload.js'; import { getIsSearching, getIsSearchingGlobally, getIsSearchingInAConversation, getMessageSearchResultSelector, getSearchResults, -} from '../../../state/selectors/search.js'; -import { makeLookup } from '../../../util/makeLookup.js'; -import { generateAci } from '../../../types/ServiceId.js'; +} from '../../../state/selectors/search.dom.js'; +import { makeLookup } from '../../../util/makeLookup.std.js'; +import { generateAci } from '../../../types/ServiceId.std.js'; import { getDefaultConversation, getDefaultConversationWithServiceId, -} from '../../../test-helpers/getDefaultConversation.js'; -import { ReadStatus } from '../../../messages/MessageReadStatus.js'; +} from '../../../test-helpers/getDefaultConversation.std.js'; +import { ReadStatus } from '../../../messages/MessageReadStatus.std.js'; -import type { StateType } from '../../../state/reducer.js'; -import { reducer as rootReducer } from '../../../state/reducer.js'; +import type { StateType } from '../../../state/reducer.preload.js'; +import { reducer as rootReducer } from '../../../state/reducer.preload.js'; describe('both/state/selectors/search', () => { const NOW = 1_000_000; diff --git a/ts/test-node/state/selectors/user_test.ts b/ts/test-node/state/selectors/user_test.ts index 12e9c8999b..e06b0cf1b0 100644 --- a/ts/test-node/state/selectors/user_test.ts +++ b/ts/test-node/state/selectors/user_test.ts @@ -3,11 +3,11 @@ import { assert } from 'chai'; -import type { StateType } from '../../../state/reducer.js'; -import type { UserStateType } from '../../../state/ducks/user.js'; -import { getEmptyState } from '../../../state/ducks/user.js'; +import type { StateType } from '../../../state/reducer.preload.js'; +import type { UserStateType } from '../../../state/ducks/user.preload.js'; +import { getEmptyState } from '../../../state/ducks/user.preload.js'; -import { getIsNightly, getIsBeta } from '../../../state/selectors/user.js'; +import { getIsNightly, getIsBeta } from '../../../state/selectors/user.std.js'; describe('both/state/selectors/user', () => { function getRootState( diff --git a/ts/test-node/types/Attachment_test.ts b/ts/test-node/types/Attachment_test.ts index 7dc7bd7dd9..0cb02069e4 100644 --- a/ts/test-node/types/Attachment_test.ts +++ b/ts/test-node/types/Attachment_test.ts @@ -3,19 +3,19 @@ import { assert } from 'chai'; -import * as Attachment from '../../util/Attachment.js'; +import * as Attachment from '../../util/Attachment.std.js'; import type { LocalAttachmentV2Type, AttachmentType, -} from '../../types/Attachment.js'; -import * as MIME from '../../types/MIME.js'; -import { SignalService } from '../../protobuf/index.js'; -import * as Bytes from '../../Bytes.js'; -import { createLogger } from '../../logging/log.js'; +} from '../../types/Attachment.std.js'; +import * as MIME from '../../types/MIME.std.js'; +import { SignalService } from '../../protobuf/index.std.js'; +import * as Bytes from '../../Bytes.std.js'; +import { createLogger } from '../../logging/log.std.js'; -import { fakeAttachment } from '../../test-helpers/fakeAttachment.js'; -import { DAY } from '../../util/durations/index.js'; -import { migrateDataToFileSystem } from '../../util/attachments/migrateDataToFilesystem.js'; +import { fakeAttachment } from '../../test-helpers/fakeAttachment.std.js'; +import { DAY } from '../../util/durations/index.std.js'; +import { migrateDataToFileSystem } from '../../util/attachments/migrateDataToFilesystem.std.js'; const logger = createLogger('Attachment_test'); diff --git a/ts/test-node/types/Avatar_test.ts b/ts/test-node/types/Avatar_test.ts index 4eaf45d5b9..ff49c94c44 100644 --- a/ts/test-node/types/Avatar_test.ts +++ b/ts/test-node/types/Avatar_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { getDefaultAvatars } from '../../types/Avatar.js'; +import { getDefaultAvatars } from '../../types/Avatar.std.js'; describe('Avatar', () => { describe('getDefaultAvatars', () => { diff --git a/ts/test-node/types/BodyRange_test.ts b/ts/test-node/types/BodyRange_test.ts index bdd3d23aae..979fae9e91 100644 --- a/ts/test-node/types/BodyRange_test.ts +++ b/ts/test-node/types/BodyRange_test.ts @@ -5,7 +5,7 @@ import { assert } from 'chai'; import type { HydratedBodyRangeMention, RangeNode, -} from '../../types/BodyRange.js'; +} from '../../types/BodyRange.std.js'; import { BodyRange, DisplayStyle, @@ -15,8 +15,8 @@ import { insertRange, processBodyRangesForSearchResult, trimMessageWhitespace, -} from '../../types/BodyRange.js'; -import { generateAci } from '../../types/ServiceId.js'; +} from '../../types/BodyRange.std.js'; +import { generateAci } from '../../types/ServiceId.std.js'; const SERVICE_ID_1 = generateAci(); const SERVICE_ID_2 = generateAci(); diff --git a/ts/test-node/types/DonationsCardForm_test.ts b/ts/test-node/types/DonationsCardForm_test.ts index bb776678c8..219825dd29 100644 --- a/ts/test-node/types/DonationsCardForm_test.ts +++ b/ts/test-node/types/DonationsCardForm_test.ts @@ -6,7 +6,7 @@ import type { CardFormFields, CardFormResult, CardFormSettings, -} from '../../types/DonationsCardForm.js'; +} from '../../types/DonationsCardForm.std.js'; import { CardCvcError, CardExpirationError, @@ -19,8 +19,8 @@ import { parseCardExpiration, parseCardForm, parseCardNumber, -} from '../../types/DonationsCardForm.js'; -import type { CardDetail } from '../../types/Donations.js'; +} from '../../types/DonationsCardForm.std.js'; +import type { CardDetail } from '../../types/Donations.std.js'; function testCard(cardNumber: string, cvcSize: number) { return { cardNumber, cvcSize }; diff --git a/ts/test-node/types/EmbeddedContact_test.ts b/ts/test-node/types/EmbeddedContact_test.ts index 7c1eb07b15..1d66ae771a 100644 --- a/ts/test-node/types/EmbeddedContact_test.ts +++ b/ts/test-node/types/EmbeddedContact_test.ts @@ -4,10 +4,10 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import { createLogger } from '../../logging/log.js'; -import { IMAGE_GIF, IMAGE_PNG } from '../../types/MIME.js'; +import { createLogger } from '../../logging/log.std.js'; +import { IMAGE_GIF, IMAGE_PNG } from '../../types/MIME.std.js'; import type { MessageAttributesType } from '../../model-types.d.ts'; -import type { Avatar, Email, Phone } from '../../types/EmbeddedContact.js'; +import type { Avatar, Email, Phone } from '../../types/EmbeddedContact.std.js'; import { _validate, ContactFormType, @@ -15,9 +15,9 @@ import { getName, parseAndWriteAvatar, parsePhoneItem, -} from '../../types/EmbeddedContact.js'; -import { fakeAttachment } from '../../test-helpers/fakeAttachment.js'; -import { generateAci } from '../../types/ServiceId.js'; +} from '../../types/EmbeddedContact.std.js'; +import { fakeAttachment } from '../../test-helpers/fakeAttachment.std.js'; +import { generateAci } from '../../types/ServiceId.std.js'; const logger = createLogger('EmbeddedContact_test'); diff --git a/ts/test-node/types/LinkPreview_test.ts b/ts/test-node/types/LinkPreview_test.ts index 302325dd16..d169e6e3ed 100644 --- a/ts/test-node/types/LinkPreview_test.ts +++ b/ts/test-node/types/LinkPreview_test.ts @@ -9,7 +9,7 @@ import { isValidLink, shouldLinkifyMessage, shouldPreviewHref, -} from '../../types/LinkPreview.js'; +} from '../../types/LinkPreview.std.js'; describe('Link previews', () => { describe('#isValidLink', () => { diff --git a/ts/test-node/types/MIME_test.ts b/ts/test-node/types/MIME_test.ts index c249483e87..71a9d21e8d 100644 --- a/ts/test-node/types/MIME_test.ts +++ b/ts/test-node/types/MIME_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import * as MIME from '../../types/MIME.js'; +import * as MIME from '../../types/MIME.std.js'; describe('MIME', () => { describe('isGif', () => { diff --git a/ts/test-node/types/Message2_test.ts b/ts/test-node/types/Message2_test.ts index e7d7b0a093..b1b39dd2e4 100644 --- a/ts/test-node/types/Message2_test.ts +++ b/ts/test-node/types/Message2_test.ts @@ -4,19 +4,19 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import * as Message from '../../types/Message2.js'; -import { SignalService } from '../../protobuf/index.js'; -import * as Bytes from '../../Bytes.js'; -import * as MIME from '../../types/MIME.js'; +import * as Message from '../../types/Message2.preload.js'; +import { SignalService } from '../../protobuf/index.std.js'; +import * as Bytes from '../../Bytes.std.js'; +import * as MIME from '../../types/MIME.std.js'; -import type { EmbeddedContactType } from '../../types/EmbeddedContact.js'; +import type { EmbeddedContactType } from '../../types/EmbeddedContact.std.js'; import type { MessageAttributesType } from '../../model-types.d.ts'; import type { AddressableAttachmentType, AttachmentType, LocalAttachmentV2Type, -} from '../../types/Attachment.js'; -import type { LoggerType } from '../../types/Logging.js'; +} from '../../types/Attachment.std.js'; +import type { LoggerType } from '../../types/Logging.std.js'; const FAKE_LOCAL_ATTACHMENT: LocalAttachmentV2Type = { version: 2, diff --git a/ts/test-node/types/NotificationProfile_test.ts b/ts/test-node/types/NotificationProfile_test.ts index bda70fc35a..5990735df4 100644 --- a/ts/test-node/types/NotificationProfile_test.ts +++ b/ts/test-node/types/NotificationProfile_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { DAY, HOUR, MINUTE } from '../../util/durations/index.js'; +import { DAY, HOUR, MINUTE } from '../../util/durations/index.std.js'; import { DayOfWeek, @@ -14,13 +14,13 @@ import { getStartTime, loopThroughWeek, sortProfiles, -} from '../../types/NotificationProfile.js'; -import { generateNotificationProfileId } from '../../types/NotificationProfile-node.js'; +} from '../../types/NotificationProfile.std.js'; +import { generateNotificationProfileId } from '../../types/NotificationProfile-node.node.js'; import type { NextProfileEvent, NotificationProfileType, -} from '../../types/NotificationProfile.js'; +} from '../../types/NotificationProfile.std.js'; describe('NotificationProfile', () => { const startingTime = Date.now(); diff --git a/ts/test-node/types/PhoneNumber_test.ts b/ts/test-node/types/PhoneNumber_test.ts index def7341636..3470a9498f 100644 --- a/ts/test-node/types/PhoneNumber_test.ts +++ b/ts/test-node/types/PhoneNumber_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { getCountryCode } from '../../types/PhoneNumber.js'; +import { getCountryCode } from '../../types/PhoneNumber.std.js'; describe('types/PhoneNumber', () => { describe('#getCountryCode', () => { diff --git a/ts/test-node/types/SchemaVersion_test.ts b/ts/test-node/types/SchemaVersion_test.ts index 19a799ddb2..a9e8de6b30 100644 --- a/ts/test-node/types/SchemaVersion_test.ts +++ b/ts/test-node/types/SchemaVersion_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { isValid } from '../../types/SchemaVersion.js'; +import { isValid } from '../../types/SchemaVersion.std.js'; describe('SchemaVersion', () => { describe('isValid', () => { diff --git a/ts/test-node/types/Settings_test.ts b/ts/test-node/types/Settings_test.ts index b8398ed8b3..0e522df670 100644 --- a/ts/test-node/types/Settings_test.ts +++ b/ts/test-node/types/Settings_test.ts @@ -5,9 +5,9 @@ import os from 'node:os'; import Sinon from 'sinon'; import { assert } from 'chai'; -import { getOSFunctions } from '../../util/os/shared.js'; -import * as Settings from '../../types/Settings.js'; -import { SystemTraySetting } from '../../types/SystemTraySetting.js'; +import { getOSFunctions } from '../../util/os/shared.std.js'; +import * as Settings from '../../types/Settings.std.js'; +import { SystemTraySetting } from '../../types/SystemTraySetting.std.js'; describe('Settings', () => { let sandbox: Sinon.SinonSandbox; diff --git a/ts/test-node/types/Stickers_test.ts b/ts/test-node/types/Stickers_test.ts index d4481c7171..83332b794e 100644 --- a/ts/test-node/types/Stickers_test.ts +++ b/ts/test-node/types/Stickers_test.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import * as Stickers from '../../types/Stickers.js'; -import { isPackIdValid, redactPackId } from '../../util/Stickers.js'; +import * as Stickers from '../../types/Stickers.preload.js'; +import { isPackIdValid, redactPackId } from '../../util/Stickers.std.js'; describe('Stickers', () => { describe('getDataFromLink', () => { diff --git a/ts/test-node/types/StoryDistributionId_test.ts b/ts/test-node/types/StoryDistributionId_test.ts index 757d2e84a8..8ff4830086 100644 --- a/ts/test-node/types/StoryDistributionId_test.ts +++ b/ts/test-node/types/StoryDistributionId_test.ts @@ -5,8 +5,8 @@ import { assert } from 'chai'; import { v4 as generateUuid } from 'uuid'; import * as sinon from 'sinon'; -import type { LoggerType } from '../../types/Logging.js'; -import { normalizeStoryDistributionId } from '../../types/StoryDistributionId.js'; +import type { LoggerType } from '../../types/Logging.std.js'; +import { normalizeStoryDistributionId } from '../../types/StoryDistributionId.std.js'; describe('StoryDistributionId', () => { let warn: sinon.SinonStub; diff --git a/ts/test-node/types/SystemTraySetting_test.ts b/ts/test-node/types/SystemTraySetting_test.ts index 51083affb6..4148dbbc21 100644 --- a/ts/test-node/types/SystemTraySetting_test.ts +++ b/ts/test-node/types/SystemTraySetting_test.ts @@ -7,7 +7,7 @@ import { SystemTraySetting, parseSystemTraySetting, shouldMinimizeToSystemTray, -} from '../../types/SystemTraySetting.js'; +} from '../../types/SystemTraySetting.std.js'; describe('system tray setting utilities', () => { describe('shouldMinimizeToSystemTray', () => { diff --git a/ts/test-node/types/errors_test.ts b/ts/test-node/types/errors_test.ts index 397a900c01..622c8cded6 100644 --- a/ts/test-node/types/errors_test.ts +++ b/ts/test-node/types/errors_test.ts @@ -3,7 +3,7 @@ import * as Path from 'node:path'; import { assert } from 'chai'; -import * as Errors from '../../types/errors.js'; +import * as Errors from '../../types/errors.std.js'; const APP_ROOT_PATH = Path.join(__dirname, '..', '..', '..'); diff --git a/ts/test-node/types/setupI18n_test.ts b/ts/test-node/types/setupI18n_test.ts index abc99680f4..257cd54174 100644 --- a/ts/test-node/types/setupI18n_test.ts +++ b/ts/test-node/types/setupI18n_test.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import type { LocalizerType } from '../../types/Util.js'; -import { setupI18n } from '../../util/setupI18n.js'; -import { enMessages } from '../util/i18n.js'; +import type { LocalizerType } from '../../types/Util.std.js'; +import { setupI18n } from '../../util/setupI18n.dom.js'; +import { enMessages } from '../util/i18n.node.js'; describe('setupI18n', () => { let i18n: LocalizerType; diff --git a/ts/test-node/updater/common_test.ts b/ts/test-node/updater/common_test.ts index 8c4fa7e47c..ce0bb545f9 100644 --- a/ts/test-node/updater/common_test.ts +++ b/ts/test-node/updater/common_test.ts @@ -16,8 +16,8 @@ import { createTempDir, getTempDir, deleteTempDir, -} from '../../updater/common.js'; -import { createLogger } from '../../logging/log.js'; +} from '../../updater/common.main.js'; +import { createLogger } from '../../logging/log.std.js'; const { pathExists } = fsExtra; diff --git a/ts/test-node/updater/curve_test.ts b/ts/test-node/updater/curve_test.ts index 06b0a9535e..cb57f02cc8 100644 --- a/ts/test-node/updater/curve_test.ts +++ b/ts/test-node/updater/curve_test.ts @@ -4,7 +4,7 @@ import { assert } from 'chai'; import config from 'config'; -import { keyPair, sign, verify } from '../../updater/curve.js'; +import { keyPair, sign, verify } from '../../updater/curve.node.js'; describe('updater/curve', () => { it('roundtrips', () => { diff --git a/ts/test-node/updater/differential_test.ts b/ts/test-node/updater/differential_test.ts index 050bcbed86..9ff53b1933 100644 --- a/ts/test-node/updater/differential_test.ts +++ b/ts/test-node/updater/differential_test.ts @@ -7,16 +7,16 @@ import http from 'node:http'; import fs from 'node:fs/promises'; import { tmpdir } from 'node:os'; -import { strictAssert } from '../../util/assert.js'; -import * as durations from '../../util/durations/index.js'; -import { getGotOptions } from '../../updater/got.js'; +import { strictAssert } from '../../util/assert.std.js'; +import * as durations from '../../util/durations/index.std.js'; +import { getGotOptions } from '../../updater/got.node.js'; import { computeDiff, getBlockMapFileName, prepareDownload, isValidPreparedData, download, -} from '../../updater/differential.js'; +} from '../../updater/differential.node.js'; const FIXTURES = path.join(__dirname, '..', '..', '..', 'fixtures'); const CRLF = '\r\n'; diff --git a/ts/test-node/updater/signature_test.ts b/ts/test-node/updater/signature_test.ts index 2ce71bffa9..0a1d4dbbf2 100644 --- a/ts/test-node/updater/signature_test.ts +++ b/ts/test-node/updater/signature_test.ts @@ -14,10 +14,10 @@ import { verifySignature, writeHexToPath, writeSignature, -} from '../../updater/signature.js'; -import { createTempDir, deleteTempDir } from '../../updater/common.js'; -import { keyPair } from '../../updater/curve.js'; -import { createLogger } from '../../logging/log.js'; +} from '../../updater/signature.node.js'; +import { createTempDir, deleteTempDir } from '../../updater/common.main.js'; +import { keyPair } from '../../updater/curve.node.js'; +import { createLogger } from '../../logging/log.std.js'; const { copy } = fsExtra; diff --git a/ts/test-node/updater/util_test.ts b/ts/test-node/updater/util_test.ts index 2ffc9278f7..afba7c55ef 100644 --- a/ts/test-node/updater/util_test.ts +++ b/ts/test-node/updater/util_test.ts @@ -3,9 +3,9 @@ import { assert } from 'chai'; -import { isTimeToUpdate } from '../../updater/util.js'; -import { HOUR } from '../../util/durations/index.js'; -import { createLogger } from '../../logging/log.js'; +import { isTimeToUpdate } from '../../updater/util.node.js'; +import { HOUR } from '../../util/durations/index.std.js'; +import { createLogger } from '../../logging/log.std.js'; const logger = createLogger('util_test'); diff --git a/ts/test-node/util/AbortableProcess_test.ts b/ts/test-node/util/AbortableProcess_test.ts index 6abb894b80..0f6c901e32 100644 --- a/ts/test-node/util/AbortableProcess_test.ts +++ b/ts/test-node/util/AbortableProcess_test.ts @@ -4,7 +4,7 @@ import { assert } from 'chai'; import lodash from 'lodash'; -import { AbortableProcess } from '../../util/AbortableProcess.js'; +import { AbortableProcess } from '../../util/AbortableProcess.std.js'; const { noop } = lodash; diff --git a/ts/test-node/util/BackOff_test.ts b/ts/test-node/util/BackOff_test.ts index aaa0961180..c74f8d36ef 100644 --- a/ts/test-node/util/BackOff_test.ts +++ b/ts/test-node/util/BackOff_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { BackOff } from '../../util/BackOff.js'; +import { BackOff } from '../../util/BackOff.std.js'; describe('BackOff', () => { it('should return increasing timeouts', () => { diff --git a/ts/test-node/util/Bytes_test.ts b/ts/test-node/util/Bytes_test.ts index 7ea5d27d4a..32efd43135 100644 --- a/ts/test-node/util/Bytes_test.ts +++ b/ts/test-node/util/Bytes_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import * as Bytes from '../../Bytes.js'; +import * as Bytes from '../../Bytes.std.js'; describe('Bytes', () => { it('converts to base64 and back', () => { diff --git a/ts/test-node/util/DelimitedStream_test.ts b/ts/test-node/util/DelimitedStream_test.ts index f0d400985e..fbdb848826 100644 --- a/ts/test-node/util/DelimitedStream_test.ts +++ b/ts/test-node/util/DelimitedStream_test.ts @@ -6,7 +6,7 @@ import { Readable, Writable } from 'node:stream'; import { pipeline } from 'node:stream/promises'; import { BufferWriter } from 'protobufjs'; -import { DelimitedStream } from '../../util/DelimitedStream.js'; +import { DelimitedStream } from '../../util/DelimitedStream.node.js'; describe('DelimitedStream', () => { function collect(out: Array): Writable { diff --git a/ts/test-node/util/LatestQueue_test.ts b/ts/test-node/util/LatestQueue_test.ts index 53d1428ac8..0652db2d30 100644 --- a/ts/test-node/util/LatestQueue_test.ts +++ b/ts/test-node/util/LatestQueue_test.ts @@ -3,7 +3,7 @@ import * as sinon from 'sinon'; -import { LatestQueue } from '../../util/LatestQueue.js'; +import { LatestQueue } from '../../util/LatestQueue.std.js'; describe('LatestQueue', () => { it('if the queue is empty, new tasks are started immediately', done => { diff --git a/ts/test-node/util/appendMacStream_test.ts b/ts/test-node/util/appendMacStream_test.ts index be5c8aee29..8ce974d505 100644 --- a/ts/test-node/util/appendMacStream_test.ts +++ b/ts/test-node/util/appendMacStream_test.ts @@ -8,8 +8,8 @@ import { appendMacStream, MAC_KEY_SIZE, MAC_SIZE, -} from '../../util/appendMacStream.js'; -import { generateConfigMatrix } from '../../util/generateConfigMatrix.js'; +} from '../../util/appendMacStream.node.js'; +import { generateConfigMatrix } from '../../util/generateConfigMatrix.std.js'; describe('appendMacStream', () => { generateConfigMatrix({ diff --git a/ts/test-node/util/areObjectEntriesEqual_test.ts b/ts/test-node/util/areObjectEntriesEqual_test.ts index 2aec73d8f8..65df7044bc 100644 --- a/ts/test-node/util/areObjectEntriesEqual_test.ts +++ b/ts/test-node/util/areObjectEntriesEqual_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { areObjectEntriesEqual } from '../../util/areObjectEntriesEqual.js'; +import { areObjectEntriesEqual } from '../../util/areObjectEntriesEqual.std.js'; describe('areObjectEntriesEqual', () => { type TestObject = { foo?: number; bar?: number }; diff --git a/ts/test-node/util/arePinnedConversationsEqual_test.ts b/ts/test-node/util/arePinnedConversationsEqual_test.ts index 368f43da59..785cc5b686 100644 --- a/ts/test-node/util/arePinnedConversationsEqual_test.ts +++ b/ts/test-node/util/arePinnedConversationsEqual_test.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { arePinnedConversationsEqual } from '../../util/arePinnedConversationsEqual.js'; -import { SignalService as Proto } from '../../protobuf/index.js'; +import { arePinnedConversationsEqual } from '../../util/arePinnedConversationsEqual.node.js'; +import { SignalService as Proto } from '../../protobuf/index.std.js'; import PinnedConversation = Proto.AccountRecord.IPinnedConversation; diff --git a/ts/test-node/util/assert_test.ts b/ts/test-node/util/assert_test.ts index 19af8580e2..38e4084ce8 100644 --- a/ts/test-node/util/assert_test.ts +++ b/ts/test-node/util/assert_test.ts @@ -3,7 +3,7 @@ import { assert as chaiAssert } from 'chai'; -import { assertDev, strictAssert } from '../../util/assert.js'; +import { assertDev, strictAssert } from '../../util/assert.std.js'; describe('assert utilities', () => { describe('assert', () => { diff --git a/ts/test-node/util/assignWithNoUnnecessaryAllocation_test.ts b/ts/test-node/util/assignWithNoUnnecessaryAllocation_test.ts index ae8a1b9db8..13b13ec0df 100644 --- a/ts/test-node/util/assignWithNoUnnecessaryAllocation_test.ts +++ b/ts/test-node/util/assignWithNoUnnecessaryAllocation_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { assignWithNoUnnecessaryAllocation } from '../../util/assignWithNoUnnecessaryAllocation.js'; +import { assignWithNoUnnecessaryAllocation } from '../../util/assignWithNoUnnecessaryAllocation.std.js'; describe('assignWithNoUnnecessaryAllocation', () => { type Person = { diff --git a/ts/test-node/util/asyncIterables_test.ts b/ts/test-node/util/asyncIterables_test.ts index ee5a2d5ddb..fb0051fae6 100644 --- a/ts/test-node/util/asyncIterables_test.ts +++ b/ts/test-node/util/asyncIterables_test.ts @@ -3,8 +3,8 @@ import { assert } from 'chai'; -import type { MaybeAsyncIterable } from '../../util/asyncIterables.js'; -import { concat, wrapPromise } from '../../util/asyncIterables.js'; +import type { MaybeAsyncIterable } from '../../util/asyncIterables.std.js'; +import { concat, wrapPromise } from '../../util/asyncIterables.std.js'; describe('async iterable utilities', () => { describe('concat', () => { diff --git a/ts/test-node/util/awaitObject_test.ts b/ts/test-node/util/awaitObject_test.ts index f2bff9c00f..a2eaf07ab5 100644 --- a/ts/test-node/util/awaitObject_test.ts +++ b/ts/test-node/util/awaitObject_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { awaitObject } from '../../util/awaitObject.js'; +import { awaitObject } from '../../util/awaitObject.std.js'; describe('awaitObject', () => { it('returns correct result', async () => { diff --git a/ts/test-node/util/batcher_test.ts b/ts/test-node/util/batcher_test.ts index fbff27b6e6..7f40feb4b7 100644 --- a/ts/test-node/util/batcher_test.ts +++ b/ts/test-node/util/batcher_test.ts @@ -4,8 +4,8 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import { createBatcher } from '../../util/batcher.js'; -import { sleep } from '../../util/sleep.js'; +import { createBatcher } from '../../util/batcher.std.js'; +import { sleep } from '../../util/sleep.std.js'; describe('batcher', () => { it('should schedule a full batch', async () => { diff --git a/ts/test-node/util/blockSendUntilConversationsAreVerified_test.ts b/ts/test-node/util/blockSendUntilConversationsAreVerified_test.ts index a9439cd756..8f85c4bdb8 100644 --- a/ts/test-node/util/blockSendUntilConversationsAreVerified_test.ts +++ b/ts/test-node/util/blockSendUntilConversationsAreVerified_test.ts @@ -3,15 +3,15 @@ import { assert } from 'chai'; -import type { RecipientsByConversation } from '../../state/ducks/stories.js'; -import type { ServiceIdString } from '../../types/ServiceId.js'; +import type { RecipientsByConversation } from '../../state/ducks/stories.preload.js'; +import type { ServiceIdString } from '../../types/ServiceId.std.js'; -import { generateAci } from '../../types/ServiceId.js'; -import { generateStoryDistributionId } from '../../types/StoryDistributionId.js'; +import { generateAci } from '../../types/ServiceId.std.js'; +import { generateStoryDistributionId } from '../../types/StoryDistributionId.std.js'; import { getAllServiceIds, filterServiceIds, -} from '../../util/blockSendUntilConversationsAreVerified.js'; +} from '../../util/blockSendUntilConversationsAreVerified.dom.js'; describe('both/util/blockSendUntilConversationsAreVerified', () => { const SERVICE_ID_1 = generateAci(); diff --git a/ts/test-node/util/callDisposition_test.ts b/ts/test-node/util/callDisposition_test.ts index 25dcd7943e..9d96f78820 100644 --- a/ts/test-node/util/callDisposition_test.ts +++ b/ts/test-node/util/callDisposition_test.ts @@ -8,12 +8,12 @@ import { getPeerIdFromConversation, getCallIdFromEra, getGroupCallMeta, -} from '../../util/callDisposition.js'; +} from '../../util/callDisposition.preload.js'; import { getDefaultConversation, getDefaultGroup, -} from '../../test-helpers/getDefaultConversation.js'; -import { uuidToBytes } from '../../util/uuidToBytes.js'; +} from '../../test-helpers/getDefaultConversation.std.js'; +import { uuidToBytes } from '../../util/uuidToBytes.std.js'; const MOCK_ERA = 'abc'; const MOCK_CALL_ID = '16919744041952114874'; diff --git a/ts/test-node/util/callLinks_test.ts b/ts/test-node/util/callLinks_test.ts index c52ea8c4c0..71dad462bb 100644 --- a/ts/test-node/util/callLinks_test.ts +++ b/ts/test-node/util/callLinks_test.ts @@ -6,13 +6,13 @@ import { assert } from 'chai'; import { callLinkToRecord, callLinkFromRecord, -} from '../../util/callLinksRingrtc.js'; +} from '../../util/callLinksRingrtc.node.js'; import { FAKE_CALL_LINK as CALL_LINK, FAKE_CALL_LINK_WITH_ADMIN_KEY as CALL_LINK_WITH_ADMIN_KEY, FAKE_CALL_LINK_WITH_EPOCH as CALL_LINK_WITH_EPOCH, FAKE_CALL_LINK_WITH_ADMIN_KEY_AND_EPOCH as CALL_LINK_WITH_ADMIN_KEY_AND_EPOCH, -} from '../../test-helpers/fakeCallLink.js'; +} from '../../test-helpers/fakeCallLink.std.js'; describe('callLinks', () => { it('callLinkToRecord() and callLinkFromRecord() can convert to record and back', () => { diff --git a/ts/test-node/util/callingGetParticipantName_test.ts b/ts/test-node/util/callingGetParticipantName_test.ts index de6cb6f892..011e7d78a5 100644 --- a/ts/test-node/util/callingGetParticipantName_test.ts +++ b/ts/test-node/util/callingGetParticipantName_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { getParticipantName } from '../../util/callingGetParticipantName.js'; +import { getParticipantName } from '../../util/callingGetParticipantName.std.js'; describe('getParticipantName', () => { it('returns the first name if available', () => { diff --git a/ts/test-node/util/callingMessageToProto_test.ts b/ts/test-node/util/callingMessageToProto_test.ts index 3e7d59a9c5..b0671e98f1 100644 --- a/ts/test-node/util/callingMessageToProto_test.ts +++ b/ts/test-node/util/callingMessageToProto_test.ts @@ -10,9 +10,9 @@ import { HangupType, OpaqueMessage, } from '@signalapp/ringrtc'; -import { SignalService as Proto } from '../../protobuf/index.js'; +import { SignalService as Proto } from '../../protobuf/index.std.js'; -import { callingMessageToProto } from '../../util/callingMessageToProto.js'; +import { callingMessageToProto } from '../../util/callingMessageToProto.node.js'; describe('callingMessageToProto', () => { // NOTE: These tests are incomplete. diff --git a/ts/test-node/util/callingNotification_test.ts b/ts/test-node/util/callingNotification_test.ts index 66c2efba9e..49ea4e699e 100644 --- a/ts/test-node/util/callingNotification_test.ts +++ b/ts/test-node/util/callingNotification_test.ts @@ -2,20 +2,20 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { getCallingNotificationText } from '../../util/callingNotification.js'; +import { getCallingNotificationText } from '../../util/callingNotification.std.js'; import { CallMode, CallDirection, CallType, GroupCallStatus, -} from '../../types/CallDisposition.js'; -import i18n from './i18n.js'; +} from '../../types/CallDisposition.std.js'; +import i18n from './i18n.node.js'; import { getDefaultConversation, getDefaultGroup, -} from '../../test-helpers/getDefaultConversation.js'; -import { getPeerIdFromConversation } from '../../util/callDisposition.js'; -import { HOUR } from '../../util/durations/index.js'; +} from '../../test-helpers/getDefaultConversation.std.js'; +import { getPeerIdFromConversation } from '../../util/callDisposition.preload.js'; +import { HOUR } from '../../util/durations/index.std.js'; describe('calling notification helpers', () => { describe('getCallingNotificationText', () => { diff --git a/ts/test-node/util/characters_test.ts b/ts/test-node/util/characters_test.ts index 1ff99a5a58..73958645ba 100644 --- a/ts/test-node/util/characters_test.ts +++ b/ts/test-node/util/characters_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { count } from '../../util/characters.js'; +import { count } from '../../util/characters.std.js'; describe('character utilities', () => { describe('count', () => { diff --git a/ts/test-node/util/clearTimeoutIfNecessary_test.ts b/ts/test-node/util/clearTimeoutIfNecessary_test.ts index 206b0bf88f..f380956a4c 100644 --- a/ts/test-node/util/clearTimeoutIfNecessary_test.ts +++ b/ts/test-node/util/clearTimeoutIfNecessary_test.ts @@ -3,7 +3,7 @@ import * as sinon from 'sinon'; -import { clearTimeoutIfNecessary } from '../../util/clearTimeoutIfNecessary.js'; +import { clearTimeoutIfNecessary } from '../../util/clearTimeoutIfNecessary.std.js'; describe('clearTimeoutIfNecessary', () => { let sandbox: sinon.SinonSandbox; diff --git a/ts/test-node/util/combineNames_test.ts b/ts/test-node/util/combineNames_test.ts index 6f21c5d426..5f13ced411 100644 --- a/ts/test-node/util/combineNames_test.ts +++ b/ts/test-node/util/combineNames_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { combineNames } from '../../util/combineNames.js'; +import { combineNames } from '../../util/combineNames.std.js'; describe('combineNames', () => { it('returns undefined if no names provided', () => { diff --git a/ts/test-node/util/countUnreadStats_test.ts b/ts/test-node/util/countUnreadStats_test.ts index 238ba0586d..e3159dd99a 100644 --- a/ts/test-node/util/countUnreadStats_test.ts +++ b/ts/test-node/util/countUnreadStats_test.ts @@ -3,11 +3,11 @@ import { assert } from 'chai'; import { v4 as generateUuid } from 'uuid'; -import { countConversationUnreadStats } from '../../util/countUnreadStats.js'; +import { countConversationUnreadStats } from '../../util/countUnreadStats.std.js'; import type { UnreadStats, ConversationPropsForUnreadStats, -} from '../../util/countUnreadStats.js'; +} from '../../util/countUnreadStats.std.js'; function getFutureMutedTimestamp() { return Date.now() + 12345; diff --git a/ts/test-node/util/createSupportUrl_test.ts b/ts/test-node/util/createSupportUrl_test.ts index bd2068f159..f4813139d8 100644 --- a/ts/test-node/util/createSupportUrl_test.ts +++ b/ts/test-node/util/createSupportUrl_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { createSupportUrl } from '../../util/createSupportUrl.js'; +import { createSupportUrl } from '../../util/createSupportUrl.std.js'; describe('createSupportUrl', () => { it('returns support url for "en" locale', () => { diff --git a/ts/test-node/util/currency_test.ts b/ts/test-node/util/currency_test.ts index 33a28f81f0..0a9aa922dd 100644 --- a/ts/test-node/util/currency_test.ts +++ b/ts/test-node/util/currency_test.ts @@ -10,7 +10,7 @@ import { toHumanDonationAmount, toHumanCurrencyString, toStripeDonationAmount, -} from '../../util/currency.js'; +} from '../../util/currency.dom.js'; describe('parseCurrencyString', () => { function testFn( diff --git a/ts/test-node/util/deconstructLookup_test.ts b/ts/test-node/util/deconstructLookup_test.ts index 49f756173d..dc2efeeb87 100644 --- a/ts/test-node/util/deconstructLookup_test.ts +++ b/ts/test-node/util/deconstructLookup_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { deconstructLookup } from '../../util/deconstructLookup.js'; +import { deconstructLookup } from '../../util/deconstructLookup.std.js'; describe('deconstructLookup', () => { it('looks up an array of properties in a lookup', () => { diff --git a/ts/test-node/util/diffArraysAsSets_test.ts b/ts/test-node/util/diffArraysAsSets_test.ts index e2b75a6f79..f3893e68dc 100644 --- a/ts/test-node/util/diffArraysAsSets_test.ts +++ b/ts/test-node/util/diffArraysAsSets_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { diffArraysAsSets } from '../../util/diffArraysAsSets.js'; +import { diffArraysAsSets } from '../../util/diffArraysAsSets.std.js'; function assertMatch({ added, diff --git a/ts/test-node/util/dropNull_test.ts b/ts/test-node/util/dropNull_test.ts index 673af32124..32e71627bd 100644 --- a/ts/test-node/util/dropNull_test.ts +++ b/ts/test-node/util/dropNull_test.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { dropNull, shallowDropNull } from '../../util/dropNull.js'; +import { dropNull, shallowDropNull } from '../../util/dropNull.std.js'; type Test = { a: number | null; diff --git a/ts/test-node/util/emoji_test.ts b/ts/test-node/util/emoji_test.ts index 3d7cffe5bc..215b645a49 100644 --- a/ts/test-node/util/emoji_test.ts +++ b/ts/test-node/util/emoji_test.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { replaceEmojiWithSpaces, splitByEmoji } from '../../util/emoji.js'; +import { replaceEmojiWithSpaces, splitByEmoji } from '../../util/emoji.std.js'; describe('emoji', () => { describe('replaceEmojiWithSpaces', () => { diff --git a/ts/test-node/util/enum_test.ts b/ts/test-node/util/enum_test.ts index 0425a57554..510fcdda05 100644 --- a/ts/test-node/util/enum_test.ts +++ b/ts/test-node/util/enum_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { makeEnumParser } from '../../util/enum.js'; +import { makeEnumParser } from '../../util/enum.std.js'; describe('enum utils', () => { describe('makeEnumParser', () => { diff --git a/ts/test-node/util/expirationTimer_test.ts b/ts/test-node/util/expirationTimer_test.ts index 22f2a1ef69..7ac6254dad 100644 --- a/ts/test-node/util/expirationTimer_test.ts +++ b/ts/test-node/util/expirationTimer_test.ts @@ -5,11 +5,11 @@ import { readFileSync } from 'node:fs'; import { join } from 'node:path'; import { assert } from 'chai'; import * as moment from 'moment'; -import { setupI18n } from '../../util/setupI18n.js'; -import { DurationInSeconds } from '../../util/durations/index.js'; -import type { LocaleMessagesType } from '../../types/I18N.js'; +import { setupI18n } from '../../util/setupI18n.dom.js'; +import { DurationInSeconds } from '../../util/durations/index.std.js'; +import type { LocaleMessagesType } from '../../types/I18N.std.js'; -import * as expirationTimer from '../../util/expirationTimer.js'; +import * as expirationTimer from '../../util/expirationTimer.std.js'; function loadMessages(locale: string): LocaleMessagesType { const localePath = join( diff --git a/ts/test-node/util/explodePromise_test.ts b/ts/test-node/util/explodePromise_test.ts index a53653c4f2..45c7bb95f3 100644 --- a/ts/test-node/util/explodePromise_test.ts +++ b/ts/test-node/util/explodePromise_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { explodePromise } from '../../util/explodePromise.js'; +import { explodePromise } from '../../util/explodePromise.std.js'; describe('explodePromise', () => { it('resolves the promise', async () => { diff --git a/ts/test-node/util/exponentialBackoff_test.ts b/ts/test-node/util/exponentialBackoff_test.ts index 727845de98..a225d5fbbc 100644 --- a/ts/test-node/util/exponentialBackoff_test.ts +++ b/ts/test-node/util/exponentialBackoff_test.ts @@ -2,12 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import * as durations from '../../util/durations/index.js'; +import * as durations from '../../util/durations/index.std.js'; import { exponentialBackoffSleepTime, exponentialBackoffMaxAttempts, -} from '../../util/exponentialBackoff.js'; +} from '../../util/exponentialBackoff.std.js'; describe('exponential backoff utilities', () => { describe('exponentialBackoffSleepTime', () => { diff --git a/ts/test-node/util/filterAndSortConversations_test.ts b/ts/test-node/util/filterAndSortConversations_test.ts index 71468b56a0..7097c7dcc4 100644 --- a/ts/test-node/util/filterAndSortConversations_test.ts +++ b/ts/test-node/util/filterAndSortConversations_test.ts @@ -3,9 +3,9 @@ import { assert } from 'chai'; import lodash from 'lodash'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; -import { filterAndSortConversations } from '../../util/filterAndSortConversations.js'; -import type { ConversationType } from '../../state/ducks/conversations.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.std.js'; +import { filterAndSortConversations } from '../../util/filterAndSortConversations.std.js'; +import type { ConversationType } from '../../state/ducks/conversations.preload.js'; const { pick } = lodash; diff --git a/ts/test-node/util/finalStream_test.ts b/ts/test-node/util/finalStream_test.ts index 54fa01c83e..8dfc2ce716 100644 --- a/ts/test-node/util/finalStream_test.ts +++ b/ts/test-node/util/finalStream_test.ts @@ -5,7 +5,7 @@ import { assert } from 'chai'; import { Readable } from 'node:stream'; import { pipeline } from 'node:stream/promises'; -import { finalStream } from '../../util/finalStream.js'; +import { finalStream } from '../../util/finalStream.node.js'; describe('finalStream', () => { it('should invoke callback before pipeline resolves', async () => { diff --git a/ts/test-node/util/formatTimestamp_test.ts b/ts/test-node/util/formatTimestamp_test.ts deleted file mode 100644 index af1b979a43..0000000000 --- a/ts/test-node/util/formatTimestamp_test.ts +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2023 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -import { assert } from 'chai'; -import * as sinon from 'sinon'; -import { formatTimestamp } from '../../util/formatTimestamp.js'; -import { HourCyclePreference } from '../../types/I18N.js'; - -const min = new Date(2023, 0, 1, 0).getTime(); -const max = new Date(2023, 0, 1, 23).getTime(); - -describe('formatTimestamp', () => { - let sandbox: sinon.SinonSandbox; - let localesStub: sinon.SinonStub; - let localeOverrideStub: sinon.SinonStub; - let hourCycleStub: sinon.SinonStub; - - beforeEach(() => { - sandbox = sinon.createSandbox(); - localesStub = sandbox.stub( - window.SignalContext, - 'getPreferredSystemLocales' - ); - localeOverrideStub = sandbox.stub( - window.SignalContext, - 'getLocaleOverride' - ); - hourCycleStub = sandbox.stub( - window.SignalContext, - 'getHourCyclePreference' - ); - }); - - afterEach(() => { - sandbox.restore(); - }); - - function testCase( - locale: string, - preference: HourCyclePreference, - time: number, - expected: string - ) { - const timeFmt = new Intl.DateTimeFormat('en', { - timeStyle: 'medium', - }).format(time); - it(`should format with locale: ${locale} (${HourCyclePreference[preference]}) @ ${timeFmt})`, () => { - localesStub.returns([locale]); - localeOverrideStub.returns(null); - hourCycleStub.returns(preference); - assert.equal(formatTimestamp(time, { timeStyle: 'medium' }), expected); - }); - } - - testCase('en', HourCyclePreference.UnknownPreference, min, '12:00:00 AM'); - testCase('en', HourCyclePreference.UnknownPreference, max, '11:00:00 PM'); - testCase('en', HourCyclePreference.Prefer12, min, '12:00:00 AM'); - testCase('en', HourCyclePreference.Prefer12, max, '11:00:00 PM'); - testCase('en', HourCyclePreference.Prefer24, min, '00:00:00'); - testCase('en', HourCyclePreference.Prefer24, max, '23:00:00'); - - testCase('nb', HourCyclePreference.UnknownPreference, min, '00:00:00'); - testCase('nb', HourCyclePreference.UnknownPreference, max, '23:00:00'); - testCase('nb', HourCyclePreference.Prefer12, min, '12:00:00 a.m.'); - testCase('nb', HourCyclePreference.Prefer12, max, '11:00:00 p.m.'); - testCase('nb', HourCyclePreference.Prefer24, min, '00:00:00'); - testCase('nb', HourCyclePreference.Prefer24, max, '23:00:00'); - - testCase('ja', HourCyclePreference.UnknownPreference, min, '0:00:00'); - testCase('ja', HourCyclePreference.UnknownPreference, max, '23:00:00'); - testCase('ja', HourCyclePreference.Prefer12, min, '午前0:00:00'); - testCase('ja', HourCyclePreference.Prefer12, max, '午後11:00:00'); - testCase('ja', HourCyclePreference.Prefer24, min, '0:00:00'); - testCase('ja', HourCyclePreference.Prefer24, max, '23:00:00'); -}); diff --git a/ts/test-node/util/generateConfigMatrix_test.ts b/ts/test-node/util/generateConfigMatrix_test.ts index fbf1c2e93a..a41b16ef86 100644 --- a/ts/test-node/util/generateConfigMatrix_test.ts +++ b/ts/test-node/util/generateConfigMatrix_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { generateConfigMatrix } from '../../util/generateConfigMatrix.js'; +import { generateConfigMatrix } from '../../util/generateConfigMatrix.std.js'; describe('generateConfigMatrix', () => { it('generates an empty list', () => { diff --git a/ts/test-node/util/getAvatarData_test.ts b/ts/test-node/util/getAvatarData_test.ts index c89110f717..b276904e89 100644 --- a/ts/test-node/util/getAvatarData_test.ts +++ b/ts/test-node/util/getAvatarData_test.ts @@ -3,9 +3,9 @@ import { assert } from 'chai'; import { v4 as uuid } from 'uuid'; -import { getRandomColor } from '../../test-helpers/getRandomColor.js'; +import { getRandomColor } from '../../test-helpers/getRandomColor.std.js'; -import { getAvatarData } from '../../util/getAvatarData.js'; +import { getAvatarData } from '../../util/getAvatarData.dom.js'; describe('getAvatarData', () => { it('returns existing avatars if present', () => { diff --git a/ts/test-node/util/getClassNamesFor_test.ts b/ts/test-node/util/getClassNamesFor_test.ts index f13d4d444d..74bfa23ea0 100644 --- a/ts/test-node/util/getClassNamesFor_test.ts +++ b/ts/test-node/util/getClassNamesFor_test.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { getClassNamesFor } from '../../util/getClassNamesFor.js'; +import { getClassNamesFor } from '../../util/getClassNamesFor.std.js'; describe('getClassNamesFor', () => { it('returns a function', () => { diff --git a/ts/test-node/util/getCustomColorStyle.ts b/ts/test-node/util/getCustomColorStyle.ts index 7c9938a523..4fad8c816d 100644 --- a/ts/test-node/util/getCustomColorStyle.ts +++ b/ts/test-node/util/getCustomColorStyle.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { getCustomColorStyle } from '../../util/getCustomColorStyle.js'; +import { getCustomColorStyle } from '../../util/getCustomColorStyle.dom.js'; describe('getCustomColorStyle', () => { it('returns undefined if no color passed in', () => { diff --git a/ts/test-node/util/getFontNameByTextScript_test.ts b/ts/test-node/util/getFontNameByTextScript_test.ts index c4dfa2a6fa..a7792a6419 100644 --- a/ts/test-node/util/getFontNameByTextScript_test.ts +++ b/ts/test-node/util/getFontNameByTextScript_test.ts @@ -6,8 +6,8 @@ import { assert } from 'chai'; import { fontSniffer, getFontNameByTextScript, -} from '../../util/getFontNameByTextScript.js'; -import { setupI18n } from '../../util/setupI18n.js'; +} from '../../util/getFontNameByTextScript.std.js'; +import { setupI18n } from '../../util/setupI18n.dom.js'; describe('getFontNameByTextScript', () => { it('has arabic', () => { diff --git a/ts/test-node/util/getGroupMemberships_test.ts b/ts/test-node/util/getGroupMemberships_test.ts index 683f839cc2..9b1a83b9e7 100644 --- a/ts/test-node/util/getGroupMemberships_test.ts +++ b/ts/test-node/util/getGroupMemberships_test.ts @@ -2,13 +2,13 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import type { ConversationType } from '../../state/ducks/conversations.js'; -import { generateAci } from '../../types/ServiceId.js'; -import { normalizeAci } from '../../util/normalizeAci.js'; -import type { ServiceIdString } from '../../types/ServiceId.js'; -import { getDefaultConversationWithServiceId } from '../../test-helpers/getDefaultConversation.js'; +import type { ConversationType } from '../../state/ducks/conversations.preload.js'; +import { generateAci } from '../../types/ServiceId.std.js'; +import { normalizeAci } from '../../util/normalizeAci.std.js'; +import type { ServiceIdString } from '../../types/ServiceId.std.js'; +import { getDefaultConversationWithServiceId } from '../../test-helpers/getDefaultConversation.std.js'; -import { getGroupMemberships } from '../../util/getGroupMemberships.js'; +import { getGroupMemberships } from '../../util/getGroupMemberships.dom.js'; describe('getGroupMemberships', () => { const normalConversation1 = getDefaultConversationWithServiceId(); diff --git a/ts/test-node/util/getHSL_test.ts b/ts/test-node/util/getHSL_test.ts index ce888b18ad..ffbca732db 100644 --- a/ts/test-node/util/getHSL_test.ts +++ b/ts/test-node/util/getHSL_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { getHSL } from '../../util/getHSL.js'; +import { getHSL } from '../../util/getHSL.std.js'; describe('getHSL', () => { it('returns expected lightness values', () => { diff --git a/ts/test-node/util/getInitials_test.ts b/ts/test-node/util/getInitials_test.ts index ec8fb379cc..2167dab764 100644 --- a/ts/test-node/util/getInitials_test.ts +++ b/ts/test-node/util/getInitials_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { getInitials } from '../../util/getInitials.js'; +import { getInitials } from '../../util/getInitials.std.js'; describe('getInitials', () => { it('returns undefined when passed undefined', () => { diff --git a/ts/test-node/util/getMuteOptions_test.ts b/ts/test-node/util/getMuteOptions_test.ts index 715b1e730c..0a2347a7c1 100644 --- a/ts/test-node/util/getMuteOptions_test.ts +++ b/ts/test-node/util/getMuteOptions_test.ts @@ -3,9 +3,9 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import i18n from './i18n.js'; +import i18n from './i18n.node.js'; -import { getMuteOptions } from '../../util/getMuteOptions.js'; +import { getMuteOptions } from '../../util/getMuteOptions.std.js'; describe('getMuteOptions', () => { const HOUR = 3600000; diff --git a/ts/test-node/util/getMutedUntilText_test.ts b/ts/test-node/util/getMutedUntilText_test.ts index 448709e0f8..322a4606de 100644 --- a/ts/test-node/util/getMutedUntilText_test.ts +++ b/ts/test-node/util/getMutedUntilText_test.ts @@ -3,9 +3,9 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import i18n from './i18n.js'; +import i18n from './i18n.node.js'; -import { getMutedUntilText } from '../../util/getMutedUntilText.js'; +import { getMutedUntilText } from '../../util/getMutedUntilText.std.js'; describe('getMutedUntilText', () => { let sandbox: sinon.SinonSandbox; diff --git a/ts/test-node/util/getOwn_test.ts b/ts/test-node/util/getOwn_test.ts index d4baf8915b..b95d152437 100644 --- a/ts/test-node/util/getOwn_test.ts +++ b/ts/test-node/util/getOwn_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { getOwn } from '../../util/getOwn.js'; +import { getOwn } from '../../util/getOwn.std.js'; describe('getOwn', () => { class Person { diff --git a/ts/test-node/util/getStreamWithTimeout_test.ts b/ts/test-node/util/getStreamWithTimeout_test.ts index 4178ba2c25..694760aecf 100644 --- a/ts/test-node/util/getStreamWithTimeout_test.ts +++ b/ts/test-node/util/getStreamWithTimeout_test.ts @@ -7,7 +7,7 @@ import * as sinon from 'sinon'; import lodash from 'lodash'; import { once } from 'node:events'; -import { getStreamWithTimeout } from '../../util/getStreamWithTimeout.js'; +import { getStreamWithTimeout } from '../../util/getStreamWithTimeout.node.js'; const { noop } = lodash; diff --git a/ts/test-node/util/getUserAgent_test.ts b/ts/test-node/util/getUserAgent_test.ts index 2dd058f5c6..bcc49a5e9b 100644 --- a/ts/test-node/util/getUserAgent_test.ts +++ b/ts/test-node/util/getUserAgent_test.ts @@ -4,7 +4,7 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import { getUserAgent } from '../../util/getUserAgent.js'; +import { getUserAgent } from '../../util/getUserAgent.node.js'; describe('getUserAgent', () => { beforeEach(function (this: Mocha.Context) { diff --git a/ts/test-node/util/graphemeAndLinkAwareSlice.ts b/ts/test-node/util/graphemeAndLinkAwareSlice.ts index c697dff5bc..c80597a100 100644 --- a/ts/test-node/util/graphemeAndLinkAwareSlice.ts +++ b/ts/test-node/util/graphemeAndLinkAwareSlice.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { graphemeAndLinkAwareSlice } from '../../util/graphemeAndLinkAwareSlice.js'; +import { graphemeAndLinkAwareSlice } from '../../util/graphemeAndLinkAwareSlice.std.js'; describe('graphemeAndLinkAwareSlice', () => { it('returns entire string when shorter than maximum', () => { diff --git a/ts/test-node/util/grapheme_test.ts b/ts/test-node/util/grapheme_test.ts index 6bed559d5f..3355fec0b9 100644 --- a/ts/test-node/util/grapheme_test.ts +++ b/ts/test-node/util/grapheme_test.ts @@ -8,7 +8,7 @@ import { count, hasAtMostGraphemes, isSingleGrapheme, -} from '../../util/grapheme.js'; +} from '../../util/grapheme.std.js'; describe('grapheme utilities', () => { describe('getGraphemes', () => { diff --git a/ts/test-node/util/groupBy_test.ts b/ts/test-node/util/groupBy_test.ts index 9c2ef1564b..d36f6de319 100644 --- a/ts/test-node/util/groupBy_test.ts +++ b/ts/test-node/util/groupBy_test.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { groupWhile, formatGroups } from '../../util/groupWhile.js'; +import { groupWhile, formatGroups } from '../../util/groupWhile.std.js'; describe('groupWhile/formatGroups', () => { function check( diff --git a/ts/test-node/util/groupMemberNameCollisions_test.ts b/ts/test-node/util/groupMemberNameCollisions_test.ts index c559c35d02..fe52463162 100644 --- a/ts/test-node/util/groupMemberNameCollisions_test.ts +++ b/ts/test-node/util/groupMemberNameCollisions_test.ts @@ -2,14 +2,14 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.std.js'; import { dehydrateCollisionsWithConversations, getCollisionsFromMemberships, hasUnacknowledgedCollisions, invertIdsByTitle, -} from '../../util/groupMemberNameCollisions.js'; +} from '../../util/groupMemberNameCollisions.std.js'; describe('group member name collision utilities', () => { describe('dehydrateCollisionsWithConversations', () => { diff --git a/ts/test-node/util/groupSendEndorsements_test.ts b/ts/test-node/util/groupSendEndorsements_test.ts index 96e49c766d..d0f1fc66bd 100644 --- a/ts/test-node/util/groupSendEndorsements_test.ts +++ b/ts/test-node/util/groupSendEndorsements_test.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import assert from 'node:assert/strict'; -import { validateGroupSendEndorsementsExpiration } from '../../util/groupSendEndorsements.js'; -import { DAY, HOUR, SECOND } from '../../util/durations/index.js'; +import { validateGroupSendEndorsementsExpiration } from '../../util/groupSendEndorsements.preload.js'; +import { DAY, HOUR, SECOND } from '../../util/durations/index.std.js'; describe('groupSendEndorsements', () => { describe('validateGroupSendEndorsementsExpiration', () => { diff --git a/ts/test-node/util/hslToRGB_test.ts b/ts/test-node/util/hslToRGB_test.ts index 2542a9364f..5601564eed 100644 --- a/ts/test-node/util/hslToRGB_test.ts +++ b/ts/test-node/util/hslToRGB_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { hslToRGB, hslToRGBInt } from '../../util/hslToRGB.js'; +import { hslToRGB, hslToRGBInt } from '../../util/hslToRGB.std.js'; describe('hslToRGB', () => { it('converts pure rgb colors', () => { diff --git a/ts/test-node/util/i18n.ts b/ts/test-node/util/i18n.ts index 60447ed759..a0e294f1f6 100644 --- a/ts/test-node/util/i18n.ts +++ b/ts/test-node/util/i18n.ts @@ -4,7 +4,8 @@ import { readFileSync } from 'node:fs'; import { join } from 'node:path'; -import { setupI18n } from '../../util/setupI18n.js'; +import { setupI18n } from '../../util/setupI18nMain.std.js'; +import { shouldNeverBeCalled } from '../../util/shouldNeverBeCalled.std.js'; const PATH = join( __dirname, @@ -18,4 +19,8 @@ const PATH = join( export const enMessages = JSON.parse(readFileSync(PATH, 'utf8')); -export default setupI18n('en', enMessages); +export default setupI18n('en', enMessages, { + renderEmojify: shouldNeverBeCalled, + getLocaleDirection: shouldNeverBeCalled, + getHourCyclePreference: shouldNeverBeCalled, +}); diff --git a/ts/test-node/util/isConversationMuted_test.ts b/ts/test-node/util/isConversationMuted_test.ts index 08fd4b632d..70a4e04bdf 100644 --- a/ts/test-node/util/isConversationMuted_test.ts +++ b/ts/test-node/util/isConversationMuted_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { isConversationMuted } from '../../util/isConversationMuted.js'; +import { isConversationMuted } from '../../util/isConversationMuted.std.js'; describe('isConversationMuted', () => { it('returns false if passed an undefined expiry time', () => { diff --git a/ts/test-node/util/isConversationNameKnown_test.ts b/ts/test-node/util/isConversationNameKnown_test.ts index 0bb9ffa424..c200fc0c18 100644 --- a/ts/test-node/util/isConversationNameKnown_test.ts +++ b/ts/test-node/util/isConversationNameKnown_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { isConversationNameKnown } from '../../util/isConversationNameKnown.js'; +import { isConversationNameKnown } from '../../util/isConversationNameKnown.std.js'; describe('isConversationNameKnown', () => { describe('for direct conversations', () => { diff --git a/ts/test-node/util/isConversationSMSOnly_test.ts b/ts/test-node/util/isConversationSMSOnly_test.ts index 0be1798c44..4a760ccecf 100644 --- a/ts/test-node/util/isConversationSMSOnly_test.ts +++ b/ts/test-node/util/isConversationSMSOnly_test.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { generateAci } from '../../types/ServiceId.js'; +import { generateAci } from '../../types/ServiceId.std.js'; -import { isConversationSMSOnly } from '../../util/isConversationSMSOnly.js'; +import { isConversationSMSOnly } from '../../util/isConversationSMSOnly.std.js'; const serviceId = generateAci(); diff --git a/ts/test-node/util/isConversationUnread_test.ts b/ts/test-node/util/isConversationUnread_test.ts index d81aea9c97..699b63c7fe 100644 --- a/ts/test-node/util/isConversationUnread_test.ts +++ b/ts/test-node/util/isConversationUnread_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { isConversationUnread } from '../../util/isConversationUnread.js'; +import { isConversationUnread } from '../../util/isConversationUnread.std.js'; describe('isConversationUnread', () => { it('returns false if both markedUnread and unreadCount are undefined', () => { diff --git a/ts/test-node/util/isConversationUnregistered_test.ts b/ts/test-node/util/isConversationUnregistered_test.ts index 0231ced475..6ed8057185 100644 --- a/ts/test-node/util/isConversationUnregistered_test.ts +++ b/ts/test-node/util/isConversationUnregistered_test.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { generateAci } from '../../types/ServiceId.js'; -import * as durations from '../../util/durations/index.js'; +import { generateAci } from '../../types/ServiceId.std.js'; +import * as durations from '../../util/durations/index.std.js'; -import { isConversationUnregistered } from '../../util/isConversationUnregistered.js'; +import { isConversationUnregistered } from '../../util/isConversationUnregistered.dom.js'; const serviceId = generateAci(); diff --git a/ts/test-node/util/isFileDangerous_test.ts b/ts/test-node/util/isFileDangerous_test.ts index 868d7d98d4..075bcc759b 100644 --- a/ts/test-node/util/isFileDangerous_test.ts +++ b/ts/test-node/util/isFileDangerous_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { isFileDangerous } from '../../util/isFileDangerous.js'; +import { isFileDangerous } from '../../util/isFileDangerous.std.js'; describe('isFileDangerous', () => { it('returns false for images', () => { diff --git a/ts/test-node/util/isInSystemContacts_test.ts b/ts/test-node/util/isInSystemContacts_test.ts index 4807537426..152da6c394 100644 --- a/ts/test-node/util/isInSystemContacts_test.ts +++ b/ts/test-node/util/isInSystemContacts_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { isInSystemContacts } from '../../util/isInSystemContacts.js'; +import { isInSystemContacts } from '../../util/isInSystemContacts.std.js'; describe('isInSystemContacts', () => { it('returns true for direct conversations that have a `name` property', () => { diff --git a/ts/test-node/util/isMessageUnread_test.ts b/ts/test-node/util/isMessageUnread_test.ts index 6b39f6540d..c1616b04f3 100644 --- a/ts/test-node/util/isMessageUnread_test.ts +++ b/ts/test-node/util/isMessageUnread_test.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { ReadStatus } from '../../messages/MessageReadStatus.js'; +import { ReadStatus } from '../../messages/MessageReadStatus.std.js'; -import { isMessageUnread } from '../../util/isMessageUnread.js'; +import { isMessageUnread } from '../../util/isMessageUnread.std.js'; describe('isMessageUnread', () => { it("returns false if the message's `readStatus` field is undefined", () => { diff --git a/ts/test-node/util/isNormalNumber_test.ts b/ts/test-node/util/isNormalNumber_test.ts index 6e9da749c3..689d5ac9d1 100644 --- a/ts/test-node/util/isNormalNumber_test.ts +++ b/ts/test-node/util/isNormalNumber_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { isNormalNumber } from '../../util/isNormalNumber.js'; +import { isNormalNumber } from '../../util/isNormalNumber.std.js'; describe('isNormalNumber', () => { it('returns false for non-numbers', () => { diff --git a/ts/test-node/util/isNotNil_test.ts b/ts/test-node/util/isNotNil_test.ts index f4c372bcb7..1f9be75564 100644 --- a/ts/test-node/util/isNotNil_test.ts +++ b/ts/test-node/util/isNotNil_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { isNotNil } from '../../util/isNotNil.js'; +import { isNotNil } from '../../util/isNotNil.std.js'; describe('isNotNil', () => { it('returns false if provided null value', () => { diff --git a/ts/test-node/util/isPathInside_test.ts b/ts/test-node/util/isPathInside_test.ts index 8ace6e9ce2..e5a07df360 100644 --- a/ts/test-node/util/isPathInside_test.ts +++ b/ts/test-node/util/isPathInside_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { isPathInside } from '../../util/isPathInside.js'; +import { isPathInside } from '../../util/isPathInside.node.js'; describe('isPathInside', () => { it('returns false if the child path is not inside the parent path', () => { diff --git a/ts/test-node/util/isRecord_test.ts b/ts/test-node/util/isRecord_test.ts index d058d500f5..eba3696675 100644 --- a/ts/test-node/util/isRecord_test.ts +++ b/ts/test-node/util/isRecord_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { isRecord } from '../../util/isRecord.js'; +import { isRecord } from '../../util/isRecord.std.js'; describe('isRecord', () => { it('returns false for primitives', () => { diff --git a/ts/test-node/util/isSorted_test.ts b/ts/test-node/util/isSorted_test.ts index c97660a4b4..ed96bdf846 100644 --- a/ts/test-node/util/isSorted_test.ts +++ b/ts/test-node/util/isSorted_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { isSorted } from '../../util/isSorted.js'; +import { isSorted } from '../../util/isSorted.std.js'; describe('isSorted', () => { it('returns true for empty lists', () => { diff --git a/ts/test-node/util/isValidE164_test.ts b/ts/test-node/util/isValidE164_test.ts index da3aba1291..03278f91ba 100644 --- a/ts/test-node/util/isValidE164_test.ts +++ b/ts/test-node/util/isValidE164_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { isValidE164 } from '../../util/isValidE164.js'; +import { isValidE164 } from '../../util/isValidE164.std.js'; describe('isValidE164', () => { it('returns false for non-strings', () => { diff --git a/ts/test-node/util/isValidUuid.ts b/ts/test-node/util/isValidUuid.ts index 2c65ad824e..803c3246ae 100644 --- a/ts/test-node/util/isValidUuid.ts +++ b/ts/test-node/util/isValidUuid.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { isValidUuid } from '../../util/isValidUuid.js'; +import { isValidUuid } from '../../util/isValidUuid.std.js'; describe('isValidUuid', () => { const LOWERCASE_V4_UUID = '9cb737ce-2bb3-4c21-9fe0-d286caa0ca68'; diff --git a/ts/test-node/util/iterables_test.ts b/ts/test-node/util/iterables_test.ts index 19fcb66d59..90beb6c89d 100644 --- a/ts/test-node/util/iterables_test.ts +++ b/ts/test-node/util/iterables_test.ts @@ -20,7 +20,7 @@ import { size, take, zipObject, -} from '../../util/iterables.js'; +} from '../../util/iterables.std.js'; describe('iterable utilities', () => { describe('isIterable', () => { diff --git a/ts/test-node/util/libphonenumberUtil_test.ts b/ts/test-node/util/libphonenumberUtil_test.ts index 494d4f3c4a..ab07eec5a2 100644 --- a/ts/test-node/util/libphonenumberUtil_test.ts +++ b/ts/test-node/util/libphonenumberUtil_test.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert, AssertionError } from 'chai'; -import { parseNumber } from '../../util/libphonenumberUtil.js'; +import { parseNumber } from '../../util/libphonenumberUtil.std.js'; describe('libphonenumber util', () => { describe('parseNumber', () => { diff --git a/ts/test-node/util/logPadding_test.ts b/ts/test-node/util/logPadding_test.ts index a3f37fc220..1c071e2bac 100644 --- a/ts/test-node/util/logPadding_test.ts +++ b/ts/test-node/util/logPadding_test.ts @@ -4,8 +4,8 @@ import { assert } from 'chai'; import { Readable } from 'node:stream'; -import { appendPaddingStream } from '../../util/logPadding.js'; -import { logPadSize } from '../../util/logPadSize.js'; +import { appendPaddingStream } from '../../util/logPadding.node.js'; +import { logPadSize } from '../../util/logPadSize.std.js'; const BUCKET_SIZES = [ 541, 568, 596, 626, 657, 690, 725, 761, 799, 839, 881, 925, 972, 1020, 1071, diff --git a/ts/test-node/util/makeLookup_test.ts b/ts/test-node/util/makeLookup_test.ts index e99aca030a..c0243a82b9 100644 --- a/ts/test-node/util/makeLookup_test.ts +++ b/ts/test-node/util/makeLookup_test.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { makeLookup } from '../../util/makeLookup.js'; +import { makeLookup } from '../../util/makeLookup.std.js'; describe('makeLookup', () => { it('returns an empty object if passed an empty array', () => { diff --git a/ts/test-node/util/mapEmplace_test.ts b/ts/test-node/util/mapEmplace_test.ts index e7a9a096f8..14563c883d 100644 --- a/ts/test-node/util/mapEmplace_test.ts +++ b/ts/test-node/util/mapEmplace_test.ts @@ -3,8 +3,8 @@ import * as sinon from 'sinon'; import assert from 'node:assert/strict'; -import type { MapEmplaceOptions } from '../../util/mapEmplace.js'; -import { mapEmplace } from '../../util/mapEmplace.js'; +import type { MapEmplaceOptions } from '../../util/mapEmplace.std.js'; +import { mapEmplace } from '../../util/mapEmplace.std.js'; type InsertFn = NonNullable>['insert']>; type UpdateFn = NonNullable>['update']>; diff --git a/ts/test-node/util/mapObjectWithSpec_test.ts b/ts/test-node/util/mapObjectWithSpec_test.ts index deb5007d0f..a610d23b0d 100644 --- a/ts/test-node/util/mapObjectWithSpec_test.ts +++ b/ts/test-node/util/mapObjectWithSpec_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { mapObjectWithSpec } from '../../util/mapObjectWithSpec.js'; +import { mapObjectWithSpec } from '../../util/mapObjectWithSpec.std.js'; describe('mapObjectWithSpec', () => { const increment = (value: number) => value + 1; diff --git a/ts/test-node/util/mapUtil_test.ts b/ts/test-node/util/mapUtil_test.ts index 100feeab56..c2783346ff 100644 --- a/ts/test-node/util/mapUtil_test.ts +++ b/ts/test-node/util/mapUtil_test.ts @@ -4,7 +4,7 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import { groupBy, isEqual } from '../../util/mapUtil.js'; +import { groupBy, isEqual } from '../../util/mapUtil.std.js'; describe('map utilities', () => { describe('groupBy', () => { diff --git a/ts/test-node/util/messageFailures.ts b/ts/test-node/util/messageFailures.ts index 39a63ae018..113730faab 100644 --- a/ts/test-node/util/messageFailures.ts +++ b/ts/test-node/util/messageFailures.ts @@ -3,27 +3,25 @@ import lodash from 'lodash'; -import type { CustomError } from '../../textsecure/Types.js'; +import type { CustomError } from '../../textsecure/Types.d.ts'; -import type { MessageAttributesType } from '../../model-types.js'; -import { createLogger } from '../../logging/log.js'; -import * as Errors from '../../types/errors.js'; +import type { MessageAttributesType } from '../../model-types.d.ts'; +import { createLogger } from '../../logging/log.std.js'; +import * as Errors from '../../types/errors.std.js'; +import { NotificationType } from '../../types/notifications.std.js'; import { getChangesForPropAtTimestamp, getPropForTimestamp, -} from '../../util/editHelpers.js'; +} from '../../util/editHelpers.std.js'; import { isSent, SendActionType, sendStateReducer, someRecipientSendStatus, -} from '../../messages/MessageSendState.js'; -import { isStory } from '../../messages/helpers.js'; -import { - notificationService, - NotificationType, -} from '../../services/notifications.js'; -import type { MessageModel } from '../../models/messages.js'; +} from '../../messages/MessageSendState.std.js'; +import { isStory } from '../../messages/helpers.std.js'; +import { notificationService } from '../../services/notifications.preload.js'; +import type { MessageModel } from '../../models/messages.preload.js'; const { mapValues, pick } = lodash; diff --git a/ts/test-node/util/normalizeDeviceName_test.ts b/ts/test-node/util/normalizeDeviceName_test.ts index 2761c85140..e15630836e 100644 --- a/ts/test-node/util/normalizeDeviceName_test.ts +++ b/ts/test-node/util/normalizeDeviceName_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { normalizeDeviceName } from '../../util/normalizeDeviceName.js'; +import { normalizeDeviceName } from '../../util/normalizeDeviceName.std.js'; describe('normalizeDeviceName', () => { it('leaves normal device names untouched', () => { diff --git a/ts/test-node/util/parseIntOrThrow_test.ts b/ts/test-node/util/parseIntOrThrow_test.ts index 7a65a8b0be..10a61c7cb1 100644 --- a/ts/test-node/util/parseIntOrThrow_test.ts +++ b/ts/test-node/util/parseIntOrThrow_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { parseIntOrThrow } from '../../util/parseIntOrThrow.js'; +import { parseIntOrThrow } from '../../util/parseIntOrThrow.std.js'; describe('parseIntOrThrow', () => { describe('when passed a number argument', () => { diff --git a/ts/test-node/util/parseIntWithFallback_test.ts b/ts/test-node/util/parseIntWithFallback_test.ts index 9cad8935fd..75823b87f5 100644 --- a/ts/test-node/util/parseIntWithFallback_test.ts +++ b/ts/test-node/util/parseIntWithFallback_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { parseIntWithFallback } from '../../util/parseIntWithFallback.js'; +import { parseIntWithFallback } from '../../util/parseIntWithFallback.std.js'; describe('parseIntWithFallback', () => { describe('when passed a number argument', () => { diff --git a/ts/test-node/util/parseRetryAfter_test.ts b/ts/test-node/util/parseRetryAfter_test.ts index b2f4c09045..7885e5a7c2 100644 --- a/ts/test-node/util/parseRetryAfter_test.ts +++ b/ts/test-node/util/parseRetryAfter_test.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { MINUTE } from '../../util/durations/index.js'; +import { MINUTE } from '../../util/durations/index.std.js'; -import { parseRetryAfterWithDefault } from '../../util/parseRetryAfter.js'; +import { parseRetryAfterWithDefault } from '../../util/parseRetryAfter.std.js'; describe('parseRetryAfter', () => { it('should return 1 minute when passed non-strings', () => { diff --git a/ts/test-node/util/prependStream_test.ts b/ts/test-node/util/prependStream_test.ts index 34689fc887..7d59a5f167 100644 --- a/ts/test-node/util/prependStream_test.ts +++ b/ts/test-node/util/prependStream_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { prependStream } from '../../util/prependStream.js'; +import { prependStream } from '../../util/prependStream.node.js'; describe('prependStream', () => { it('should prepend stream with a prefix', async () => { diff --git a/ts/test-node/util/privacy_test.ts b/ts/test-node/util/privacy_test.ts index c06f5b6671..f5134f035d 100644 --- a/ts/test-node/util/privacy_test.ts +++ b/ts/test-node/util/privacy_test.ts @@ -3,8 +3,8 @@ import { assert } from 'chai'; -import * as Privacy from '../../util/privacy.js'; -import { APP_ROOT_PATH } from '../../util/privacy.js'; +import * as Privacy from '../../util/privacy.node.js'; +import { APP_ROOT_PATH } from '../../util/privacy.node.js'; Privacy.addSensitivePath('sensitive-path'); diff --git a/ts/test-node/util/queueAttachmentDownloads_test.ts b/ts/test-node/util/queueAttachmentDownloads_test.ts index 4c932e0bab..595ba6f8d1 100644 --- a/ts/test-node/util/queueAttachmentDownloads_test.ts +++ b/ts/test-node/util/queueAttachmentDownloads_test.ts @@ -3,12 +3,12 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ import { assert } from 'chai'; -import type { MessageAttributesType } from '../../model-types.js'; -import type { AttachmentType } from '../../types/Attachment.js'; -import { IMAGE_JPEG, LONG_MESSAGE } from '../../types/MIME.js'; -import { generateMessageId } from '../../util/generateMessageId.js'; -import { ensureBodyAttachmentsAreSeparated } from '../../util/queueAttachmentDownloads.js'; -import { createLogger } from '../../logging/log.js'; +import type { MessageAttributesType } from '../../model-types.d.ts'; +import type { AttachmentType } from '../../types/Attachment.std.js'; +import { IMAGE_JPEG, LONG_MESSAGE } from '../../types/MIME.std.js'; +import { generateMessageId } from '../../util/generateMessageId.node.js'; +import { ensureBodyAttachmentsAreSeparated } from '../../util/queueAttachmentDownloads.preload.js'; +import { createLogger } from '../../logging/log.std.js'; const logger = createLogger('queueAttachmentDownloads_test'); diff --git a/ts/test-node/util/reallyJsonStringify_test.ts b/ts/test-node/util/reallyJsonStringify_test.ts index 5c7bffe44a..6e7cc72684 100644 --- a/ts/test-node/util/reallyJsonStringify_test.ts +++ b/ts/test-node/util/reallyJsonStringify_test.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { reallyJsonStringify } from '../../util/reallyJsonStringify.js'; +import { reallyJsonStringify } from '../../util/reallyJsonStringify.std.js'; describe('reallyJsonStringify', () => { it('returns the same thing as JSON.stringify when JSON.stringify returns a string', () => { diff --git a/ts/test-node/util/replaceIndex_test.ts b/ts/test-node/util/replaceIndex_test.ts index 2387385b3f..277f305c14 100644 --- a/ts/test-node/util/replaceIndex_test.ts +++ b/ts/test-node/util/replaceIndex_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { replaceIndex } from '../../util/replaceIndex.js'; +import { replaceIndex } from '../../util/replaceIndex.std.js'; describe('replaceIndex', () => { it('returns a new array with an index replaced', () => { diff --git a/ts/test-node/util/resolveCanonicalLocales_test.ts b/ts/test-node/util/resolveCanonicalLocales_test.ts index b77c36ee6f..e97171f8b9 100644 --- a/ts/test-node/util/resolveCanonicalLocales_test.ts +++ b/ts/test-node/util/resolveCanonicalLocales_test.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import assert from 'node:assert/strict'; -import { resolveCanonicalLocales } from '../../util/resolveCanonicalLocales.js'; +import { resolveCanonicalLocales } from '../../util/resolveCanonicalLocales.std.js'; describe('resolveCanonicalLocales', () => { it('returns an array of canonical locales', () => { diff --git a/ts/test-node/util/rgbToHSL_test.ts b/ts/test-node/util/rgbToHSL_test.ts index e68f0a97a8..ace487b64e 100644 --- a/ts/test-node/util/rgbToHSL_test.ts +++ b/ts/test-node/util/rgbToHSL_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { rgbIntToHSL, rgbToHSL } from '../../util/rgbToHSL.js'; +import { rgbIntToHSL, rgbToHSL } from '../../util/rgbToHSL.std.js'; describe('rgbToHSL', () => { it('converts pure rgb colors', () => { diff --git a/ts/test-node/util/ringrtc/nonRenderedRemoteParticipant_test.ts b/ts/test-node/util/ringrtc/nonRenderedRemoteParticipant_test.ts index 9fdb60ff59..c89cef29ec 100644 --- a/ts/test-node/util/ringrtc/nonRenderedRemoteParticipant_test.ts +++ b/ts/test-node/util/ringrtc/nonRenderedRemoteParticipant_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { nonRenderedRemoteParticipant } from '../../../util/ringrtc/nonRenderedRemoteParticipant.js'; +import { nonRenderedRemoteParticipant } from '../../../util/ringrtc/nonRenderedRemoteParticipant.std.js'; describe('nonRenderedRemoteParticipant', () => { it('returns a video request object a width and height of 0', () => { diff --git a/ts/test-node/util/ringrtc/normalizeGroupCallTimestamp_test.ts b/ts/test-node/util/ringrtc/normalizeGroupCallTimestamp_test.ts index a41d7b10b8..b9b09320c3 100644 --- a/ts/test-node/util/ringrtc/normalizeGroupCallTimestamp_test.ts +++ b/ts/test-node/util/ringrtc/normalizeGroupCallTimestamp_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { normalizeGroupCallTimestamp } from '../../../util/ringrtc/normalizeGroupCallTimestamp.js'; +import { normalizeGroupCallTimestamp } from '../../../util/ringrtc/normalizeGroupCallTimestamp.std.js'; describe('normalizeGroupCallTimestamp', () => { it('returns undefined if passed a string that cannot be parsed as a number', () => { diff --git a/ts/test-node/util/schemas_test.ts b/ts/test-node/util/schemas_test.ts index cabddd68b6..463859fae3 100644 --- a/ts/test-node/util/schemas_test.ts +++ b/ts/test-node/util/schemas_test.ts @@ -9,7 +9,7 @@ import { parseStrict, parseUnknown, SchemaParseError, -} from '../../util/schemas.js'; +} from '../../util/schemas.std.js'; describe('schemas', () => { const schema = z.object({ prop: z.literal('value') }); diff --git a/ts/test-node/util/searchConversationTitles_test.ts b/ts/test-node/util/searchConversationTitles_test.ts index 99ced264e3..ee13497eae 100644 --- a/ts/test-node/util/searchConversationTitles_test.ts +++ b/ts/test-node/util/searchConversationTitles_test.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.js'; -import { searchConversationTitles } from '../../util/searchConversationTitles.js'; +import { getDefaultConversation } from '../../test-helpers/getDefaultConversation.std.js'; +import { searchConversationTitles } from '../../util/searchConversationTitles.std.js'; describe('searchContactTitles', () => { const conversations = [ diff --git a/ts/test-node/util/search_test.ts b/ts/test-node/util/search_test.ts index f03b992d15..a3cd2fcc28 100644 --- a/ts/test-node/util/search_test.ts +++ b/ts/test-node/util/search_test.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { generateSnippetAroundMention } from '../../util/search.js'; +import { generateSnippetAroundMention } from '../../util/search.std.js'; describe('generateSnippetAroundMention', () => { it('generates snippet around mention at start of body', () => { diff --git a/ts/test-node/util/serverAlerts_test.ts b/ts/test-node/util/serverAlerts_test.ts index e1e50febfb..ee0de61adf 100644 --- a/ts/test-node/util/serverAlerts_test.ts +++ b/ts/test-node/util/serverAlerts_test.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { getServerAlertToShow } from '../../util/handleServerAlerts.js'; -import { ServerAlert } from '../../types/ServerAlert.js'; -import { DAY, MONTH, WEEK } from '../../util/durations/index.js'; +import { getServerAlertToShow } from '../../util/handleServerAlerts.preload.js'; +import { ServerAlert } from '../../types/ServerAlert.std.js'; +import { DAY, MONTH, WEEK } from '../../util/durations/index.std.js'; describe('serverAlerts', () => { it('should prefer critical alerts', () => { diff --git a/ts/test-node/util/sessionTranslation_test.ts b/ts/test-node/util/sessionTranslation_test.ts index b7b2948808..ba3652da23 100644 --- a/ts/test-node/util/sessionTranslation_test.ts +++ b/ts/test-node/util/sessionTranslation_test.ts @@ -6,9 +6,9 @@ import { assert } from 'chai'; import Long from 'long'; -import * as Bytes from '../../Bytes.js'; -import type { LocalUserDataType } from '../../util/sessionTranslation.js'; -import { sessionRecordToProtobuf } from '../../util/sessionTranslation.js'; +import * as Bytes from '../../Bytes.std.js'; +import type { LocalUserDataType } from '../../util/sessionTranslation.node.js'; +import { sessionRecordToProtobuf } from '../../util/sessionTranslation.node.js'; const getRecordCopy = (record: any): any => JSON.parse(JSON.stringify(record)); diff --git a/ts/test-node/util/setUtil_test.ts b/ts/test-node/util/setUtil_test.ts index 7b4adc29c1..76fe45df92 100644 --- a/ts/test-node/util/setUtil_test.ts +++ b/ts/test-node/util/setUtil_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { difference, isEqual, remove, toggle } from '../../util/setUtil.js'; +import { difference, isEqual, remove, toggle } from '../../util/setUtil.std.js'; describe('set utilities', () => { const original = new Set([1, 2, 3]); diff --git a/ts/test-node/util/signalRoutes_test.ts b/ts/test-node/util/signalRoutes_test.ts index 671c923973..68d09e8c85 100644 --- a/ts/test-node/util/signalRoutes_test.ts +++ b/ts/test-node/util/signalRoutes_test.ts @@ -1,14 +1,14 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import type { ParsedSignalRoute } from '../../util/signalRoutes.js'; +import type { ParsedSignalRoute } from '../../util/signalRoutes.std.js'; import { isSignalRoute, parseSignalRoute, toSignalRouteAppUrl, toSignalRouteUrl, toSignalRouteWebUrl, -} from '../../util/signalRoutes.js'; +} from '../../util/signalRoutes.std.js'; describe('signalRoutes', () => { type CheckConfig = { diff --git a/ts/test-node/util/sleep_test.ts b/ts/test-node/util/sleep_test.ts index 42850d0285..1cd9f6333d 100644 --- a/ts/test-node/util/sleep_test.ts +++ b/ts/test-node/util/sleep_test.ts @@ -4,7 +4,7 @@ import { assert } from 'chai'; import { useFakeTimers } from 'sinon'; -import { sleep } from '../../util/sleep.js'; +import { sleep } from '../../util/sleep.std.js'; describe('sleep', () => { beforeEach(function (this: Mocha.Context) { diff --git a/ts/test-node/util/sniffImageMimeType_test.ts b/ts/test-node/util/sniffImageMimeType_test.ts index f833507e12..df17821a68 100644 --- a/ts/test-node/util/sniffImageMimeType_test.ts +++ b/ts/test-node/util/sniffImageMimeType_test.ts @@ -11,9 +11,9 @@ import { IMAGE_JPEG, IMAGE_PNG, IMAGE_WEBP, -} from '../../types/MIME.js'; +} from '../../types/MIME.std.js'; -import { sniffImageMimeType } from '../../util/sniffImageMimeType.js'; +import { sniffImageMimeType } from '../../util/sniffImageMimeType.std.js'; describe('sniffImageMimeType', () => { const fixture = (filename: string): Promise => { diff --git a/ts/test-node/util/sortByTitle_test.ts b/ts/test-node/util/sortByTitle_test.ts index 227212287e..7d4e2b45a2 100644 --- a/ts/test-node/util/sortByTitle_test.ts +++ b/ts/test-node/util/sortByTitle_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { sortByTitle } from '../../util/sortByTitle.js'; +import { sortByTitle } from '../../util/sortByTitle.std.js'; describe('sortByTitle', () => { it("does nothing to arrays that don't need to be sorted", () => { diff --git a/ts/test-node/util/splitText_test.ts b/ts/test-node/util/splitText_test.ts index 63ef8b44f1..7ad463fc0e 100644 --- a/ts/test-node/util/splitText_test.ts +++ b/ts/test-node/util/splitText_test.ts @@ -3,8 +3,8 @@ import { assert } from 'chai'; -import type { SplitTextOptionsType } from '../../util/splitText.js'; -import { splitText } from '../../util/splitText.js'; +import type { SplitTextOptionsType } from '../../util/splitText.std.js'; +import { splitText } from '../../util/splitText.std.js'; describe('splitText', () => { describe('grapheme granularity', () => { diff --git a/ts/test-node/util/startTimeTravelDetector_test.ts b/ts/test-node/util/startTimeTravelDetector_test.ts index ec1a190b49..7374ef5231 100644 --- a/ts/test-node/util/startTimeTravelDetector_test.ts +++ b/ts/test-node/util/startTimeTravelDetector_test.ts @@ -3,7 +3,7 @@ import * as sinon from 'sinon'; -import { startTimeTravelDetector } from '../../util/startTimeTravelDetector.js'; +import { startTimeTravelDetector } from '../../util/startTimeTravelDetector.std.js'; describe('startTimeTravelDetector', () => { let sandbox: sinon.SinonSandbox; diff --git a/ts/test-node/util/theme_test.ts b/ts/test-node/util/theme_test.ts index 7769fb320c..95e2e88da8 100644 --- a/ts/test-node/util/theme_test.ts +++ b/ts/test-node/util/theme_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; -import { Theme, themeClassName } from '../../util/theme.js'; +import { Theme, themeClassName } from '../../util/theme.std.js'; describe('themeClassName', () => { it('returns "light-theme" when passed a light theme', () => { diff --git a/ts/test-node/util/timelineUtil_test.ts b/ts/test-node/util/timelineUtil_test.ts index 2d8bce0125..8470caf458 100644 --- a/ts/test-node/util/timelineUtil_test.ts +++ b/ts/test-node/util/timelineUtil_test.ts @@ -5,15 +5,15 @@ import { assert } from 'chai'; import lodash from 'lodash'; import { v4 as uuid } from 'uuid'; import type { LastMessageStatus } from '../../model-types.d.ts'; -import { MINUTE, SECOND } from '../../util/durations/index.js'; -import type { MaybeMessageTimelineItemType } from '../../util/timelineUtil.js'; +import { MINUTE, SECOND } from '../../util/durations/index.std.js'; +import type { MaybeMessageTimelineItemType } from '../../util/timelineUtil.std.js'; import { ScrollAnchor, areMessagesInSameGroup, getScrollAnchorBeforeUpdate, shouldCurrentMessageHideMetadata, TimelineMessageLoadingState, -} from '../../util/timelineUtil.js'; +} from '../../util/timelineUtil.std.js'; const { times } = lodash; diff --git a/ts/test-node/util/timestampLongUtils_test.ts b/ts/test-node/util/timestampLongUtils_test.ts index 192df07a40..d7f7e57509 100644 --- a/ts/test-node/util/timestampLongUtils_test.ts +++ b/ts/test-node/util/timestampLongUtils_test.ts @@ -10,8 +10,8 @@ import { getTimestampOrUndefinedFromLong, getCheckedTimestampFromLong, getCheckedTimestampOrUndefinedFromLong, -} from '../../util/timestampLongUtils.js'; -import { MAX_SAFE_DATE } from '../../util/timestamp.js'; +} from '../../util/timestampLongUtils.std.js'; +import { MAX_SAFE_DATE } from '../../util/timestamp.std.js'; describe('getSafeLongFromTimestamp', () => { it('returns zero when passed undefined', () => { diff --git a/ts/test-node/util/timestamp_test.ts b/ts/test-node/util/timestamp_test.ts index 98a8972fa4..b55fd17d5c 100644 --- a/ts/test-node/util/timestamp_test.ts +++ b/ts/test-node/util/timestamp_test.ts @@ -3,21 +3,15 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import moment from 'moment'; -import { HOUR, DAY } from '../../util/durations/index.js'; -import i18n from './i18n.js'; +import { HOUR, DAY } from '../../util/durations/index.std.js'; import { - formatDate, - formatDateTimeLong, - formatDateTimeShort, - formatTime, isMoreRecentThan, isOlderThan, isSameDay, isToday, toDayMillis, -} from '../../util/timestamp.js'; +} from '../../util/timestamp.std.js'; const FAKE_NOW = new Date('2020-01-23T04:56:00.000'); @@ -35,159 +29,6 @@ describe('timestamp', () => { }); } - describe('formatDate', () => { - useFakeTimers(); - - it('returns "Today" for times today', () => { - [moment(), moment().endOf('day'), moment().startOf('day')].forEach(m => { - assert.strictEqual(formatDate(i18n, m), 'Today'); - }); - }); - - it('returns "Yesterday" for times yesterday', () => { - const minus24Hours = moment().subtract(1, 'day'); - [ - minus24Hours, - minus24Hours.clone().endOf('day'), - minus24Hours.clone().startOf('day'), - ].forEach(m => { - assert.strictEqual(formatDate(i18n, m), 'Yesterday'); - }); - }); - - it('returns a formatted timestamp for dates more recent than six months', () => { - const m = moment().subtract(2, 'months'); - const result = formatDate(i18n, m); - assert.include(result, m.format('ddd')); - assert.include(result, m.format('MMM')); - assert.include(result, m.format('D')); - assert.notInclude(result, m.format('YYYY')); - }); - - it('returns a formatted timestamp for dates older than six months', () => { - assert.strictEqual(formatDate(i18n, moment('2017-03-03')), 'Mar 3, 2017'); - }); - }); - - describe('formatDateTimeLong', () => { - useFakeTimers(); - - it('includes "Today" and the time for times today', () => { - const rx = /Today \d+:\d+ [A|P]M/; - const datetime = formatDateTimeLong(i18n, FAKE_NOW); - assert.isTrue(rx.test(datetime)); - }); - - it('includes "Yesterday" and the time for times yesterday', () => { - const rx = /Yesterday \d+:\d+ [A|P]M/; - const datetime = formatDateTimeLong(i18n, moment().subtract(1, 'day')); - assert.isTrue(rx.test(datetime)); - }); - - it('formats month name, day of month, year, and time for other times', () => { - const rx = /Apr (19|20|21), 2000, \d+:\d+ [A|P]M/; - const datetime = formatDateTimeLong(i18n, new Date(956216013000)); - assert.isTrue(rx.test(datetime)); - }); - }); - - describe('formatDateTimeShort', () => { - useFakeTimers(); - - it('returns "Now" for times within the last minute, including unexpected times in the future', () => { - [ - Date.now(), - moment().subtract(1, 'second'), - moment().subtract(59, 'seconds'), - moment().add(1, 'minute'), - moment().add(1, 'year'), - ].forEach(timestamp => { - assert.strictEqual(formatDateTimeShort(i18n, timestamp), 'Now'); - }); - }); - - it('returns "X minutes ago" for times in the last hour, but older than 1 minute', () => { - assert.strictEqual( - formatDateTimeShort(i18n, moment().subtract(1, 'minute')), - '1m' - ); - assert.strictEqual( - formatDateTimeShort(i18n, moment().subtract(30, 'minutes')), - '30m' - ); - assert.strictEqual( - formatDateTimeShort(i18n, moment().subtract(59, 'minutes')), - '59m' - ); - }); - - it('returns hh:mm-like times for times older than 1 hour from now, but still today', () => { - const oneHourAgo = new Date('2020-01-23T03:56:00.000'); - const rx = /\d+:\d+ [A|P]M/; - const datetime = formatDateTimeLong(i18n, oneHourAgo); - assert.isTrue(rx.test(datetime)); - }); - - it('returns the day of the week for dates in the last week, but still this month', () => { - const yesterday = new Date('2020-01-22T23:56:00.000'); - assert.deepEqual(formatDateTimeShort(i18n, yesterday), 'Wed'); - - const twoDaysAgo = new Date('2020-01-21T05:56:00.000'); - assert.deepEqual(formatDateTimeShort(i18n, twoDaysAgo), 'Tue'); - }); - - it('returns the month and day for dates older than this week, but still this year', () => { - const earlier = new Date('2020-01-03T04:56:00.000'); - assert.deepEqual(formatDateTimeShort(i18n, earlier), 'Jan 3'); - }); - - it('returns the year, month, and day for dates older than a year ago', () => { - const longAgo = new Date('1998-11-23T12:34:00.000'); - assert.deepEqual(formatDateTimeShort(i18n, longAgo), 'Nov 23, 1998'); - }); - }); - - describe('formatTime', () => { - it('returns "Now" for times within the last minute, including unexpected times in the future', () => { - [ - FAKE_NOW, - moment(FAKE_NOW).subtract(1, 'second'), - moment(FAKE_NOW).subtract(59, 'seconds'), - moment(FAKE_NOW).add(1, 'minute'), - moment(FAKE_NOW).add(1, 'year'), - ].forEach(timestamp => { - assert.strictEqual(formatTime(i18n, timestamp, FAKE_NOW), 'Now'); - }); - }); - - it('returns "X minutes ago" for times in the last hour, but older than 1 minute', () => { - assert.strictEqual( - formatTime(i18n, moment(FAKE_NOW).subtract(1, 'minute'), FAKE_NOW), - '1m' - ); - assert.strictEqual( - formatTime(i18n, moment(FAKE_NOW).subtract(30, 'minutes'), FAKE_NOW), - '30m' - ); - assert.strictEqual( - formatTime(i18n, moment(FAKE_NOW).subtract(59, 'minutes'), FAKE_NOW), - '59m' - ); - }); - - it('returns hh:mm-like times for times older than 1 hour from now', () => { - const rx = /\d+:\d+ [A|P]M/; - const oneHourAgo = new Date('2020-01-23T03:56:00.000'); - assert.isTrue(rx.test(formatTime(i18n, oneHourAgo, FAKE_NOW))); - - const oneDayAgo = new Date('2020-01-22T04:56:00.000'); - assert.isTrue(rx.test(formatTime(i18n, oneDayAgo, FAKE_NOW))); - - const oneYearAgo = new Date('2019-01-23T04:56:00.000'); - assert.isTrue(rx.test(formatTime(i18n, oneYearAgo, FAKE_NOW))); - }); - }); - describe('isOlderThan', () => { it('returns false on recent and future timestamps', () => { assert.isFalse(isOlderThan(Date.now(), DAY)); diff --git a/ts/test-node/util/toWebStream_test.ts b/ts/test-node/util/toWebStream_test.ts index 3116f56d54..2bd9980dce 100644 --- a/ts/test-node/util/toWebStream_test.ts +++ b/ts/test-node/util/toWebStream_test.ts @@ -4,7 +4,7 @@ import { assert } from 'chai'; import { Readable } from 'node:stream'; import { once } from 'node:events'; -import { toWebStream } from '../../util/toWebStream.js'; +import { toWebStream } from '../../util/toWebStream.node.js'; describe('toWebStream', () => { it('only reads what it needs', async () => { diff --git a/ts/test-node/util/toggleMaximizedBrowserWindow_test.ts b/ts/test-node/util/toggleMaximizedBrowserWindow_test.ts index 68360fcb8b..963f751d55 100644 --- a/ts/test-node/util/toggleMaximizedBrowserWindow_test.ts +++ b/ts/test-node/util/toggleMaximizedBrowserWindow_test.ts @@ -4,7 +4,7 @@ import * as sinon from 'sinon'; import type { BrowserWindow } from 'electron'; -import { toggleMaximizedBrowserWindow } from '../../util/toggleMaximizedBrowserWindow.js'; +import { toggleMaximizedBrowserWindow } from '../../util/toggleMaximizedBrowserWindow.std.js'; describe('toggleMaximizedBrowserWindow', () => { const createFakeWindow = () => ({ diff --git a/ts/test-node/util/unicodeBidi_test.ts b/ts/test-node/util/unicodeBidi_test.ts index 8a80eae392..2456a10b8b 100644 --- a/ts/test-node/util/unicodeBidi_test.ts +++ b/ts/test-node/util/unicodeBidi_test.ts @@ -13,7 +13,7 @@ import { LTR_OVERRIDE, RTL_EMBEDDING, RTL_OVERRIDE, -} from '../../util/unicodeBidi.js'; +} from '../../util/unicodeBidi.std.js'; function debugUnicode(text: string) { return text diff --git a/ts/test-node/util/unicodeSlice_test.ts b/ts/test-node/util/unicodeSlice_test.ts index 05ec01ddbf..76abc606c9 100644 --- a/ts/test-node/util/unicodeSlice_test.ts +++ b/ts/test-node/util/unicodeSlice_test.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import assert from 'node:assert/strict'; -import { unicodeSlice } from '../../util/unicodeSlice.js'; -import { byteLength } from '../../Bytes.js'; +import { unicodeSlice } from '../../util/unicodeSlice.std.js'; +import { byteLength } from '../../Bytes.std.js'; describe('unicodeSlice()', () => { function test( diff --git a/ts/test-node/util/uploads/helpers.ts b/ts/test-node/util/uploads/helpers.ts index 5216c2798f..a56a3bbe24 100644 --- a/ts/test-node/util/uploads/helpers.ts +++ b/ts/test-node/util/uploads/helpers.ts @@ -9,7 +9,7 @@ import type { Server, OutgoingHttpHeaders, } from 'node:http'; -import { strictAssert } from '../../../util/assert.js'; +import { strictAssert } from '../../../util/assert.std.js'; export type NextResponse = Readonly<{ status: number; diff --git a/ts/test-node/util/uploads/tusProtocol_test.ts b/ts/test-node/util/uploads/tusProtocol_test.ts index 468ff929b4..409c1a61a8 100644 --- a/ts/test-node/util/uploads/tusProtocol_test.ts +++ b/ts/test-node/util/uploads/tusProtocol_test.ts @@ -8,9 +8,9 @@ import { _tusGetCurrentOffsetRequest, _tusResumeUploadRequest, tusUpload, -} from '../../../util/uploads/tusProtocol.js'; -import { TestServer, body } from './helpers.js'; -import { toLogFormat } from '../../../types/errors.js'; +} from '../../../util/uploads/tusProtocol.node.js'; +import { TestServer, body } from './helpers.node.js'; +import { toLogFormat } from '../../../types/errors.std.js'; describe('tusProtocol', () => { describe('_getUploadMetadataHeader', () => { diff --git a/ts/test-node/util/url_test.ts b/ts/test-node/util/url_test.ts index bb920a245c..5469a40bc4 100644 --- a/ts/test-node/util/url_test.ts +++ b/ts/test-node/util/url_test.ts @@ -2,13 +2,13 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { size } from '../../util/iterables.js'; +import { size } from '../../util/iterables.std.js'; import { maybeParseUrl, setUrlSearchParams, urlPathFromComponents, -} from '../../util/url.js'; +} from '../../util/url.std.js'; describe('URL utilities', () => { describe('maybeParseUrl', () => { diff --git a/ts/test-node/util/userLanguages_test.ts b/ts/test-node/util/userLanguages_test.ts index 7da216a45d..3e001b2d44 100644 --- a/ts/test-node/util/userLanguages_test.ts +++ b/ts/test-node/util/userLanguages_test.ts @@ -5,7 +5,7 @@ import { assert } from 'chai'; import { formatAcceptLanguageHeader, getUserLanguages, -} from '../../util/userLanguages.js'; +} from '../../util/userLanguages.std.js'; describe('user language utilities', () => { describe('formatAcceptLanguageHeader', () => { diff --git a/ts/test-node/util/version_test.ts b/ts/test-node/util/version_test.ts index e3262a3006..23f9655b00 100644 --- a/ts/test-node/util/version_test.ts +++ b/ts/test-node/util/version_test.ts @@ -13,7 +13,7 @@ import { isBeta, isProduction, isStaging, -} from '../../util/version.js'; +} from '../../util/version.std.js'; describe('version utilities', () => { describe('isProduction', () => { diff --git a/ts/test-node/util/waitBatcher_test.ts b/ts/test-node/util/waitBatcher_test.ts index 4f75586f73..fdaf16ced7 100644 --- a/ts/test-node/util/waitBatcher_test.ts +++ b/ts/test-node/util/waitBatcher_test.ts @@ -4,9 +4,9 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import { createWaitBatcher } from '../../util/waitBatcher.js'; -import { drop } from '../../util/drop.js'; -import { sleep } from '../../util/sleep.js'; +import { createWaitBatcher } from '../../util/waitBatcher.std.js'; +import { drop } from '../../util/drop.std.js'; +import { sleep } from '../../util/sleep.std.js'; describe('waitBatcher', () => { let processBatch: sinon.SinonSpy; diff --git a/ts/test-node/util/waitForAll.ts b/ts/test-node/util/waitForAll.ts index f64c6b995e..c67638ec2a 100644 --- a/ts/test-node/util/waitForAll.ts +++ b/ts/test-node/util/waitForAll.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { assert } from 'chai'; -import { waitForAll } from '../../util/waitForAll.js'; +import { waitForAll } from '../../util/waitForAll.std.js'; describe('util/waitForAll', () => { it('returns result of provided tasks', async () => { diff --git a/ts/test-node/util/webSafeBase64_test.ts b/ts/test-node/util/webSafeBase64_test.ts index 3d39a4f477..89141f76ef 100644 --- a/ts/test-node/util/webSafeBase64_test.ts +++ b/ts/test-node/util/webSafeBase64_test.ts @@ -6,7 +6,7 @@ import { assert } from 'chai'; import { toWebSafeBase64, fromWebSafeBase64, -} from '../../util/webSafeBase64.js'; +} from '../../util/webSafeBase64.std.js'; describe('both/util/webSafeBase64', () => { it('roundtrips with all elements', () => { diff --git a/ts/test-node/util/windowsZoneIdentifier_test.ts b/ts/test-node/util/windowsZoneIdentifier_test.ts index 0be2625a57..e86f2005ac 100644 --- a/ts/test-node/util/windowsZoneIdentifier_test.ts +++ b/ts/test-node/util/windowsZoneIdentifier_test.ts @@ -8,7 +8,7 @@ import * as fs from 'node:fs'; import * as fse from 'fs-extra'; import * as Sinon from 'sinon'; -import { writeWindowsZoneIdentifier } from '../../util/windowsZoneIdentifier.js'; +import { writeWindowsZoneIdentifier } from '../../util/windowsZoneIdentifier.node.js'; describe('writeWindowsZoneIdentifier', () => { before(function (this: Mocha.Context) { diff --git a/ts/test-node/util/wrapEventEmitterOnce_test.ts b/ts/test-node/util/wrapEventEmitterOnce_test.ts index fe8904e3ca..d3c97d3b5e 100644 --- a/ts/test-node/util/wrapEventEmitterOnce_test.ts +++ b/ts/test-node/util/wrapEventEmitterOnce_test.ts @@ -4,7 +4,7 @@ import { assert } from 'chai'; import { EventEmitter } from 'node:events'; -import { wrapEventEmitterOnce as once } from '../../util/wrapEventEmitterOnce.js'; +import { wrapEventEmitterOnce as once } from '../../util/wrapEventEmitterOnce.node.js'; describe('wrapEventEmitterOnce', () => { let ee: EventEmitter; diff --git a/ts/textsecure/AccountManager.ts b/ts/textsecure/AccountManager.ts index fb2b6ea68d..5a76531cc6 100644 --- a/ts/textsecure/AccountManager.ts +++ b/ts/textsecure/AccountManager.ts @@ -9,7 +9,7 @@ import { BackupKey, } from '@signalapp/libsignal-client/dist/AccountKeys.js'; -import EventTarget from './EventTarget.js'; +import EventTarget from './EventTarget.std.js'; import { type UploadKeysType, type UploadKyberPreKeyType, @@ -23,7 +23,7 @@ import { createAccount, linkDevice, authenticate, -} from './WebAPI.js'; +} from './WebAPI.preload.js'; import type { CompatPreKeyType, CompatSignedPreKeyType, @@ -31,11 +31,11 @@ import type { KyberPreKeyType, PniKeyMaterialType, } from './Types.d.ts'; -import createTaskWithTimeout from './TaskWithTimeout.js'; -import * as Bytes from '../Bytes.js'; -import * as Errors from '../types/errors.js'; -import { isMockEnvironment } from '../environment.js'; -import { senderCertificateService } from '../services/senderCertificate.js'; +import createTaskWithTimeout from './TaskWithTimeout.std.js'; +import * as Bytes from '../Bytes.std.js'; +import * as Errors from '../types/errors.std.js'; +import { isMockEnvironment } from '../environment.std.js'; +import { senderCertificateService } from '../services/senderCertificate.preload.js'; import { decryptDeviceName, deriveStorageServiceKey, @@ -43,42 +43,42 @@ import { encryptDeviceName, generateRegistrationId, getRandomBytes, -} from '../Crypto.js'; +} from '../Crypto.node.js'; import { generateKeyPair, generateKyberPreKey, generatePreKey, generateSignedPreKey, -} from '../Curve.js'; +} from '../Curve.node.js'; import type { AciString, PniString, ServiceIdString, -} from '../types/ServiceId.js'; +} from '../types/ServiceId.std.js'; import { isUntaggedPniString, normalizePni, ServiceIdKind, toTaggedPni, -} from '../types/ServiceId.js'; -import { normalizeAci } from '../util/normalizeAci.js'; -import { drop } from '../util/drop.js'; -import { isMoreRecentThan, isOlderThan } from '../util/timestamp.js'; -import { ourProfileKeyService } from '../services/ourProfileKey.js'; -import { strictAssert } from '../util/assert.js'; -import { getRegionCodeForNumber } from '../util/libphonenumberUtil.js'; -import { isNotNil } from '../util/isNotNil.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { SignalService as Proto } from '../protobuf/index.js'; -import { createLogger } from '../logging/log.js'; -import type { StorageAccessType } from '../types/Storage.js'; -import { getRelativePath, createName } from '../util/attachmentPath.js'; -import { isLinkAndSyncEnabled } from '../util/isLinkAndSyncEnabled.js'; -import { getMessageQueueTime } from '../util/getMessageQueueTime.js'; -import { canAttemptRemoteBackupDownload } from '../util/isBackupEnabled.js'; -import { signalProtocolStore } from '../SignalProtocolStore.js'; -import { itemStorage } from './Storage.js'; -import { deriveAccessKeyFromProfileKey } from '../util/zkgroup.js'; +} from '../types/ServiceId.std.js'; +import { normalizeAci } from '../util/normalizeAci.std.js'; +import { drop } from '../util/drop.std.js'; +import { isMoreRecentThan, isOlderThan } from '../util/timestamp.std.js'; +import { ourProfileKeyService } from '../services/ourProfileKey.std.js'; +import { strictAssert } from '../util/assert.std.js'; +import { getRegionCodeForNumber } from '../util/libphonenumberUtil.std.js'; +import { isNotNil } from '../util/isNotNil.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; +import { createLogger } from '../logging/log.std.js'; +import type { StorageAccessType } from '../types/Storage.d.ts'; +import { getRelativePath, createName } from '../util/attachmentPath.node.js'; +import { isLinkAndSyncEnabled } from '../util/isLinkAndSyncEnabled.preload.js'; +import { getMessageQueueTime } from '../util/getMessageQueueTime.dom.js'; +import { canAttemptRemoteBackupDownload } from '../util/isBackupEnabled.preload.js'; +import { signalProtocolStore } from '../SignalProtocolStore.preload.js'; +import { itemStorage } from './Storage.preload.js'; +import { deriveAccessKeyFromProfileKey } from '../util/zkgroup.node.js'; const { isNumber, omit, orderBy } = lodash; diff --git a/ts/textsecure/ContactsParser.ts b/ts/textsecure/ContactsParser.ts index 5edbd9320e..1d8c4998c1 100644 --- a/ts/textsecure/ContactsParser.ts +++ b/ts/textsecure/ContactsParser.ts @@ -3,26 +3,26 @@ import { Transform } from 'node:stream'; -import { createLogger } from '../logging/log.js'; -import { SignalService as Proto } from '../protobuf/index.js'; -import protobuf from '../protobuf/wrap.js'; -import { DurationInSeconds } from '../util/durations/index.js'; +import { createLogger } from '../logging/log.std.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; +import protobuf from '../protobuf/wrap.node.js'; +import { DurationInSeconds } from '../util/durations/index.std.js'; import { getAbsoluteAttachmentPath, writeNewAttachmentData, deleteAttachmentData, -} from '../util/migrations.js'; -import type { ContactAvatarType } from '../types/Avatar.js'; -import type { AttachmentType } from '../types/Attachment.js'; -import type { AciString } from '../types/ServiceId.js'; -import { computeHash } from '../Crypto.js'; -import { dropNull } from '../util/dropNull.js'; -import { fromAciUuidBytesOrString } from '../util/ServiceId.js'; -import * as Bytes from '../Bytes.js'; -import { decryptAttachmentV2ToSink } from '../AttachmentCrypto.js'; +} from '../util/migrations.preload.js'; +import type { ContactAvatarType } from '../types/Avatar.std.js'; +import type { AttachmentType } from '../types/Attachment.std.js'; +import type { AciString } from '../types/ServiceId.std.js'; +import { computeHash } from '../Crypto.node.js'; +import { dropNull } from '../util/dropNull.std.js'; +import { fromAciUuidBytesOrString } from '../util/ServiceId.node.js'; +import * as Bytes from '../Bytes.std.js'; +import { decryptAttachmentV2ToSink } from '../AttachmentCrypto.node.js'; import Avatar = Proto.ContactDetails.IAvatar; -import { stringToMIMEType } from '../types/MIME.js'; +import { stringToMIMEType } from '../types/MIME.std.js'; const log = createLogger('ContactsParser'); diff --git a/ts/textsecure/Errors.ts b/ts/textsecure/Errors.ts index a0ac2d3410..64c052eae2 100644 --- a/ts/textsecure/Errors.ts +++ b/ts/textsecure/Errors.ts @@ -5,9 +5,9 @@ import type { LibSignalErrorBase } from '@signalapp/libsignal-client'; -import { parseRetryAfter } from '../util/parseRetryAfter.js'; -import type { ServiceIdString } from '../types/ServiceId.js'; -import type { HTTPError } from '../types/HTTPError.js'; +import { parseRetryAfter } from '../util/parseRetryAfter.std.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; +import type { HTTPError } from '../types/HTTPError.std.js'; import type { HeaderListType } from '../types/WebAPI.d.ts'; import type { CallbackResultType } from './Types.d.ts'; diff --git a/ts/textsecure/KeyChangeListener.ts b/ts/textsecure/KeyChangeListener.ts index d8a08b3c57..ad4a451a53 100644 --- a/ts/textsecure/KeyChangeListener.ts +++ b/ts/textsecure/KeyChangeListener.ts @@ -1,8 +1,8 @@ // Copyright 2017 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ServiceIdString } from '../types/ServiceId.js'; -import type { SignalProtocolStore } from '../SignalProtocolStore.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; +import type { SignalProtocolStore } from '../SignalProtocolStore.preload.js'; export function init(signalProtocolStore: SignalProtocolStore): void { signalProtocolStore.on( diff --git a/ts/textsecure/MessageReceiver.ts b/ts/textsecure/MessageReceiver.ts index 05831ee1ef..eea7df7ed3 100644 --- a/ts/textsecure/MessageReceiver.ts +++ b/ts/textsecure/MessageReceiver.ts @@ -38,22 +38,22 @@ import { SenderKeys, Sessions, SignedPreKeys, -} from '../LibSignalStores.js'; -import { createName } from '../util/attachmentPath.js'; -import { assertDev, strictAssert } from '../util/assert.js'; -import type { BatcherType } from '../util/batcher.js'; -import { createBatcher } from '../util/batcher.js'; -import { drop } from '../util/drop.js'; -import { dropNull } from '../util/dropNull.js'; -import { parseIntOrThrow } from '../util/parseIntOrThrow.js'; -import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.js'; -import { Zone } from '../util/Zone.js'; -import * as durations from '../util/durations/index.js'; -import { DurationInSeconds } from '../util/durations/index.js'; -import { Address } from '../types/Address.js'; -import { QualifiedAddress } from '../types/QualifiedAddress.js'; -import { normalizeStoryDistributionId } from '../types/StoryDistributionId.js'; -import type { ServiceIdString, AciString } from '../types/ServiceId.js'; +} from '../LibSignalStores.preload.js'; +import { createName } from '../util/attachmentPath.node.js'; +import { assertDev, strictAssert } from '../util/assert.std.js'; +import type { BatcherType } from '../util/batcher.std.js'; +import { createBatcher } from '../util/batcher.std.js'; +import { drop } from '../util/drop.std.js'; +import { dropNull } from '../util/dropNull.std.js'; +import { parseIntOrThrow } from '../util/parseIntOrThrow.std.js'; +import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.std.js'; +import { Zone } from '../util/Zone.std.js'; +import * as durations from '../util/durations/index.std.js'; +import { DurationInSeconds } from '../util/durations/index.std.js'; +import { Address } from '../types/Address.std.js'; +import { QualifiedAddress } from '../types/QualifiedAddress.std.js'; +import { normalizeStoryDistributionId } from '../types/StoryDistributionId.std.js'; +import type { ServiceIdString, AciString } from '../types/ServiceId.std.js'; import { fromPniObject, isPniString, @@ -63,33 +63,33 @@ import { normalizeServiceId, ServiceIdKind, toTaggedPni, -} from '../types/ServiceId.js'; -import { normalizeAci } from '../util/normalizeAci.js'; -import { isAciString } from '../util/isAciString.js'; -import { calling } from '../services/calling.js'; -import { retryPlaceholders } from '../services/retryPlaceholders.js'; -import * as Errors from '../types/errors.js'; -import { signalProtocolStore } from '../SignalProtocolStore.js'; +} from '../types/ServiceId.std.js'; +import { normalizeAci } from '../util/normalizeAci.std.js'; +import { isAciString } from '../util/isAciString.std.js'; +import { calling } from '../services/calling.preload.js'; +import { retryPlaceholders } from '../services/retryPlaceholders.std.js'; +import * as Errors from '../types/errors.std.js'; +import { signalProtocolStore } from '../SignalProtocolStore.preload.js'; -import { SignalService as Proto } from '../protobuf/index.js'; -import { deriveGroupFields, MASTER_KEY_LENGTH } from '../groups.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; +import { deriveGroupFields, MASTER_KEY_LENGTH } from '../groups.preload.js'; -import createTaskWithTimeout from './TaskWithTimeout.js'; +import createTaskWithTimeout from './TaskWithTimeout.std.js'; import { processAttachment, processDataMessage, processGroupV2Context, processPreview, -} from './processDataMessage.js'; -import { processSyncMessage } from './processSyncMessage.js'; -import type { EventHandler } from './EventTarget.js'; -import EventTarget from './EventTarget.js'; -import type { IncomingWebSocketRequest } from './WebsocketResources.js'; -import { ServerRequestType } from './WebsocketResources.js'; -import { type Storage } from './Storage.js'; -import { accountManager } from './AccountManager.js'; -import { WarnOnlyError } from './Errors.js'; -import * as Bytes from '../Bytes.js'; +} from './processDataMessage.preload.js'; +import { processSyncMessage } from './processSyncMessage.node.js'; +import type { EventHandler } from './EventTarget.std.js'; +import EventTarget from './EventTarget.std.js'; +import type { IncomingWebSocketRequest } from './WebsocketResources.preload.js'; +import { ServerRequestType } from './WebsocketResources.preload.js'; +import { type Storage } from './Storage.preload.js'; +import { accountManager } from './AccountManager.preload.js'; +import { WarnOnlyError } from './Errors.std.js'; +import * as Bytes from '../Bytes.std.js'; import type { IRequestHandler, ProcessedAttachment, @@ -109,7 +109,7 @@ import type { AddressableMessage, ReadSyncEventData, ViewSyncEventData, -} from './messageReceiverEvents.js'; +} from './messageReceiverEvents.std.js'; import { AttachmentBackfillResponseSyncEvent, CallEventSyncEvent, @@ -142,36 +142,36 @@ import { ViewEvent, ViewOnceOpenSyncEvent, ViewSyncEvent, -} from './messageReceiverEvents.js'; -import { createLogger } from '../logging/log.js'; -import { diffArraysAsSets } from '../util/diffArraysAsSets.js'; -import { generateBlurHash } from '../util/generateBlurHash.js'; -import { TEXT_ATTACHMENT } from '../types/MIME.js'; -import type { SendTypesType } from '../util/handleMessageSend.js'; -import { getStoriesBlocked } from '../util/stories.js'; -import { isNotNil } from '../util/isNotNil.js'; -import { chunk } from '../util/iterables.js'; -import { inspectUnknownFieldTags } from '../util/inspectProtobufs.js'; -import { incrementMessageCounter } from '../util/incrementMessageCounter.js'; -import { filterAndClean } from '../types/BodyRange.js'; +} from './messageReceiverEvents.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { diffArraysAsSets } from '../util/diffArraysAsSets.std.js'; +import { generateBlurHash } from '../util/generateBlurHash.std.js'; +import { TEXT_ATTACHMENT } from '../types/MIME.std.js'; +import type { SendTypesType } from '../util/handleMessageSend.preload.js'; +import { getStoriesBlocked } from '../util/stories.preload.js'; +import { isNotNil } from '../util/isNotNil.std.js'; +import { chunk } from '../util/iterables.std.js'; +import { inspectUnknownFieldTags } from '../util/inspectProtobufs.node.js'; +import { incrementMessageCounter } from '../util/incrementMessageCounter.preload.js'; +import { filterAndClean } from '../types/BodyRange.std.js'; import { getCallEventForProto, getCallLogEventForProto, -} from '../util/callDisposition.js'; -import { checkOurPniIdentityKey } from '../util/checkOurPniIdentityKey.js'; -import { CallLinkUpdateSyncType } from '../types/CallLink.js'; -import { bytesToUuid } from '../util/uuidToBytes.js'; -import { isBodyTooLong } from '../util/longAttachment.js'; +} from '../util/callDisposition.preload.js'; +import { checkOurPniIdentityKey } from '../util/checkOurPniIdentityKey.preload.js'; +import { CallLinkUpdateSyncType } from '../types/CallLink.std.js'; +import { bytesToUuid } from '../util/uuidToBytes.std.js'; +import { isBodyTooLong } from '../util/longAttachment.std.js'; import { fromServiceIdBinaryOrString, fromAciUuidBytes, fromAciUuidBytesOrString, fromPniUuidBytesOrUntaggedString, -} from '../util/ServiceId.js'; +} from '../util/ServiceId.node.js'; import { type MessageRequestResponseInfo, MessageRequestResponseSource, -} from '../types/MessageRequestResponseEvent.js'; +} from '../types/MessageRequestResponseEvent.std.js'; const { isBoolean, isNumber, isString, noop, omit } = lodash; diff --git a/ts/textsecure/OutgoingMessage.ts b/ts/textsecure/OutgoingMessage.ts index 65bff583e0..bcfbfea0c0 100644 --- a/ts/textsecure/OutgoingMessage.ts +++ b/ts/textsecure/OutgoingMessage.ts @@ -28,31 +28,34 @@ import { sendMessagesUnauth, getKeysForServiceId as doGetKeysForServiceId, getKeysForServiceIdUnauth, -} from './WebAPI.js'; -import type { MessageType } from './WebAPI.js'; -import type { SendMetadataType, SendOptionsType } from './SendMessage.js'; +} from './WebAPI.preload.js'; +import type { MessageType } from './WebAPI.preload.js'; +import type { + SendMetadataType, + SendOptionsType, +} from './SendMessage.preload.js'; import { OutgoingIdentityKeyError, OutgoingMessageError, SendMessageNetworkError, SendMessageChallengeError, UnregisteredUserError, -} from './Errors.js'; +} from './Errors.std.js'; import type { CallbackResultType, CustomError } from './Types.d.ts'; -import { Address } from '../types/Address.js'; -import * as Errors from '../types/errors.js'; -import { HTTPError } from '../types/HTTPError.js'; -import { QualifiedAddress } from '../types/QualifiedAddress.js'; -import type { ServiceIdString } from '../types/ServiceId.js'; -import { Sessions, IdentityKeys } from '../LibSignalStores.js'; -import { getKeysForServiceId } from './getKeysForServiceId.js'; -import { SignalService as Proto } from '../protobuf/index.js'; -import { createLogger } from '../logging/log.js'; -import type { GroupSendToken } from '../types/GroupSendEndorsements.js'; -import { isSignalServiceId } from '../util/isSignalConversation.js'; -import * as Bytes from '../Bytes.js'; -import { signalProtocolStore } from '../SignalProtocolStore.js'; -import { itemStorage } from './Storage.js'; +import { Address } from '../types/Address.std.js'; +import * as Errors from '../types/errors.std.js'; +import { HTTPError } from '../types/HTTPError.std.js'; +import { QualifiedAddress } from '../types/QualifiedAddress.std.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; +import { Sessions, IdentityKeys } from '../LibSignalStores.preload.js'; +import { getKeysForServiceId } from './getKeysForServiceId.preload.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; +import { createLogger } from '../logging/log.std.js'; +import type { GroupSendToken } from '../types/GroupSendEndorsements.std.js'; +import { isSignalServiceId } from '../util/isSignalConversation.dom.js'; +import * as Bytes from '../Bytes.std.js'; +import { signalProtocolStore } from '../SignalProtocolStore.preload.js'; +import { itemStorage } from './Storage.preload.js'; const { reject } = lodash; diff --git a/ts/textsecure/Provisioner.ts b/ts/textsecure/Provisioner.ts index 023a84d523..cf73dd24e2 100644 --- a/ts/textsecure/Provisioner.ts +++ b/ts/textsecure/Provisioner.ts @@ -3,35 +3,35 @@ import pTimeout, { TimeoutError as PTimeoutError } from 'p-timeout'; -import { createLogger } from '../logging/log.js'; -import * as Errors from '../types/errors.js'; -import { MAX_DEVICE_NAME_LENGTH } from '../types/InstallScreen.js'; -import { strictAssert } from '../util/assert.js'; -import { BackOff, FIBONACCI_TIMEOUTS } from '../util/BackOff.js'; -import { SECOND } from '../util/durations/index.js'; -import { explodePromise } from '../util/explodePromise.js'; -import { drop } from '../util/drop.js'; -import { isLinkAndSyncEnabled } from '../util/isLinkAndSyncEnabled.js'; -import { normalizeDeviceName } from '../util/normalizeDeviceName.js'; -import { linkDeviceRoute } from '../util/signalRoutes.js'; -import { sleep } from '../util/sleep.js'; -import * as Bytes from '../Bytes.js'; -import { SignalService as Proto } from '../protobuf/index.js'; +import { createLogger } from '../logging/log.std.js'; +import * as Errors from '../types/errors.std.js'; +import { MAX_DEVICE_NAME_LENGTH } from '../types/InstallScreen.std.js'; +import { strictAssert } from '../util/assert.std.js'; +import { BackOff, FIBONACCI_TIMEOUTS } from '../util/BackOff.std.js'; +import { SECOND } from '../util/durations/index.std.js'; +import { explodePromise } from '../util/explodePromise.std.js'; +import { drop } from '../util/drop.std.js'; +import { isLinkAndSyncEnabled } from '../util/isLinkAndSyncEnabled.preload.js'; +import { normalizeDeviceName } from '../util/normalizeDeviceName.std.js'; +import { linkDeviceRoute } from '../util/signalRoutes.std.js'; +import { sleep } from '../util/sleep.std.js'; +import * as Bytes from '../Bytes.std.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; import { type CreateLinkedDeviceOptionsType, AccountType, -} from './AccountManager.js'; +} from './AccountManager.preload.js'; import ProvisioningCipher, { type ProvisionDecryptResult, -} from './ProvisioningCipher.js'; +} from './ProvisioningCipher.node.js'; import { type IWebSocketResource, type IncomingWebSocketRequest, ServerRequestType, -} from './WebsocketResources.js'; -import { ConnectTimeoutError } from './Errors.js'; -import type { getProvisioningResource } from './WebAPI.js'; +} from './WebsocketResources.preload.js'; +import { ConnectTimeoutError } from './Errors.std.js'; +import type { getProvisioningResource } from './WebAPI.preload.js'; const log = createLogger('Provisioner'); diff --git a/ts/textsecure/ProvisioningCipher.ts b/ts/textsecure/ProvisioningCipher.ts index 4876017702..f3049a826e 100644 --- a/ts/textsecure/ProvisioningCipher.ts +++ b/ts/textsecure/ProvisioningCipher.ts @@ -5,21 +5,21 @@ import { PublicKey, Aci, Pni } from '@signalapp/libsignal-client'; import type { KeyPairType } from './Types.d.ts'; -import * as Bytes from '../Bytes.js'; +import * as Bytes from '../Bytes.std.js'; import { decryptAes256CbcPkcsPadding, deriveSecrets, verifyHmacSha256, -} from '../Crypto.js'; +} from '../Crypto.node.js'; import { calculateAgreement, createKeyPair, generateKeyPair, -} from '../Curve.js'; -import { SignalService as Proto } from '../protobuf/index.js'; -import { strictAssert } from '../util/assert.js'; -import { dropNull } from '../util/dropNull.js'; -import { normalizeAci } from '../util/normalizeAci.js'; +} from '../Curve.node.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; +import { strictAssert } from '../util/assert.std.js'; +import { dropNull } from '../util/dropNull.std.js'; +import { normalizeAci } from '../util/normalizeAci.std.js'; import { type AciString, type PniString, @@ -28,7 +28,7 @@ import { isUntaggedPniString, fromAciObject, fromPniObject, -} from '../types/ServiceId.js'; +} from '../types/ServiceId.std.js'; export type ProvisionDecryptResult = Readonly<{ aciKeyPair: KeyPairType; diff --git a/ts/textsecure/SendMessage.ts b/ts/textsecure/SendMessage.ts index 3828ec17f8..64a2adbf2a 100644 --- a/ts/textsecure/SendMessage.ts +++ b/ts/textsecure/SendMessage.ts @@ -15,88 +15,94 @@ import { SenderKeyDistributionMessage, } from '@signalapp/libsignal-client'; -import { GLOBAL_ZONE, signalProtocolStore } from '../SignalProtocolStore.js'; -import { DataWriter } from '../sql/Client.js'; -import type { ConversationModel } from '../models/conversations.js'; -import { assertDev, strictAssert } from '../util/assert.js'; -import { parseIntOrThrow } from '../util/parseIntOrThrow.js'; -import { Address } from '../types/Address.js'; -import { QualifiedAddress } from '../types/QualifiedAddress.js'; -import { SenderKeys } from '../LibSignalStores.js'; +import { + GLOBAL_ZONE, + signalProtocolStore, +} from '../SignalProtocolStore.preload.js'; +import { DataWriter } from '../sql/Client.preload.js'; +import type { ConversationModel } from '../models/conversations.preload.js'; +import { assertDev, strictAssert } from '../util/assert.std.js'; +import { parseIntOrThrow } from '../util/parseIntOrThrow.std.js'; +import { Address } from '../types/Address.std.js'; +import { QualifiedAddress } from '../types/QualifiedAddress.std.js'; +import { SenderKeys } from '../LibSignalStores.preload.js'; import type { TextAttachmentType, UploadedAttachmentType, -} from '../types/Attachment.js'; -import type { AciString, ServiceIdString } from '../types/ServiceId.js'; +} from '../types/Attachment.std.js'; +import type { AciString, ServiceIdString } from '../types/ServiceId.std.js'; import { ServiceIdKind, serviceIdSchema, isPniString, -} from '../types/ServiceId.js'; +} from '../types/ServiceId.std.js'; import { toAciObject, toPniObject, toServiceIdObject, -} from '../util/ServiceId.js'; -import createTaskWithTimeout from './TaskWithTimeout.js'; +} from '../util/ServiceId.node.js'; +import createTaskWithTimeout from './TaskWithTimeout.std.js'; import type { CallbackResultType } from './Types.d.ts'; import type { SerializedCertificateType, SendLogCallbackType, -} from './OutgoingMessage.js'; -import OutgoingMessage from './OutgoingMessage.js'; -import * as Bytes from '../Bytes.js'; -import { getRandomBytes } from '../Crypto.js'; +} from './OutgoingMessage.preload.js'; +import OutgoingMessage from './OutgoingMessage.preload.js'; +import * as Bytes from '../Bytes.std.js'; +import { getRandomBytes } from '../Crypto.node.js'; import { MessageError, SendMessageProtoError, NoSenderKeyError, -} from './Errors.js'; -import { BodyRange } from '../types/BodyRange.js'; -import { HTTPError } from '../types/HTTPError.js'; -import type { RawBodyRange } from '../types/BodyRange.js'; -import type { StoryContextType } from '../types/Util.js'; -import { concat, isEmpty } from '../util/iterables.js'; -import type { SendTypesType } from '../util/handleMessageSend.js'; -import { shouldSaveProto, sendTypesEnum } from '../util/handleMessageSend.js'; -import type { DurationInSeconds } from '../util/durations/index.js'; -import { SignalService as Proto } from '../protobuf/index.js'; -import { createLogger } from '../logging/log.js'; -import type { EmbeddedContactWithUploadedAvatar } from '../types/EmbeddedContact.js'; +} from './Errors.std.js'; +import { BodyRange } from '../types/BodyRange.std.js'; +import { HTTPError } from '../types/HTTPError.std.js'; +import type { RawBodyRange } from '../types/BodyRange.std.js'; +import type { StoryContextType } from '../types/Util.std.js'; +import { concat, isEmpty } from '../util/iterables.std.js'; +import type { SendTypesType } from '../util/handleMessageSend.preload.js'; +import { + shouldSaveProto, + sendTypesEnum, +} from '../util/handleMessageSend.preload.js'; +import type { DurationInSeconds } from '../util/durations/index.std.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; +import { createLogger } from '../logging/log.std.js'; +import type { EmbeddedContactWithUploadedAvatar } from '../types/EmbeddedContact.std.js'; import { numberToPhoneType, numberToEmailType, numberToAddressType, -} from '../types/EmbeddedContact.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { drop } from '../util/drop.js'; +} from '../types/EmbeddedContact.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { drop } from '../util/drop.std.js'; import type { ConversationIdentifier, DeleteForMeSyncEventData, DeleteMessageSyncTarget, AddressableMessage, -} from './messageReceiverEvents.js'; -import { getConversationFromTarget } from '../util/syncIdentifiers.js'; +} from './messageReceiverEvents.std.js'; +import { getConversationFromTarget } from '../util/syncIdentifiers.preload.js'; import type { CallDetails, CallHistoryDetails, -} from '../types/CallDisposition.js'; +} from '../types/CallDisposition.std.js'; import { AdhocCallStatus, DirectCallStatus, GroupCallStatus, CallMode, -} from '../types/CallDisposition.js'; +} from '../types/CallDisposition.std.js'; import { getBytesForPeerId, getCallIdForProto, getProtoForCallHistory, -} from '../util/callDisposition.js'; -import { MAX_MESSAGE_COUNT } from '../util/deleteForMe.types.js'; -import { isProtoBinaryEncodingEnabled } from '../util/isProtoBinaryEncodingEnabled.js'; -import type { GroupSendToken } from '../types/GroupSendEndorsements.js'; -import { itemStorage } from './Storage.js'; -import { accountManager } from './AccountManager.js'; +} from '../util/callDisposition.preload.js'; +import { MAX_MESSAGE_COUNT } from '../util/deleteForMe.types.std.js'; +import { isProtoBinaryEncodingEnabled } from '../util/isProtoBinaryEncodingEnabled.std.js'; +import type { GroupSendToken } from '../types/GroupSendEndorsements.std.js'; +import { itemStorage } from './Storage.preload.js'; +import { accountManager } from './AccountManager.preload.js'; const log = createLogger('SendMessage'); diff --git a/ts/textsecure/SocketManager.ts b/ts/textsecure/SocketManager.ts index ec3925bfda..6b9dece6ba 100644 --- a/ts/textsecure/SocketManager.ts +++ b/ts/textsecure/SocketManager.ts @@ -15,39 +15,39 @@ import EventListener from 'node:events'; import type { IncomingMessage } from 'node:http'; import { setTimeout as sleep } from 'node:timers/promises'; -import type { AbortableProcess } from '../util/AbortableProcess.js'; -import { strictAssert } from '../util/assert.js'; -import { explodePromise } from '../util/explodePromise.js'; +import type { AbortableProcess } from '../util/AbortableProcess.std.js'; +import { strictAssert } from '../util/assert.std.js'; +import { explodePromise } from '../util/explodePromise.std.js'; import { BackOff, EXTENDED_FIBONACCI_TIMEOUTS, FIBONACCI_TIMEOUTS, -} from '../util/BackOff.js'; -import * as durations from '../util/durations/index.js'; -import { drop } from '../util/drop.js'; -import type { ProxyAgent } from '../util/createProxyAgent.js'; -import { createProxyAgent } from '../util/createProxyAgent.js'; -import { type SocketInfo, SocketStatus } from '../types/SocketStatus.js'; -import { HTTPError } from '../types/HTTPError.js'; -import * as Errors from '../types/errors.js'; -import * as Bytes from '../Bytes.js'; -import { createLogger } from '../logging/log.js'; +} from '../util/BackOff.std.js'; +import * as durations from '../util/durations/index.std.js'; +import { drop } from '../util/drop.std.js'; +import type { ProxyAgent } from '../util/createProxyAgent.node.js'; +import { createProxyAgent } from '../util/createProxyAgent.node.js'; +import { type SocketInfo, SocketStatus } from '../types/SocketStatus.std.js'; +import { HTTPError } from '../types/HTTPError.std.js'; +import * as Errors from '../types/errors.std.js'; +import * as Bytes from '../Bytes.std.js'; +import { createLogger } from '../logging/log.std.js'; import type { IncomingWebSocketRequest, IWebSocketResource, WebSocketResourceOptions, -} from './WebsocketResources.js'; +} from './WebsocketResources.preload.js'; import WebSocketResource, { connectAuthenticatedLibsignal, connectUnauthenticatedLibsignal, ServerRequestType, -} from './WebsocketResources.js'; -import { ConnectTimeoutError } from './Errors.js'; +} from './WebsocketResources.preload.js'; +import { ConnectTimeoutError } from './Errors.std.js'; import type { IRequestHandler, WebAPICredentials } from './Types.d.ts'; -import { connect as connectWebSocket } from './WebSocket.js'; -import type { ServerAlert } from '../types/ServerAlert.js'; -import { getUserLanguages } from '../util/userLanguages.js'; +import { connect as connectWebSocket } from './WebSocket.preload.js'; +import type { ServerAlert } from '../types/ServerAlert.std.js'; +import { getUserLanguages } from '../util/userLanguages.std.js'; const log = createLogger('SocketManager'); diff --git a/ts/textsecure/Storage.ts b/ts/textsecure/Storage.ts index 9e5e42cedc..e6b4b759b9 100644 --- a/ts/textsecure/Storage.ts +++ b/ts/textsecure/Storage.ts @@ -5,11 +5,11 @@ import type { StorageAccessType as Access, StorageInterface, } from '../types/Storage.d.ts'; -import { User } from './storage/User.js'; -import { Blocked } from './storage/Blocked.js'; +import { User } from './storage/User.dom.js'; +import { Blocked } from './storage/Blocked.std.js'; -import { DataReader, DataWriter } from '../sql/Client.js'; -import { createLogger } from '../logging/log.js'; +import { DataReader, DataWriter } from '../sql/Client.preload.js'; +import { createLogger } from '../logging/log.std.js'; const log = createLogger('Storage'); diff --git a/ts/textsecure/TaskWithTimeout.ts b/ts/textsecure/TaskWithTimeout.ts index 897c29ab63..cc1130171f 100644 --- a/ts/textsecure/TaskWithTimeout.ts +++ b/ts/textsecure/TaskWithTimeout.ts @@ -1,11 +1,11 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { MINUTE } from '../util/durations/index.js'; -import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.js'; -import { explodePromise } from '../util/explodePromise.js'; -import { toLogFormat } from '../types/errors.js'; -import { createLogger } from '../logging/log.js'; +import { MINUTE } from '../util/durations/index.std.js'; +import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.std.js'; +import { explodePromise } from '../util/explodePromise.std.js'; +import { toLogFormat } from '../types/errors.std.js'; +import { createLogger } from '../logging/log.std.js'; const log = createLogger('TaskWithTimeout'); diff --git a/ts/textsecure/Types.d.ts b/ts/textsecure/Types.d.ts index 610a594dc1..a6dcf5d395 100644 --- a/ts/textsecure/Types.d.ts +++ b/ts/textsecure/Types.d.ts @@ -3,19 +3,19 @@ import type * as client from '@signalapp/libsignal-client'; -import type { SignalService as Proto } from '../protobuf/index.js'; -import type { IncomingWebSocketRequest } from './WebsocketResources.js'; +import type { SignalService as Proto } from '../protobuf/index.std.js'; +import type { IncomingWebSocketRequest } from './WebsocketResources.preload.js'; import type { ServiceIdString, AciString, PniString, -} from '../types/ServiceId.js'; -import type { TextAttachmentType } from '../types/Attachment.js'; -import type { GiftBadgeStates } from '../types/GiftBadgeStates.js'; -import type { MIMEType } from '../types/MIME.js'; -import type { DurationInSeconds } from '../util/durations/index.js'; -import type { AnyPaymentEvent } from '../types/Payment.js'; -import type { RawBodyRange } from '../types/BodyRange.js'; +} from '../types/ServiceId.std.js'; +import type { TextAttachmentType } from '../types/Attachment.std.js'; +import type { GiftBadgeStates } from '../types/GiftBadgeStates.std.js'; +import type { MIMEType } from '../types/MIME.std.js'; +import type { DurationInSeconds } from '../util/durations/index.std.js'; +import type { AnyPaymentEvent } from '../types/Payment.std.js'; +import type { RawBodyRange } from '../types/BodyRange.std.js'; export { IdentityKeyType, @@ -30,7 +30,7 @@ export { SignedPreKeyIdType, SignedPreKeyType, UnprocessedType, -} from '../sql/Interface.ts'; +} from '../sql/Interface.std.js'; export type StorageServiceCallOptionsType = { credentials?: StorageServiceCredentials; diff --git a/ts/textsecure/UpdateKeysListener.ts b/ts/textsecure/UpdateKeysListener.ts index 4c41940730..9a0d59070d 100644 --- a/ts/textsecure/UpdateKeysListener.ts +++ b/ts/textsecure/UpdateKeysListener.ts @@ -1,16 +1,16 @@ // Copyright 2017 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as durations from '../util/durations/index.js'; -import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.js'; -import * as Registration from '../util/registration.js'; -import { ServiceIdKind } from '../types/ServiceId.js'; -import { createLogger } from '../logging/log.js'; -import * as Errors from '../types/errors.js'; -import { HTTPError } from '../types/HTTPError.js'; -import { isOnline } from './WebAPI.js'; -import { itemStorage } from './Storage.js'; -import { accountManager } from './AccountManager.js'; +import * as durations from '../util/durations/index.std.js'; +import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary.std.js'; +import * as Registration from '../util/registration.preload.js'; +import { ServiceIdKind } from '../types/ServiceId.std.js'; +import { createLogger } from '../logging/log.std.js'; +import * as Errors from '../types/errors.std.js'; +import { HTTPError } from '../types/HTTPError.std.js'; +import { isOnline } from './WebAPI.preload.js'; +import { itemStorage } from './Storage.preload.js'; +import { accountManager } from './AccountManager.preload.js'; const log = createLogger('UpdateKeysListener'); diff --git a/ts/textsecure/Utils.ts b/ts/textsecure/Utils.ts index be1db7e18b..3520e187d0 100644 --- a/ts/textsecure/Utils.ts +++ b/ts/textsecure/Utils.ts @@ -1,7 +1,7 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { HTTPError } from '../types/HTTPError.js'; +import type { HTTPError } from '../types/HTTPError.std.js'; export async function handleStatusCode(status: number): Promise { if (status === 499) { diff --git a/ts/textsecure/WebAPI.ts b/ts/textsecure/WebAPI.ts index f3cc8feca4..3645c905f8 100644 --- a/ts/textsecure/WebAPI.ts +++ b/ts/textsecure/WebAPI.ts @@ -23,54 +23,57 @@ import type { } from '@signalapp/libsignal-client'; import { AccountAttributes } from '@signalapp/libsignal-client/dist/net.js'; -import { assertDev, strictAssert } from '../util/assert.js'; -import * as durations from '../util/durations/index.js'; -import type { ExplodePromiseResultType } from '../util/explodePromise.js'; -import { explodePromise } from '../util/explodePromise.js'; -import { getUserAgent } from '../util/getUserAgent.js'; -import { getTimeoutStream } from '../util/getStreamWithTimeout.js'; -import { toWebSafeBase64, fromWebSafeBase64 } from '../util/webSafeBase64.js'; -import { getBasicAuth } from '../util/getBasicAuth.js'; -import { createHTTPSAgent } from '../util/createHTTPSAgent.js'; -import { createProxyAgent } from '../util/createProxyAgent.js'; -import type { ProxyAgent } from '../util/createProxyAgent.js'; -import type { FetchFunctionType } from '../util/uploads/tusProtocol.js'; -import { VerificationTransport } from '../types/VerificationTransport.js'; +import { assertDev, strictAssert } from '../util/assert.std.js'; +import * as durations from '../util/durations/index.std.js'; +import type { ExplodePromiseResultType } from '../util/explodePromise.std.js'; +import { explodePromise } from '../util/explodePromise.std.js'; +import { getUserAgent } from '../util/getUserAgent.node.js'; +import { getTimeoutStream } from '../util/getStreamWithTimeout.node.js'; +import { + toWebSafeBase64, + fromWebSafeBase64, +} from '../util/webSafeBase64.std.js'; +import { getBasicAuth } from '../util/getBasicAuth.std.js'; +import { createHTTPSAgent } from '../util/createHTTPSAgent.node.js'; +import { createProxyAgent } from '../util/createProxyAgent.node.js'; +import type { ProxyAgent } from '../util/createProxyAgent.node.js'; +import type { FetchFunctionType } from '../util/uploads/tusProtocol.node.js'; +import { VerificationTransport } from '../types/VerificationTransport.std.js'; import type { CapabilitiesType, CapabilitiesUploadType, } from '../types/Capabilities.d.ts'; import type { HeaderListType } from '../types/WebAPI.d.ts'; -import { ZERO_ACCESS_KEY } from '../types/SealedSender.js'; -import { toLogFormat } from '../types/errors.js'; -import { isPackIdValid, redactPackId } from '../util/Stickers.js'; +import { ZERO_ACCESS_KEY } from '../types/SealedSender.std.js'; +import { toLogFormat } from '../types/errors.std.js'; +import { isPackIdValid, redactPackId } from '../util/Stickers.std.js'; import type { ServiceIdString, AciString, UntaggedPniString, -} from '../types/ServiceId.js'; +} from '../types/ServiceId.std.js'; import { ServiceIdKind, serviceIdSchema, aciSchema, untaggedPniSchema, -} from '../types/ServiceId.js'; -import type { BackupPresentationHeadersType } from '../types/backups.js'; -import { HTTPError } from '../types/HTTPError.js'; -import * as Bytes from '../Bytes.js'; -import { getRandomBytes, randomInt } from '../Crypto.js'; -import * as linkPreviewFetch from '../linkPreviews/linkPreviewFetch.js'; -import { isBadgeImageFileUrlValid } from '../badges/isBadgeImageFileUrlValid.js'; +} from '../types/ServiceId.std.js'; +import type { BackupPresentationHeadersType } from '../types/backups.node.js'; +import { HTTPError } from '../types/HTTPError.std.js'; +import * as Bytes from '../Bytes.std.js'; +import { getRandomBytes, randomInt } from '../Crypto.node.js'; +import * as linkPreviewFetch from '../linkPreviews/linkPreviewFetch.preload.js'; +import { isBadgeImageFileUrlValid } from '../badges/isBadgeImageFileUrlValid.std.js'; import { SocketManager, type SocketStatuses, type SocketExpirationReason, -} from './SocketManager.js'; +} from './SocketManager.preload.js'; import type { CDSAuthType, CDSResponseType } from './cds/Types.d.ts'; -import { CDSI } from './cds/CDSI.js'; -import { SignalService as Proto } from '../protobuf/index.js'; -import { isEnabled as isRemoteConfigEnabled } from '../RemoteConfig.js'; +import { CDSI } from './cds/CDSI.node.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; +import { isEnabled as isRemoteConfigEnabled } from '../RemoteConfig.dom.js'; import type { WebAPICredentials, @@ -78,34 +81,37 @@ import type { StorageServiceCallOptionsType, StorageServiceCredentials, } from './Types.d.ts'; -import { handleStatusCode, translateError } from './Utils.js'; -import { createLogger } from '../logging/log.js'; -import { maybeParseUrl, urlPathFromComponents } from '../util/url.js'; -import { HOUR, MINUTE, SECOND } from '../util/durations/index.js'; -import { safeParseNumber } from '../util/numbers.js'; -import type { IWebSocketResource } from './WebsocketResources.js'; -import { getLibsignalNet } from './preconnect.js'; -import type { GroupSendToken } from '../types/GroupSendEndorsements.js'; +import { handleStatusCode, translateError } from './Utils.dom.js'; +import { createLogger } from '../logging/log.std.js'; +import { maybeParseUrl, urlPathFromComponents } from '../util/url.std.js'; +import { HOUR, MINUTE, SECOND } from '../util/durations/index.std.js'; +import { safeParseNumber } from '../util/numbers.std.js'; +import type { IWebSocketResource } from './WebsocketResources.preload.js'; +import { getLibsignalNet } from './preconnect.preload.js'; +import type { GroupSendToken } from '../types/GroupSendEndorsements.std.js'; import { parseUnknown, safeParseUnknown, type Schema, -} from '../util/schemas.js'; +} from '../util/schemas.std.js'; import type { ProfileFetchAuthRequestOptions, ProfileFetchUnauthRequestOptions, -} from '../services/profiles.js'; -import { ToastType } from '../types/Toast.js'; -import { isProduction } from '../util/version.js'; -import type { ServerAlert } from '../types/ServerAlert.js'; -import { isAbortError } from '../util/isAbortError.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { drop } from '../util/drop.js'; -import { subscriptionConfigurationCurrencyZod } from '../types/Donations.js'; -import type { StripeDonationAmount, CardDetail } from '../types/Donations.js'; -import { badgeFromServerSchema } from '../badges/parseBadgesFromServer.js'; -import { ZERO_DECIMAL_CURRENCIES } from '../util/currency.js'; -import type { JobCancelReason } from '../jobs/types.js'; +} from '../services/profiles.preload.js'; +import { ToastType } from '../types/Toast.dom.js'; +import { isProduction } from '../util/version.std.js'; +import type { ServerAlert } from '../types/ServerAlert.std.js'; +import { isAbortError } from '../util/isAbortError.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { drop } from '../util/drop.std.js'; +import { subscriptionConfigurationCurrencyZod } from '../types/Donations.std.js'; +import type { + StripeDonationAmount, + CardDetail, +} from '../types/Donations.std.js'; +import { badgeFromServerSchema } from '../badges/parseBadgesFromServer.std.js'; +import { ZERO_DECIMAL_CURRENCIES } from '../util/currency.dom.js'; +import type { JobCancelReason } from '../jobs/types.std.js'; const { escapeRegExp, isNumber, throttle } = lodash; diff --git a/ts/textsecure/WebSocket.ts b/ts/textsecure/WebSocket.ts index 65b0ed58d0..a8798ec225 100644 --- a/ts/textsecure/WebSocket.ts +++ b/ts/textsecure/WebSocket.ts @@ -5,18 +5,18 @@ import ws from 'websocket'; import type { connection as WebSocket } from 'websocket'; import type { IncomingMessage } from 'node:http'; -import { AbortableProcess } from '../util/AbortableProcess.js'; -import { strictAssert } from '../util/assert.js'; -import { explodePromise } from '../util/explodePromise.js'; -import { getUserAgent } from '../util/getUserAgent.js'; -import * as durations from '../util/durations/index.js'; -import type { ProxyAgent } from '../util/createProxyAgent.js'; -import { createHTTPSAgent } from '../util/createHTTPSAgent.js'; -import { HTTPError } from '../types/HTTPError.js'; -import { createLogger } from '../logging/log.js'; -import * as Timers from '../Timers.js'; -import { ConnectTimeoutError } from './Errors.js'; -import { handleStatusCode, translateError } from './Utils.js'; +import { AbortableProcess } from '../util/AbortableProcess.std.js'; +import { strictAssert } from '../util/assert.std.js'; +import { explodePromise } from '../util/explodePromise.std.js'; +import { getUserAgent } from '../util/getUserAgent.node.js'; +import * as durations from '../util/durations/index.std.js'; +import type { ProxyAgent } from '../util/createProxyAgent.node.js'; +import { createHTTPSAgent } from '../util/createHTTPSAgent.node.js'; +import { HTTPError } from '../types/HTTPError.std.js'; +import { createLogger } from '../logging/log.std.js'; +import * as Timers from '../Timers.dom.js'; +import { ConnectTimeoutError } from './Errors.std.js'; +import { handleStatusCode, translateError } from './Utils.dom.js'; const { client: WebSocketClient } = ws; diff --git a/ts/textsecure/WebsocketResources.ts b/ts/textsecure/WebsocketResources.ts index 8ffc126caa..06155a9295 100644 --- a/ts/textsecure/WebsocketResources.ts +++ b/ts/textsecure/WebsocketResources.ts @@ -41,26 +41,26 @@ import type { ChatServiceListener, ConnectionEventsListener, } from '@signalapp/libsignal-client/dist/net/Chat.js'; -import type { EventHandler } from './EventTarget.js'; -import EventTarget from './EventTarget.js'; +import type { EventHandler } from './EventTarget.std.js'; +import EventTarget from './EventTarget.std.js'; -import * as durations from '../util/durations/index.js'; -import { dropNull } from '../util/dropNull.js'; -import { drop } from '../util/drop.js'; -import { isOlderThan } from '../util/timestamp.js'; -import { strictAssert } from '../util/assert.js'; -import * as Errors from '../types/errors.js'; -import { SignalService as Proto } from '../protobuf/index.js'; -import { createLogger } from '../logging/log.js'; -import * as Timers from '../Timers.js'; -import type { IResource } from './WebSocket.js'; +import * as durations from '../util/durations/index.std.js'; +import { dropNull } from '../util/dropNull.std.js'; +import { drop } from '../util/drop.std.js'; +import { isOlderThan } from '../util/timestamp.std.js'; +import { strictAssert } from '../util/assert.std.js'; +import * as Errors from '../types/errors.std.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; +import { createLogger } from '../logging/log.std.js'; +import * as Timers from '../Timers.dom.js'; +import type { IResource } from './WebSocket.preload.js'; -import { AbortableProcess } from '../util/AbortableProcess.js'; -import type { WebAPICredentials } from './Types.js'; -import { NORMAL_DISCONNECT_CODE } from './SocketManager.js'; -import { parseUnknown } from '../util/schemas.js'; -import { parseServerAlertsFromHeader } from '../util/handleServerAlerts.js'; -import type { ServerAlert } from '../types/ServerAlert.js'; +import { AbortableProcess } from '../util/AbortableProcess.std.js'; +import type { WebAPICredentials } from './Types.d.ts'; +import { NORMAL_DISCONNECT_CODE } from './SocketManager.preload.js'; +import { parseUnknown } from '../util/schemas.std.js'; +import { parseServerAlertsFromHeader } from '../util/handleServerAlerts.preload.js'; +import type { ServerAlert } from '../types/ServerAlert.std.js'; const log = createLogger('WebsocketResources'); diff --git a/ts/textsecure/cds/CDSBase.ts b/ts/textsecure/cds/CDSBase.ts index 2e246b39d9..33164d1bc1 100644 --- a/ts/textsecure/cds/CDSBase.ts +++ b/ts/textsecure/cds/CDSBase.ts @@ -6,11 +6,11 @@ import type { CDSRequestOptionsType, CDSResponseType, } from './Types.d.ts'; -import type { LoggerType } from '../../types/Logging.js'; -import { isOlderThan } from '../../util/timestamp.js'; -import { HOUR } from '../../util/durations/index.js'; -import { createProxyAgent } from '../../util/createProxyAgent.js'; -import type { ProxyAgent } from '../../util/createProxyAgent.js'; +import type { LoggerType } from '../../types/Logging.std.js'; +import { isOlderThan } from '../../util/timestamp.std.js'; +import { HOUR } from '../../util/durations/index.std.js'; +import { createProxyAgent } from '../../util/createProxyAgent.node.js'; +import type { ProxyAgent } from '../../util/createProxyAgent.node.js'; // It is 24 hours, but we don't want latency between server and client to be // count. diff --git a/ts/textsecure/cds/CDSI.ts b/ts/textsecure/cds/CDSI.ts index fa1be83346..7b4bc34362 100644 --- a/ts/textsecure/cds/CDSI.ts +++ b/ts/textsecure/cds/CDSI.ts @@ -10,11 +10,11 @@ import { LibSignalErrorBase, } from '@signalapp/libsignal-client'; import pTimeout from 'p-timeout'; -import type { CDSBaseOptionsType } from './CDSBase.js'; -import { CDSBase } from './CDSBase.js'; -import type { CDSRequestOptionsType, CDSResponseType } from './Types.js'; -import { sleep } from '../../util/sleep.js'; -import * as durations from '../../util/durations/index.js'; +import type { CDSBaseOptionsType } from './CDSBase.node.js'; +import { CDSBase } from './CDSBase.node.js'; +import type { CDSRequestOptionsType, CDSResponseType } from './Types.d.ts'; +import { sleep } from '../../util/sleep.std.js'; +import * as durations from '../../util/durations/index.std.js'; export type CDSIOptionsType = CDSBaseOptionsType; diff --git a/ts/textsecure/cds/CDSISocket.ts b/ts/textsecure/cds/CDSISocket.ts index 052e62798d..91ec49ee8e 100644 --- a/ts/textsecure/cds/CDSISocket.ts +++ b/ts/textsecure/cds/CDSISocket.ts @@ -3,10 +3,10 @@ import { Cds2Client } from '@signalapp/libsignal-client'; -import { strictAssert } from '../../util/assert.js'; -import { SignalService as Proto } from '../../protobuf/index.js'; -import { CDSSocketBase, CDSSocketState } from './CDSSocketBase.js'; -import type { CDSSocketBaseOptionsType } from './CDSSocketBase.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { SignalService as Proto } from '../../protobuf/index.std.js'; +import { CDSSocketBase, CDSSocketState } from './CDSSocketBase.node.js'; +import type { CDSSocketBaseOptionsType } from './CDSSocketBase.node.js'; export type CDSISocketOptionsType = Readonly<{ mrenclave: Uint8Array; diff --git a/ts/textsecure/cds/CDSSocketBase.ts b/ts/textsecure/cds/CDSSocketBase.ts index cb7f6a8502..00a071d069 100644 --- a/ts/textsecure/cds/CDSSocketBase.ts +++ b/ts/textsecure/cds/CDSSocketBase.ts @@ -7,20 +7,20 @@ import lodash from 'lodash'; import type { connection as WebSocket } from 'websocket'; import Long from 'long'; -import type { LoggerType } from '../../types/Logging.js'; -import { strictAssert } from '../../util/assert.js'; -import { isUntaggedPniString, toTaggedPni } from '../../types/ServiceId.js'; -import { isAciString } from '../../util/isAciString.js'; -import * as Bytes from '../../Bytes.js'; -import { UUID_BYTE_SIZE } from '../../types/Crypto.js'; -import { uuidToBytes, bytesToUuid } from '../../util/uuidToBytes.js'; -import { SignalService as Proto } from '../../protobuf/index.js'; +import type { LoggerType } from '../../types/Logging.std.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { isUntaggedPniString, toTaggedPni } from '../../types/ServiceId.std.js'; +import { isAciString } from '../../util/isAciString.std.js'; +import * as Bytes from '../../Bytes.std.js'; +import { UUID_BYTE_SIZE } from '../../types/Crypto.std.js'; +import { uuidToBytes, bytesToUuid } from '../../util/uuidToBytes.std.js'; +import { SignalService as Proto } from '../../protobuf/index.std.js'; import type { CDSRequestOptionsType, CDSResponseEntryType, CDSResponseType, } from './Types.d.ts'; -import { RateLimitedError } from './RateLimitedError.js'; +import { RateLimitedError } from './RateLimitedError.std.js'; const { noop } = lodash; diff --git a/ts/textsecure/cds/Types.d.ts b/ts/textsecure/cds/Types.d.ts index 7bf9ee2ad8..3306b1182c 100644 --- a/ts/textsecure/cds/Types.d.ts +++ b/ts/textsecure/cds/Types.d.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { Net } from '@signalapp/libsignal-client'; -import type { AciString, PniString } from '../../types/ServiceId.js'; +import type { AciString, PniString } from '../../types/ServiceId.std.js'; export type CDSAuthType = Net.ServiceAuth; export type CDSResponseEntryType = Net.CDSResponseEntryType< diff --git a/ts/textsecure/downloadAttachment.ts b/ts/textsecure/downloadAttachment.ts index 4528de2614..a895db1d24 100644 --- a/ts/textsecure/downloadAttachment.ts +++ b/ts/textsecure/downloadAttachment.ts @@ -9,22 +9,22 @@ import { Transform } from 'node:stream'; import { pipeline } from 'node:stream/promises'; import fsExtra from 'fs-extra'; -import { createLogger } from '../logging/log.js'; -import * as Errors from '../types/errors.js'; -import { strictAssert } from '../util/assert.js'; +import { createLogger } from '../logging/log.std.js'; +import * as Errors from '../types/errors.std.js'; +import { strictAssert } from '../util/assert.std.js'; import { getAbsoluteDownloadsPath, getAbsoluteAttachmentPath, -} from '../util/migrations.js'; -import { hasRequiredInformationForBackup } from '../util/Attachment.js'; +} from '../util/migrations.preload.js'; +import { hasRequiredInformationForBackup } from '../util/Attachment.std.js'; import { AttachmentSizeError, type AttachmentType, AttachmentVariant, AttachmentPermanentlyUndownloadableError, type BackupableAttachmentType, -} from '../types/Attachment.js'; -import * as Bytes from '../Bytes.js'; +} from '../types/Attachment.std.js'; +import * as Bytes from '../Bytes.std.js'; import { safeUnlink, splitKeys, @@ -32,30 +32,33 @@ import { decryptAndReencryptLocally, measureSize, type IntegrityCheckType, -} from '../AttachmentCrypto.js'; +} from '../AttachmentCrypto.node.js'; import type { ProcessedAttachment } from './Types.d.ts'; -import type { getAttachment, getAttachmentFromBackupTier } from './WebAPI.js'; -import { getAttachmentCiphertextSize } from '../util/AttachmentCrypto.js'; -import { createName, getRelativePath } from '../util/attachmentPath.js'; -import { MediaTier } from '../types/AttachmentDownload.js'; +import type { + getAttachment, + getAttachmentFromBackupTier, +} from './WebAPI.preload.js'; +import { getAttachmentCiphertextSize } from '../util/AttachmentCrypto.std.js'; +import { createName, getRelativePath } from '../util/attachmentPath.node.js'; +import { MediaTier } from '../types/AttachmentDownload.std.js'; import { getBackupMediaRootKey, deriveBackupMediaKeyMaterial, type BackupMediaKeyMaterialType, deriveBackupThumbnailTransitKeyMaterial, -} from '../services/backups/crypto.js'; -import { backupsService } from '../services/backups/index.js'; +} from '../services/backups/crypto.preload.js'; +import { backupsService } from '../services/backups/index.preload.js'; import { getMediaIdForAttachment, getMediaIdForAttachmentThumbnail, -} from '../services/backups/util/mediaId.js'; -import { MAX_BACKUP_THUMBNAIL_SIZE } from '../types/VisualAttachment.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { IV_LENGTH, MAC_LENGTH } from '../types/Crypto.js'; -import { BackupCredentialType } from '../types/backups.js'; -import { HTTPError } from '../types/HTTPError.js'; -import { getValue } from '../RemoteConfig.js'; -import { parseIntOrThrow } from '../util/parseIntOrThrow.js'; +} from '../services/backups/util/mediaId.preload.js'; +import { MAX_BACKUP_THUMBNAIL_SIZE } from '../types/VisualAttachment.dom.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { IV_LENGTH, MAC_LENGTH } from '../types/Crypto.std.js'; +import { BackupCredentialType } from '../types/backups.node.js'; +import { HTTPError } from '../types/HTTPError.std.js'; +import { getValue } from '../RemoteConfig.dom.js'; +import { parseIntOrThrow } from '../util/parseIntOrThrow.std.js'; const { ensureFile } = fsExtra; diff --git a/ts/textsecure/getKeysForServiceId.ts b/ts/textsecure/getKeysForServiceId.ts index 719557a748..8eec5fcb83 100644 --- a/ts/textsecure/getKeysForServiceId.ts +++ b/ts/textsecure/getKeysForServiceId.ts @@ -11,23 +11,26 @@ import { PublicKey, } from '@signalapp/libsignal-client'; -import { OutgoingIdentityKeyError, UnregisteredUserError } from './Errors.js'; -import { Sessions, IdentityKeys } from '../LibSignalStores.js'; -import { Address } from '../types/Address.js'; -import { QualifiedAddress } from '../types/QualifiedAddress.js'; -import type { ServiceIdString } from '../types/ServiceId.js'; +import { + OutgoingIdentityKeyError, + UnregisteredUserError, +} from './Errors.std.js'; +import { Sessions, IdentityKeys } from '../LibSignalStores.preload.js'; +import { Address } from '../types/Address.std.js'; +import { QualifiedAddress } from '../types/QualifiedAddress.std.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; import type { getKeysForServiceId as doGetKeysForServiceId, getKeysForServiceIdUnauth, ServerKeysType, -} from './WebAPI.js'; -import { createLogger } from '../logging/log.js'; -import { isRecord } from '../util/isRecord.js'; -import type { GroupSendToken } from '../types/GroupSendEndorsements.js'; -import { HTTPError } from '../types/HTTPError.js'; -import { onFailedToSendWithEndorsements } from '../util/groupSendEndorsements.js'; -import { signalProtocolStore } from '../SignalProtocolStore.js'; -import { itemStorage } from './Storage.js'; +} from './WebAPI.preload.js'; +import { createLogger } from '../logging/log.std.js'; +import { isRecord } from '../util/isRecord.std.js'; +import type { GroupSendToken } from '../types/GroupSendEndorsements.std.js'; +import { HTTPError } from '../types/HTTPError.std.js'; +import { onFailedToSendWithEndorsements } from '../util/groupSendEndorsements.preload.js'; +import { signalProtocolStore } from '../SignalProtocolStore.preload.js'; +import { itemStorage } from './Storage.preload.js'; const log = createLogger('getKeysForServiceId'); diff --git a/ts/textsecure/messageReceiverEvents.ts b/ts/textsecure/messageReceiverEvents.ts index 10cbd2fd6c..3c9b4c13bc 100644 --- a/ts/textsecure/messageReceiverEvents.ts +++ b/ts/textsecure/messageReceiverEvents.ts @@ -5,13 +5,13 @@ import type { PublicKey } from '@signalapp/libsignal-client'; import { z } from 'zod'; -import type { SignalService as Proto } from '../protobuf/index.js'; +import type { SignalService as Proto } from '../protobuf/index.std.js'; import { type ServiceIdString, type AciString, isPniString, -} from '../types/ServiceId.js'; -import type { StoryDistributionIdString } from '../types/StoryDistributionId.js'; +} from '../types/ServiceId.std.js'; +import type { StoryDistributionIdString } from '../types/StoryDistributionId.std.js'; import type { ProcessedEnvelope, ProcessedDataMessage, @@ -21,9 +21,9 @@ import type { import type { CallEventDetails, CallLogEventDetails, -} from '../types/CallDisposition.js'; -import type { CallLinkUpdateSyncType } from '../types/CallLink.js'; -import { isAciString } from '../util/isAciString.js'; +} from '../types/CallDisposition.std.js'; +import type { CallLinkUpdateSyncType } from '../types/CallLink.std.js'; +import { isAciString } from '../util/isAciString.std.js'; export class EmptyEvent extends Event { constructor() { diff --git a/ts/textsecure/preconnect.ts b/ts/textsecure/preconnect.ts index 0032a7692c..81bdab1c7b 100644 --- a/ts/textsecure/preconnect.ts +++ b/ts/textsecure/preconnect.ts @@ -3,14 +3,14 @@ import { Net } from '@signalapp/libsignal-client'; -import { getUserAgent } from '../util/getUserAgent.js'; -import { isStagingServer } from '../util/isStagingServer.js'; -import { getMockServerPort } from '../util/getMockServerPort.js'; -import { isMockServer } from '../util/isMockServer.js'; -import { pemToDer } from '../util/pemToDer.js'; -import { drop } from '../util/drop.js'; -import { toLogFormat } from '../types/errors.js'; -import { createLogger } from '../logging/log.js'; +import { getUserAgent } from '../util/getUserAgent.node.js'; +import { isStagingServer } from '../util/isStagingServer.dom.js'; +import { getMockServerPort } from '../util/getMockServerPort.dom.js'; +import { isMockServer } from '../util/isMockServer.dom.js'; +import { pemToDer } from '../util/pemToDer.std.js'; +import { drop } from '../util/drop.std.js'; +import { toLogFormat } from '../types/errors.std.js'; +import { createLogger } from '../logging/log.std.js'; const log = createLogger('preconnect'); diff --git a/ts/textsecure/processDataMessage.ts b/ts/textsecure/processDataMessage.ts index fbe378f741..2ef8286556 100644 --- a/ts/textsecure/processDataMessage.ts +++ b/ts/textsecure/processDataMessage.ts @@ -5,13 +5,13 @@ import Long from 'long'; import { ReceiptCredentialPresentation } from '@signalapp/libsignal-client/zkgroup.js'; import lodash from 'lodash'; -import { assertDev, strictAssert } from '../util/assert.js'; -import { dropNull, shallowDropNull } from '../util/dropNull.js'; -import { fromAciUuidBytesOrString } from '../util/ServiceId.js'; -import { getTimestampFromLong } from '../util/timestampLongUtils.js'; -import { SignalService as Proto } from '../protobuf/index.js'; -import { deriveGroupFields } from '../groups.js'; -import * as Bytes from '../Bytes.js'; +import { assertDev, strictAssert } from '../util/assert.std.js'; +import { dropNull, shallowDropNull } from '../util/dropNull.std.js'; +import { fromAciUuidBytesOrString } from '../util/ServiceId.node.js'; +import { getTimestampFromLong } from '../util/timestampLongUtils.std.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; +import { deriveGroupFields } from '../groups.preload.js'; +import * as Bytes from '../Bytes.std.js'; import type { ProcessedAttachment, @@ -29,16 +29,19 @@ import type { ProcessedGiftBadge, ProcessedStoryContext, } from './Types.d.ts'; -import { GiftBadgeStates } from '../types/GiftBadgeStates.js'; -import { APPLICATION_OCTET_STREAM, stringToMIMEType } from '../types/MIME.js'; -import { SECOND, DurationInSeconds } from '../util/durations/index.js'; -import type { AnyPaymentEvent } from '../types/Payment.js'; -import { PaymentEventKind } from '../types/Payment.js'; -import { filterAndClean } from '../types/BodyRange.js'; -import { bytesToUuid } from '../util/uuidToBytes.js'; -import { createName } from '../util/attachmentPath.js'; -import { partitionBodyAndNormalAttachments } from '../util/Attachment.js'; -import { isNotNil } from '../util/isNotNil.js'; +import { GiftBadgeStates } from '../types/GiftBadgeStates.std.js'; +import { + APPLICATION_OCTET_STREAM, + stringToMIMEType, +} from '../types/MIME.std.js'; +import { SECOND, DurationInSeconds } from '../util/durations/index.std.js'; +import type { AnyPaymentEvent } from '../types/Payment.std.js'; +import { PaymentEventKind } from '../types/Payment.std.js'; +import { filterAndClean } from '../types/BodyRange.std.js'; +import { bytesToUuid } from '../util/uuidToBytes.std.js'; +import { createName } from '../util/attachmentPath.node.js'; +import { partitionBodyAndNormalAttachments } from '../util/Attachment.std.js'; +import { isNotNil } from '../util/isNotNil.std.js'; const { isNumber } = lodash; diff --git a/ts/textsecure/processSyncMessage.ts b/ts/textsecure/processSyncMessage.ts index 03681e7676..b2ef2d3054 100644 --- a/ts/textsecure/processSyncMessage.ts +++ b/ts/textsecure/processSyncMessage.ts @@ -1,9 +1,9 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { SignalService as Proto } from '../protobuf/index.js'; -import type { ServiceIdString } from '../types/ServiceId.js'; -import { fromServiceIdBinaryOrString } from '../util/ServiceId.js'; +import type { SignalService as Proto } from '../protobuf/index.std.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; +import { fromServiceIdBinaryOrString } from '../util/ServiceId.node.js'; import type { ProcessedSent, ProcessedSyncMessage } from './Types.d.ts'; type ProtoServiceId = Readonly<{ diff --git a/ts/textsecure/storage/Blocked.ts b/ts/textsecure/storage/Blocked.ts index 49c3a37fd3..ab30902d13 100644 --- a/ts/textsecure/storage/Blocked.ts +++ b/ts/textsecure/storage/Blocked.ts @@ -3,11 +3,11 @@ import lodash from 'lodash'; -import { createLogger } from '../../logging/log.js'; -import * as Bytes from '../../Bytes.js'; -import { isAciString } from '../../util/isAciString.js'; +import { createLogger } from '../../logging/log.std.js'; +import * as Bytes from '../../Bytes.std.js'; +import { isAciString } from '../../util/isAciString.std.js'; import type { StorageInterface } from '../../types/Storage.d.ts'; -import type { AciString, ServiceIdString } from '../../types/ServiceId.js'; +import type { AciString, ServiceIdString } from '../../types/ServiceId.std.js'; const { without } = lodash; diff --git a/ts/textsecure/storage/User.ts b/ts/textsecure/storage/User.ts index bded556f74..6f58bb29fc 100644 --- a/ts/textsecure/storage/User.ts +++ b/ts/textsecure/storage/User.ts @@ -3,18 +3,18 @@ import type { WebAPICredentials } from '../Types.d.ts'; -import { strictAssert } from '../../util/assert.js'; +import { strictAssert } from '../../util/assert.std.js'; import type { StorageInterface } from '../../types/Storage.d.ts'; import type { AciString, PniString, ServiceIdString, -} from '../../types/ServiceId.js'; -import { ServiceIdKind, isPniString } from '../../types/ServiceId.js'; -import { isAciString } from '../../util/isAciString.js'; -import { createLogger } from '../../logging/log.js'; +} from '../../types/ServiceId.std.js'; +import { ServiceIdKind, isPniString } from '../../types/ServiceId.std.js'; +import { isAciString } from '../../util/isAciString.std.js'; +import { createLogger } from '../../logging/log.std.js'; -import Helpers from '../Helpers.js'; +import Helpers from '../Helpers.std.js'; const log = createLogger('User'); diff --git a/ts/textsecure/syncRequests.ts b/ts/textsecure/syncRequests.ts index 739e20ef9f..8e20c5939f 100644 --- a/ts/textsecure/syncRequests.ts +++ b/ts/textsecure/syncRequests.ts @@ -1,10 +1,10 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log.js'; -import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue.js'; -import { MessageSender } from './SendMessage.js'; -import { toLogFormat } from '../types/errors.js'; +import { createLogger } from '../logging/log.std.js'; +import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue.preload.js'; +import { MessageSender } from './SendMessage.preload.js'; +import { toLogFormat } from '../types/errors.std.js'; const log = createLogger('syncRequests'); diff --git a/ts/types/Address.ts b/ts/types/Address.ts index 029eaef1ae..738f933d5b 100644 --- a/ts/types/Address.ts +++ b/ts/types/Address.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ServiceIdString } from './ServiceId.js'; +import type { ServiceIdString } from './ServiceId.std.js'; export type AddressStringType = `${ServiceIdString}.${number}`; diff --git a/ts/types/Attachment.ts b/ts/types/Attachment.ts index 837eb8cbaa..52273db6df 100644 --- a/ts/types/Attachment.ts +++ b/ts/types/Attachment.ts @@ -2,10 +2,13 @@ // SPDX-License-Identifier: AGPL-3.0-only /* eslint-disable max-classes-per-file */ -import type { LinkPreviewForUIType } from './message/LinkPreviews.js'; -import type { MIMEType } from './MIME.js'; -import type { WithOptionalProperties, WithRequiredProperties } from './Util.js'; -import type { SignalService as Proto } from '../protobuf/index.js'; +import type { LinkPreviewForUIType } from './message/LinkPreviews.std.js'; +import type { MIMEType } from './MIME.std.js'; +import type { + WithOptionalProperties, + WithRequiredProperties, +} from './Util.std.js'; +import type { SignalService as Proto } from '../protobuf/index.std.js'; export type ThumbnailType = EphemeralAttachmentFields & { size: number; diff --git a/ts/types/AttachmentBackup.ts b/ts/types/AttachmentBackup.ts index db2cae7dbc..1d96bfb4ad 100644 --- a/ts/types/AttachmentBackup.ts +++ b/ts/types/AttachmentBackup.ts @@ -4,8 +4,8 @@ import { z } from 'zod'; import { type JobManagerJobType, jobManagerJobSchema, -} from '../jobs/JobManager.js'; -import { type MIMEType, MIMETypeSchema } from './MIME.js'; +} from '../jobs/JobManager.std.js'; +import { type MIMEType, MIMETypeSchema } from './MIME.std.js'; export type CoreAttachmentBackupJobType = | StandardAttachmentBackupJobType diff --git a/ts/types/AttachmentDownload.ts b/ts/types/AttachmentDownload.ts index 52f0ec07f9..ca54b74f3e 100644 --- a/ts/types/AttachmentDownload.ts +++ b/ts/types/AttachmentDownload.ts @@ -1,13 +1,13 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import { z } from 'zod'; -import { MIMETypeSchema, type MIMEType } from './MIME.js'; -import type { AttachmentType } from './Attachment.js'; +import { MIMETypeSchema, type MIMEType } from './MIME.std.js'; +import type { AttachmentType } from './Attachment.std.js'; import { type JobManagerJobType, jobManagerJobSchema, -} from '../jobs/JobManager.js'; -import { AttachmentDownloadSource } from '../sql/Interface.js'; +} from '../jobs/JobManager.std.js'; +import { AttachmentDownloadSource } from '../sql/Interface.std.js'; export enum MediaTier { STANDARD = 'standard', diff --git a/ts/types/AttachmentSize.ts b/ts/types/AttachmentSize.ts index 203bc2924a..d1ab1ee80e 100644 --- a/ts/types/AttachmentSize.ts +++ b/ts/types/AttachmentSize.ts @@ -1,9 +1,9 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log.js'; -import { parseIntOrThrow } from '../util/parseIntOrThrow.js'; -import type * as RemoteConfig from '../RemoteConfig.js'; +import { createLogger } from '../logging/log.std.js'; +import { parseIntOrThrow } from '../util/parseIntOrThrow.std.js'; +import type * as RemoteConfig from '../RemoteConfig.dom.js'; const log = createLogger('AttachmentSize'); diff --git a/ts/types/Avatar.ts b/ts/types/Avatar.ts index 0f687c3b2e..8620cc99f7 100644 --- a/ts/types/Avatar.ts +++ b/ts/types/Avatar.ts @@ -1,9 +1,9 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AvatarColorType } from './Colors.js'; -import type { AddressableAttachmentType } from './Attachment.js'; -import { strictAssert } from '../util/assert.js'; +import type { AvatarColorType } from './Colors.std.js'; +import type { AddressableAttachmentType } from './Attachment.std.js'; +import { strictAssert } from '../util/assert.std.js'; export const PersonalAvatarIcons = [ 'abstract_01', diff --git a/ts/types/BodyRange.ts b/ts/types/BodyRange.ts index 61cbe7133c..bacb2571d8 100644 --- a/ts/types/BodyRange.ts +++ b/ts/types/BodyRange.ts @@ -5,18 +5,18 @@ import lodash from 'lodash'; -import { SignalService as Proto } from '../protobuf/index.js'; -import { createLogger } from '../logging/log.js'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { isNotNil } from '../util/isNotNil.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { isNotNil } from '../util/isNotNil.std.js'; import { SNIPPET_LEFT_PLACEHOLDER, SNIPPET_RIGHT_PLACEHOLDER, SNIPPET_TRUNCATION_PLACEHOLDER, -} from '../util/search.js'; -import { assertDev } from '../util/assert.js'; -import type { AciString } from './ServiceId.js'; -import { normalizeAci } from '../util/normalizeAci.js'; +} from '../util/search.std.js'; +import { assertDev } from '../util/assert.std.js'; +import type { AciString } from './ServiceId.std.js'; +import { normalizeAci } from '../util/normalizeAci.std.js'; const { isEqual, isNumber, omit, orderBy, partition } = lodash; diff --git a/ts/types/CallDisposition.ts b/ts/types/CallDisposition.ts index 63bd4487d9..579c26e5aa 100644 --- a/ts/types/CallDisposition.ts +++ b/ts/types/CallDisposition.ts @@ -3,12 +3,12 @@ import { z } from 'zod'; import Long from 'long'; -import type { AciString } from './ServiceId.js'; -import { aciSchema } from './ServiceId.js'; -import { bytesToUuid } from '../util/uuidToBytes.js'; -import { SignalService as Proto } from '../protobuf/index.js'; -import * as Bytes from '../Bytes.js'; -import { UUID_BYTE_SIZE } from './Crypto.js'; +import type { AciString } from './ServiceId.std.js'; +import { aciSchema } from './ServiceId.std.js'; +import { bytesToUuid } from '../util/uuidToBytes.std.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; +import * as Bytes from '../Bytes.std.js'; +import { UUID_BYTE_SIZE } from './Crypto.std.js'; // These are strings (1) for the backup (2) for Storybook. export enum CallMode { diff --git a/ts/types/CallLink.ts b/ts/types/CallLink.ts index f6bce4a44f..5f6280275e 100644 --- a/ts/types/CallLink.ts +++ b/ts/types/CallLink.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { ReadonlyDeep } from 'type-fest'; import { z } from 'zod'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import { safeParseInteger } from '../util/numbers.js'; -import { byteLength } from '../Bytes.js'; -import type { StorageServiceFieldsType } from '../sql/Interface.js'; -import { parsePartial } from '../util/schemas.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import { safeParseInteger } from '../util/numbers.std.js'; +import { byteLength } from '../Bytes.std.js'; +import type { StorageServiceFieldsType } from '../sql/Interface.std.js'; +import { parsePartial } from '../util/schemas.std.js'; export enum CallLinkUpdateSyncType { Update = 'Update', diff --git a/ts/types/Calling.ts b/ts/types/Calling.ts index 8b82e414e4..c8cd27c53b 100644 --- a/ts/types/Calling.ts +++ b/ts/types/Calling.ts @@ -3,10 +3,10 @@ import type { ReadonlyDeep } from 'type-fest'; import type { AudioDevice, Reaction as CallReaction } from '@signalapp/ringrtc'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import type { AciString, ServiceIdString } from './ServiceId.js'; -import type { CallLinkConversationType } from './CallLink.js'; -import type { CallMode } from './CallDisposition.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import type { AciString, ServiceIdString } from './ServiceId.std.js'; +import type { CallLinkConversationType } from './CallLink.std.js'; +import type { CallMode } from './CallDisposition.std.js'; export const MAX_CALLING_REACTIONS = 5; export const CALLING_REACTIONS_LIFETIME = 4000; diff --git a/ts/types/ChatFolder.ts b/ts/types/ChatFolder.ts index b2de95b54d..60f7806d24 100644 --- a/ts/types/ChatFolder.ts +++ b/ts/types/ChatFolder.ts @@ -2,16 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { z } from 'zod'; import type { Simplify } from 'type-fest'; -import { - Environment, - getEnvironment, - isMockEnvironment, -} from '../environment.js'; -import * as grapheme from '../util/grapheme.js'; -import * as RemoteConfig from '../RemoteConfig.js'; -import { isAlpha, isBeta, isProduction } from '../util/version.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import { isConversationUnread } from '../util/isConversationUnread.js'; +import * as grapheme from '../util/grapheme.std.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import { isConversationUnread } from '../util/isConversationUnread.std.js'; export const CHAT_FOLDER_NAME_MAX_CHAR_LENGTH = 32; @@ -155,34 +148,6 @@ function isSameConversationIds( return new Set(a).symmetricDifference(new Set(b)).size === 0; } -export function isChatFoldersEnabled(): boolean { - const env = getEnvironment(); - - if ( - env === Environment.Development || - env === Environment.Test || - isMockEnvironment() - ) { - return true; - } - - const version = window.getVersion?.(); - - if (version != null) { - if (isProduction(version)) { - return RemoteConfig.isEnabled('desktop.chatFolders.prod'); - } - if (isBeta(version)) { - return RemoteConfig.isEnabled('desktop.chatFolders.beta'); - } - if (isAlpha(version)) { - return RemoteConfig.isEnabled('desktop.chatFolders.alpha'); - } - } - - return false; -} - type ConversationPropsForChatFolder = Pick< ConversationType, 'type' | 'id' | 'unreadCount' | 'markedUnread' | 'muteExpiresAt' diff --git a/ts/types/Conversation.ts b/ts/types/Conversation.ts index 798643b006..10813489d7 100644 --- a/ts/types/Conversation.ts +++ b/ts/types/Conversation.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { ConversationAttributesType } from '../model-types.d.ts'; -import type { ContactAvatarType } from './Avatar.js'; -import type { LocalAttachmentV2Type } from './Attachment.js'; -import { computeHash } from '../Crypto.js'; -import { createLogger } from '../logging/log.js'; +import type { ContactAvatarType } from './Avatar.std.js'; +import type { LocalAttachmentV2Type } from './Attachment.std.js'; +import { computeHash } from '../Crypto.node.js'; +import { createLogger } from '../logging/log.std.js'; const log = createLogger('Conversation'); diff --git a/ts/types/Crypto.ts b/ts/types/Crypto.ts index 841e89f77c..5d221f0cfb 100644 --- a/ts/types/Crypto.ts +++ b/ts/types/Crypto.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { fromBase64, fromHex } from '../Bytes.js'; +import { fromBase64, fromHex } from '../Bytes.std.js'; export enum HashType { size256 = 'sha256', diff --git a/ts/types/CurrentChatFolders.ts b/ts/types/CurrentChatFolders.ts index ddbaf671f3..7bc63d6123 100644 --- a/ts/types/CurrentChatFolders.ts +++ b/ts/types/CurrentChatFolders.ts @@ -1,9 +1,9 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { strictAssert } from '../util/assert.js'; -import { ChatFolderType } from './ChatFolder.js'; -import type { ChatFolder, ChatFolderId } from './ChatFolder.js'; +import { strictAssert } from '../util/assert.std.js'; +import { ChatFolderType } from './ChatFolder.std.js'; +import type { ChatFolder, ChatFolderId } from './ChatFolder.std.js'; export type CurrentChatFolder = ChatFolder & Readonly<{ diff --git a/ts/types/DonationsCardForm.ts b/ts/types/DonationsCardForm.ts index 955a33bed8..7e599b67b7 100644 --- a/ts/types/DonationsCardForm.ts +++ b/ts/types/DonationsCardForm.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import cardValidator from 'card-validator'; import creditCardType from 'credit-card-type'; -import { strictAssert } from '../util/assert.js'; -import type { CardDetail } from './Donations.js'; +import { strictAssert } from '../util/assert.std.js'; +import type { CardDetail } from './Donations.std.js'; export type CardFormat = Readonly<{ _debugName: string; diff --git a/ts/types/EmbeddedContact.ts b/ts/types/EmbeddedContact.ts index 76d44e351f..73af3e7d60 100644 --- a/ts/types/EmbeddedContact.ts +++ b/ts/types/EmbeddedContact.ts @@ -4,26 +4,26 @@ import lodash from 'lodash'; import type { ReadonlyDeep } from 'type-fest'; -import { SignalService as Proto } from '../protobuf/index.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; -import { isNotNil } from '../util/isNotNil.js'; +import { isNotNil } from '../util/isNotNil.std.js'; import { format as formatPhoneNumber, normalize as normalizePhoneNumber, -} from './PhoneNumber.js'; +} from './PhoneNumber.std.js'; import type { AttachmentType, AttachmentForUIType, AttachmentWithHydratedData, LocalAttachmentV2Type, UploadedAttachmentType, -} from './Attachment.js'; -import { toLogFormat } from './errors.js'; -import type { LoggerType } from './Logging.js'; -import type { ServiceIdString } from './ServiceId.js'; -import type { migrateDataToFileSystem } from '../util/attachments/migrateDataToFilesystem.js'; -import { getLocalAttachmentUrl } from '../util/getLocalAttachmentUrl.js'; +} from './Attachment.std.js'; +import { toLogFormat } from './errors.std.js'; +import type { LoggerType } from './Logging.std.js'; +import type { ServiceIdString } from './ServiceId.std.js'; +import type { migrateDataToFileSystem } from '../util/attachments/migrateDataToFilesystem.std.js'; +import { getLocalAttachmentUrl } from '../util/getLocalAttachmentUrl.std.js'; const { omit } = lodash; diff --git a/ts/types/ErrorWithToast.ts b/ts/types/ErrorWithToast.ts index 67ebc228b9..c93c4166b2 100644 --- a/ts/types/ErrorWithToast.ts +++ b/ts/types/ErrorWithToast.ts @@ -1,7 +1,7 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ToastType } from './Toast.js'; +import type { ToastType } from './Toast.dom.js'; export class ErrorWithToast extends Error { public toastType: ToastType; diff --git a/ts/types/ForwardDraft.ts b/ts/types/ForwardDraft.ts index 7ac56f695c..ba27e4cd06 100644 --- a/ts/types/ForwardDraft.ts +++ b/ts/types/ForwardDraft.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import lodash from 'lodash'; -import type { ReadonlyMessageAttributesType } from '../model-types.js'; -import type { AttachmentForUIType } from './Attachment.js'; -import { isVoiceMessage, isDownloaded } from '../util/Attachment.js'; -import type { HydratedBodyRangesType } from './BodyRange.js'; -import type { LinkPreviewForUIType } from './message/LinkPreviews.js'; +import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; +import type { AttachmentForUIType } from './Attachment.std.js'; +import { isVoiceMessage, isDownloaded } from '../util/Attachment.std.js'; +import type { HydratedBodyRangesType } from './BodyRange.std.js'; +import type { LinkPreviewForUIType } from './message/LinkPreviews.std.js'; const { orderBy } = lodash; diff --git a/ts/types/GroupSendEndorsements.ts b/ts/types/GroupSendEndorsements.ts index cf36ef9961..4b0949bd59 100644 --- a/ts/types/GroupSendEndorsements.ts +++ b/ts/types/GroupSendEndorsements.ts @@ -1,9 +1,9 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import { z } from 'zod'; -import { aciSchema, type AciString } from './ServiceId.js'; -import * as Bytes from '../Bytes.js'; -import { parseStrict } from '../util/schemas.js'; +import { aciSchema, type AciString } from './ServiceId.std.js'; +import * as Bytes from '../Bytes.std.js'; +import { parseStrict } from '../util/schemas.std.js'; const GROUPV2_ID_LENGTH = 32; // 32 bytes diff --git a/ts/types/I18N.ts b/ts/types/I18N.ts index bf8157750c..974024a597 100644 --- a/ts/types/I18N.ts +++ b/ts/types/I18N.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { z } from 'zod'; -import type { LocalizerType } from './Util.js'; +import type { LocalizerType } from './Util.std.js'; -export type { LocalizerType } from './Util.js'; +export type { LocalizerType } from './Util.std.js'; type SmartlingConfigType = { placeholder_format_custom: string; diff --git a/ts/types/LinkPreview.ts b/ts/types/LinkPreview.ts index 79ff083eef..7185cabf72 100644 --- a/ts/types/LinkPreview.ts +++ b/ts/types/LinkPreview.ts @@ -8,18 +8,18 @@ import lodash from 'lodash'; import nodeUrl from 'url'; import LinkifyIt from 'linkify-it'; -import { maybeParseUrl } from '../util/url.js'; -import { replaceEmojiWithSpaces } from '../util/emoji.js'; -import { count } from '../util/grapheme.js'; +import { maybeParseUrl } from '../util/url.std.js'; +import { replaceEmojiWithSpaces } from '../util/emoji.std.js'; +import { count } from '../util/grapheme.std.js'; -import type { AttachmentWithHydratedData } from './Attachment.js'; +import type { AttachmentWithHydratedData } from './Attachment.std.js'; import { artAddStickersRoute, groupInvitesRoute, linkCallRoute, -} from '../util/signalRoutes.js'; -import type { Backups } from '../protobuf/index.js'; -import type { LinkPreviewType } from './message/LinkPreviews.js'; +} from '../util/signalRoutes.std.js'; +import type { Backups } from '../protobuf/index.std.js'; +import type { LinkPreviewType } from './message/LinkPreviews.std.js'; const { isNumber, compact, isEmpty, range } = lodash; diff --git a/ts/types/MediaItem.ts b/ts/types/MediaItem.ts index f1df97799b..eacd4e9fca 100644 --- a/ts/types/MediaItem.ts +++ b/ts/types/MediaItem.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AttachmentForUIType } from './Attachment.js'; +import type { AttachmentForUIType } from './Attachment.std.js'; import type { MessageAttributesType } from '../model-types.d.ts'; export type MediaItemMessageType = Readonly<{ diff --git a/ts/types/Message.ts b/ts/types/Message.ts index 248d4f8e46..b33f86a0b8 100644 --- a/ts/types/Message.ts +++ b/ts/types/Message.ts @@ -1,9 +1,9 @@ // Copyright 2018 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { DurationInSeconds } from '../util/durations/index.js'; -import type { AttachmentType } from './Attachment.js'; -import type { EmbeddedContactType } from './EmbeddedContact.js'; +import type { DurationInSeconds } from '../util/durations/index.std.js'; +import type { AttachmentType } from './Attachment.std.js'; +import type { EmbeddedContactType } from './EmbeddedContact.std.js'; export function getMentionsRegex(): RegExp { return /\uFFFC/g; diff --git a/ts/types/Message2.ts b/ts/types/Message2.ts index 0b6e463491..e3720c55c1 100644 --- a/ts/types/Message2.ts +++ b/ts/types/Message2.ts @@ -4,31 +4,31 @@ import lodash from 'lodash'; import type { ReadonlyDeep } from 'type-fest'; -import * as Contact from './EmbeddedContact.js'; +import * as Contact from './EmbeddedContact.std.js'; import type { AddressableAttachmentType, AttachmentType, AttachmentWithHydratedData, LocalAttachmentV2Type, -} from './Attachment.js'; +} from './Attachment.std.js'; import { - captureDimensionsAndScreenshot, removeSchemaVersion, replaceUnicodeOrderOverrides, replaceUnicodeV2, shouldGenerateThumbnailForAttachmentType, -} from '../util/Attachment.js'; -import type { MakeVideoScreenshotResultType } from './VisualAttachment.js'; -import * as Errors from './errors.js'; -import * as SchemaVersion from './SchemaVersion.js'; +} from '../util/Attachment.std.js'; +import { captureDimensionsAndScreenshot } from '../util/captureDimensionsAndScreenshot.dom.js'; +import type { MakeVideoScreenshotResultType } from './VisualAttachment.dom.js'; +import * as Errors from './errors.std.js'; +import * as SchemaVersion from './SchemaVersion.std.js'; -import { LONG_MESSAGE } from './MIME.js'; -import type * as MIME from './MIME.js'; -import type { LoggerType } from './Logging.js'; +import { LONG_MESSAGE } from './MIME.std.js'; +import type * as MIME from './MIME.std.js'; +import type { LoggerType } from './Logging.std.js'; import type { EmbeddedContactType, EmbeddedContactWithHydratedAvatar, -} from './EmbeddedContact.js'; +} from './EmbeddedContact.std.js'; import type { MessageAttributesType, @@ -38,19 +38,22 @@ import type { import type { LinkPreviewType, LinkPreviewWithHydratedData, -} from './message/LinkPreviews.js'; -import type { StickerType, StickerWithHydratedData } from './Stickers.js'; -import { migrateDataToFileSystem } from '../util/attachments/migrateDataToFilesystem.js'; +} from './message/LinkPreviews.std.js'; +import type { + StickerType, + StickerWithHydratedData, +} from './Stickers.preload.js'; +import { migrateDataToFileSystem } from '../util/attachments/migrateDataToFilesystem.std.js'; import { getLocalAttachmentUrl, AttachmentDisposition, -} from '../util/getLocalAttachmentUrl.js'; -import { encryptLegacyAttachment } from '../util/encryptLegacyAttachment.js'; -import { deepClone } from '../util/deepClone.js'; -import * as Bytes from '../Bytes.js'; -import { isBodyTooLong } from '../util/longAttachment.js'; -import type { MessageAttachmentType } from './AttachmentDownload.js'; -import { getFilePathsOwnedByMessage } from '../util/messageFilePaths.js'; +} from '../util/getLocalAttachmentUrl.std.js'; +import { encryptLegacyAttachment } from '../util/encryptLegacyAttachment.preload.js'; +import { deepClone } from '../util/deepClone.std.js'; +import * as Bytes from '../Bytes.std.js'; +import { isBodyTooLong } from '../util/longAttachment.std.js'; +import type { MessageAttachmentType } from './AttachmentDownload.std.js'; +import { getFilePathsOwnedByMessage } from '../util/messageFilePaths.std.js'; const { isFunction, isObject, identity } = lodash; diff --git a/ts/types/Nav.ts b/ts/types/Nav.ts index d779e15e97..b477bbd399 100644 --- a/ts/types/Nav.ts +++ b/ts/types/Nav.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { ReadonlyDeep } from 'type-fest'; -import type { ChatFolderId } from './ChatFolder.js'; +import type { ChatFolderId } from './ChatFolder.std.js'; export type SettingsLocation = ReadonlyDeep< | { diff --git a/ts/types/NotificationProfile-node.ts b/ts/types/NotificationProfile-node.ts index 83daf9a73e..8986f23c41 100644 --- a/ts/types/NotificationProfile-node.ts +++ b/ts/types/NotificationProfile-node.ts @@ -2,15 +2,15 @@ // SPDX-License-Identifier: AGPL-3.0-only // Note: this is a dangerous import; it will break storybook -import { getRandomBytes } from '../Crypto.js'; +import { getRandomBytes } from '../Crypto.node.js'; -import * as Bytes from '../Bytes.js'; -import { createLogger } from '../logging/log.js'; +import * as Bytes from '../Bytes.std.js'; +import { createLogger } from '../logging/log.std.js'; -import { NOTIFICATION_PROFILE_ID_LENGTH } from './NotificationProfile.js'; +import { NOTIFICATION_PROFILE_ID_LENGTH } from './NotificationProfile.std.js'; -import type { NotificationProfileIdString } from './NotificationProfile.js'; -import type { LoggerType } from './Logging.js'; +import type { NotificationProfileIdString } from './NotificationProfile.std.js'; +import type { LoggerType } from './Logging.std.js'; const log = createLogger('NotificationProfile-node'); diff --git a/ts/types/NotificationProfile.ts b/ts/types/NotificationProfile.ts index 70ca0e23a2..a0957ad230 100644 --- a/ts/types/NotificationProfile.ts +++ b/ts/types/NotificationProfile.ts @@ -3,10 +3,10 @@ import lodash from 'lodash'; -import { DAY, HOUR, MINUTE } from '../util/durations/index.js'; -import { strictAssert } from '../util/assert.js'; +import { DAY, HOUR, MINUTE } from '../util/durations/index.std.js'; +import { strictAssert } from '../util/assert.std.js'; -import type { StorageServiceFieldsType } from '../sql/Interface.js'; +import type { StorageServiceFieldsType } from '../sql/Interface.std.js'; const { isNumber, orderBy } = lodash; diff --git a/ts/types/PhoneNumber.ts b/ts/types/PhoneNumber.ts index 4a19c6bd3a..498fc2efe9 100644 --- a/ts/types/PhoneNumber.ts +++ b/ts/types/PhoneNumber.ts @@ -2,9 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import memoizee from 'memoizee'; -import { instance, PhoneNumberFormat } from '../util/libphonenumberInstance.js'; -import { createLogger } from '../logging/log.js'; -import * as Errors from './errors.js'; +import { + instance, + PhoneNumberFormat, +} from '../util/libphonenumberInstance.std.js'; +import { createLogger } from '../logging/log.std.js'; +import * as Errors from './errors.std.js'; const log = createLogger('PhoneNumber'); diff --git a/ts/types/PhoneNumberSharingMode.ts b/ts/types/PhoneNumberSharingMode.ts index 86af8810f0..390a2c4227 100644 --- a/ts/types/PhoneNumberSharingMode.ts +++ b/ts/types/PhoneNumberSharingMode.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { makeEnumParser } from '../util/enum.js'; +import { makeEnumParser } from '../util/enum.std.js'; // These strings are saved to disk, so be careful when changing them. export enum PhoneNumberSharingMode { diff --git a/ts/types/Polls.ts b/ts/types/Polls.ts index fe5179a499..0209525e99 100644 --- a/ts/types/Polls.ts +++ b/ts/types/Polls.ts @@ -2,15 +2,15 @@ // SPDX-License-Identifier: AGPL-3.0-only import { z } from 'zod'; -import { isAciString } from '../util/isAciString.js'; -import { hasAtMostGraphemes } from '../util/grapheme.js'; +import { isAciString } from '../util/isAciString.std.js'; +import { hasAtMostGraphemes } from '../util/grapheme.std.js'; import { Environment, getEnvironment, isMockEnvironment, -} from '../environment.js'; -import * as RemoteConfig from '../RemoteConfig.js'; -import { isAlpha, isBeta, isProduction } from '../util/version.js'; +} from '../environment.std.js'; +import * as RemoteConfig from '../RemoteConfig.dom.js'; +import { isAlpha, isBeta, isProduction } from '../util/version.std.js'; // PollCreate schema (processed shape) // - question: required, 1..100 chars diff --git a/ts/types/PreferencesBackupPage.ts b/ts/types/PreferencesBackupPage.ts index fbd7002384..7f762b1015 100644 --- a/ts/types/PreferencesBackupPage.ts +++ b/ts/types/PreferencesBackupPage.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { SettingsPage } from './Nav.js'; +import { SettingsPage } from './Nav.std.js'; // Should be in sync with isBackupPage() export type PreferencesBackupPage = diff --git a/ts/types/QualifiedAddress.ts b/ts/types/QualifiedAddress.ts index 44798a255e..5b9e1bff6f 100644 --- a/ts/types/QualifiedAddress.ts +++ b/ts/types/QualifiedAddress.ts @@ -1,12 +1,12 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { strictAssert } from '../util/assert.js'; +import { strictAssert } from '../util/assert.std.js'; -import type { ServiceIdString } from './ServiceId.js'; -import { isServiceIdString } from './ServiceId.js'; -import type { AddressStringType } from './Address.js'; -import { Address } from './Address.js'; +import type { ServiceIdString } from './ServiceId.std.js'; +import { isServiceIdString } from './ServiceId.std.js'; +import type { AddressStringType } from './Address.std.js'; +import { Address } from './Address.std.js'; const QUALIFIED_ADDRESS_REGEXP = /^((?:PNI:)?[:0-9a-f-]+):((?:PNI:)?[:0-9a-f-]+).(\d+)$/i; diff --git a/ts/types/Reactions.ts b/ts/types/Reactions.ts index c89373cec3..a97c783f88 100644 --- a/ts/types/Reactions.ts +++ b/ts/types/Reactions.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AciString } from './ServiceId.js'; +import type { AciString } from './ServiceId.std.js'; export type ReactionType = Readonly<{ conversationId: string; diff --git a/ts/types/Receipt.ts b/ts/types/Receipt.ts index 0bed06245b..64a2496661 100644 --- a/ts/types/Receipt.ts +++ b/ts/types/Receipt.ts @@ -3,7 +3,7 @@ import { z } from 'zod'; -import { aciSchema } from './ServiceId.js'; +import { aciSchema } from './ServiceId.std.js'; export const receiptSchema = z.object({ messageId: z.string(), diff --git a/ts/types/RendererConfig.ts b/ts/types/RendererConfig.ts index 1c0312c768..5cd7eb2b54 100644 --- a/ts/types/RendererConfig.ts +++ b/ts/types/RendererConfig.ts @@ -3,10 +3,10 @@ import { z } from 'zod'; -import { Environment } from '../environment.js'; -import { themeSettingSchema } from './StorageUIKeys.js'; -import { HourCyclePreferenceSchema } from './I18N.js'; -import { DNSFallbackSchema } from './DNSFallback.js'; +import { Environment } from '../environment.std.js'; +import { themeSettingSchema } from './StorageUIKeys.std.js'; +import { HourCyclePreferenceSchema } from './I18N.std.js'; +import { DNSFallbackSchema } from './DNSFallback.std.js'; const environmentSchema = z.nativeEnum(Environment); diff --git a/ts/types/ServiceId.ts b/ts/types/ServiceId.ts index d14ce48191..b9c7776c2a 100644 --- a/ts/types/ServiceId.ts +++ b/ts/types/ServiceId.ts @@ -5,10 +5,10 @@ import { v4 as generateUuid } from 'uuid'; import { z } from 'zod'; import type { ServiceId, Aci, Pni } from '@signalapp/libsignal-client'; -import { isValidUuid } from '../util/isValidUuid.js'; -import { createLogger } from '../logging/log.js'; -import type { LoggerType } from './Logging.js'; -import { isAciString } from '../util/isAciString.js'; +import { isValidUuid } from '../util/isValidUuid.std.js'; +import { createLogger } from '../logging/log.std.js'; +import type { LoggerType } from './Logging.std.js'; +import { isAciString } from '../util/isAciString.std.js'; const log = createLogger('ServiceId'); diff --git a/ts/types/Settings.ts b/ts/types/Settings.ts index bff70eca0f..b57a4a7aae 100644 --- a/ts/types/Settings.ts +++ b/ts/types/Settings.ts @@ -3,9 +3,9 @@ import semver from 'semver'; -import type { OSType } from '../util/os/shared.js'; -import { SystemTraySetting } from './SystemTraySetting.js'; -import { isNotUpdatable, isProduction } from '../util/version.js'; +import type { OSType } from '../util/os/shared.std.js'; +import { SystemTraySetting } from './SystemTraySetting.std.js'; +import { isNotUpdatable, isProduction } from '../util/version.std.js'; const MIN_WINDOWS_VERSION = '8.0.0'; diff --git a/ts/types/SignalConversation.ts b/ts/types/SignalConversation.ts index 111d66fedb..0605bdfd3a 100644 --- a/ts/types/SignalConversation.ts +++ b/ts/types/SignalConversation.ts @@ -1,7 +1,7 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AciString } from './ServiceId.js'; +import type { AciString } from './ServiceId.std.js'; export const SIGNAL_ACI = '11111111-1111-4111-8111-111111111111' as AciString; export const SIGNAL_AVATAR_PATH = 'images/profile-avatar.svg'; diff --git a/ts/types/Stickers.ts b/ts/types/Stickers.ts index 7a807e0d41..8fff9ccb0a 100644 --- a/ts/types/Stickers.ts +++ b/ts/types/Stickers.ts @@ -5,31 +5,31 @@ import lodash from 'lodash'; import pMap from 'p-map'; import Queue from 'p-queue'; -import { strictAssert } from '../util/assert.js'; -import { dropNull } from '../util/dropNull.js'; -import { makeLookup } from '../util/makeLookup.js'; -import { maybeParseUrl } from '../util/url.js'; -import { getMessagesById } from '../messages/getMessagesById.js'; -import * as Bytes from '../Bytes.js'; -import * as Errors from './errors.js'; -import { deriveStickerPackKey, decryptAttachmentV1 } from '../Crypto.js'; -import { IMAGE_WEBP } from './MIME.js'; -import { sniffImageMimeType } from '../util/sniffImageMimeType.js'; +import { strictAssert } from '../util/assert.std.js'; +import { dropNull } from '../util/dropNull.std.js'; +import { makeLookup } from '../util/makeLookup.std.js'; +import { maybeParseUrl } from '../util/url.std.js'; +import { getMessagesById } from '../messages/getMessagesById.preload.js'; +import * as Bytes from '../Bytes.std.js'; +import * as Errors from './errors.std.js'; +import { deriveStickerPackKey, decryptAttachmentV1 } from '../Crypto.node.js'; +import { IMAGE_WEBP } from './MIME.std.js'; +import { sniffImageMimeType } from '../util/sniffImageMimeType.std.js'; import type { AttachmentType, AttachmentWithHydratedData, -} from './Attachment.js'; +} from './Attachment.std.js'; import type { StickerType as StickerFromDBType, StickerPackType, StickerPackStatusType, UninstalledStickerPackType, -} from '../sql/Interface.js'; -import { DataReader, DataWriter } from '../sql/Client.js'; -import { SignalService as Proto } from '../protobuf/index.js'; -import { createLogger } from '../logging/log.js'; -import type { StickersStateType } from '../state/ducks/stickers.js'; -import { MINUTE } from '../util/durations/index.js'; +} from '../sql/Interface.std.js'; +import { DataReader, DataWriter } from '../sql/Client.preload.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; +import { createLogger } from '../logging/log.std.js'; +import type { StickersStateType } from '../state/ducks/stickers.preload.js'; +import { MINUTE } from '../util/durations/index.std.js'; import { processNewEphemeralSticker, processNewSticker, @@ -40,18 +40,18 @@ import { deleteSticker, readStickerData, writeNewStickerData, -} from '../util/migrations.js'; -import { drop } from '../util/drop.js'; -import { isNotNil } from '../util/isNotNil.js'; -import { encryptLegacyAttachment } from '../util/encryptLegacyAttachment.js'; -import { AttachmentDisposition } from '../util/getLocalAttachmentUrl.js'; -import { isPackIdValid, redactPackId } from '../util/Stickers.js'; -import { getPlaintextHashForInMemoryAttachment } from '../AttachmentCrypto.js'; +} from '../util/migrations.preload.js'; +import { drop } from '../util/drop.std.js'; +import { isNotNil } from '../util/isNotNil.std.js'; +import { encryptLegacyAttachment } from '../util/encryptLegacyAttachment.preload.js'; +import { AttachmentDisposition } from '../util/getLocalAttachmentUrl.std.js'; +import { isPackIdValid, redactPackId } from '../util/Stickers.std.js'; +import { getPlaintextHashForInMemoryAttachment } from '../AttachmentCrypto.node.js'; import { isOnline, getSticker as doGetSticker, getStickerPackManifest, -} from '../textsecure/WebAPI.js'; +} from '../textsecure/WebAPI.preload.js'; const { isNumber, reject, groupBy, values, chunk } = lodash; diff --git a/ts/types/Storage.d.ts b/ts/types/Storage.d.ts index e8931129a5..9061ffd1d8 100644 --- a/ts/types/Storage.d.ts +++ b/ts/types/Storage.d.ts @@ -5,13 +5,13 @@ import type { AudioDevice } from '@signalapp/ringrtc'; import type { CustomColorsItemType, DefaultConversationColorType, -} from './Colors.js'; -import type { PhoneNumberDiscoverability } from '../util/phoneNumberDiscoverability.js'; -import type { RetryItemType } from '../util/retryPlaceholders.js'; -import type { ConfigMapType as RemoteConfigType } from '../RemoteConfig.js'; +} from './Colors.std.js'; +import type { PhoneNumberDiscoverability } from '../util/phoneNumberDiscoverability.std.js'; +import type { RetryItemType } from '../services/retryPlaceholders.std.js'; +import type { ConfigMapType as RemoteConfigType } from '../RemoteConfig.dom.js'; import type { ExtendedStorageID, UnknownRecord } from './StorageService.d.ts'; -import type { GroupCredentialType } from '../textsecure/WebAPI.js'; +import type { GroupCredentialType } from '../textsecure/WebAPI.preload.js'; import type { SessionResetsType, StorageServiceCredentials, @@ -20,12 +20,12 @@ import type { BackupCredentialWrapperType, BackupsSubscriptionType, BackupStatusType, -} from './backups.js'; -import type { ServiceIdString } from './ServiceId.js'; -import type { RegisteredChallengeType } from '../challenge.js'; -import type { ServerAlertsType } from '../util/handleServerAlerts.js'; -import type { NotificationProfileOverride } from './NotificationProfile.js'; -import type { PhoneNumberSharingMode } from './PhoneNumberSharingMode.js'; +} from './backups.node.js'; +import type { ServiceIdString } from './ServiceId.std.js'; +import type { RegisteredChallengeType } from '../challenge.dom.js'; +import type { ServerAlertsType } from '../util/handleServerAlerts.preload.js'; +import type { NotificationProfileOverride } from './NotificationProfile.std.js'; +import type { PhoneNumberSharingMode } from './PhoneNumberSharingMode.std.js'; export type AutoDownloadAttachmentType = { photos: boolean; diff --git a/ts/types/Stories.ts b/ts/types/Stories.ts index d0f9d9930f..2b02c9b516 100644 --- a/ts/types/Stories.ts +++ b/ts/types/Stories.ts @@ -1,16 +1,16 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AttachmentType } from './Attachment.js'; -import type { HydratedBodyRangesType } from './BodyRange.js'; -import type { LocalizerType } from './Util.js'; -import type { ContactNameColorType } from './Colors.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import type { ReadStatus } from '../messages/MessageReadStatus.js'; -import type { SendStatus } from '../messages/MessageSendState.js'; -import type { StoryDistributionListDataType } from '../state/ducks/storyDistributionLists.js'; -import type { ServiceIdString } from './ServiceId.js'; -import type { StoryDistributionIdString } from './StoryDistributionId.js'; +import type { AttachmentType } from './Attachment.std.js'; +import type { HydratedBodyRangesType } from './BodyRange.std.js'; +import type { LocalizerType } from './Util.std.js'; +import type { ContactNameColorType } from './Colors.std.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import type { ReadStatus } from '../messages/MessageReadStatus.std.js'; +import type { SendStatus } from '../messages/MessageSendState.std.js'; +import type { StoryDistributionListDataType } from '../state/ducks/storyDistributionLists.preload.js'; +import type { ServiceIdString } from './ServiceId.std.js'; +import type { StoryDistributionIdString } from './StoryDistributionId.std.js'; export type ReplyType = { author: Pick< diff --git a/ts/types/StoryDistributionId.ts b/ts/types/StoryDistributionId.ts index 6902a119dc..003b7efb8b 100644 --- a/ts/types/StoryDistributionId.ts +++ b/ts/types/StoryDistributionId.ts @@ -3,9 +3,9 @@ import { v4 as generateUuid } from 'uuid'; -import { isValidUuid } from '../util/isValidUuid.js'; -import { createLogger } from '../logging/log.js'; -import type { LoggerType } from './Logging.js'; +import { isValidUuid } from '../util/isValidUuid.std.js'; +import { createLogger } from '../logging/log.std.js'; +import type { LoggerType } from './Logging.std.js'; const log = createLogger('StoryDistributionId'); diff --git a/ts/types/SystemTraySetting.ts b/ts/types/SystemTraySetting.ts index dad12c5973..f06f4731f4 100644 --- a/ts/types/SystemTraySetting.ts +++ b/ts/types/SystemTraySetting.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { makeEnumParser } from '../util/enum.js'; +import { makeEnumParser } from '../util/enum.std.js'; // Be careful when changing these values, as they are persisted. export enum SystemTraySetting { diff --git a/ts/types/Util.ts b/ts/types/Util.ts index 44888810d8..dcd9f15c9c 100644 --- a/ts/types/Util.ts +++ b/ts/types/Util.ts @@ -2,14 +2,14 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { IntlShape } from 'react-intl'; -import type { AciString } from './ServiceId.js'; -import type { LocaleDirection } from '../../app/locale.js'; +import type { AciString } from './ServiceId.std.js'; +import type { LocaleDirection } from '../../app/locale.main.js'; import type { ICUJSXMessageParamsByKeyType, ICUStringMessageParamsByKeyType, } from '../../build/ICUMessageParams.d.ts'; -import type { HourCyclePreference, LocaleMessagesType } from './I18N.js'; +import type { HourCyclePreference, LocaleMessagesType } from './I18N.std.js'; export type StoryContextType = { authorAci?: AciString; diff --git a/ts/types/VisualAttachment.ts b/ts/types/VisualAttachment.ts index 8b3e619605..ede002f6a4 100644 --- a/ts/types/VisualAttachment.ts +++ b/ts/types/VisualAttachment.ts @@ -3,16 +3,16 @@ import loadImage from 'blueimp-load-image'; import { blobToArrayBuffer } from 'blob-util'; -import { toLogFormat } from './errors.js'; -import type { MIMEType } from './MIME.js'; -import { IMAGE_JPEG, IMAGE_PNG } from './MIME.js'; -import type { LoggerType } from './Logging.js'; -import { strictAssert } from '../util/assert.js'; -import { canvasToBlob } from '../util/canvasToBlob.js'; -import { KIBIBYTE } from './AttachmentSize.js'; -import { explodePromise } from '../util/explodePromise.js'; -import { SECOND } from '../util/durations/index.js'; -import { createLogger } from '../logging/log.js'; +import { toLogFormat } from './errors.std.js'; +import type { MIMEType } from './MIME.std.js'; +import { IMAGE_JPEG, IMAGE_PNG } from './MIME.std.js'; +import type { LoggerType } from './Logging.std.js'; +import { strictAssert } from '../util/assert.std.js'; +import { canvasToBlob } from '../util/canvasToBlob.std.js'; +import { KIBIBYTE } from './AttachmentSize.std.js'; +import { explodePromise } from '../util/explodePromise.std.js'; +import { SECOND } from '../util/durations/index.std.js'; +import { createLogger } from '../logging/log.std.js'; const logging = createLogger('VisualAttachment'); diff --git a/ts/types/backups.ts b/ts/types/backups.ts index 64cbadc958..0f8541f3b1 100644 --- a/ts/types/backups.ts +++ b/ts/types/backups.ts @@ -3,7 +3,7 @@ import type { BackupLevel } from '@signalapp/libsignal-client/dist/zkgroup/index.js'; import { BackupCredentialType } from '@signalapp/libsignal-client/dist/zkgroup/index.js'; -import type { GetBackupCDNCredentialsResponseType } from '../textsecure/WebAPI.js'; +import type { GetBackupCDNCredentialsResponseType } from '../textsecure/WebAPI.preload.js'; export { BackupCredentialType }; diff --git a/ts/types/errors.ts b/ts/types/errors.ts index 3c790fc966..311b3e81da 100644 --- a/ts/types/errors.ts +++ b/ts/types/errors.ts @@ -1,7 +1,7 @@ // Copyright 2018 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { HTTPError } from './HTTPError.js'; +import { HTTPError } from './HTTPError.std.js'; export function toLogFormat(error: unknown): string { let result = ''; diff --git a/ts/types/groups.ts b/ts/types/groups.ts index addb7e6077..f2cdf1a497 100644 --- a/ts/types/groups.ts +++ b/ts/types/groups.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ServiceIdString, AciString, PniString } from './ServiceId.js'; +import type { ServiceIdString, AciString, PniString } from './ServiceId.std.js'; export const ID_V1_LENGTH = 16; export const ID_LENGTH = 32; diff --git a/ts/types/message/LinkPreviews.ts b/ts/types/message/LinkPreviews.ts index 2275a10709..32f82cb84b 100644 --- a/ts/types/message/LinkPreviews.ts +++ b/ts/types/message/LinkPreviews.ts @@ -5,7 +5,7 @@ import type { AttachmentType, AttachmentForUIType, AttachmentWithHydratedData, -} from '../Attachment.js'; +} from '../Attachment.std.js'; type GenericLinkPreviewType = { title?: string; diff --git a/ts/types/notifications.ts b/ts/types/notifications.ts new file mode 100644 index 0000000000..5e0bf7d865 --- /dev/null +++ b/ts/types/notifications.ts @@ -0,0 +1,10 @@ +// Copyright 2025 Signal Messenger, LLC +// SPDX-License-Identifier: AGPL-3.0-only + +export enum NotificationType { + IncomingCall = 'IncomingCall', + IncomingGroupCall = 'IncomingGroupCall', + IsPresenting = 'IsPresenting', + Message = 'Message', + Reaction = 'Reaction', +} diff --git a/ts/updateConversationsWithUuidLookup.ts b/ts/updateConversationsWithUuidLookup.ts index 650a04e70f..8913473547 100644 --- a/ts/updateConversationsWithUuidLookup.ts +++ b/ts/updateConversationsWithUuidLookup.ts @@ -1,12 +1,15 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationController } from './ConversationController.js'; -import type { ConversationModel } from './models/conversations.js'; -import type { cdsLookup, checkAccountExistence } from './textsecure/WebAPI.js'; -import { assertDev } from './util/assert.js'; -import { isNotNil } from './util/isNotNil.js'; -import { getServiceIdsForE164s } from './util/getServiceIdsForE164s.js'; +import type { ConversationController } from './ConversationController.preload.js'; +import type { ConversationModel } from './models/conversations.preload.js'; +import type { + cdsLookup, + checkAccountExistence, +} from './textsecure/WebAPI.preload.js'; +import { assertDev } from './util/assert.std.js'; +import { isNotNil } from './util/isNotNil.std.js'; +import { getServiceIdsForE164s } from './util/getServiceIdsForE164s.dom.js'; export type ServerType = Readonly<{ cdsLookup: typeof cdsLookup; diff --git a/ts/updater/common.ts b/ts/updater/common.ts index 1deef3b6fe..bd3aa51d8b 100644 --- a/ts/updater/common.ts +++ b/ts/updater/common.ts @@ -19,47 +19,50 @@ import { v4 as getGuid } from 'uuid'; import type { BrowserWindow } from 'electron'; import { app, ipcMain } from 'electron'; -import { missingCaseError } from '../util/missingCaseError.js'; -import { getTempPath, getUpdateCachePath } from '../../app/attachments.js'; -import { markShouldNotQuit, markShouldQuit } from '../../app/window_state.js'; -import { DialogType } from '../types/Dialogs.js'; -import * as Errors from '../types/errors.js'; -import { strictAssert } from '../util/assert.js'; -import { drop } from '../util/drop.js'; -import * as durations from '../util/durations/index.js'; +import { missingCaseError } from '../util/missingCaseError.std.js'; +import { getTempPath, getUpdateCachePath } from '../../app/attachments.node.js'; +import { + markShouldNotQuit, + markShouldQuit, +} from '../../app/window_state.std.js'; +import { DialogType } from '../types/Dialogs.std.js'; +import * as Errors from '../types/errors.std.js'; +import { strictAssert } from '../util/assert.std.js'; +import { drop } from '../util/drop.std.js'; +import * as durations from '../util/durations/index.std.js'; import { isAlpha, isAxolotl, isBeta, isNotUpdatable, isStaging, -} from '../util/version.js'; -import { isPathInside } from '../util/isPathInside.js'; +} from '../util/version.std.js'; +import { isPathInside } from '../util/isPathInside.node.js'; -import { version as packageVersion } from '../util/packageJson.js'; +import { version as packageVersion } from '../util/packageJson.node.js'; import { getSignatureFileName, hexToBinary, verifySignature, -} from './signature.js'; +} from './signature.node.js'; import { download as downloadDifferentialData, getBlockMapFileName, isValidPreparedData as isValidDifferentialData, prepareDownload as prepareDifferentialDownload, -} from './differential.js'; -import { getGotOptions } from './got.js'; +} from './differential.node.js'; +import { getGotOptions } from './got.node.js'; import { checkIntegrity, gracefulRename, gracefulRmRecursive, isTimeToUpdate, -} from './util.js'; +} from './util.node.js'; -import type { LoggerType } from '../types/Logging.js'; -import type { PrepareDownloadResultType as DifferentialDownloadDataType } from './differential.js'; -import type { MainSQL } from '../sql/main.js'; +import type { LoggerType } from '../types/Logging.std.js'; +import type { PrepareDownloadResultType as DifferentialDownloadDataType } from './differential.node.js'; +import type { MainSQL } from '../sql/main.main.js'; const { pathExists } = fsExtra; diff --git a/ts/updater/differential.ts b/ts/updater/differential.ts index d4ecc913ba..474bda1ce4 100644 --- a/ts/updater/differential.ts +++ b/ts/updater/differential.ts @@ -12,12 +12,12 @@ import lodash from 'lodash'; import pMap from 'p-map'; import Dicer from '@indutny/dicer'; -import { strictAssert } from '../util/assert.js'; -import { wrapEventEmitterOnce } from '../util/wrapEventEmitterOnce.js'; -import type { LoggerType } from '../types/Logging.js'; -import { getGotOptions } from './got.js'; -import type { GotOptions } from './got.js'; -import { checkIntegrity } from './util.js'; +import { strictAssert } from '../util/assert.std.js'; +import { wrapEventEmitterOnce } from '../util/wrapEventEmitterOnce.node.js'; +import type { LoggerType } from '../types/Logging.std.js'; +import { getGotOptions } from './got.node.js'; +import type { GotOptions } from './got.node.js'; +import { checkIntegrity } from './util.node.js'; const { chunk: lodashChunk, noop } = lodash; diff --git a/ts/updater/generateKeyPair.ts b/ts/updater/generateKeyPair.ts index a32a23bbce..d253ef5bbc 100644 --- a/ts/updater/generateKeyPair.ts +++ b/ts/updater/generateKeyPair.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only /* eslint-disable no-console */ -import * as Errors from '../types/errors.js'; -import { getCliOptions } from './common.js'; -import { keyPair } from './curve.js'; -import { writeHexToPath } from './signature.js'; +import * as Errors from '../types/errors.std.js'; +import { getCliOptions } from './common.main.js'; +import { keyPair } from './curve.node.js'; +import { writeHexToPath } from './signature.node.js'; const OPTIONS = [ { diff --git a/ts/updater/generateSignature.ts b/ts/updater/generateSignature.ts index e0241f9e81..09486294d8 100644 --- a/ts/updater/generateSignature.ts +++ b/ts/updater/generateSignature.ts @@ -7,10 +7,10 @@ import { readdir as readdirCallback } from 'node:fs'; import pify from 'pify'; -import * as Errors from '../types/errors.js'; -import { getCliOptions } from './common.js'; -import { writeSignature } from './signature.js'; -import { version as packageVersion } from '../util/packageJson.js'; +import * as Errors from '../types/errors.std.js'; +import { getCliOptions } from './common.main.js'; +import { writeSignature } from './signature.node.js'; +import { version as packageVersion } from '../util/packageJson.node.js'; const readdir = pify(readdirCallback); diff --git a/ts/updater/got.ts b/ts/updater/got.ts index 1ec07de592..68263fbd1e 100644 --- a/ts/updater/got.ts +++ b/ts/updater/got.ts @@ -5,11 +5,11 @@ import type { StrictOptions as GotOptions } from 'got'; import config from 'config'; import { Agent as HTTPAgent } from 'node:http'; -import { version } from '../util/packageJson.js'; -import { getUserAgent } from '../util/getUserAgent.js'; -import * as durations from '../util/durations/index.js'; -import { createHTTPSAgent } from '../util/createHTTPSAgent.js'; -import { createProxyAgent } from '../util/createProxyAgent.js'; +import { version } from '../util/packageJson.node.js'; +import { getUserAgent } from '../util/getUserAgent.node.js'; +import * as durations from '../util/durations/index.std.js'; +import { createHTTPSAgent } from '../util/createHTTPSAgent.node.js'; +import { createProxyAgent } from '../util/createProxyAgent.node.js'; export const GOT_CONNECT_TIMEOUT = durations.MINUTE; export const GOT_LOOKUP_TIMEOUT = durations.MINUTE; diff --git a/ts/updater/index.ts b/ts/updater/index.ts index cc6a212940..c08a91271f 100644 --- a/ts/updater/index.ts +++ b/ts/updater/index.ts @@ -3,10 +3,10 @@ import config from 'config'; import { app } from 'electron'; -import type { Updater, UpdaterOptionsType } from './common.js'; -import { MacOSUpdater } from './macos.js'; -import { WindowsUpdater } from './windows.js'; -import { initLinux } from './linux.js'; +import type { Updater, UpdaterOptionsType } from './common.main.js'; +import { MacOSUpdater } from './macos.main.js'; +import { WindowsUpdater } from './windows.main.js'; +import { initLinux } from './linux.main.js'; let initialized = false; diff --git a/ts/updater/linux.ts b/ts/updater/linux.ts index d0cb0004cb..d45643fa80 100644 --- a/ts/updater/linux.ts +++ b/ts/updater/linux.ts @@ -8,11 +8,11 @@ import { app, ipcMain } from 'electron'; import { extractFile } from '@electron/asar'; import z from 'zod'; -import { markShouldQuit } from '../../app/window_state.js'; -import type { LoggerType } from '../types/Logging.js'; -import { DialogType } from '../types/Dialogs.js'; -import * as Errors from '../types/errors.js'; -import type { UpdaterOptionsType } from './common.js'; +import { markShouldQuit } from '../../app/window_state.std.js'; +import type { LoggerType } from '../types/Logging.std.js'; +import { DialogType } from '../types/Dialogs.std.js'; +import * as Errors from '../types/errors.std.js'; +import type { UpdaterOptionsType } from './common.main.js'; const MIN_UBUNTU_VERSION = '22.04'; diff --git a/ts/updater/macos.ts b/ts/updater/macos.ts index 52211603ea..b175b9e37d 100644 --- a/ts/updater/macos.ts +++ b/ts/updater/macos.ts @@ -6,10 +6,10 @@ import { autoUpdater } from 'electron'; import { writeFile } from 'node:fs/promises'; import { join } from 'node:path'; -import { Updater, createTempDir, deleteTempDir } from './common.js'; -import { explodePromise } from '../util/explodePromise.js'; -import * as Errors from '../types/errors.js'; -import { DialogType } from '../types/Dialogs.js'; +import { Updater, createTempDir, deleteTempDir } from './common.main.js'; +import { explodePromise } from '../util/explodePromise.std.js'; +import * as Errors from '../types/errors.std.js'; +import { DialogType } from '../types/Dialogs.std.js'; export class MacOSUpdater extends Updater { protected async deletePreviousInstallers(): Promise { diff --git a/ts/updater/signature.ts b/ts/updater/signature.ts index c33e62024c..ef958816be 100644 --- a/ts/updater/signature.ts +++ b/ts/updater/signature.ts @@ -12,7 +12,7 @@ import { basename, dirname, join, resolve as resolvePath } from 'node:path'; import pify from 'pify'; -import { sign, verify } from './curve.js'; +import { sign, verify } from './curve.node.js'; const readFile = pify(readFileCallback); const writeFile = pify(writeFileCallback); diff --git a/ts/updater/util.ts b/ts/updater/util.ts index 0c0c2a40c3..ab833d6a3e 100644 --- a/ts/updater/util.ts +++ b/ts/updater/util.ts @@ -6,11 +6,11 @@ import { createReadStream } from 'node:fs'; import { rename, rm } from 'node:fs/promises'; import { pipeline } from 'node:stream/promises'; -import type { LoggerType } from '../types/Logging.js'; -import * as Errors from '../types/errors.js'; -import { SECOND, MINUTE, HOUR } from '../util/durations/index.js'; -import { sleep } from '../util/sleep.js'; -import { isOlderThan } from '../util/timestamp.js'; +import type { LoggerType } from '../types/Logging.std.js'; +import * as Errors from '../types/errors.std.js'; +import { SECOND, MINUTE, HOUR } from '../util/durations/index.std.js'; +import { sleep } from '../util/sleep.std.js'; +import { isOlderThan } from '../util/timestamp.std.js'; export type CheckIntegrityResultType = Readonly< | { diff --git a/ts/updater/windows.ts b/ts/updater/windows.ts index dc4bd0e8f7..3498970dca 100644 --- a/ts/updater/windows.ts +++ b/ts/updater/windows.ts @@ -9,7 +9,7 @@ import { readdir as readdirCallback, unlink as unlinkCallback } from 'node:fs'; import { app } from 'electron'; import pify from 'pify'; -import { Updater } from './common.js'; +import { Updater } from './common.main.js'; const readdir = pify(readdirCallback); const unlink = pify(unlinkCallback); diff --git a/ts/util/AbortableProcess.ts b/ts/util/AbortableProcess.ts index 0b80926a2c..2b13cb7ca8 100644 --- a/ts/util/AbortableProcess.ts +++ b/ts/util/AbortableProcess.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only /* eslint-disable no-restricted-syntax */ -import { explodePromise } from './explodePromise.js'; +import { explodePromise } from './explodePromise.std.js'; export interface IController { abort(): void; diff --git a/ts/util/Attachment.ts b/ts/util/Attachment.ts index fbe7839f71..91f1d3f044 100644 --- a/ts/util/Attachment.ts +++ b/ts/util/Attachment.ts @@ -3,42 +3,38 @@ import moment from 'moment'; import lodash from 'lodash'; -import { blobToArrayBuffer } from 'blob-util'; import type { AttachmentType, - LocalAttachmentV2Type, AddressableAttachmentType, AttachmentForUIType, AttachmentWithHydratedData, BackupableAttachmentType, AttachmentDownloadableFromTransitTier, LocallySavedAttachment, -} from '../types/Attachment.js'; -import type { LoggerType } from '../types/Logging.js'; -import { createLogger } from '../logging/log.js'; -import * as MIME from '../types/MIME.js'; -import { toLogFormat } from '../types/errors.js'; -import { SignalService } from '../protobuf/index.js'; -import { isImageTypeSupported, isVideoTypeSupported } from './GoogleChrome.js'; -import type { LocalizerType } from '../types/Util.js'; -import { ThemeType } from '../types/Util.js'; -import * as GoogleChrome from './GoogleChrome.js'; -import { ReadStatus } from '../messages/MessageReadStatus.js'; -import type { MessageStatusType } from '../types/message/MessageStatus.js'; -import { isMoreRecentThan } from './timestamp.js'; -import { DAY } from './durations/index.js'; -import { getMessageQueueTime } from './getMessageQueueTime.js'; -import { getLocalAttachmentUrl } from './getLocalAttachmentUrl.js'; +} from '../types/Attachment.std.js'; +import type { LoggerType } from '../types/Logging.std.js'; +import { createLogger } from '../logging/log.std.js'; +import * as MIME from '../types/MIME.std.js'; +import { SignalService } from '../protobuf/index.std.js'; +import { + isImageTypeSupported, + isVideoTypeSupported, +} from './GoogleChrome.std.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { ThemeType } from '../types/Util.std.js'; +import { ReadStatus } from '../messages/MessageReadStatus.std.js'; +import type { MessageStatusType } from '../types/message/MessageStatus.std.js'; +import { isMoreRecentThan } from './timestamp.std.js'; +import { DAY } from './durations/index.std.js'; import { isValidAttachmentKey, isValidDigest, isValidPlaintextHash, -} from '../types/Crypto.js'; -import { missingCaseError } from './missingCaseError.js'; -import type { MakeVideoScreenshotResultType } from '../types/VisualAttachment.js'; -import type { MessageAttachmentType } from '../types/AttachmentDownload.js'; -import { getFilePathsOwnedByAttachment } from './messageFilePaths.js'; +} from '../types/Crypto.std.js'; +import { missingCaseError } from './missingCaseError.std.js'; +import type { MessageAttachmentType } from '../types/AttachmentDownload.std.js'; +import { getFilePathsOwnedByAttachment } from './messageFilePaths.std.js'; const { isNumber, @@ -234,181 +230,6 @@ export function deleteAllAttachmentFilesOnDisk({ }; } -const THUMBNAIL_SIZE = 150; -const THUMBNAIL_CONTENT_TYPE = MIME.IMAGE_PNG; - -export async function captureDimensionsAndScreenshot( - attachment: AttachmentType, - options: { generateThumbnail: boolean }, - params: { - writeNewAttachmentData: ( - data: Uint8Array - ) => Promise; - makeObjectUrl: ( - data: Uint8Array | ArrayBuffer, - contentType: MIME.MIMEType - ) => string; - revokeObjectUrl: (path: string) => void; - getImageDimensions: (params: { - objectUrl: string; - logger: LoggerType; - }) => Promise<{ - width: number; - height: number; - }>; - makeImageThumbnail: (params: { - size: number; - objectUrl: string; - contentType: MIME.MIMEType; - logger: LoggerType; - }) => Promise; - makeVideoScreenshot: (params: { - objectUrl: string; - contentType: MIME.MIMEType; - logger: LoggerType; - }) => Promise; - logger: LoggerType; - } -): Promise { - const { contentType } = attachment; - - const { - writeNewAttachmentData, - makeObjectUrl, - revokeObjectUrl, - getImageDimensions: getImageDimensionsFromURL, - makeImageThumbnail, - makeVideoScreenshot, - logger, - } = params; - - if ( - !GoogleChrome.isImageTypeSupported(contentType) && - !GoogleChrome.isVideoTypeSupported(contentType) - ) { - return attachment; - } - - // If the attachment hasn't been downloaded yet, we won't have a path - if (!attachment.path) { - return attachment; - } - - const localUrl = getLocalAttachmentUrl(attachment); - - if (GoogleChrome.isImageTypeSupported(contentType)) { - try { - const { width, height } = await getImageDimensionsFromURL({ - objectUrl: localUrl, - logger, - }); - let thumbnail: LocalAttachmentV2Type | undefined; - - if (options.generateThumbnail) { - const thumbnailBuffer = await blobToArrayBuffer( - await makeImageThumbnail({ - size: THUMBNAIL_SIZE, - objectUrl: localUrl, - contentType: THUMBNAIL_CONTENT_TYPE, - logger, - }) - ); - - thumbnail = await writeNewAttachmentData( - new Uint8Array(thumbnailBuffer) - ); - } - - return { - ...attachment, - width, - height, - thumbnail: thumbnail - ? { - ...thumbnail, - contentType: THUMBNAIL_CONTENT_TYPE, - width: THUMBNAIL_SIZE, - height: THUMBNAIL_SIZE, - } - : undefined, - }; - } catch (error) { - logger.error( - 'captureDimensionsAndScreenshot:', - 'error processing image; skipping screenshot generation', - toLogFormat(error) - ); - return attachment; - } - } - - let screenshotObjectUrl: string | undefined; - try { - const { blob, duration } = await makeVideoScreenshot({ - objectUrl: localUrl, - contentType: THUMBNAIL_CONTENT_TYPE, - logger, - }); - const screenshotBuffer = await blobToArrayBuffer(blob); - screenshotObjectUrl = makeObjectUrl( - screenshotBuffer, - THUMBNAIL_CONTENT_TYPE - ); - const { width, height } = await getImageDimensionsFromURL({ - objectUrl: screenshotObjectUrl, - logger, - }); - const screenshot = await writeNewAttachmentData( - new Uint8Array(screenshotBuffer) - ); - - let thumbnail: LocalAttachmentV2Type | undefined; - if (options.generateThumbnail) { - const thumbnailBuffer = await blobToArrayBuffer( - await makeImageThumbnail({ - size: THUMBNAIL_SIZE, - objectUrl: screenshotObjectUrl, - contentType: THUMBNAIL_CONTENT_TYPE, - logger, - }) - ); - - thumbnail = await writeNewAttachmentData(new Uint8Array(thumbnailBuffer)); - } - - return { - ...attachment, - duration, - screenshot: { - ...screenshot, - contentType: THUMBNAIL_CONTENT_TYPE, - width, - height, - }, - thumbnail: thumbnail - ? { - ...thumbnail, - contentType: THUMBNAIL_CONTENT_TYPE, - width: THUMBNAIL_SIZE, - height: THUMBNAIL_SIZE, - } - : undefined, - width, - height, - }; - } catch (error) { - logger.error( - 'captureDimensionsAndScreenshot: error processing video; skipping screenshot generation', - toLogFormat(error) - ); - return attachment; - } finally { - if (screenshotObjectUrl !== undefined) { - revokeObjectUrl(screenshotObjectUrl); - } - } -} - // UI-focused functions export function getExtensionForDisplay({ @@ -1026,37 +847,6 @@ export function getCachedAttachmentBySignature( return undefined; } -// Extend range in case the attachment is actually still there (this function is meant to -// be optimistic) -const BUFFER_TIME_ON_TRANSIT_TIER = 5 * DAY; - -export function mightStillBeOnTransitTier( - attachment: Pick -): boolean { - if (!attachment.cdnKey) { - return false; - } - if (attachment.cdnNumber == null) { - return false; - } - - if (!attachment.uploadTimestamp) { - // Let's be conservative and still assume it might be downloadable - return true; - } - - if ( - isMoreRecentThan( - attachment.uploadTimestamp, - getMessageQueueTime() + BUFFER_TIME_ON_TRANSIT_TIER - ) - ) { - return true; - } - - return false; -} - export function hasRequiredInformationForBackup( attachment: AttachmentType ): attachment is BackupableAttachmentType { diff --git a/ts/util/AttachmentCrypto.ts b/ts/util/AttachmentCrypto.ts index eda7d9a111..59bbc25c72 100644 --- a/ts/util/AttachmentCrypto.ts +++ b/ts/util/AttachmentCrypto.ts @@ -1,10 +1,10 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { IV_LENGTH, ATTACHMENT_MAC_LENGTH } from '../types/Crypto.js'; -import { MediaTier } from '../types/AttachmentDownload.js'; -import { logPadSize } from './logPadSize.js'; -import { missingCaseError } from './missingCaseError.js'; +import { IV_LENGTH, ATTACHMENT_MAC_LENGTH } from '../types/Crypto.std.js'; +import { MediaTier } from '../types/AttachmentDownload.std.js'; +import { logPadSize } from './logPadSize.std.js'; +import { missingCaseError } from './missingCaseError.std.js'; export function getCiphertextSize(plaintextLength: number): number { const paddedPlaintextSize = logPadSize(plaintextLength); diff --git a/ts/util/DelimitedStream.ts b/ts/util/DelimitedStream.ts index 849132c289..7370e4d6e4 100644 --- a/ts/util/DelimitedStream.ts +++ b/ts/util/DelimitedStream.ts @@ -3,7 +3,7 @@ import { Transform } from 'node:stream'; -import { missingCaseError } from './missingCaseError.js'; +import { missingCaseError } from './missingCaseError.std.js'; enum State { Prefix = 'Prefix', diff --git a/ts/util/GoogleChrome.ts b/ts/util/GoogleChrome.ts index d501d92918..556dbadc9c 100644 --- a/ts/util/GoogleChrome.ts +++ b/ts/util/GoogleChrome.ts @@ -1,7 +1,7 @@ // Copyright 2018 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type * as MIME from '../types/MIME.js'; +import type * as MIME from '../types/MIME.std.js'; type MIMETypeSupportMap = Record; diff --git a/ts/util/JobQueue.ts b/ts/util/JobQueue.ts index 93b722188e..1b5a4d1f8c 100644 --- a/ts/util/JobQueue.ts +++ b/ts/util/JobQueue.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import PQueue from 'p-queue'; -import createTaskWithTimeout from '../textsecure/TaskWithTimeout.js'; +import createTaskWithTimeout from '../textsecure/TaskWithTimeout.std.js'; function createJobQueue(label: string) { const jobQueue = new PQueue({ concurrency: 1 }); diff --git a/ts/util/LatestQueue.ts b/ts/util/LatestQueue.ts index 265a73ac5c..a85d30c9ba 100644 --- a/ts/util/LatestQueue.ts +++ b/ts/util/LatestQueue.ts @@ -17,7 +17,7 @@ * previously queued task completely. */ -import { drop } from './drop.js'; +import { drop } from './drop.std.js'; export class LatestQueue { #isRunning: boolean; diff --git a/ts/util/ServiceId.ts b/ts/util/ServiceId.ts index 9e229edfab..d35c407c89 100644 --- a/ts/util/ServiceId.ts +++ b/ts/util/ServiceId.ts @@ -6,7 +6,7 @@ import type { AciString, PniString, ServiceIdString, -} from '../types/ServiceId.js'; +} from '../types/ServiceId.std.js'; import { normalizeServiceId, normalizePni, @@ -15,9 +15,9 @@ import { fromServiceIdObject, fromAciObject, fromPniObject, -} from '../types/ServiceId.js'; -import * as Bytes from '../Bytes.js'; -import { normalizeAci } from './normalizeAci.js'; +} from '../types/ServiceId.std.js'; +import * as Bytes from '../Bytes.std.js'; +import { normalizeAci } from './normalizeAci.std.js'; export function toServiceIdObject(serviceId: ServiceIdString): ServiceId { return ServiceId.parseFromServiceIdString(serviceId); diff --git a/ts/util/Settings.ts b/ts/util/Settings.ts index 248fe8e5dc..2098b003be 100644 --- a/ts/util/Settings.ts +++ b/ts/util/Settings.ts @@ -1,6 +1,6 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { itemStorage } from '../textsecure/Storage.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; export function getLinkPreviewSetting(): boolean { return itemStorage.get('linkPreviews', false); diff --git a/ts/util/Sound.ts b/ts/util/Sound.ts index 497fe58b95..6029592a05 100644 --- a/ts/util/Sound.ts +++ b/ts/util/Sound.ts @@ -1,8 +1,8 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log.js'; -import { missingCaseError } from './missingCaseError.js'; +import { createLogger } from '../logging/log.std.js'; +import { missingCaseError } from './missingCaseError.std.js'; const log = createLogger('Sound'); diff --git a/ts/util/StartupQueue.ts b/ts/util/StartupQueue.ts index b09c206e03..935a0cd4d3 100644 --- a/ts/util/StartupQueue.ts +++ b/ts/util/StartupQueue.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import PQueue from 'p-queue'; -import * as Errors from '../types/errors.js'; -import { createLogger } from '../logging/log.js'; +import * as Errors from '../types/errors.std.js'; +import { createLogger } from '../logging/log.std.js'; const log = createLogger('StartupQueue'); diff --git a/ts/util/Username.ts b/ts/util/Username.ts index ee6e271bf8..f989bc5bd2 100644 --- a/ts/util/Username.ts +++ b/ts/util/Username.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as RemoteConfig from '../RemoteConfig.js'; -import { parseIntWithFallback } from './parseIntWithFallback.js'; +import * as RemoteConfig from '../RemoteConfig.dom.js'; +import { parseIntWithFallback } from './parseIntWithFallback.std.js'; export function getMaxNickname(): number { return parseIntWithFallback( diff --git a/ts/util/appendMacStream.ts b/ts/util/appendMacStream.ts index f8805e0b68..b9d3d7fbeb 100644 --- a/ts/util/appendMacStream.ts +++ b/ts/util/appendMacStream.ts @@ -5,7 +5,7 @@ import { createHmac } from 'node:crypto'; import { Transform } from 'node:stream'; import type { Duplex } from 'node:stream'; -import { HashType } from '../types/Crypto.js'; +import { HashType } from '../types/Crypto.std.js'; export const MAC_KEY_SIZE = 32; diff --git a/ts/util/arePinnedConversationsEqual.ts b/ts/util/arePinnedConversationsEqual.ts index a3a1376cdf..6286f99b77 100644 --- a/ts/util/arePinnedConversationsEqual.ts +++ b/ts/util/arePinnedConversationsEqual.ts @@ -1,10 +1,10 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as Bytes from '../Bytes.js'; +import * as Bytes from '../Bytes.std.js'; -import { SignalService as Proto } from '../protobuf/index.js'; -import { fromServiceIdBinaryOrString } from './ServiceId.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; +import { fromServiceIdBinaryOrString } from './ServiceId.node.js'; import PinnedConversation = Proto.AccountRecord.IPinnedConversation; diff --git a/ts/util/areWeAdmin.ts b/ts/util/areWeAdmin.ts index cc0ce3cab9..99c8609e24 100644 --- a/ts/util/areWeAdmin.ts +++ b/ts/util/areWeAdmin.ts @@ -1,10 +1,10 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types.js'; -import { SignalService as Proto } from '../protobuf/index.js'; -import { isGroupV2 } from './whatTypeOfConversation.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import type { ConversationAttributesType } from '../model-types.d.ts'; +import { SignalService as Proto } from '../protobuf/index.std.js'; +import { isGroupV2 } from './whatTypeOfConversation.dom.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; export function areWeAdmin( attributes: Pick< diff --git a/ts/util/arrayBufferToObjectURL.ts b/ts/util/arrayBufferToObjectURL.ts index b578a4a12c..5c51d29bc2 100644 --- a/ts/util/arrayBufferToObjectURL.ts +++ b/ts/util/arrayBufferToObjectURL.ts @@ -1,7 +1,7 @@ // Copyright 2018 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { MIMEType } from '../types/MIME.js'; +import type { MIMEType } from '../types/MIME.std.js'; export const arrayBufferToObjectURL = ({ data, diff --git a/ts/util/assert.ts b/ts/util/assert.ts index 9d0f858293..290b99d6c0 100644 --- a/ts/util/assert.ts +++ b/ts/util/assert.ts @@ -1,9 +1,9 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { getEnvironment, Environment } from '../environment.js'; -import { createLogger } from '../logging/log.js'; -import * as Errors from '../types/errors.js'; +import { getEnvironment, Environment } from '../environment.std.js'; +import { createLogger } from '../logging/log.std.js'; +import * as Errors from '../types/errors.std.js'; const log = createLogger('assert'); diff --git a/ts/util/attachmentDownloadQueue.ts b/ts/util/attachmentDownloadQueue.ts index 7c94ad12ec..273c253b8e 100644 --- a/ts/util/attachmentDownloadQueue.ts +++ b/ts/util/attachmentDownloadQueue.ts @@ -1,19 +1,19 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { MessageModel } from '../models/messages.js'; -import type { MessageAttributesType } from '../model-types.js'; -import type { AttachmentType } from '../types/Attachment.js'; +import type { MessageModel } from '../models/messages.preload.js'; +import type { MessageAttributesType } from '../model-types.d.ts'; +import type { AttachmentType } from '../types/Attachment.std.js'; -import { createLogger } from '../logging/log.js'; -import * as MIME from '../types/MIME.js'; +import { createLogger } from '../logging/log.std.js'; +import * as MIME from '../types/MIME.std.js'; -import { DataWriter } from '../sql/Client.js'; -import { isMoreRecentThan } from './timestamp.js'; -import { isNotNil } from './isNotNil.js'; -import { queueAttachmentDownloads } from './queueAttachmentDownloads.js'; -import { postSaveUpdates } from './cleanup.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import { DataWriter } from '../sql/Client.preload.js'; +import { isMoreRecentThan } from './timestamp.std.js'; +import { isNotNil } from './isNotNil.std.js'; +import { queueAttachmentDownloads } from './queueAttachmentDownloads.preload.js'; +import { postSaveUpdates } from './cleanup.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const log = createLogger('attachmentDownloadQueue'); diff --git a/ts/util/attachmentPath.ts b/ts/util/attachmentPath.ts index 708a681c57..0c86cdf151 100644 --- a/ts/util/attachmentPath.ts +++ b/ts/util/attachmentPath.ts @@ -4,8 +4,8 @@ import { join } from 'node:path'; import lodash from 'lodash'; -import { getRandomBytes } from '../Crypto.js'; -import * as Bytes from '../Bytes.js'; +import { getRandomBytes } from '../Crypto.node.js'; +import * as Bytes from '../Bytes.std.js'; const { isString } = lodash; diff --git a/ts/util/attachments.ts b/ts/util/attachments.ts index ae8fcb6aee..fb2afba01e 100644 --- a/ts/util/attachments.ts +++ b/ts/util/attachments.ts @@ -3,17 +3,17 @@ import { blobToArrayBuffer } from 'blob-util'; -import { createLogger } from '../logging/log.js'; -import { scaleImageToLevel } from './scaleImageToLevel.js'; -import { dropNull } from './dropNull.js'; -import { getLocalAttachmentUrl } from './getLocalAttachmentUrl.js'; +import { createLogger } from '../logging/log.std.js'; +import { scaleImageToLevel } from './scaleImageToLevel.preload.js'; +import { dropNull } from './dropNull.std.js'; +import { getLocalAttachmentUrl } from './getLocalAttachmentUrl.std.js'; import type { AttachmentType, UploadedAttachmentType, -} from '../types/Attachment.js'; -import { canBeTranscoded } from './Attachment.js'; -import * as Errors from '../types/errors.js'; -import * as Bytes from '../Bytes.js'; +} from '../types/Attachment.std.js'; +import { canBeTranscoded } from './Attachment.std.js'; +import * as Errors from '../types/errors.std.js'; +import * as Bytes from '../Bytes.std.js'; const log = createLogger('attachments'); diff --git a/ts/util/attachments/markAttachmentAsPermanentlyErrored.ts b/ts/util/attachments/markAttachmentAsPermanentlyErrored.ts index 575c5cf960..fe3e7ce81b 100644 --- a/ts/util/attachments/markAttachmentAsPermanentlyErrored.ts +++ b/ts/util/attachments/markAttachmentAsPermanentlyErrored.ts @@ -3,7 +3,7 @@ import lodash from 'lodash'; -import type { AttachmentType } from '../../types/Attachment.js'; +import type { AttachmentType } from '../../types/Attachment.std.js'; const { omit } = lodash; diff --git a/ts/util/attachments/migrateDataToFilesystem.ts b/ts/util/attachments/migrateDataToFilesystem.ts index b9b8122850..bbcdebfd38 100644 --- a/ts/util/attachments/migrateDataToFilesystem.ts +++ b/ts/util/attachments/migrateDataToFilesystem.ts @@ -5,8 +5,8 @@ import lodash from 'lodash'; import type { AttachmentType, LocalAttachmentV2Type, -} from '../../types/Attachment.js'; -import type { LoggerType } from '../../types/Logging.js'; +} from '../../types/Attachment.std.js'; +import type { LoggerType } from '../../types/Logging.std.js'; const { isFunction, isTypedArray, isUndefined, omit } = lodash; diff --git a/ts/util/avatarDataToBytes.ts b/ts/util/avatarDataToBytes.ts index 47b8e2cc5d..2da88171e5 100644 --- a/ts/util/avatarDataToBytes.ts +++ b/ts/util/avatarDataToBytes.ts @@ -1,15 +1,15 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AvatarColorType } from '../types/Colors.js'; -import { AvatarColorMap } from '../types/Colors.js'; -import type { AvatarDataType } from '../types/Avatar.js'; -import { canvasToBytes } from './canvasToBytes.js'; -import { getFittedFontSize } from './avatarTextSizeCalculator.js'; +import type { AvatarColorType } from '../types/Colors.std.js'; +import { AvatarColorMap } from '../types/Colors.std.js'; +import type { AvatarDataType } from '../types/Avatar.std.js'; +import { canvasToBytes } from './canvasToBytes.std.js'; +import { getFittedFontSize } from './avatarTextSizeCalculator.std.js'; import { getLocalAttachmentUrl, AttachmentDisposition, -} from './getLocalAttachmentUrl.js'; +} from './getLocalAttachmentUrl.std.js'; const CANVAS_SIZE = 1024; diff --git a/ts/util/avatarTextSizeCalculator.ts b/ts/util/avatarTextSizeCalculator.ts index 671abb4432..a2e1010ebc 100644 --- a/ts/util/avatarTextSizeCalculator.ts +++ b/ts/util/avatarTextSizeCalculator.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only // eslint-disable-next-line import/no-restricted-paths -import { getEmojifyData } from '../components/fun/data/emojis.js'; +import { getEmojifyData } from '../components/fun/data/emojis.std.js'; type FontSizes = { diameter: number; diff --git a/ts/util/avatarUtils.ts b/ts/util/avatarUtils.ts index be73df99c3..a534676617 100644 --- a/ts/util/avatarUtils.ts +++ b/ts/util/avatarUtils.ts @@ -2,12 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { ConversationAttributesType } from '../model-types.d.ts'; -import type { ContactAvatarType } from '../types/Avatar.js'; -import { isMe } from './whatTypeOfConversation.js'; -import { isSignalConversation } from './isSignalConversation.js'; -import { getLocalAttachmentUrl } from './getLocalAttachmentUrl.js'; -import { getAbsoluteAttachmentPath } from './migrations.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import type { ContactAvatarType } from '../types/Avatar.std.js'; +import { isMe } from './whatTypeOfConversation.dom.js'; +import { isSignalConversation } from './isSignalConversation.dom.js'; +import { getLocalAttachmentUrl } from './getLocalAttachmentUrl.std.js'; +import { getAbsoluteAttachmentPath } from './migrations.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; export function hasAvatar( conversationAttrs: ConversationAttributesType diff --git a/ts/util/backupMediaDownload.ts b/ts/util/backupMediaDownload.ts index f2439a635f..c93c8ae07c 100644 --- a/ts/util/backupMediaDownload.ts +++ b/ts/util/backupMediaDownload.ts @@ -1,10 +1,10 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { AttachmentDownloadManager } from '../jobs/AttachmentDownloadManager.js'; -import { createLogger } from '../logging/log.js'; -import { DataWriter } from '../sql/Client.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import { AttachmentDownloadManager } from '../jobs/AttachmentDownloadManager.preload.js'; +import { createLogger } from '../logging/log.std.js'; +import { DataWriter } from '../sql/Client.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const log = createLogger('backupMediaDownload'); diff --git a/ts/util/backupSubscriptionData.ts b/ts/util/backupSubscriptionData.ts index 70fc332a13..464b3685ab 100644 --- a/ts/util/backupSubscriptionData.ts +++ b/ts/util/backupSubscriptionData.ts @@ -2,13 +2,13 @@ // SPDX-License-Identifier: AGPL-3.0-only import Long from 'long'; -import type { Backups, SignalService } from '../protobuf/index.js'; -import * as Bytes from '../Bytes.js'; -import { backupsService } from '../services/backups/index.js'; -import { drop } from './drop.js'; -import { createLogger } from '../logging/log.js'; -import { resetBackupMediaDownloadStats } from './backupMediaDownload.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import type { Backups, SignalService } from '../protobuf/index.std.js'; +import * as Bytes from '../Bytes.std.js'; +import { backupsService } from '../services/backups/index.preload.js'; +import { drop } from './drop.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { resetBackupMediaDownloadStats } from './backupMediaDownload.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const log = createLogger('BackupSubscriptionData'); diff --git a/ts/util/basePaths.ts b/ts/util/basePaths.ts index 44d40d3a2e..b036dfc870 100644 --- a/ts/util/basePaths.ts +++ b/ts/util/basePaths.ts @@ -9,7 +9,7 @@ import { getBadgesPath, getAvatarsPath, getDownloadsPath, -} from '../windows/main/attachments.js'; +} from '../windows/main/attachments.preload.js'; const userDataPath = window.SignalContext.getPath('userData'); diff --git a/ts/util/batcher.ts b/ts/util/batcher.ts index f14da8a550..22172b186a 100644 --- a/ts/util/batcher.ts +++ b/ts/util/batcher.ts @@ -3,12 +3,12 @@ import PQueue from 'p-queue'; -import { sleep } from './sleep.js'; -import { createLogger } from '../logging/log.js'; -import * as Errors from '../types/errors.js'; -import { clearTimeoutIfNecessary } from './clearTimeoutIfNecessary.js'; -import { MINUTE } from './durations/index.js'; -import { drop } from './drop.js'; +import { sleep } from './sleep.std.js'; +import { createLogger } from '../logging/log.std.js'; +import * as Errors from '../types/errors.std.js'; +import { clearTimeoutIfNecessary } from './clearTimeoutIfNecessary.std.js'; +import { MINUTE } from './durations/index.std.js'; +import { drop } from './drop.std.js'; const log = createLogger('batcher'); diff --git a/ts/util/blockSendUntilConversationsAreVerified.ts b/ts/util/blockSendUntilConversationsAreVerified.ts index 3beb5752c8..97b33065cb 100644 --- a/ts/util/blockSendUntilConversationsAreVerified.ts +++ b/ts/util/blockSendUntilConversationsAreVerified.ts @@ -1,16 +1,16 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { SafetyNumberChangeSource } from '../types/SafetyNumberChangeSource.js'; -import { createLogger } from '../logging/log.js'; -import { explodePromise } from './explodePromise.js'; +import type { SafetyNumberChangeSource } from '../types/SafetyNumberChangeSource.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { explodePromise } from './explodePromise.std.js'; import type { RecipientsByConversation, RecipientEntry, -} from '../state/ducks/stories.js'; -import { isNotNil } from './isNotNil.js'; -import type { ServiceIdString } from '../types/ServiceId.js'; -import { waitForAll } from './waitForAll.js'; +} from '../state/ducks/stories.preload.js'; +import { isNotNil } from './isNotNil.std.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; +import { waitForAll } from './waitForAll.std.js'; const log = createLogger('blockSendUntilConversationsAreVerified'); diff --git a/ts/util/buildExpiration.ts b/ts/util/buildExpiration.ts index ae3f3b34ff..530443ec76 100644 --- a/ts/util/buildExpiration.ts +++ b/ts/util/buildExpiration.ts @@ -1,11 +1,11 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { Environment, getEnvironment } from '../environment.js'; -import type { LoggerType } from '../types/Logging.js'; -import { isNotUpdatable } from './version.js'; -import { isInPast } from './timestamp.js'; -import { DAY } from './durations/index.js'; +import { Environment, getEnvironment } from '../environment.std.js'; +import type { LoggerType } from '../types/Logging.std.js'; +import { isNotUpdatable } from './version.std.js'; +import { isInPast } from './timestamp.std.js'; +import { DAY } from './durations/index.std.js'; const NINETY_ONE_DAYS = 91 * DAY; const THIRTY_ONE_DAYS = 31 * DAY; diff --git a/ts/util/callDisposition.ts b/ts/util/callDisposition.ts index 47e100177e..3154d2fe64 100644 --- a/ts/util/callDisposition.ts +++ b/ts/util/callDisposition.ts @@ -13,13 +13,13 @@ import { } from '@signalapp/ringrtc'; import { ContentHint } from '@signalapp/libsignal-client'; import lodash from 'lodash'; -import { strictAssert } from './assert.js'; -import { DataReader, DataWriter } from '../sql/Client.js'; -import { SignalService as Proto } from '../protobuf/index.js'; -import { bytesToUuid, uuidToBytes } from './uuidToBytes.js'; -import { missingCaseError } from './missingCaseError.js'; -import { generateMessageId } from './generateMessageId.js'; -import { CallEndedReason, GroupCallJoinState } from '../types/Calling.js'; +import { strictAssert } from './assert.std.js'; +import { DataReader, DataWriter } from '../sql/Client.preload.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; +import { bytesToUuid, uuidToBytes } from './uuidToBytes.std.js'; +import { missingCaseError } from './missingCaseError.std.js'; +import { generateMessageId } from './generateMessageId.node.js'; +import { CallEndedReason, GroupCallJoinState } from '../types/Calling.std.js'; import { CallMode, DirectCallStatus, @@ -37,20 +37,20 @@ import { callLogEventNormalizeSchema, CallLogEvent, ClearCallHistoryResult, -} from '../types/CallDisposition.js'; -import type { AciString } from '../types/ServiceId.js'; -import { isAciString } from './isAciString.js'; -import { isMe } from './whatTypeOfConversation.js'; -import { createLogger } from '../logging/log.js'; -import * as Errors from '../types/errors.js'; -import { incrementMessageCounter } from './incrementMessageCounter.js'; -import { ReadStatus } from '../messages/MessageReadStatus.js'; -import { SeenStatus, maxSeenStatus } from '../MessageSeenStatus.js'; -import { canConversationBeUnarchived } from './canConversationBeUnarchived.js'; -import type { ConversationAttributesType } from '../model-types.js'; -import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue.js'; -import { MessageSender } from '../textsecure/SendMessage.js'; -import * as Bytes from '../Bytes.js'; +} from '../types/CallDisposition.std.js'; +import type { AciString } from '../types/ServiceId.std.js'; +import { isAciString } from './isAciString.std.js'; +import { isMe } from './whatTypeOfConversation.dom.js'; +import { createLogger } from '../logging/log.std.js'; +import * as Errors from '../types/errors.std.js'; +import { incrementMessageCounter } from './incrementMessageCounter.preload.js'; +import { ReadStatus } from '../messages/MessageReadStatus.std.js'; +import { SeenStatus, maxSeenStatus } from '../MessageSeenStatus.std.js'; +import { canConversationBeUnarchived } from './canConversationBeUnarchived.preload.js'; +import type { ConversationAttributesType } from '../model-types.d.ts'; +import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue.preload.js'; +import { MessageSender } from '../textsecure/SendMessage.preload.js'; +import * as Bytes from '../Bytes.std.js'; import type { CallDetails, CallEvent, @@ -60,18 +60,18 @@ import type { CallLogEventDetails, CallStatus, GroupCallMeta, -} from '../types/CallDisposition.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import type { ConversationModel } from '../models/conversations.js'; -import { drop } from './drop.js'; -import { sendCallLinkUpdateSync } from './sendCallLinkUpdateSync.js'; -import { storageServiceUploadJob } from '../services/storage.js'; -import { CallLinkFinalizeDeleteManager } from '../jobs/CallLinkFinalizeDeleteManager.js'; -import { parsePartial, parseStrict } from './schemas.js'; -import { calling } from '../services/calling.js'; -import { cleanupMessages } from './cleanup.js'; -import { MessageModel } from '../models/messages.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from '../types/CallDisposition.std.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import type { ConversationModel } from '../models/conversations.preload.js'; +import { drop } from './drop.std.js'; +import { sendCallLinkUpdateSync } from './sendCallLinkUpdateSync.preload.js'; +import { storageServiceUploadJob } from '../services/storage.preload.js'; +import { CallLinkFinalizeDeleteManager } from '../jobs/CallLinkFinalizeDeleteManager.preload.js'; +import { parsePartial, parseStrict } from './schemas.std.js'; +import { calling } from '../services/calling.preload.js'; +import { cleanupMessages } from './cleanup.preload.js'; +import { MessageModel } from '../models/messages.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const { isEqual } = lodash; diff --git a/ts/util/callLinks.ts b/ts/util/callLinks.ts index d827ca0cb9..095505c4f9 100644 --- a/ts/util/callLinks.ts +++ b/ts/util/callLinks.ts @@ -1,21 +1,21 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import { v4 as generateUuid } from 'uuid'; -import * as Bytes from '../Bytes.js'; +import * as Bytes from '../Bytes.std.js'; import type { CallLinkConversationType, CallLinkType, -} from '../types/CallLink.js'; -import { CallLinkRestrictions } from '../types/CallLink.js'; -import type { LocalizerType } from '../types/Util.js'; -import { getColorForCallLink } from './getColorForCallLink.js'; +} from '../types/CallLink.std.js'; +import { CallLinkRestrictions } from '../types/CallLink.std.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { getColorForCallLink } from './getColorForCallLink.std.js'; import { AdhocCallStatus, CallDirection, CallType, type CallHistoryDetails, CallMode, -} from '../types/CallDisposition.js'; +} from '../types/CallDisposition.std.js'; export const CALL_LINK_DEFAULT_STATE: Pick< CallLinkType, diff --git a/ts/util/callLinks/zkgroup.ts b/ts/util/callLinks/zkgroup.ts index 5de4e6b54a..33a90056ce 100644 --- a/ts/util/callLinks/zkgroup.ts +++ b/ts/util/callLinks/zkgroup.ts @@ -3,15 +3,15 @@ import type { CallLinkRootKey } from '@signalapp/ringrtc'; import { Aci } from '@signalapp/libsignal-client'; -import { getCheckedCallLinkAuthCredentialsForToday } from '../../services/groupCredentialFetcher.js'; -import { itemStorage } from '../../textsecure/Storage.js'; -import type { CallLinkAuthCredentialPresentation } from '../zkgroup.js'; -import * as durations from '../durations/index.js'; +import { getCheckedCallLinkAuthCredentialsForToday } from '../../services/groupCredentialFetcher.preload.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; +import type { CallLinkAuthCredentialPresentation } from '../zkgroup.node.js'; +import * as durations from '../durations/index.std.js'; import { CallLinkAuthCredential, CallLinkSecretParams, GenericServerPublicParams, -} from '../zkgroup.js'; +} from '../zkgroup.node.js'; export async function getCallLinkAuthCredentialPresentation( callLinkRootKey: CallLinkRootKey diff --git a/ts/util/callLinksRingrtc.ts b/ts/util/callLinksRingrtc.ts index 0cb8262b92..a7df3538c8 100644 --- a/ts/util/callLinksRingrtc.ts +++ b/ts/util/callLinksRingrtc.ts @@ -13,7 +13,7 @@ import { callLinkRecordSchema, defunctCallLinkRecordSchema, toCallLinkRestrictions, -} from '../types/CallLink.js'; +} from '../types/CallLink.std.js'; import type { CallLinkRecord, CallLinkRestrictions, @@ -21,15 +21,15 @@ import type { DefunctCallLinkRecord, DefunctCallLinkType, CallLinkStateType, -} from '../types/CallLink.js'; -import { unicodeSlice } from './unicodeSlice.js'; +} from '../types/CallLink.std.js'; +import { unicodeSlice } from './unicodeSlice.std.js'; import { fromAdminKeyBytes, getKeyFromCallLink, toAdminKeyBytes, -} from './callLinks.js'; -import { parseStrict } from './schemas.js'; -import * as Bytes from '../Bytes.js'; +} from './callLinks.std.js'; +import { parseStrict } from './schemas.std.js'; +import * as Bytes from '../Bytes.std.js'; /** * RingRTC conversions diff --git a/ts/util/callingGetParticipantName.ts b/ts/util/callingGetParticipantName.ts index 1cff89e95a..5e9cd928f7 100644 --- a/ts/util/callingGetParticipantName.ts +++ b/ts/util/callingGetParticipantName.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationType } from '../state/ducks/conversations.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; export function getParticipantName( participant: Readonly< diff --git a/ts/util/callingIsReconnecting.ts b/ts/util/callingIsReconnecting.ts index ffa90c06ce..439be04496 100644 --- a/ts/util/callingIsReconnecting.ts +++ b/ts/util/callingIsReconnecting.ts @@ -1,10 +1,10 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { CallState, GroupCallConnectionState } from '../types/Calling.js'; -import { CallMode } from '../types/CallDisposition.js'; -import type { ActiveCallType } from '../types/Calling.js'; -import { isGroupOrAdhocActiveCall } from './isGroupOrAdhocCall.js'; +import { CallState, GroupCallConnectionState } from '../types/Calling.std.js'; +import { CallMode } from '../types/CallDisposition.std.js'; +import type { ActiveCallType } from '../types/Calling.std.js'; +import { isGroupOrAdhocActiveCall } from './isGroupOrAdhocCall.std.js'; export function isReconnecting(activeCall: ActiveCallType): boolean { return ( diff --git a/ts/util/callingMessageToProto.ts b/ts/util/callingMessageToProto.ts index 1198686f74..9a53b45749 100644 --- a/ts/util/callingMessageToProto.ts +++ b/ts/util/callingMessageToProto.ts @@ -4,10 +4,10 @@ import type { CallingMessage } from '@signalapp/ringrtc'; import { CallMessageUrgency } from '@signalapp/ringrtc'; import Long from 'long'; -import { SignalService as Proto } from '../protobuf/index.js'; -import { createLogger } from '../logging/log.js'; -import { toLogFormat } from '../types/errors.js'; -import { missingCaseError } from './missingCaseError.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { toLogFormat } from '../types/errors.std.js'; +import { missingCaseError } from './missingCaseError.std.js'; const log = createLogger('callingMessageToProto'); diff --git a/ts/util/callingNotification.ts b/ts/util/callingNotification.ts index 62f1901564..49a279e572 100644 --- a/ts/util/callingNotification.ts +++ b/ts/util/callingNotification.ts @@ -1,23 +1,23 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LocalizerType } from '../types/Util.js'; +import type { LocalizerType } from '../types/Util.std.js'; import { CallMode, CallDirection, DirectCallStatus, CallType, GroupCallStatus, -} from '../types/CallDisposition.js'; +} from '../types/CallDisposition.std.js'; import type { CallStatus, CallHistoryDetails, -} from '../types/CallDisposition.js'; -import { missingCaseError } from './missingCaseError.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import { strictAssert } from './assert.js'; -import { isMoreRecentThan } from './timestamp.js'; -import { MINUTE } from './durations/index.js'; +} from '../types/CallDisposition.std.js'; +import { missingCaseError } from './missingCaseError.std.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import { strictAssert } from './assert.std.js'; +import { isMoreRecentThan } from './timestamp.std.js'; +import { MINUTE } from './durations/index.std.js'; export type CallingNotificationType = Readonly<{ // In some older calls, we don't have a call id, this hardens against that. diff --git a/ts/util/callingTones.ts b/ts/util/callingTones.ts index 7c6a9c8653..042b60dfad 100644 --- a/ts/util/callingTones.ts +++ b/ts/util/callingTones.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import PQueue from 'p-queue'; -import { MINUTE } from './durations/index.js'; -import { Sound, SoundType } from './Sound.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import { MINUTE } from './durations/index.std.js'; +import { Sound, SoundType } from './Sound.std.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const ringtoneEventQueue = new PQueue({ concurrency: 1, diff --git a/ts/util/canAddNewMembers.ts b/ts/util/canAddNewMembers.ts index 2965acd80c..8e75bc5495 100644 --- a/ts/util/canAddNewMembers.ts +++ b/ts/util/canAddNewMembers.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { ConversationAttributesType } from '../model-types.d.ts'; -import { SignalService as Proto } from '../protobuf/index.js'; -import { isGroupV2 } from './whatTypeOfConversation.js'; -import { areWeAdmin } from './areWeAdmin.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; +import { isGroupV2 } from './whatTypeOfConversation.dom.js'; +import { areWeAdmin } from './areWeAdmin.preload.js'; export function canAddNewMembers( conversationAttrs: ConversationAttributesType diff --git a/ts/util/canBeAnnouncementGroup.ts b/ts/util/canBeAnnouncementGroup.ts index 117ecef687..0cffb690be 100644 --- a/ts/util/canBeAnnouncementGroup.ts +++ b/ts/util/canBeAnnouncementGroup.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { ConversationAttributesType } from '../model-types.d.ts'; -import { isGroupV2 } from './whatTypeOfConversation.js'; +import { isGroupV2 } from './whatTypeOfConversation.dom.js'; export function canBeAnnouncementGroup( conversationAttrs: Pick< diff --git a/ts/util/canChangeTimer.ts b/ts/util/canChangeTimer.ts index 560bb730ee..6a150c315b 100644 --- a/ts/util/canChangeTimer.ts +++ b/ts/util/canChangeTimer.ts @@ -1,14 +1,14 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types.js'; -import { SignalService as Proto } from '../protobuf/index.js'; -import { areWeAdmin } from './areWeAdmin.js'; +import type { ConversationAttributesType } from '../model-types.d.ts'; +import { SignalService as Proto } from '../protobuf/index.std.js'; +import { areWeAdmin } from './areWeAdmin.preload.js'; import { isDirectConversation, isGroupV1, isGroupV2, -} from './whatTypeOfConversation.js'; +} from './whatTypeOfConversation.dom.js'; export function canChangeTimer( attributes: ConversationAttributesType diff --git a/ts/util/canConversationBeUnarchived.ts b/ts/util/canConversationBeUnarchived.ts index 608acc0200..b74136561c 100644 --- a/ts/util/canConversationBeUnarchived.ts +++ b/ts/util/canConversationBeUnarchived.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { ConversationAttributesType } from '../model-types.d.ts'; -import { isConversationMuted } from './isConversationMuted.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import { isConversationMuted } from './isConversationMuted.std.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; export function canConversationBeUnarchived( attrs: ConversationAttributesType diff --git a/ts/util/canEditGroupInfo.ts b/ts/util/canEditGroupInfo.ts index 49bdfd4288..157dfa26b1 100644 --- a/ts/util/canEditGroupInfo.ts +++ b/ts/util/canEditGroupInfo.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { ConversationAttributesType } from '../model-types.d.ts'; -import { SignalService as Proto } from '../protobuf/index.js'; -import { isGroupV2 } from './whatTypeOfConversation.js'; -import { areWeAdmin } from './areWeAdmin.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; +import { isGroupV2 } from './whatTypeOfConversation.dom.js'; +import { areWeAdmin } from './areWeAdmin.preload.js'; export function canEditGroupInfo( conversationAttrs: ConversationAttributesType diff --git a/ts/util/canEditMessage.ts b/ts/util/canEditMessage.ts index d1f20eda94..945b795ee2 100644 --- a/ts/util/canEditMessage.ts +++ b/ts/util/canEditMessage.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; -import { DAY } from './durations/index.js'; -import { isMoreRecentThan } from './timestamp.js'; -import { isOutgoing } from '../messages/helpers.js'; -import { isMessageNoteToSelf } from './isMessageNoteToSelf.js'; +import { DAY } from './durations/index.std.js'; +import { isMoreRecentThan } from './timestamp.std.js'; +import { isOutgoing } from '../messages/helpers.std.js'; +import { isMessageNoteToSelf } from './isMessageNoteToSelf.dom.js'; export const MESSAGE_MAX_EDIT_COUNT = 10; diff --git a/ts/util/canvasToBlob.ts b/ts/util/canvasToBlob.ts index 3bbecaf3de..bc5e66c731 100644 --- a/ts/util/canvasToBlob.ts +++ b/ts/util/canvasToBlob.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { IMAGE_JPEG } from '../types/MIME.js'; +import { IMAGE_JPEG } from '../types/MIME.std.js'; /** * Similar to [the built-in `toBlob` method][0], but returns a Promise. diff --git a/ts/util/canvasToBytes.ts b/ts/util/canvasToBytes.ts index 1639d6258d..965af9b74e 100644 --- a/ts/util/canvasToBytes.ts +++ b/ts/util/canvasToBytes.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { canvasToBlob } from './canvasToBlob.js'; -import type { MIMEType } from '../types/MIME.js'; +import { canvasToBlob } from './canvasToBlob.std.js'; +import type { MIMEType } from '../types/MIME.std.js'; export async function canvasToBytes( canvas: HTMLCanvasElement, diff --git a/ts/util/captureDimensionsAndScreenshot.ts b/ts/util/captureDimensionsAndScreenshot.ts new file mode 100644 index 0000000000..80dce56450 --- /dev/null +++ b/ts/util/captureDimensionsAndScreenshot.ts @@ -0,0 +1,193 @@ +// Copyright 2025 Signal Messenger, LLC +// SPDX-License-Identifier: AGPL-3.0-only + +import { blobToArrayBuffer } from 'blob-util'; + +import type { + AttachmentType, + LocalAttachmentV2Type, +} from '../types/Attachment.std.js'; +import { type MIMEType, IMAGE_PNG } from '../types/MIME.std.js'; +import type { MakeVideoScreenshotResultType } from '../types/VisualAttachment.dom.js'; +import type { LoggerType } from '../types/Logging.std.js'; +import { getLocalAttachmentUrl } from './getLocalAttachmentUrl.std.js'; +import { toLogFormat } from '../types/errors.std.js'; +import { + isImageTypeSupported, + isVideoTypeSupported, +} from './GoogleChrome.std.js'; + +const THUMBNAIL_SIZE = 150; +const THUMBNAIL_CONTENT_TYPE = IMAGE_PNG; + +export async function captureDimensionsAndScreenshot( + attachment: AttachmentType, + options: { generateThumbnail: boolean }, + params: { + writeNewAttachmentData: ( + data: Uint8Array + ) => Promise; + makeObjectUrl: ( + data: Uint8Array | ArrayBuffer, + contentType: MIMEType + ) => string; + revokeObjectUrl: (path: string) => void; + getImageDimensions: (params: { + objectUrl: string; + logger: LoggerType; + }) => Promise<{ + width: number; + height: number; + }>; + makeImageThumbnail: (params: { + size: number; + objectUrl: string; + contentType: MIMEType; + logger: LoggerType; + }) => Promise; + makeVideoScreenshot: (params: { + objectUrl: string; + contentType: MIMEType; + logger: LoggerType; + }) => Promise; + logger: LoggerType; + } +): Promise { + const { contentType } = attachment; + + const { + writeNewAttachmentData, + makeObjectUrl, + revokeObjectUrl, + getImageDimensions: getImageDimensionsFromURL, + makeImageThumbnail, + makeVideoScreenshot, + logger, + } = params; + + if ( + !isImageTypeSupported(contentType) && + !isVideoTypeSupported(contentType) + ) { + return attachment; + } + + // If the attachment hasn't been downloaded yet, we won't have a path + if (!attachment.path) { + return attachment; + } + + const localUrl = getLocalAttachmentUrl(attachment); + + if (isImageTypeSupported(contentType)) { + try { + const { width, height } = await getImageDimensionsFromURL({ + objectUrl: localUrl, + logger, + }); + let thumbnail: LocalAttachmentV2Type | undefined; + + if (options.generateThumbnail) { + const thumbnailBuffer = await blobToArrayBuffer( + await makeImageThumbnail({ + size: THUMBNAIL_SIZE, + objectUrl: localUrl, + contentType: THUMBNAIL_CONTENT_TYPE, + logger, + }) + ); + + thumbnail = await writeNewAttachmentData( + new Uint8Array(thumbnailBuffer) + ); + } + + return { + ...attachment, + width, + height, + thumbnail: thumbnail + ? { + ...thumbnail, + contentType: THUMBNAIL_CONTENT_TYPE, + width: THUMBNAIL_SIZE, + height: THUMBNAIL_SIZE, + } + : undefined, + }; + } catch (error) { + logger.error( + 'captureDimensionsAndScreenshot:', + 'error processing image; skipping screenshot generation', + toLogFormat(error) + ); + return attachment; + } + } + + let screenshotObjectUrl: string | undefined; + try { + const { blob, duration } = await makeVideoScreenshot({ + objectUrl: localUrl, + contentType: THUMBNAIL_CONTENT_TYPE, + logger, + }); + const screenshotBuffer = await blobToArrayBuffer(blob); + screenshotObjectUrl = makeObjectUrl( + screenshotBuffer, + THUMBNAIL_CONTENT_TYPE + ); + const { width, height } = await getImageDimensionsFromURL({ + objectUrl: screenshotObjectUrl, + logger, + }); + const screenshot = await writeNewAttachmentData( + new Uint8Array(screenshotBuffer) + ); + + let thumbnail: LocalAttachmentV2Type | undefined; + if (options.generateThumbnail) { + const thumbnailBuffer = await blobToArrayBuffer( + await makeImageThumbnail({ + size: THUMBNAIL_SIZE, + objectUrl: screenshotObjectUrl, + contentType: THUMBNAIL_CONTENT_TYPE, + logger, + }) + ); + + thumbnail = await writeNewAttachmentData(new Uint8Array(thumbnailBuffer)); + } + + return { + ...attachment, + duration, + screenshot: { + ...screenshot, + contentType: THUMBNAIL_CONTENT_TYPE, + width, + height, + }, + thumbnail: thumbnail + ? { + ...thumbnail, + contentType: THUMBNAIL_CONTENT_TYPE, + width: THUMBNAIL_SIZE, + height: THUMBNAIL_SIZE, + } + : undefined, + width, + height, + }; + } catch (error) { + logger.error( + 'captureDimensionsAndScreenshot: error processing video; skipping screenshot generation', + toLogFormat(error) + ); + return attachment; + } finally { + if (screenshotObjectUrl !== undefined) { + revokeObjectUrl(screenshotObjectUrl); + } + } +} diff --git a/ts/util/checkFirstEnvelope.ts b/ts/util/checkFirstEnvelope.ts index 025e669cb7..92c03f5c1f 100644 --- a/ts/util/checkFirstEnvelope.ts +++ b/ts/util/checkFirstEnvelope.ts @@ -3,14 +3,14 @@ import lodash from 'lodash'; -import { createLogger } from '../logging/log.js'; -import { SignalService as Proto } from '../protobuf/index.js'; -import { ToastType } from '../types/Toast.js'; -import { HOUR, SECOND } from './durations/index.js'; -import { isOlderThan } from './timestamp.js'; -import { isProduction } from './version.js'; +import { createLogger } from '../logging/log.std.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; +import { ToastType } from '../types/Toast.dom.js'; +import { HOUR, SECOND } from './durations/index.std.js'; +import { isOlderThan } from './timestamp.std.js'; +import { isProduction } from './version.std.js'; -import type { IncomingWebSocketRequest } from '../textsecure/WebsocketResources.js'; +import type { IncomingWebSocketRequest } from '../textsecure/WebsocketResources.preload.js'; const { isNumber } = lodash; diff --git a/ts/util/checkOurPniIdentityKey.ts b/ts/util/checkOurPniIdentityKey.ts index d2063949a6..547e2f72b1 100644 --- a/ts/util/checkOurPniIdentityKey.ts +++ b/ts/util/checkOurPniIdentityKey.ts @@ -1,11 +1,11 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log.js'; -import { constantTimeEqual } from '../Crypto.js'; -import { signalProtocolStore } from '../SignalProtocolStore.js'; -import { whoami, getKeysForServiceId } from '../textsecure/WebAPI.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import { createLogger } from '../logging/log.std.js'; +import { constantTimeEqual } from '../Crypto.node.js'; +import { signalProtocolStore } from '../SignalProtocolStore.preload.js'; +import { whoami, getKeysForServiceId } from '../textsecure/WebAPI.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const log = createLogger('checkOurPniIdentityKey'); diff --git a/ts/util/cleanup.ts b/ts/util/cleanup.ts index f6f6995b2f..b7e4b0da64 100644 --- a/ts/util/cleanup.ts +++ b/ts/util/cleanup.ts @@ -5,31 +5,31 @@ import PQueue from 'p-queue'; import { batch } from 'react-redux'; import type { MessageAttributesType } from '../model-types.d.ts'; -import { MessageModel } from '../models/messages.js'; +import { MessageModel } from '../models/messages.preload.js'; -import * as Errors from '../types/errors.js'; -import { createLogger } from '../logging/log.js'; +import * as Errors from '../types/errors.std.js'; +import { createLogger } from '../logging/log.std.js'; -import { MessageSender } from '../textsecure/SendMessage.js'; -import { DataReader, DataWriter } from '../sql/Client.js'; -import { deletePackReference } from '../types/Stickers.js'; -import { isStory } from '../messages/helpers.js'; -import { isDirectConversation } from './whatTypeOfConversation.js'; -import { getCallHistorySelector } from '../state/selectors/callHistory.js'; +import { MessageSender } from '../textsecure/SendMessage.preload.js'; +import { DataReader, DataWriter } from '../sql/Client.preload.js'; +import { deletePackReference } from '../types/Stickers.preload.js'; +import { isStory } from '../messages/helpers.std.js'; +import { isDirectConversation } from './whatTypeOfConversation.dom.js'; +import { getCallHistorySelector } from '../state/selectors/callHistory.std.js'; import { DirectCallStatus, GroupCallStatus, AdhocCallStatus, -} from '../types/CallDisposition.js'; -import { getMessageIdForLogging } from './idForLogging.js'; -import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue.js'; -import { MINUTE } from './durations/index.js'; -import { drop } from './drop.js'; -import { deleteExternalMessageFiles } from './migrations.js'; -import { hydrateStoryContext } from './hydrateStoryContext.js'; -import { update as updateExpiringMessagesService } from '../services/expiringMessagesDeletion.js'; -import { tapToViewMessagesDeletionService } from '../services/tapToViewMessagesDeletionService.js'; -import { throttledUpdateBackupMediaDownloadProgress } from './updateBackupMediaDownloadProgress.js'; +} from '../types/CallDisposition.std.js'; +import { getMessageIdForLogging } from './idForLogging.preload.js'; +import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue.preload.js'; +import { MINUTE } from './durations/index.std.js'; +import { drop } from './drop.std.js'; +import { deleteExternalMessageFiles } from './migrations.preload.js'; +import { hydrateStoryContext } from './hydrateStoryContext.preload.js'; +import { update as updateExpiringMessagesService } from '../services/expiringMessagesDeletion.preload.js'; +import { tapToViewMessagesDeletionService } from '../services/tapToViewMessagesDeletionService.preload.js'; +import { throttledUpdateBackupMediaDownloadProgress } from './updateBackupMediaDownloadProgress.preload.js'; const log = createLogger('cleanup'); diff --git a/ts/util/clearConversationDraftAttachments.ts b/ts/util/clearConversationDraftAttachments.ts index f05cab52d5..5893003fdc 100644 --- a/ts/util/clearConversationDraftAttachments.ts +++ b/ts/util/clearConversationDraftAttachments.ts @@ -1,10 +1,10 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AttachmentDraftType } from '../types/Attachment.js'; -import { DataWriter } from '../sql/Client.js'; -import { strictAssert } from './assert.js'; -import { deleteDraftAttachment } from './deleteDraftAttachment.js'; +import type { AttachmentDraftType } from '../types/Attachment.std.js'; +import { DataWriter } from '../sql/Client.preload.js'; +import { strictAssert } from './assert.std.js'; +import { deleteDraftAttachment } from './deleteDraftAttachment.preload.js'; export async function clearConversationDraftAttachments( conversationId: string, diff --git a/ts/util/computeBlurHashUrl.ts b/ts/util/computeBlurHashUrl.ts index d796cbd565..403936f824 100644 --- a/ts/util/computeBlurHashUrl.ts +++ b/ts/util/computeBlurHashUrl.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { decode } from 'blurhash'; -import * as Bytes from '../Bytes.js'; +import * as Bytes from '../Bytes.std.js'; const BITMAP_HEADER = new Uint8Array([ // Header diff --git a/ts/util/consoleLogger.ts b/ts/util/consoleLogger.ts index 0d1f93b63f..4b8c585a6e 100644 --- a/ts/util/consoleLogger.ts +++ b/ts/util/consoleLogger.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LoggerType } from '../types/Logging.js'; +import type { LoggerType } from '../types/Logging.std.js'; /* eslint-disable no-console */ export const consoleLogger: LoggerType = { diff --git a/ts/util/copyLinksWithToast.ts b/ts/util/copyLinksWithToast.ts index bfebbf347e..0dff88746a 100644 --- a/ts/util/copyLinksWithToast.ts +++ b/ts/util/copyLinksWithToast.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { ToastType } from '../types/Toast.js'; +import { ToastType } from '../types/Toast.dom.js'; export async function copyGroupLink(groupLink: string): Promise { await window.navigator.clipboard.writeText(groupLink); diff --git a/ts/util/countMutedStats.ts b/ts/util/countMutedStats.ts index ccc5b78aa1..2efbe05ec1 100644 --- a/ts/util/countMutedStats.ts +++ b/ts/util/countMutedStats.ts @@ -1,13 +1,13 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationType } from '../state/ducks/conversations.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; import { isConversationInChatFolder, type ChatFolderId, -} from '../types/ChatFolder.js'; -import { CurrentChatFolders } from '../types/CurrentChatFolders.js'; -import { isConversationMuted } from './isConversationMuted.js'; +} from '../types/ChatFolder.std.js'; +import { CurrentChatFolders } from '../types/CurrentChatFolders.std.js'; +import { isConversationMuted } from './isConversationMuted.std.js'; type MutableMutedStats = { chatsMutedCount: number; diff --git a/ts/util/countUnreadStats.ts b/ts/util/countUnreadStats.ts index 7872931574..d455c7dde1 100644 --- a/ts/util/countUnreadStats.ts +++ b/ts/util/countUnreadStats.ts @@ -1,11 +1,11 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationType } from '../state/ducks/conversations.js'; -import { isConversationInChatFolder } from '../types/ChatFolder.js'; -import type { ChatFolderId } from '../types/ChatFolder.js'; -import { CurrentChatFolders } from '../types/CurrentChatFolders.js'; -import { isConversationMuted } from './isConversationMuted.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import { isConversationInChatFolder } from '../types/ChatFolder.std.js'; +import type { ChatFolderId } from '../types/ChatFolder.std.js'; +import { CurrentChatFolders } from '../types/CurrentChatFolders.std.js'; +import { isConversationMuted } from './isConversationMuted.std.js'; type MutableUnreadStats = { /** diff --git a/ts/util/createAvatarData.ts b/ts/util/createAvatarData.ts index a7a13b2712..12013eb2cb 100644 --- a/ts/util/createAvatarData.ts +++ b/ts/util/createAvatarData.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { v4 as uuid } from 'uuid'; -import type { AvatarDataType } from '../types/Avatar.js'; +import type { AvatarDataType } from '../types/Avatar.std.js'; export function createAvatarData( partialAvatarData: Readonly> diff --git a/ts/util/createHTTPSAgent.ts b/ts/util/createHTTPSAgent.ts index 1351d56d82..a71f87e700 100644 --- a/ts/util/createHTTPSAgent.ts +++ b/ts/util/createHTTPSAgent.ts @@ -10,17 +10,17 @@ import type { ConnectionOptions } from 'node:tls'; import { callbackify, promisify } from 'node:util'; import pTimeout from 'p-timeout'; -import { createLogger } from '../logging/log.js'; +import { createLogger } from '../logging/log.std.js'; import { electronLookup as electronLookupWithCb, interleaveAddresses, -} from './dns.js'; -import { strictAssert } from './assert.js'; -import { parseIntOrThrow } from './parseIntOrThrow.js'; -import { sleep } from './sleep.js'; -import { SECOND } from './durations/index.js'; -import { dropNull } from './dropNull.js'; -import { explodePromise } from './explodePromise.js'; +} from './dns.node.js'; +import { strictAssert } from './assert.std.js'; +import { parseIntOrThrow } from './parseIntOrThrow.std.js'; +import { sleep } from './sleep.std.js'; +import { SECOND } from './durations/index.std.js'; +import { dropNull } from './dropNull.std.js'; +import { explodePromise } from './explodePromise.std.js'; const log = createLogger('createHTTPSAgent'); diff --git a/ts/util/createIPCEvents.ts b/ts/util/createIPCEvents.ts index 5432223971..24fc3b5789 100644 --- a/ts/util/createIPCEvents.ts +++ b/ts/util/createIPCEvents.ts @@ -6,33 +6,36 @@ import type { SystemPreferences } from 'electron'; import lodash from 'lodash'; import type { ZoomFactorType } from '../types/Storage.d.ts'; -import * as Errors from '../types/errors.js'; -import * as Stickers from '../types/Stickers.js'; -import * as Settings from '../types/Settings.js'; +import * as Errors from '../types/errors.std.js'; +import * as Stickers from '../types/Stickers.preload.js'; +import * as Settings from '../types/Settings.std.js'; -import { resolveUsernameByLinkBase64 } from '../services/username.js'; -import { isInCall } from '../state/selectors/calling.js'; +import { resolveUsernameByLinkBase64 } from '../services/username.preload.js'; +import { isInCall } from '../state/selectors/calling.std.js'; -import * as Registration from './registration.js'; -import { lookupConversationWithoutServiceId } from './lookupConversationWithoutServiceId.js'; -import { createLogger } from '../logging/log.js'; +import * as Registration from './registration.preload.js'; +import { lookupConversationWithoutServiceId } from './lookupConversationWithoutServiceId.preload.js'; +import { createLogger } from '../logging/log.std.js'; import { type NotificationClickData, notificationService, -} from '../services/notifications.js'; -import { joinViaLink } from '../groups.js'; -import { StoryViewModeType, StoryViewTargetType } from '../types/Stories.js'; -import { isValidE164 } from './isValidE164.js'; -import { fromWebSafeBase64 } from './webSafeBase64.js'; -import { showConfirmationDialog } from './showConfirmationDialog.js'; +} from '../services/notifications.preload.js'; +import { joinViaLink } from '../groups.preload.js'; +import { + StoryViewModeType, + StoryViewTargetType, +} from '../types/Stories.std.js'; +import { isValidE164 } from './isValidE164.std.js'; +import { fromWebSafeBase64 } from './webSafeBase64.std.js'; +import { showConfirmationDialog } from './showConfirmationDialog.dom.js'; import type { EphemeralSettings, SettingsValuesType, ThemeType, -} from './preload.js'; -import { SystemTraySetting } from '../types/SystemTraySetting.js'; -import { putStickers } from '../textsecure/WebAPI.js'; -import OS from './os/osPreload.js'; +} from './preload.preload.js'; +import { SystemTraySetting } from '../types/SystemTraySetting.std.js'; +import { putStickers } from '../textsecure/WebAPI.preload.js'; +import OS from './os/osPreload.preload.js'; const { noop } = lodash; diff --git a/ts/util/createIdenticon.tsx b/ts/util/createIdenticon.tsx index d08a55a291..0ca3eb3fe4 100644 --- a/ts/util/createIdenticon.tsx +++ b/ts/util/createIdenticon.tsx @@ -4,16 +4,16 @@ import React from 'react'; import loadImage from 'blueimp-load-image'; import { renderToString } from 'react-dom/server'; -import type { AvatarColorType } from '../types/Colors.js'; -import { AvatarColorMap } from '../types/Colors.js'; +import type { AvatarColorType } from '../types/Colors.std.js'; +import { AvatarColorMap } from '../types/Colors.std.js'; import { IdenticonSVGForCallLink, IdenticonSVGForContact, IdenticonSVGForGroup, // eslint-disable-next-line import/no-restricted-paths -} from '../components/IdenticonSVG.js'; -import { missingCaseError } from './missingCaseError.js'; -import { writeNewPlaintextTempData } from './migrations.js'; +} from '../components/IdenticonSVG.dom.js'; +import { missingCaseError } from './missingCaseError.std.js'; +import { writeNewPlaintextTempData } from './migrations.preload.js'; const TARGET_MIME = 'image/png'; diff --git a/ts/util/createProxyAgent.ts b/ts/util/createProxyAgent.ts index fd0f26e485..e1c65aeefd 100644 --- a/ts/util/createProxyAgent.ts +++ b/ts/util/createProxyAgent.ts @@ -7,12 +7,12 @@ import { URL } from 'node:url'; import type { LookupOptions, LookupAddress } from 'node:dns'; import { lookup } from 'node:dns/promises'; -import { createLogger } from '../logging/log.js'; -import { happyEyeballs } from './createHTTPSAgent.js'; -import type { ConnectOptionsType } from './createHTTPSAgent.js'; -import { explodePromise } from './explodePromise.js'; -import { SECOND } from './durations/index.js'; -import { drop } from './drop.js'; +import { createLogger } from '../logging/log.std.js'; +import { happyEyeballs } from './createHTTPSAgent.node.js'; +import type { ConnectOptionsType } from './createHTTPSAgent.node.js'; +import { explodePromise } from './explodePromise.std.js'; +import { SECOND } from './durations/index.std.js'; +import { drop } from './drop.std.js'; const log = createLogger('createProxyAgent'); diff --git a/ts/util/currency.ts b/ts/util/currency.ts index b95e4e9e25..9cc1f98af5 100644 --- a/ts/util/currency.ts +++ b/ts/util/currency.ts @@ -6,13 +6,13 @@ import type { HumanDonationAmount, DonationReceipt, StripeDonationAmount, -} from '../types/Donations.js'; +} from '../types/Donations.std.js'; import { humanDonationAmountSchema, stripeDonationAmountSchema, -} from '../types/Donations.js'; -import { parseStrict, safeParseStrict } from './schemas.js'; -import { missingCaseError } from './missingCaseError.js'; +} from '../types/Donations.std.js'; +import { parseStrict, safeParseStrict } from './schemas.std.js'; +import { missingCaseError } from './missingCaseError.std.js'; // See: https://docs.stripe.com/currencies?presentment-currency=US export const ZERO_DECIMAL_CURRENCIES = new Set([ diff --git a/ts/util/decipherWithAesKey.ts b/ts/util/decipherWithAesKey.ts index ad40fee99e..dd9fa31ca8 100644 --- a/ts/util/decipherWithAesKey.ts +++ b/ts/util/decipherWithAesKey.ts @@ -5,8 +5,8 @@ import { createDecipheriv, type Decipher } from 'node:crypto'; import { Buffer } from 'node:buffer'; import { Transform } from 'node:stream'; -import { CipherType, IV_LENGTH } from '../types/Crypto.js'; -import { strictAssert } from './assert.js'; +import { CipherType, IV_LENGTH } from '../types/Crypto.std.js'; +import { strictAssert } from './assert.std.js'; /** * Gets the IV from the start of the stream and creates a decipher. diff --git a/ts/util/deconstructLookup.ts b/ts/util/deconstructLookup.ts index 778c9b7499..a3b06b68c6 100644 --- a/ts/util/deconstructLookup.ts +++ b/ts/util/deconstructLookup.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { getOwn } from './getOwn.js'; -import { assertDev } from './assert.js'; +import { getOwn } from './getOwn.std.js'; +import { assertDev } from './assert.std.js'; export const deconstructLookup = ( lookup: Record, diff --git a/ts/util/deleteAllLogs.ts b/ts/util/deleteAllLogs.ts index 8bb4885d07..2633a9e355 100644 --- a/ts/util/deleteAllLogs.ts +++ b/ts/util/deleteAllLogs.ts @@ -4,8 +4,8 @@ import { ipcRenderer } from 'electron'; import pTimeout from 'p-timeout'; -import { beforeRestart } from '../logging/set_up_renderer_logging.js'; -import * as durations from './durations/index.js'; +import { beforeRestart } from '../logging/set_up_renderer_logging.preload.js'; +import * as durations from './durations/index.std.js'; export function deleteAllLogs(): Promise { // Restart logging again when the file stream close diff --git a/ts/util/deleteAllMyStories.ts b/ts/util/deleteAllMyStories.ts index 3b4c89f130..bde0db56be 100644 --- a/ts/util/deleteAllMyStories.ts +++ b/ts/util/deleteAllMyStories.ts @@ -1,7 +1,7 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { deleteStoryForEveryone } from './deleteStoryForEveryone.js'; +import { deleteStoryForEveryone } from './deleteStoryForEveryone.preload.js'; export async function deleteAllMyStories(): Promise { const { stories } = window.reduxStore.getState().stories; diff --git a/ts/util/deleteDraftAttachment.ts b/ts/util/deleteDraftAttachment.ts index c79189a9ca..e8e5f419e5 100644 --- a/ts/util/deleteDraftAttachment.ts +++ b/ts/util/deleteDraftAttachment.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AttachmentType } from '../types/Attachment.js'; -import { deleteDraftFile } from './migrations.js'; +import type { AttachmentType } from '../types/Attachment.std.js'; +import { deleteDraftFile } from './migrations.preload.js'; export async function deleteDraftAttachment( attachment: Pick diff --git a/ts/util/deleteForEveryone.ts b/ts/util/deleteForEveryone.ts index a81cca7c44..00218328da 100644 --- a/ts/util/deleteForEveryone.ts +++ b/ts/util/deleteForEveryone.ts @@ -1,16 +1,16 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { DeleteAttributesType } from '../messageModifiers/Deletes.js'; -import type { MessageModel } from '../models/messages.js'; -import { createLogger } from '../logging/log.js'; -import { isMe } from './whatTypeOfConversation.js'; -import { getAuthorId } from '../messages/sources.js'; -import { isStory } from '../state/selectors/message.js'; -import { isTooOldToModifyMessage } from './isTooOldToModifyMessage.js'; -import { drop } from './drop.js'; -import { eraseMessageContents } from './cleanup.js'; -import { notificationService } from '../services/notifications.js'; +import type { DeleteAttributesType } from '../messageModifiers/Deletes.preload.js'; +import type { MessageModel } from '../models/messages.preload.js'; +import { createLogger } from '../logging/log.std.js'; +import { isMe } from './whatTypeOfConversation.dom.js'; +import { getAuthorId } from '../messages/sources.preload.js'; +import { isStory } from '../state/selectors/message.preload.js'; +import { isTooOldToModifyMessage } from './isTooOldToModifyMessage.std.js'; +import { drop } from './drop.std.js'; +import { eraseMessageContents } from './cleanup.preload.js'; +import { notificationService } from '../services/notifications.preload.js'; const log = createLogger('deleteForEveryone'); diff --git a/ts/util/deleteForMe.ts b/ts/util/deleteForMe.ts index e35fd35a4c..a864718524 100644 --- a/ts/util/deleteForMe.ts +++ b/ts/util/deleteForMe.ts @@ -3,21 +3,25 @@ import lodash from 'lodash'; -import { createLogger } from '../logging/log.js'; -import { DataReader, DataWriter, deleteAndCleanup } from '../sql/Client.js'; -import { deleteAllAttachmentFilesOnDisk } from './Attachment.js'; +import { createLogger } from '../logging/log.std.js'; +import { + DataReader, + DataWriter, + deleteAndCleanup, +} from '../sql/Client.preload.js'; +import { deleteAllAttachmentFilesOnDisk } from './Attachment.std.js'; -import type { MessageAttributesType } from '../model-types.js'; -import type { ConversationModel } from '../models/conversations.js'; -import type { AddressableMessage } from '../textsecure/messageReceiverEvents.js'; -import type { AttachmentType } from '../types/Attachment.js'; -import { MessageModel } from '../models/messages.js'; -import { cleanupMessages, postSaveUpdates } from './cleanup.js'; +import type { MessageAttributesType } from '../model-types.d.ts'; +import type { ConversationModel } from '../models/conversations.preload.js'; +import type { AddressableMessage } from '../textsecure/messageReceiverEvents.std.js'; +import type { AttachmentType } from '../types/Attachment.std.js'; +import { MessageModel } from '../models/messages.preload.js'; +import { cleanupMessages, postSaveUpdates } from './cleanup.preload.js'; import { findMatchingMessage, getMessageQueryFromTarget, -} from './syncIdentifiers.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from './syncIdentifiers.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const { last, sortBy } = lodash; diff --git a/ts/util/deleteGroupStoryReplyForEveryone.ts b/ts/util/deleteGroupStoryReplyForEveryone.ts index e6b8d95dec..7ca90a188e 100644 --- a/ts/util/deleteGroupStoryReplyForEveryone.ts +++ b/ts/util/deleteGroupStoryReplyForEveryone.ts @@ -1,10 +1,10 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { DAY } from './durations/index.js'; -import { sendDeleteForEveryoneMessage } from './sendDeleteForEveryoneMessage.js'; -import { getMessageById } from '../messages/getMessageById.js'; -import { createLogger } from '../logging/log.js'; +import { DAY } from './durations/index.std.js'; +import { sendDeleteForEveryoneMessage } from './sendDeleteForEveryoneMessage.preload.js'; +import { getMessageById } from '../messages/getMessageById.preload.js'; +import { createLogger } from '../logging/log.std.js'; const log = createLogger('deleteGroupStoryReplyForEveryone'); diff --git a/ts/util/deleteStoryForEveryone.ts b/ts/util/deleteStoryForEveryone.ts index 4cd57a0580..51268a0cec 100644 --- a/ts/util/deleteStoryForEveryone.ts +++ b/ts/util/deleteStoryForEveryone.ts @@ -3,25 +3,25 @@ import lodash from 'lodash'; -import type { ConversationQueueJobData } from '../jobs/conversationJobQueue.js'; -import type { StoryDataType } from '../state/ducks/stories.js'; -import * as Errors from '../types/errors.js'; -import type { StoryMessageRecipientsType } from '../types/Stories.js'; -import type { StoryDistributionIdString } from '../types/StoryDistributionId.js'; -import type { ServiceIdString } from '../types/ServiceId.js'; -import { createLogger } from '../logging/log.js'; -import { DAY } from './durations/index.js'; -import { StoryRecipientUpdateEvent } from '../textsecure/messageReceiverEvents.js'; +import type { ConversationQueueJobData } from '../jobs/conversationJobQueue.preload.js'; +import type { StoryDataType } from '../state/ducks/stories.preload.js'; +import * as Errors from '../types/errors.std.js'; +import type { StoryMessageRecipientsType } from '../types/Stories.std.js'; +import type { StoryDistributionIdString } from '../types/StoryDistributionId.std.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { DAY } from './durations/index.std.js'; +import { StoryRecipientUpdateEvent } from '../textsecure/messageReceiverEvents.std.js'; import { conversationJobQueue, conversationQueueJobEnum, -} from '../jobs/conversationJobQueue.js'; -import { onStoryRecipientUpdate } from './onStoryRecipientUpdate.js'; -import { sendDeleteForEveryoneMessage } from './sendDeleteForEveryoneMessage.js'; -import { isGroupV2 } from './whatTypeOfConversation.js'; -import { getMessageById } from '../messages/getMessageById.js'; -import { repeat, zipObject } from './iterables.js'; -import { isOlderThan } from './timestamp.js'; +} from '../jobs/conversationJobQueue.preload.js'; +import { onStoryRecipientUpdate } from './onStoryRecipientUpdate.preload.js'; +import { sendDeleteForEveryoneMessage } from './sendDeleteForEveryoneMessage.preload.js'; +import { isGroupV2 } from './whatTypeOfConversation.dom.js'; +import { getMessageById } from '../messages/getMessageById.preload.js'; +import { repeat, zipObject } from './iterables.std.js'; +import { isOlderThan } from './timestamp.std.js'; const { noop } = lodash; diff --git a/ts/util/deliveryReceipt.ts b/ts/util/deliveryReceipt.ts index a36097615b..daf584147b 100644 --- a/ts/util/deliveryReceipt.ts +++ b/ts/util/deliveryReceipt.ts @@ -7,11 +7,11 @@ import lodash from 'lodash'; import { conversationJobQueue, conversationQueueJobEnum, -} from '../jobs/conversationJobQueue.js'; -import { ReceiptType } from '../types/Receipt.js'; -import type { Receipt } from '../types/Receipt.js'; -import { MINUTE } from './durations/index.js'; -import { createBatcher } from './batcher.js'; +} from '../jobs/conversationJobQueue.preload.js'; +import { ReceiptType } from '../types/Receipt.std.js'; +import type { Receipt } from '../types/Receipt.std.js'; +import { MINUTE } from './durations/index.std.js'; +import { createBatcher } from './batcher.std.js'; const { groupBy } = lodash; diff --git a/ts/util/denyPendingApprovalRequest.ts b/ts/util/denyPendingApprovalRequest.ts index 1426a645a6..1845df364a 100644 --- a/ts/util/denyPendingApprovalRequest.ts +++ b/ts/util/denyPendingApprovalRequest.ts @@ -2,13 +2,13 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { ConversationAttributesType } from '../model-types.d.ts'; -import type { SignalService as Proto } from '../protobuf/index.js'; -import type { AciString } from '../types/ServiceId.js'; -import { createLogger } from '../logging/log.js'; -import { buildDeletePendingAdminApprovalMemberChange } from '../groups.js'; -import { getConversationIdForLogging } from './idForLogging.js'; -import { isMemberRequestingToJoin } from './groupMembershipUtils.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import type { SignalService as Proto } from '../protobuf/index.std.js'; +import type { AciString } from '../types/ServiceId.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { buildDeletePendingAdminApprovalMemberChange } from '../groups.preload.js'; +import { getConversationIdForLogging } from './idForLogging.preload.js'; +import { isMemberRequestingToJoin } from './groupMembershipUtils.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const log = createLogger('denyPendingApprovalRequest'); diff --git a/ts/util/deprecated.ts b/ts/util/deprecated.ts index d437412ca7..ea28ede9d8 100644 --- a/ts/util/deprecated.ts +++ b/ts/util/deprecated.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { getEnvironment, Environment } from '../environment.js'; -import { createLogger } from '../logging/log.js'; +import { getEnvironment, Environment } from '../environment.std.js'; +import { createLogger } from '../logging/log.std.js'; const log = createLogger('deprecated'); diff --git a/ts/util/desktopCapturer.ts b/ts/util/desktopCapturer.ts index 889dbcbc72..a59e95bf44 100644 --- a/ts/util/desktopCapturer.ts +++ b/ts/util/desktopCapturer.ts @@ -5,21 +5,21 @@ import { ipcRenderer, type DesktopCapturerSource } from 'electron'; import type { Stream, StreamOptions } from '@indutny/mac-screen-share'; -import { createLogger } from '../logging/log.js'; -import * as Errors from '../types/errors.js'; -import type { PresentableSource } from '../types/Calling.js'; -import type { LocalizerType } from '../types/Util.js'; +import { createLogger } from '../logging/log.std.js'; +import * as Errors from '../types/errors.std.js'; +import type { PresentableSource } from '../types/Calling.std.js'; +import type { LocalizerType } from '../types/Util.std.js'; import { REQUESTED_SCREEN_SHARE_WIDTH, REQUESTED_SCREEN_SHARE_HEIGHT, REQUESTED_SCREEN_SHARE_FRAMERATE, -} from '../calling/constants.js'; -import { strictAssert } from './assert.js'; -import { explodePromise } from './explodePromise.js'; -import { isNotNil } from './isNotNil.js'; -import { drop } from './drop.js'; -import { SECOND } from './durations/index.js'; -import { isOlderThan } from './timestamp.js'; +} from '../calling/constants.std.js'; +import { strictAssert } from './assert.std.js'; +import { explodePromise } from './explodePromise.std.js'; +import { isNotNil } from './isNotNil.std.js'; +import { drop } from './drop.std.js'; +import { SECOND } from './durations/index.std.js'; +import { isOlderThan } from './timestamp.std.js'; const log = createLogger('desktopCapturer'); diff --git a/ts/util/distributionListToSendTarget.ts b/ts/util/distributionListToSendTarget.ts index ac81fa21ef..ce49bbec15 100644 --- a/ts/util/distributionListToSendTarget.ts +++ b/ts/util/distributionListToSendTarget.ts @@ -1,12 +1,12 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ServiceIdString } from '../types/ServiceId.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; import type { SenderKeyInfoType } from '../model-types.d.ts'; -import { DataWriter } from '../sql/Client.js'; -import type { StoryDistributionType } from '../sql/Interface.js'; -import type { SenderKeyTargetType } from './sendToGroup.js'; -import { isNotNil } from './isNotNil.js'; +import { DataWriter } from '../sql/Client.preload.js'; +import type { StoryDistributionType } from '../sql/Interface.std.js'; +import type { SenderKeyTargetType } from './sendToGroup.preload.js'; +import { isNotNil } from './isNotNil.std.js'; export function distributionListToSendTarget( distributionList: StoryDistributionType, diff --git a/ts/util/dns.ts b/ts/util/dns.ts index 8395ae7317..65d6588704 100644 --- a/ts/util/dns.ts +++ b/ts/util/dns.ts @@ -11,10 +11,10 @@ import * as electron from 'electron'; import type { ResolvedHost, ResolvedEndpoint } from 'electron'; import pTimeout from 'p-timeout'; -import { strictAssert } from './assert.js'; -import { drop } from './drop.js'; -import type { DNSFallbackType } from '../types/DNSFallback.js'; -import { SECOND } from './durations/index.js'; +import { strictAssert } from './assert.std.js'; +import { drop } from './drop.std.js'; +import type { DNSFallbackType } from '../types/DNSFallback.std.js'; +import { SECOND } from './durations/index.std.js'; const LOOKUP_TIMEOUT_MS = 5 * SECOND; const fallbackAddrs = new Map>(); diff --git a/ts/util/donations.ts b/ts/util/donations.ts index 66a58b157f..f6ee062f94 100644 --- a/ts/util/donations.ts +++ b/ts/util/donations.ts @@ -4,13 +4,13 @@ import type { DonationWorkflow, HumanDonationAmount, -} from '../types/Donations.js'; -import { donationStateSchema } from '../types/Donations.js'; +} from '../types/Donations.std.js'; +import { donationStateSchema } from '../types/Donations.std.js'; import { brandStripeDonationAmount, toHumanDonationAmount, -} from './currency.js'; -import { missingCaseError } from './missingCaseError.js'; +} from './currency.dom.js'; +import { missingCaseError } from './missingCaseError.std.js'; // Donation where we started backend processing, but did not redeem a badge yet. // Note we skip workflows in the INTENT state because it requires user confirmation diff --git a/ts/util/doubleCheckMissingQuoteReference.ts b/ts/util/doubleCheckMissingQuoteReference.ts index d4fe3306b2..cc4a3f9eac 100644 --- a/ts/util/doubleCheckMissingQuoteReference.ts +++ b/ts/util/doubleCheckMissingQuoteReference.ts @@ -1,18 +1,18 @@ // Copyright 2019 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { getMessageById } from '../messages/getMessageById.js'; -import type { MessageModel } from '../models/messages.js'; +import { getMessageById } from '../messages/getMessageById.preload.js'; +import type { MessageModel } from '../models/messages.preload.js'; -import { hydrateStoryContext } from './hydrateStoryContext.js'; -import { getMessageIdForLogging } from './idForLogging.js'; +import { hydrateStoryContext } from './hydrateStoryContext.preload.js'; +import { getMessageIdForLogging } from './idForLogging.preload.js'; -import { createLogger } from '../logging/log.js'; -import { isQuoteAMatch } from '../messages/quotes.js'; -import { shouldTryToCopyFromQuotedMessage } from '../messages/helpers.js'; -import { copyQuoteContentFromOriginal } from '../messages/copyQuote.js'; -import { queueUpdateMessage } from './messageBatcher.js'; -import { drop } from './drop.js'; +import { createLogger } from '../logging/log.std.js'; +import { isQuoteAMatch } from '../messages/quotes.preload.js'; +import { shouldTryToCopyFromQuotedMessage } from '../messages/helpers.std.js'; +import { copyQuoteContentFromOriginal } from '../messages/copyQuote.preload.js'; +import { queueUpdateMessage } from './messageBatcher.preload.js'; +import { drop } from './drop.std.js'; const log = createLogger('doubleCheckMissingQuoteReference'); diff --git a/ts/util/downloadAttachment.ts b/ts/util/downloadAttachment.ts index 11d167b3b9..993cc61878 100644 --- a/ts/util/downloadAttachment.ts +++ b/ts/util/downloadAttachment.ts @@ -4,26 +4,26 @@ import { ErrorCode, LibSignalErrorBase } from '@signalapp/libsignal-client'; import { hasRequiredInformationForBackup, wasImportedFromLocalBackup, -} from './Attachment.js'; +} from './Attachment.std.js'; import { type AttachmentType, AttachmentVariant, AttachmentPermanentlyUndownloadableError, -} from '../types/Attachment.js'; -import { downloadAttachment as doDownloadAttachment } from '../textsecure/downloadAttachment.js'; +} from '../types/Attachment.std.js'; +import { downloadAttachment as doDownloadAttachment } from '../textsecure/downloadAttachment.preload.js'; import { getAttachment, getAttachmentFromBackupTier, -} from '../textsecure/WebAPI.js'; -import { downloadAttachmentFromLocalBackup as doDownloadAttachmentFromLocalBackup } from './downloadAttachmentFromLocalBackup.js'; -import { MediaTier } from '../types/AttachmentDownload.js'; -import { createLogger } from '../logging/log.js'; -import { HTTPError } from '../types/HTTPError.js'; -import { toLogFormat } from '../types/errors.js'; -import type { ReencryptedAttachmentV2 } from '../AttachmentCrypto.js'; -import * as RemoteConfig from '../RemoteConfig.js'; -import { ToastType } from '../types/Toast.js'; -import { isAbortError } from './isAbortError.js'; +} from '../textsecure/WebAPI.preload.js'; +import { downloadAttachmentFromLocalBackup as doDownloadAttachmentFromLocalBackup } from './downloadAttachmentFromLocalBackup.preload.js'; +import { MediaTier } from '../types/AttachmentDownload.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { HTTPError } from '../types/HTTPError.std.js'; +import { toLogFormat } from '../types/errors.std.js'; +import type { ReencryptedAttachmentV2 } from '../AttachmentCrypto.node.js'; +import * as RemoteConfig from '../RemoteConfig.dom.js'; +import { ToastType } from '../types/Toast.dom.js'; +import { isAbortError } from './isAbortError.std.js'; const log = createLogger('downloadAttachment'); diff --git a/ts/util/downloadAttachmentFromLocalBackup.ts b/ts/util/downloadAttachmentFromLocalBackup.ts index 5fccdf64fd..e51a099b41 100644 --- a/ts/util/downloadAttachmentFromLocalBackup.ts +++ b/ts/util/downloadAttachmentFromLocalBackup.ts @@ -3,13 +3,13 @@ import { existsSync } from 'node:fs'; import lodash from 'lodash'; -import type { BackupableAttachmentType } from '../types/Attachment.js'; +import type { BackupableAttachmentType } from '../types/Attachment.std.js'; import { decryptAndReencryptLocally, type ReencryptedAttachmentV2, -} from '../AttachmentCrypto.js'; -import { strictAssert } from './assert.js'; -import { getAbsoluteAttachmentPath } from './migrations.js'; +} from '../AttachmentCrypto.node.js'; +import { strictAssert } from './assert.std.js'; +import { getAbsoluteAttachmentPath } from './migrations.preload.js'; const { isNumber } = lodash; diff --git a/ts/util/downloadOnboardingStory.ts b/ts/util/downloadOnboardingStory.ts index 0abce15f0f..cda0e3b3bf 100644 --- a/ts/util/downloadOnboardingStory.ts +++ b/ts/util/downloadOnboardingStory.ts @@ -3,21 +3,24 @@ import { v4 as generateUuid } from 'uuid'; -import type { AttachmentType } from '../types/Attachment.js'; -import { MessageModel } from '../models/messages.js'; -import { createLogger } from '../logging/log.js'; -import { IMAGE_JPEG } from '../types/MIME.js'; -import { ReadStatus } from '../messages/MessageReadStatus.js'; -import { SeenStatus } from '../MessageSeenStatus.js'; -import { findAndDeleteOnboardingStoryIfExists } from './findAndDeleteOnboardingStoryIfExists.js'; -import { saveNewMessageBatcher } from './messageBatcher.js'; -import { writeNewAttachmentData, processNewAttachment } from './migrations.js'; -import { incrementMessageCounter } from './incrementMessageCounter.js'; +import type { AttachmentType } from '../types/Attachment.std.js'; +import { MessageModel } from '../models/messages.preload.js'; +import { createLogger } from '../logging/log.std.js'; +import { IMAGE_JPEG } from '../types/MIME.std.js'; +import { ReadStatus } from '../messages/MessageReadStatus.std.js'; +import { SeenStatus } from '../MessageSeenStatus.std.js'; +import { findAndDeleteOnboardingStoryIfExists } from './findAndDeleteOnboardingStoryIfExists.preload.js'; +import { saveNewMessageBatcher } from './messageBatcher.preload.js'; +import { + writeNewAttachmentData, + processNewAttachment, +} from './migrations.preload.js'; +import { incrementMessageCounter } from './incrementMessageCounter.preload.js'; import { getOnboardingStoryManifest, downloadOnboardingStories, -} from '../textsecure/WebAPI.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from '../textsecure/WebAPI.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const log = createLogger('downloadOnboardingStory'); diff --git a/ts/util/durations/duration-in-seconds.ts b/ts/util/durations/duration-in-seconds.ts index d83ae66d26..f046a2894f 100644 --- a/ts/util/durations/duration-in-seconds.ts +++ b/ts/util/durations/duration-in-seconds.ts @@ -1,7 +1,7 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as Constants from './constants.js'; +import * as Constants from './constants.std.js'; export type DurationInSeconds = number & { __time_difference_in_seconds: never; diff --git a/ts/util/durations/index.ts b/ts/util/durations/index.ts index 611e96e248..c3a9ee2b84 100644 --- a/ts/util/durations/index.ts +++ b/ts/util/durations/index.ts @@ -1,5 +1,5 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -export * from './constants.js'; -export { DurationInSeconds } from './duration-in-seconds.js'; +export * from './constants.std.js'; +export { DurationInSeconds } from './duration-in-seconds.std.js'; diff --git a/ts/util/editHelpers.ts b/ts/util/editHelpers.ts index 2114e68636..693de9540e 100644 --- a/ts/util/editHelpers.ts +++ b/ts/util/editHelpers.ts @@ -4,14 +4,14 @@ import lodash from 'lodash'; import type { ReadonlyDeep } from 'type-fest'; -import { strictAssert } from './assert.js'; +import { strictAssert } from './assert.std.js'; import type { EditHistoryType, MessageAttributesType, ReadonlyMessageAttributesType, -} from '../model-types.js'; -import type { LoggerType } from '../types/Logging.js'; +} from '../model-types.d.ts'; +import type { LoggerType } from '../types/Logging.std.js'; const { isNumber, sortBy } = lodash; diff --git a/ts/util/emoji.ts b/ts/util/emoji.ts index a7f3c79a37..768b276847 100644 --- a/ts/util/emoji.ts +++ b/ts/util/emoji.ts @@ -3,8 +3,8 @@ import emojiRegex from 'emoji-regex'; -import { assertDev } from './assert.js'; -import { take } from './iterables.js'; +import { assertDev } from './assert.std.js'; +import { take } from './iterables.std.js'; const REGEXP = emojiRegex(); const MAX_EMOJI_TO_MATCH = 5000; diff --git a/ts/util/encryptConversationAttachments.ts b/ts/util/encryptConversationAttachments.ts index 09b3dab9b6..4bf6df1e39 100644 --- a/ts/util/encryptConversationAttachments.ts +++ b/ts/util/encryptConversationAttachments.ts @@ -3,12 +3,12 @@ import pMap from 'p-map'; -import { createLogger } from '../logging/log.js'; -import { DataReader, DataWriter } from '../sql/Client.js'; +import { createLogger } from '../logging/log.std.js'; +import { DataReader, DataWriter } from '../sql/Client.preload.js'; import type { ConversationAttributesType } from '../model-types.d.ts'; -import { encryptLegacyAttachment } from './encryptLegacyAttachment.js'; -import { AttachmentDisposition } from './getLocalAttachmentUrl.js'; -import { isNotNil } from './isNotNil.js'; +import { encryptLegacyAttachment } from './encryptLegacyAttachment.preload.js'; +import { AttachmentDisposition } from './getLocalAttachmentUrl.std.js'; +import { isNotNil } from './isNotNil.std.js'; import { deleteAttachmentData, deleteAvatar, @@ -19,10 +19,10 @@ import { writeNewAttachmentData, writeNewAvatarData, writeNewDraftData, -} from './migrations.js'; -import { isSignalConversation } from './isSignalConversation.js'; -import { getConversationIdForLogging } from './idForLogging.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from './migrations.preload.js'; +import { isSignalConversation } from './isSignalConversation.dom.js'; +import { getConversationIdForLogging } from './idForLogging.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const log = createLogger('encryptConversationAttachments'); diff --git a/ts/util/encryptLegacyAttachment.ts b/ts/util/encryptLegacyAttachment.ts index 1daef04531..fbef4c58c2 100644 --- a/ts/util/encryptLegacyAttachment.ts +++ b/ts/util/encryptLegacyAttachment.ts @@ -6,13 +6,13 @@ import { LRUCache } from 'lru-cache'; import type { AddressableAttachmentType, LocalAttachmentV2Type, -} from '../types/Attachment.js'; -import { createLogger } from '../logging/log.js'; -import { DataWriter } from '../sql/Client.js'; -import { AttachmentDisposition } from './getLocalAttachmentUrl.js'; -import { drop } from './drop.js'; -import { MINUTE } from './durations/index.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from '../types/Attachment.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { DataWriter } from '../sql/Client.preload.js'; +import { AttachmentDisposition } from './getLocalAttachmentUrl.std.js'; +import { drop } from './drop.std.js'; +import { MINUTE } from './durations/index.std.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const log = createLogger('encryptLegacyAttachment'); diff --git a/ts/util/encryptProfileData.ts b/ts/util/encryptProfileData.ts index a6260ee7e3..f91d21cf42 100644 --- a/ts/util/encryptProfileData.ts +++ b/ts/util/encryptProfileData.ts @@ -1,22 +1,22 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationType } from '../state/ducks/conversations.js'; -import type { ProfileRequestDataType } from '../textsecure/WebAPI.js'; -import { assertDev } from './assert.js'; -import * as Bytes from '../Bytes.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import type { ProfileRequestDataType } from '../textsecure/WebAPI.preload.js'; +import { assertDev } from './assert.std.js'; +import * as Bytes from '../Bytes.std.js'; import { PaddedLengths, encryptProfile, encryptProfileItemWithPadding, -} from '../Crypto.js'; -import type { AvatarUpdateType } from '../types/Avatar.js'; +} from '../Crypto.node.js'; +import type { AvatarUpdateType } from '../types/Avatar.std.js'; import { deriveProfileKeyCommitment, deriveProfileKeyVersion, -} from './zkgroup.js'; -import { isSharingPhoneNumberWithEverybody } from './phoneNumberSharingMode.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from './zkgroup.node.js'; +import { isSharingPhoneNumberWithEverybody } from './phoneNumberSharingMode.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; export async function encryptProfileData( conversation: ConversationType, diff --git a/ts/util/expirationTimer.ts b/ts/util/expirationTimer.ts index 5db50b2fcd..c5f05d6f03 100644 --- a/ts/util/expirationTimer.ts +++ b/ts/util/expirationTimer.ts @@ -4,8 +4,8 @@ import humanizeDuration from 'humanize-duration'; import type { Unit } from 'humanize-duration'; import lodash from 'lodash'; -import type { LocalizerType } from '../types/Util.js'; -import { SECOND, DurationInSeconds } from './durations/index.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { SECOND, DurationInSeconds } from './durations/index.std.js'; const { isNumber } = lodash; diff --git a/ts/util/exponentialBackoff.ts b/ts/util/exponentialBackoff.ts index 37cff62c03..8615f7c297 100644 --- a/ts/util/exponentialBackoff.ts +++ b/ts/util/exponentialBackoff.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { strictAssert } from './assert.js'; -import * as durations from './durations/index.js'; +import { strictAssert } from './assert.std.js'; +import * as durations from './durations/index.std.js'; const BACKOFF_FACTOR = 1.9; const MAX_BACKOFF = 15 * durations.MINUTE; diff --git a/ts/util/filterAndSortConversations.ts b/ts/util/filterAndSortConversations.ts index 9b427d4b49..d348ebd93e 100644 --- a/ts/util/filterAndSortConversations.ts +++ b/ts/util/filterAndSortConversations.ts @@ -2,14 +2,14 @@ // SPDX-License-Identifier: AGPL-3.0-only import type Fuse from 'fuse.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import { parseAndFormatPhoneNumber } from './libphonenumberInstance.js'; -import { WEEK } from './durations/index.js'; -import { fuseGetFnRemoveDiacritics, getCachedFuseIndex } from './fuse.js'; -import { isConversationUnread } from './countUnreadStats.js'; -import { getE164 } from './getE164.js'; -import { removeDiacritics } from './removeDiacritics.js'; -import { isAciString } from './isAciString.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import { parseAndFormatPhoneNumber } from './libphonenumberInstance.std.js'; +import { WEEK } from './durations/index.std.js'; +import { fuseGetFnRemoveDiacritics, getCachedFuseIndex } from './fuse.std.js'; +import { isConversationUnread } from './countUnreadStats.std.js'; +import { getE164 } from './getE164.std.js'; +import { removeDiacritics } from './removeDiacritics.std.js'; +import { isAciString } from './isAciString.std.js'; // Fuse.js scores have order of 0.01 const ACTIVE_AT_SCORE_FACTOR = (1 / WEEK) * 0.01; diff --git a/ts/util/filterCallLinks.ts b/ts/util/filterCallLinks.ts index 3973af08b7..4a07e6f6b8 100644 --- a/ts/util/filterCallLinks.ts +++ b/ts/util/filterCallLinks.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import type Fuse from 'fuse.js'; -import { fuseGetFnRemoveDiacritics, getCachedFuseIndex } from './fuse.js'; -import { removeDiacritics } from './removeDiacritics.js'; -import type { CallLinkType } from '../types/CallLink.js'; +import { fuseGetFnRemoveDiacritics, getCachedFuseIndex } from './fuse.std.js'; +import { removeDiacritics } from './removeDiacritics.std.js'; +import type { CallLinkType } from '../types/CallLink.std.js'; // Based on parameters in filterAndSortConversations const FUSE_OPTIONS: Fuse.IFuseOptions = { diff --git a/ts/util/findAndDeleteOnboardingStoryIfExists.ts b/ts/util/findAndDeleteOnboardingStoryIfExists.ts index d390ba7ee4..b3de08bc74 100644 --- a/ts/util/findAndDeleteOnboardingStoryIfExists.ts +++ b/ts/util/findAndDeleteOnboardingStoryIfExists.ts @@ -1,13 +1,13 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log.js'; -import { DataWriter } from '../sql/Client.js'; -import { calculateExpirationTimestamp } from './expirationTimer.js'; -import { DAY } from './durations/index.js'; -import { cleanupMessages } from './cleanup.js'; -import { getMessageById } from '../messages/getMessageById.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import { createLogger } from '../logging/log.std.js'; +import { DataWriter } from '../sql/Client.preload.js'; +import { calculateExpirationTimestamp } from './expirationTimer.std.js'; +import { DAY } from './durations/index.std.js'; +import { cleanupMessages } from './cleanup.preload.js'; +import { getMessageById } from '../messages/getMessageById.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const log = createLogger('findAndDeleteOnboardingStoryIfExists'); diff --git a/ts/util/findAndFormatContact.ts b/ts/util/findAndFormatContact.ts index 2ec3c352e2..25fcf84fdc 100644 --- a/ts/util/findAndFormatContact.ts +++ b/ts/util/findAndFormatContact.ts @@ -1,10 +1,10 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationType } from '../state/ducks/conversations.js'; -import { PLACEHOLDER_CONTACT_ID } from '../state/selectors/conversations.js'; -import { format, isValidNumber } from '../types/PhoneNumber.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import { PLACEHOLDER_CONTACT_ID } from '../state/selectors/conversations.dom.js'; +import { format, isValidNumber } from '../types/PhoneNumber.std.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const PLACEHOLDER_CONTACT: ConversationType = { acceptedMessageRequest: false, diff --git a/ts/util/findStoryMessage.ts b/ts/util/findStoryMessage.ts index 4eb4baa65c..75deee7248 100644 --- a/ts/util/findStoryMessage.ts +++ b/ts/util/findStoryMessage.ts @@ -5,11 +5,11 @@ import type { ReadonlyMessageAttributesType, MessageAttributesType, } from '../model-types.d.ts'; -import { type AciString } from '../types/ServiceId.js'; +import { type AciString } from '../types/ServiceId.std.js'; import type { ProcessedStoryContext } from '../textsecure/Types.d.ts'; -import { DataReader } from '../sql/Client.js'; -import { createLogger } from '../logging/log.js'; -import { getAuthorId } from '../messages/sources.js'; +import { DataReader } from '../sql/Client.preload.js'; +import { createLogger } from '../logging/log.std.js'; +import { getAuthorId } from '../messages/sources.preload.js'; const log = createLogger('findStoryMessage'); diff --git a/ts/util/formatTimestamp.ts b/ts/util/formatTimestamp.ts index 1f37e0c560..fc0fdff680 100644 --- a/ts/util/formatTimestamp.ts +++ b/ts/util/formatTimestamp.ts @@ -1,8 +1,12 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { HourCyclePreference } from '../types/I18N.js'; -import { assertDev } from './assert.js'; +import moment from 'moment'; +import { HourCyclePreference } from '../types/I18N.std.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { assertDev } from './assert.std.js'; +import { isYesterday, isToday, type RawTimestamp } from './timestamp.std.js'; +import { HOUR, MINUTE, MONTH, WEEK } from './durations/index.std.js'; function getOptionsWithPreferences( options: Intl.DateTimeFormatOptions @@ -73,6 +77,7 @@ export function getDateTimeFormatter( const locales = localeOverride != null ? [localeOverride] : preferredSystemLocales; const optionsWithPreferences = getOptionsWithPreferences(options); + console.error(locales); const cacheKey = getCacheKey(locales, optionsWithPreferences); const cachedFormatter = formatterCache.get(cacheKey); if (cachedFormatter) { @@ -96,3 +101,172 @@ export function formatTimestamp( return ''; } } + +export function formatDateTimeShort( + i18n: LocalizerType, + rawTimestamp: RawTimestamp +): string { + const timestamp = rawTimestamp.valueOf(); + + const now = Date.now(); + const diff = now - timestamp; + + if (diff < HOUR || isToday(timestamp)) { + return formatTime(i18n, rawTimestamp, now); + } + + const m = moment(timestamp); + + if (diff < WEEK && m.isSame(now, 'month')) { + return formatTimestamp(timestamp, { weekday: 'short' }); + } + + if (m.isSame(now, 'year')) { + return formatTimestamp(timestamp, { + day: 'numeric', + month: 'short', + }); + } + + return formatTimestamp(timestamp, { + day: 'numeric', + month: 'short', + year: 'numeric', + }); +} + +export function formatDateTimeForAttachment( + i18n: LocalizerType, + rawTimestamp: RawTimestamp +): string { + const timestamp = rawTimestamp.valueOf(); + + const now = Date.now(); + const diff = now - timestamp; + + if (diff < HOUR || isToday(timestamp)) { + return formatTime(i18n, rawTimestamp, now); + } + + const m = moment(timestamp); + + if (diff < WEEK && m.isSame(now, 'month')) { + return formatTimestamp(timestamp, { + weekday: 'short', + hour: 'numeric', + minute: 'numeric', + }); + } + + if (m.isSame(now, 'year')) { + return formatTimestamp(timestamp, { + day: 'numeric', + month: 'short', + hour: 'numeric', + minute: 'numeric', + }); + } + + return formatTimestamp(timestamp, { + day: 'numeric', + month: 'short', + year: 'numeric', + hour: 'numeric', + minute: 'numeric', + }); +} + +export function formatDateTimeLong( + i18n: LocalizerType, + rawTimestamp: RawTimestamp +): string { + const timestamp = rawTimestamp.valueOf(); + + if (isToday(rawTimestamp)) { + return i18n('icu:timestampFormat__long--today', { + time: formatTimestamp(timestamp, { + hour: 'numeric', + minute: 'numeric', + }), + }); + } + + if (isYesterday(rawTimestamp)) { + return i18n('icu:timestampFormat__long--yesterday', { + time: formatTimestamp(timestamp, { + hour: 'numeric', + minute: 'numeric', + }), + }); + } + + return formatTimestamp(timestamp, { + day: 'numeric', + hour: 'numeric', + minute: 'numeric', + month: 'short', + year: 'numeric', + }); +} + +export function formatTime( + i18n: LocalizerType, + rawTimestamp: RawTimestamp, + now: RawTimestamp, + isRelativeTime?: boolean +): string { + const timestamp = rawTimestamp.valueOf(); + const diff = now.valueOf() - timestamp; + + if (diff < MINUTE) { + return i18n('icu:justNow'); + } + + if (diff < HOUR) { + return i18n('icu:minutesAgo', { + minutes: Math.floor(diff / MINUTE), + }); + } + + if (isRelativeTime) { + return i18n('icu:hoursAgo', { + hours: Math.floor(diff / HOUR), + }); + } + + return formatTimestamp(timestamp, { + hour: 'numeric', + minute: '2-digit', + }); +} + +export function formatDate( + i18n: LocalizerType, + rawTimestamp: RawTimestamp +): string { + if (isToday(rawTimestamp)) { + return i18n('icu:today'); + } + + if (isYesterday(rawTimestamp)) { + return i18n('icu:yesterday'); + } + + const m = moment(rawTimestamp); + + const timestamp = rawTimestamp.valueOf(); + + if (Math.abs(m.diff(Date.now())) < 6 * MONTH) { + return formatTimestamp(timestamp, { + day: 'numeric', + month: 'short', + weekday: 'short', + }); + } + + return formatTimestamp(timestamp, { + day: 'numeric', + month: 'short', + year: 'numeric', + }); +} diff --git a/ts/util/fuse.ts b/ts/util/fuse.ts index efea18d483..e7b8380591 100644 --- a/ts/util/fuse.ts +++ b/ts/util/fuse.ts @@ -3,7 +3,7 @@ import Fuse from 'fuse.js'; -import { removeDiacritics } from './removeDiacritics.js'; +import { removeDiacritics } from './removeDiacritics.std.js'; const cachedIndices: Map< Fuse.IFuseOptions, diff --git a/ts/util/generateDonationReceipt.ts b/ts/util/generateDonationReceipt.ts index 2fdc796877..ab54f4c9c2 100644 --- a/ts/util/generateDonationReceipt.ts +++ b/ts/util/generateDonationReceipt.ts @@ -2,12 +2,15 @@ // SPDX-License-Identifier: AGPL-3.0-only import { fabric } from 'fabric'; -import type { DonationReceipt } from '../types/Donations.js'; -import type { LocalizerType } from '../types/Util.js'; -import { strictAssert } from './assert.js'; -import { getDateTimeFormatter } from './formatTimestamp.js'; -import { isStagingServer } from './isStagingServer.js'; -import { getHumanDonationAmount, toHumanCurrencyString } from './currency.js'; +import type { DonationReceipt } from '../types/Donations.std.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { strictAssert } from './assert.std.js'; +import { getDateTimeFormatter } from './formatTimestamp.dom.js'; +import { isStagingServer } from './isStagingServer.dom.js'; +import { + getHumanDonationAmount, + toHumanCurrencyString, +} from './currency.dom.js'; const SCALING_FACTOR = 4.17; diff --git a/ts/util/generateMessageId.ts b/ts/util/generateMessageId.ts index 64d2bcd41d..a4fcc90090 100644 --- a/ts/util/generateMessageId.ts +++ b/ts/util/generateMessageId.ts @@ -3,7 +3,7 @@ import { stringify } from 'uuid'; -import { getRandomBytes } from '../Crypto.js'; +import { getRandomBytes } from '../Crypto.node.js'; export type GeneratedMessageIdType = Readonly<{ id: string; diff --git a/ts/util/getAboutText.ts b/ts/util/getAboutText.ts index f1d5600867..d69d6874fa 100644 --- a/ts/util/getAboutText.ts +++ b/ts/util/getAboutText.ts @@ -1,7 +1,7 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types.js'; +import type { ConversationAttributesType } from '../model-types.d.ts'; export function getAboutText( attributes: Pick diff --git a/ts/util/getAccessControlOptions.ts b/ts/util/getAccessControlOptions.ts index 1a0bd5d2e8..4299ab6797 100644 --- a/ts/util/getAccessControlOptions.ts +++ b/ts/util/getAccessControlOptions.ts @@ -1,8 +1,8 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LocalizerType } from '../types/Util.js'; -import { SignalService as Proto } from '../protobuf/index.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; const AccessControlEnum = Proto.AccessControl.AccessRequired; diff --git a/ts/util/getAddedByForOurPendingInvitation.ts b/ts/util/getAddedByForOurPendingInvitation.ts index 58a0cf8af8..7225c7ae40 100644 --- a/ts/util/getAddedByForOurPendingInvitation.ts +++ b/ts/util/getAddedByForOurPendingInvitation.ts @@ -1,7 +1,7 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationType } from '../state/ducks/conversations.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; export function getAddedByForOurPendingInvitation( conversation: ConversationType diff --git a/ts/util/getAvatarData.ts b/ts/util/getAvatarData.ts index b025236fa0..52133903d0 100644 --- a/ts/util/getAvatarData.ts +++ b/ts/util/getAvatarData.ts @@ -1,9 +1,9 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AvatarDataType } from '../types/Avatar.js'; -import { getDefaultAvatars } from '../types/Avatar.js'; -import { isDirectConversation } from './whatTypeOfConversation.js'; +import type { AvatarDataType } from '../types/Avatar.std.js'; +import { getDefaultAvatars } from '../types/Avatar.std.js'; +import { isDirectConversation } from './whatTypeOfConversation.dom.js'; import type { ConversationAttributesType } from '../model-types.d.ts'; export function getAvatarData( diff --git a/ts/util/getBasicAuth.ts b/ts/util/getBasicAuth.ts index 2468d5198e..86bbc1ecbb 100644 --- a/ts/util/getBasicAuth.ts +++ b/ts/util/getBasicAuth.ts @@ -1,7 +1,7 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { fromString, toBase64 } from '../Bytes.js'; +import { fromString, toBase64 } from '../Bytes.std.js'; export type GetBasicAuthOptionsType = Readonly<{ username: string; diff --git a/ts/util/getColorForCallLink.ts b/ts/util/getColorForCallLink.ts index f470671f19..e071fabca7 100644 --- a/ts/util/getColorForCallLink.ts +++ b/ts/util/getColorForCallLink.ts @@ -1,8 +1,8 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { AVATAR_COLOR_COUNT, AvatarColors } from '../types/Colors.js'; -import type { AvatarColorType } from '../types/Colors.js'; +import { AVATAR_COLOR_COUNT, AvatarColors } from '../types/Colors.std.js'; +import type { AvatarColorType } from '../types/Colors.std.js'; // See https://github.com/signalapp/ringrtc/blob/49b4b8a16f997c7fa9a429e96aa83f80b2065c63/src/rust/src/lite/call_links/base16.rs#L8 const BASE_16_CONSONANT_ALPHABET = 'bcdfghkmnpqrstxz'; diff --git a/ts/util/getConversation.ts b/ts/util/getConversation.ts index 0181b90459..5d5164f81d 100644 --- a/ts/util/getConversation.ts +++ b/ts/util/getConversation.ts @@ -3,31 +3,31 @@ import memoizee from 'memoizee'; import lodash from 'lodash'; -import type { ConversationModel } from '../models/conversations.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import type { ConversationAttributesType } from '../model-types.js'; -import type { GroupNameCollisionsWithIdsByTitle } from './groupMemberNameCollisions.js'; -import { StorySendMode } from '../types/Stories.js'; -import { areWeAdmin } from './areWeAdmin.js'; -import { buildGroupLink } from '../groups.js'; -import { canAddNewMembers } from './canAddNewMembers.js'; -import { canBeAnnouncementGroup } from './canBeAnnouncementGroup.js'; -import { canChangeTimer } from './canChangeTimer.js'; -import { canEditGroupInfo } from './canEditGroupInfo.js'; -import { dropNull } from './dropNull.js'; -import { getAboutText } from './getAboutText.js'; +import type { ConversationModel } from '../models/conversations.preload.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import type { ConversationAttributesType } from '../model-types.d.ts'; +import type { GroupNameCollisionsWithIdsByTitle } from './groupMemberNameCollisions.std.js'; +import { StorySendMode } from '../types/Stories.std.js'; +import { areWeAdmin } from './areWeAdmin.preload.js'; +import { buildGroupLink } from '../groups.preload.js'; +import { canAddNewMembers } from './canAddNewMembers.preload.js'; +import { canBeAnnouncementGroup } from './canBeAnnouncementGroup.dom.js'; +import { canChangeTimer } from './canChangeTimer.preload.js'; +import { canEditGroupInfo } from './canEditGroupInfo.preload.js'; +import { dropNull } from './dropNull.std.js'; +import { getAboutText } from './getAboutText.dom.js'; import { getAvatarHash, getLocalAvatarUrl, getLocalProfileAvatarUrl, getRawAvatarPath, hasAvatar, -} from './avatarUtils.js'; -import { getAvatarData } from './getAvatarData.js'; -import { getConversationMembers } from './getConversationMembers.js'; -import { getCustomColorData, migrateColor } from './migrateColor.js'; -import { getDraftPreview } from './getDraftPreview.js'; -import { getLastMessage } from './getLastMessage.js'; +} from './avatarUtils.preload.js'; +import { getAvatarData } from './getAvatarData.dom.js'; +import { getConversationMembers } from './getConversationMembers.dom.js'; +import { getCustomColorData, migrateColor } from './migrateColor.node.js'; +import { getDraftPreview } from './getDraftPreview.preload.js'; +import { getLastMessage } from './getLastMessage.preload.js'; import { getNumber, getProfileName, @@ -35,17 +35,17 @@ import { getTitleNoDefault, canHaveUsername, renderNumber, -} from './getTitle.js'; -import { hasDraft } from './hasDraft.js'; -import { isAciString } from './isAciString.js'; -import { isBlocked } from './isBlocked.js'; -import { isConversationAccepted } from './isConversationAccepted.js'; +} from './getTitle.preload.js'; +import { hasDraft } from './hasDraft.std.js'; +import { isAciString } from './isAciString.std.js'; +import { isBlocked } from './isBlocked.preload.js'; +import { isConversationAccepted } from './isConversationAccepted.preload.js'; import { isDirectConversation, isGroupV1, isGroupV2, isMe, -} from './whatTypeOfConversation.js'; +} from './whatTypeOfConversation.dom.js'; import { areWePending, getBannedMemberships, @@ -54,11 +54,11 @@ import { getPendingApprovalMemberships, getPendingMemberships, isMemberAwaitingApproval, -} from './groupMembershipUtils.js'; -import { isNotNil } from './isNotNil.js'; -import { getIdentifierHash } from '../Crypto.js'; -import { getAvatarPlaceholderGradient } from '../utils/getAvatarPlaceholderGradient.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from './groupMembershipUtils.preload.js'; +import { isNotNil } from './isNotNil.std.js'; +import { getIdentifierHash } from '../Crypto.node.js'; +import { getAvatarPlaceholderGradient } from '../utils/getAvatarPlaceholderGradient.std.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const { sortBy } = lodash; diff --git a/ts/util/getConversationColorAttributes.ts b/ts/util/getConversationColorAttributes.ts index 5fc698edda..346608355d 100644 --- a/ts/util/getConversationColorAttributes.ts +++ b/ts/util/getConversationColorAttributes.ts @@ -5,8 +5,8 @@ import type { ConversationColorType, CustomColorType, DefaultConversationColorType, -} from '../types/Colors.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; +} from '../types/Colors.std.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; export function getConversationColorAttributes( conversationColors: Pick< diff --git a/ts/util/getConversationMembers.ts b/ts/util/getConversationMembers.ts index 3c48e2a47f..77dfc4499d 100644 --- a/ts/util/getConversationMembers.ts +++ b/ts/util/getConversationMembers.ts @@ -3,8 +3,8 @@ import lodash from 'lodash'; import type { ConversationAttributesType } from '../model-types.d.ts'; -import type { ServiceIdString } from '../types/ServiceId.js'; -import { isDirectConversation } from './whatTypeOfConversation.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; +import { isDirectConversation } from './whatTypeOfConversation.dom.js'; const { compact } = lodash; diff --git a/ts/util/getConversationTitleForPanelType.ts b/ts/util/getConversationTitleForPanelType.ts index 95f46d60ea..bfabf28b90 100644 --- a/ts/util/getConversationTitleForPanelType.ts +++ b/ts/util/getConversationTitleForPanelType.ts @@ -1,9 +1,9 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LocalizerType } from '../types/Util.js'; -import { createLogger } from '../logging/log.js'; -import { PanelType } from '../types/Panels.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { PanelType } from '../types/Panels.std.js'; const log = createLogger('getConversationTitleForPanelType'); diff --git a/ts/util/getCountryData.ts b/ts/util/getCountryData.ts index a1703abde1..8b6096c5af 100644 --- a/ts/util/getCountryData.ts +++ b/ts/util/getCountryData.ts @@ -3,7 +3,7 @@ import memoizee from 'memoizee'; -import { instance } from './libphonenumberInstance.js'; +import { instance } from './libphonenumberInstance.std.js'; export type CountryDataType = Readonly<{ region: string; diff --git a/ts/util/getCustomColorStyle.ts b/ts/util/getCustomColorStyle.ts index ada365b618..016f18718c 100644 --- a/ts/util/getCustomColorStyle.ts +++ b/ts/util/getCustomColorStyle.ts @@ -1,10 +1,10 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { CustomColorType } from '../types/Colors.js'; -import { ThemeType } from '../types/Util.js'; -import { getHSL } from './getHSL.js'; -import { getUserTheme } from '../shims/getUserTheme.js'; +import type { CustomColorType } from '../types/Colors.std.js'; +import { ThemeType } from '../types/Util.std.js'; +import { getHSL } from './getHSL.std.js'; +import { getUserTheme } from '../shims/getUserTheme.dom.js'; type ExtraQuotePropsType = { borderInlineStartColor?: string; diff --git a/ts/util/getDraftPreview.ts b/ts/util/getDraftPreview.ts index e0d4cd17fc..e9507e49a9 100644 --- a/ts/util/getDraftPreview.ts +++ b/ts/util/getDraftPreview.ts @@ -1,12 +1,12 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types.js'; -import type { DraftPreviewType } from '../state/ducks/conversations.js'; -import { findAndFormatContact } from './findAndFormatContact.js'; -import { hydrateRanges } from '../types/BodyRange.js'; -import { isVoiceMessage } from './Attachment.js'; -import { stripNewlinesForLeftPane } from './stripNewlinesForLeftPane.js'; +import type { ConversationAttributesType } from '../model-types.d.ts'; +import type { DraftPreviewType } from '../state/ducks/conversations.preload.js'; +import { findAndFormatContact } from './findAndFormatContact.preload.js'; +import { hydrateRanges } from '../types/BodyRange.std.js'; +import { isVoiceMessage } from './Attachment.std.js'; +import { stripNewlinesForLeftPane } from './stripNewlinesForLeftPane.std.js'; const { i18n } = window.SignalContext; diff --git a/ts/util/getE164.ts b/ts/util/getE164.ts index 0efd20bcf5..0596cf6b7b 100644 --- a/ts/util/getE164.ts +++ b/ts/util/getE164.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { ConversationAttributesType } from '../model-types.d.ts'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import { isInSystemContacts } from './isInSystemContacts.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import { isInSystemContacts } from './isInSystemContacts.std.js'; export function getE164( attributes: Pick< diff --git a/ts/util/getFontNameByTextScript.ts b/ts/util/getFontNameByTextScript.ts index 48048374f4..2d91735e81 100644 --- a/ts/util/getFontNameByTextScript.ts +++ b/ts/util/getFontNameByTextScript.ts @@ -1,8 +1,8 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LocalizerType } from '../types/Util.js'; -import { strictAssert } from './assert.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { strictAssert } from './assert.std.js'; const FONT_MAP = { base: [ diff --git a/ts/util/getGroupMemberships.ts b/ts/util/getGroupMemberships.ts index 7292e4b552..6329d2da35 100644 --- a/ts/util/getGroupMemberships.ts +++ b/ts/util/getGroupMemberships.ts @@ -2,15 +2,15 @@ // SPDX-License-Identifier: AGPL-3.0-only // eslint-disable-next-line import/no-restricted-paths -import type { GroupV2Membership } from '../components/conversation/conversation-details/ConversationDetailsMembershipList.js'; +import type { GroupV2Membership } from '../components/conversation/conversation-details/ConversationDetailsMembershipList.dom.js'; import type { GroupV2PendingMembership, GroupV2RequestingMembership, // eslint-disable-next-line import/no-restricted-paths -} from '../components/conversation/conversation-details/PendingInvites.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import type { ServiceIdString } from '../types/ServiceId.js'; -import { isConversationUnregistered } from './isConversationUnregistered.js'; +} from '../components/conversation/conversation-details/PendingInvites.dom.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; +import { isConversationUnregistered } from './isConversationUnregistered.dom.js'; export type GroupMemberships = { memberships: ReadonlyArray; diff --git a/ts/util/getICUMessageParams.ts b/ts/util/getICUMessageParams.ts index be54730501..8ac82ef097 100644 --- a/ts/util/getICUMessageParams.ts +++ b/ts/util/getICUMessageParams.ts @@ -6,7 +6,7 @@ import type { MessageFormatElement, PluralOrSelectOption, } from '@formatjs/icu-messageformat-parser'; -import { missingCaseError } from './missingCaseError.js'; +import { missingCaseError } from './missingCaseError.std.js'; export type ICUMessageParamType = Readonly< | { diff --git a/ts/util/getLastMessage.ts b/ts/util/getLastMessage.ts index fb7ef7c7e4..f478260574 100644 --- a/ts/util/getLastMessage.ts +++ b/ts/util/getLastMessage.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { ConversationAttributesType } from '../model-types.d.ts'; -import type { LastMessageType } from '../state/ducks/conversations.js'; -import { dropNull } from './dropNull.js'; -import { findAndFormatContact } from './findAndFormatContact.js'; -import { hydrateRanges } from '../types/BodyRange.js'; -import { stripNewlinesForLeftPane } from './stripNewlinesForLeftPane.js'; +import type { LastMessageType } from '../state/ducks/conversations.preload.js'; +import { dropNull } from './dropNull.std.js'; +import { findAndFormatContact } from './findAndFormatContact.preload.js'; +import { hydrateRanges } from '../types/BodyRange.std.js'; +import { stripNewlinesForLeftPane } from './stripNewlinesForLeftPane.std.js'; export function getLastMessage( conversationAttrs: ConversationAttributesType diff --git a/ts/util/getLocalAttachmentUrl.ts b/ts/util/getLocalAttachmentUrl.ts index 1493922e42..84642a1fe3 100644 --- a/ts/util/getLocalAttachmentUrl.ts +++ b/ts/util/getLocalAttachmentUrl.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import lodash from 'lodash'; -import { strictAssert } from './assert.js'; +import { strictAssert } from './assert.std.js'; -import type { AttachmentType } from '../types/Attachment.js'; +import type { AttachmentType } from '../types/Attachment.std.js'; const { isNumber } = lodash; diff --git a/ts/util/getMacAndUpdateHmac.ts b/ts/util/getMacAndUpdateHmac.ts index 3232090fce..9ed9f09685 100644 --- a/ts/util/getMacAndUpdateHmac.ts +++ b/ts/util/getMacAndUpdateHmac.ts @@ -5,7 +5,7 @@ import { Buffer } from 'node:buffer'; import { type Hmac } from 'node:crypto'; import { Transform } from 'node:stream'; -import { MAC_LENGTH } from '../types/Crypto.js'; +import { MAC_LENGTH } from '../types/Crypto.std.js'; /** * Updates an hmac with the stream except for the last MAC_LENGTH diff --git a/ts/util/getMessageAuthorText.ts b/ts/util/getMessageAuthorText.ts index 30e350b12f..e69919396c 100644 --- a/ts/util/getMessageAuthorText.ts +++ b/ts/util/getMessageAuthorText.ts @@ -5,8 +5,8 @@ import type { ConversationAttributesType, ReadonlyMessageAttributesType, } from '../model-types.d.ts'; -import { isIncoming, isOutgoing } from '../state/selectors/message.js'; -import { getTitle } from './getTitle.js'; +import { isIncoming, isOutgoing } from '../state/selectors/message.preload.js'; +import { getTitle } from './getTitle.preload.js'; function getIncomingContact( messageAttributes: ReadonlyMessageAttributesType diff --git a/ts/util/getMessageConversation.ts b/ts/util/getMessageConversation.ts index 832aaebbdc..16da5ba52b 100644 --- a/ts/util/getMessageConversation.ts +++ b/ts/util/getMessageConversation.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; -import type { ConversationModel } from '../models/conversations.js'; +import type { ConversationModel } from '../models/conversations.preload.js'; export function getMessageConversation({ conversationId, diff --git a/ts/util/getMessageQueueTime.ts b/ts/util/getMessageQueueTime.ts index 9794395c5a..61da772f19 100644 --- a/ts/util/getMessageQueueTime.ts +++ b/ts/util/getMessageQueueTime.ts @@ -1,9 +1,9 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as RemoteConfig from '../RemoteConfig.js'; -import { MONTH, SECOND } from './durations/index.js'; -import { parseIntWithFallback } from './parseIntWithFallback.js'; +import * as RemoteConfig from '../RemoteConfig.dom.js'; +import { MONTH, SECOND } from './durations/index.std.js'; +import { parseIntWithFallback } from './parseIntWithFallback.std.js'; export function getMessageQueueTime( reduxConfig?: RemoteConfig.ConfigMapType diff --git a/ts/util/getMessageSentTimestamp.ts b/ts/util/getMessageSentTimestamp.ts index 84698bf552..2f1e4ca857 100644 --- a/ts/util/getMessageSentTimestamp.ts +++ b/ts/util/getMessageSentTimestamp.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; -import type { LoggerType } from '../types/Logging.js'; -import { assertDev } from './assert.js'; +import type { LoggerType } from '../types/Logging.std.js'; +import { assertDev } from './assert.std.js'; export type GetMessageSentTimestampOptionsType = Readonly<{ includeEdits?: boolean; diff --git a/ts/util/getMuteOptions.ts b/ts/util/getMuteOptions.ts index c6e27cfe5f..43c10c9117 100644 --- a/ts/util/getMuteOptions.ts +++ b/ts/util/getMuteOptions.ts @@ -1,10 +1,10 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as durations from './durations/index.js'; -import type { LocalizerType } from '../types/Util.js'; -import { getMutedUntilText } from './getMutedUntilText.js'; -import { isConversationMuted } from './isConversationMuted.js'; +import * as durations from './durations/index.std.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { getMutedUntilText } from './getMutedUntilText.std.js'; +import { isConversationMuted } from './isConversationMuted.std.js'; export type MuteOption = { name: string; diff --git a/ts/util/getMutedUntilText.ts b/ts/util/getMutedUntilText.ts index 1f08249cb6..2c5a639c00 100644 --- a/ts/util/getMutedUntilText.ts +++ b/ts/util/getMutedUntilText.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import moment from 'moment'; -import type { LocalizerType } from '../types/Util.js'; -import { isToday } from './timestamp.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { isToday } from './timestamp.std.js'; /** * Returns something like "Muted until 6:09 PM", localized. diff --git a/ts/util/getNotificationDataForMessage.ts b/ts/util/getNotificationDataForMessage.ts index 9bc583005f..fe6714b3af 100644 --- a/ts/util/getNotificationDataForMessage.ts +++ b/ts/util/getNotificationDataForMessage.ts @@ -3,32 +3,35 @@ import type { ReadonlyDeep } from 'type-fest'; -import type { RawBodyRange } from '../types/BodyRange.js'; +import type { RawBodyRange } from '../types/BodyRange.std.js'; import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; -import type { ICUStringMessageParamsByKeyType } from '../types/Util.js'; -import * as Attachment from './Attachment.js'; -import * as EmbeddedContact from '../types/EmbeddedContact.js'; -import * as GroupChange from '../groupChange.js'; -import * as MIME from '../types/MIME.js'; -import * as Stickers from '../types/Stickers.js'; -import * as expirationTimer from './expirationTimer.js'; -import { createLogger } from '../logging/log.js'; -import { GiftBadgeStates } from '../types/GiftBadgeStates.js'; -import { dropNull } from './dropNull.js'; -import { getCallHistorySelector } from '../state/selectors/callHistory.js'; -import { getCallSelector, getActiveCall } from '../state/selectors/calling.js'; -import { getCallingNotificationText } from './callingNotification.js'; +import type { ICUStringMessageParamsByKeyType } from '../types/Util.std.js'; +import * as Attachment from './Attachment.std.js'; +import * as EmbeddedContact from '../types/EmbeddedContact.std.js'; +import * as GroupChange from '../groupChange.std.js'; +import * as MIME from '../types/MIME.std.js'; +import * as Stickers from '../types/Stickers.preload.js'; +import * as expirationTimer from './expirationTimer.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { GiftBadgeStates } from '../types/GiftBadgeStates.std.js'; +import { dropNull } from './dropNull.std.js'; +import { getCallHistorySelector } from '../state/selectors/callHistory.std.js'; +import { + getCallSelector, + getActiveCall, +} from '../state/selectors/calling.std.js'; +import { getCallingNotificationText } from './callingNotification.std.js'; import { getConversationSelector, getSelectedMessageIds, getTargetedMessage, -} from '../state/selectors/conversations.js'; -import { getStringForConversationMerge } from './getStringForConversationMerge.js'; -import { getStringForProfileChange } from './getStringForProfileChange.js'; -import { getTitleNoDefault, getNumber } from './getTitle.js'; -import { findAndFormatContact } from './findAndFormatContact.js'; -import { isGroup, isMe } from './whatTypeOfConversation.js'; -import { strictAssert } from './assert.js'; +} from '../state/selectors/conversations.dom.js'; +import { getStringForConversationMerge } from './getStringForConversationMerge.std.js'; +import { getStringForProfileChange } from './getStringForProfileChange.std.js'; +import { getTitleNoDefault, getNumber } from './getTitle.preload.js'; +import { findAndFormatContact } from './findAndFormatContact.preload.js'; +import { isGroup, isMe } from './whatTypeOfConversation.dom.js'; +import { strictAssert } from './assert.std.js'; import { getPropsForCallHistory, hasErrors, @@ -48,16 +51,16 @@ import { isUnsupportedMessage, isConversationMerge, isMessageRequestResponse, -} from '../state/selectors/message.js'; -import { getAuthor } from '../messages/sources.js'; +} from '../state/selectors/message.preload.js'; +import { getAuthor } from '../messages/sources.preload.js'; import { messageHasPaymentEvent, getPaymentEventNotificationText, -} from '../messages/payments.js'; -import { MessageRequestResponseEvent } from '../types/MessageRequestResponseEvent.js'; -import { missingCaseError } from './missingCaseError.js'; -import { getUserConversationId } from '../state/selectors/user.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from '../messages/payments.std.js'; +import { MessageRequestResponseEvent } from '../types/MessageRequestResponseEvent.std.js'; +import { missingCaseError } from './missingCaseError.std.js'; +import { getUserConversationId } from '../state/selectors/user.std.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const log = createLogger('getNotificationDataForMessage'); const { i18n } = window.SignalContext; diff --git a/ts/util/getNotificationTextForMessage.ts b/ts/util/getNotificationTextForMessage.ts index c0b4c125bc..86ebba2196 100644 --- a/ts/util/getNotificationTextForMessage.ts +++ b/ts/util/getNotificationTextForMessage.ts @@ -2,12 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; -import { applyRangesToText, hydrateRanges } from '../types/BodyRange.js'; -import { findAndFormatContact } from './findAndFormatContact.js'; -import { getNotificationDataForMessage } from './getNotificationDataForMessage.js'; -import { isConversationAccepted } from './isConversationAccepted.js'; -import { strictAssert } from './assert.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import { applyRangesToText, hydrateRanges } from '../types/BodyRange.std.js'; +import { findAndFormatContact } from './findAndFormatContact.preload.js'; +import { getNotificationDataForMessage } from './getNotificationDataForMessage.preload.js'; +import { isConversationAccepted } from './isConversationAccepted.preload.js'; +import { strictAssert } from './assert.std.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const { i18n } = window.SignalContext; diff --git a/ts/util/getProfile.ts b/ts/util/getProfile.ts index 02104852fd..07815960aa 100644 --- a/ts/util/getProfile.ts +++ b/ts/util/getProfile.ts @@ -1,9 +1,9 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log.js'; -import { profileService } from '../services/profiles.js'; -import type { ServiceIdString } from '../types/ServiceId.js'; +import { createLogger } from '../logging/log.std.js'; +import { profileService } from '../services/profiles.preload.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; const log = createLogger('getProfile'); diff --git a/ts/util/getQuoteBodyText.ts b/ts/util/getQuoteBodyText.ts index 536525e844..f640100ca9 100644 --- a/ts/util/getQuoteBodyText.ts +++ b/ts/util/getQuoteBodyText.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; -import * as EmbeddedContact from '../types/EmbeddedContact.js'; +import * as EmbeddedContact from '../types/EmbeddedContact.std.js'; export function getQuoteBodyText( messageAttributes: ReadonlyMessageAttributesType, diff --git a/ts/util/getRecipientConversationIds.ts b/ts/util/getRecipientConversationIds.ts index 666b829352..3730bd3fc5 100644 --- a/ts/util/getRecipientConversationIds.ts +++ b/ts/util/getRecipientConversationIds.ts @@ -3,8 +3,8 @@ import type { ConversationAttributesType } from '../model-types.d.ts'; -import { getRecipients } from './getRecipients.js'; -import { strictAssert } from './assert.js'; +import { getRecipients } from './getRecipients.dom.js'; +import { strictAssert } from './assert.std.js'; // Recipients includes only the people we'll actually send to for this conversation export function getRecipientConversationIds( diff --git a/ts/util/getRecipients.ts b/ts/util/getRecipients.ts index 9646bf36c8..9655c4dcdf 100644 --- a/ts/util/getRecipients.ts +++ b/ts/util/getRecipients.ts @@ -5,11 +5,11 @@ import lodash from 'lodash'; import type { ConversationAttributesType } from '../model-types.d.ts'; -import type { ServiceIdString } from '../types/ServiceId.js'; -import { getConversationMembers } from './getConversationMembers.js'; -import { getSendTarget } from './getSendTarget.js'; -import { isDirectConversation, isMe } from './whatTypeOfConversation.js'; -import { isNotNil } from './isNotNil.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; +import { getConversationMembers } from './getConversationMembers.dom.js'; +import { getSendTarget } from './getSendTarget.std.js'; +import { isDirectConversation, isMe } from './whatTypeOfConversation.dom.js'; +import { isNotNil } from './isNotNil.std.js'; const { compact, uniq } = lodash; diff --git a/ts/util/getRecipientsByConversation.ts b/ts/util/getRecipientsByConversation.ts index a5df115d7d..13de38fbfd 100644 --- a/ts/util/getRecipientsByConversation.ts +++ b/ts/util/getRecipientsByConversation.ts @@ -1,12 +1,12 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types.js'; -import type { RecipientsByConversation } from '../state/ducks/stories.js'; -import type { ServiceIdString } from '../types/ServiceId.js'; +import type { ConversationAttributesType } from '../model-types.d.ts'; +import type { RecipientsByConversation } from '../state/ducks/stories.preload.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; -import { getConversationMembers } from './getConversationMembers.js'; -import { isNotNil } from './isNotNil.js'; +import { getConversationMembers } from './getConversationMembers.dom.js'; +import { isNotNil } from './isNotNil.std.js'; export function getRecipientsByConversation( conversations: Array diff --git a/ts/util/getSendOptions.ts b/ts/util/getSendOptions.ts index 84d726395f..10d701f62c 100644 --- a/ts/util/getSendOptions.ts +++ b/ts/util/getSendOptions.ts @@ -6,17 +6,17 @@ import type { SendIdentifierData, SendMetadataType, SendOptionsType, -} from '../textsecure/SendMessage.js'; -import { getConversationMembers } from './getConversationMembers.js'; -import { isDirectConversation, isMe } from './whatTypeOfConversation.js'; -import { senderCertificateService } from '../services/senderCertificate.js'; -import { shouldSharePhoneNumberWith } from './phoneNumberSharingMode.js'; -import type { SerializedCertificateType } from '../textsecure/OutgoingMessage.js'; -import { SenderCertificateMode } from '../textsecure/OutgoingMessage.js'; -import { ZERO_ACCESS_KEY, SEALED_SENDER } from '../types/SealedSender.js'; -import { isNotNil } from './isNotNil.js'; -import { maybeCreateGroupSendEndorsementState } from './groupSendEndorsements.js'; -import { missingCaseError } from './missingCaseError.js'; +} from '../textsecure/SendMessage.preload.js'; +import { getConversationMembers } from './getConversationMembers.dom.js'; +import { isDirectConversation, isMe } from './whatTypeOfConversation.dom.js'; +import { senderCertificateService } from '../services/senderCertificate.preload.js'; +import { shouldSharePhoneNumberWith } from './phoneNumberSharingMode.preload.js'; +import type { SerializedCertificateType } from '../textsecure/OutgoingMessage.preload.js'; +import { SenderCertificateMode } from '../textsecure/OutgoingMessage.preload.js'; +import { ZERO_ACCESS_KEY, SEALED_SENDER } from '../types/SealedSender.std.js'; +import { isNotNil } from './isNotNil.std.js'; +import { maybeCreateGroupSendEndorsementState } from './groupSendEndorsements.preload.js'; +import { missingCaseError } from './missingCaseError.std.js'; export async function getSendOptionsForRecipients( recipients: ReadonlyArray, diff --git a/ts/util/getSendTarget.ts b/ts/util/getSendTarget.ts index b72a350477..35c75a2967 100644 --- a/ts/util/getSendTarget.ts +++ b/ts/util/getSendTarget.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { ConversationAttributesType } from '../model-types.d.ts'; -import type { ServiceIdString } from '../types/ServiceId.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; export function getSendTarget({ serviceId, diff --git a/ts/util/getServiceIdsForE164s.ts b/ts/util/getServiceIdsForE164s.ts index a86361d094..75a91d5889 100644 --- a/ts/util/getServiceIdsForE164s.ts +++ b/ts/util/getServiceIdsForE164s.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { CDSResponseType } from '../textsecure/cds/Types.d.ts'; -import type { cdsLookup } from '../textsecure/WebAPI.js'; -import type { AciString } from '../types/ServiceId.js'; -import { createLogger } from '../logging/log.js'; -import { isDirectConversation, isMe } from './whatTypeOfConversation.js'; -import { parseNumber } from './libphonenumberUtil.js'; +import type { cdsLookup } from '../textsecure/WebAPI.preload.js'; +import type { AciString } from '../types/ServiceId.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { isDirectConversation, isMe } from './whatTypeOfConversation.dom.js'; +import { parseNumber } from './libphonenumberUtil.std.js'; const log = createLogger('getServiceIdsForE164s'); diff --git a/ts/util/getSignalConnections.ts b/ts/util/getSignalConnections.ts index f94791a16f..9dd8ce55ae 100644 --- a/ts/util/getSignalConnections.ts +++ b/ts/util/getSignalConnections.ts @@ -2,13 +2,13 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { ConversationAttributesType } from '../model-types.d.ts'; -import type { ConversationModel } from '../models/conversations.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import { isInSystemContacts } from './isInSystemContacts.js'; -import { isSignalConversation } from './isSignalConversation.js'; -import { isDirectConversation } from './whatTypeOfConversation.js'; -import { isConversationEverUnregistered } from './isConversationUnregistered.js'; -import { isBlocked } from './isBlocked.js'; +import type { ConversationModel } from '../models/conversations.preload.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import { isInSystemContacts } from './isInSystemContacts.std.js'; +import { isSignalConversation } from './isSignalConversation.dom.js'; +import { isDirectConversation } from './whatTypeOfConversation.dom.js'; +import { isConversationEverUnregistered } from './isConversationUnregistered.dom.js'; +import { isBlocked } from './isBlocked.preload.js'; export function isSignalConnection( conversation: ConversationType | ConversationAttributesType diff --git a/ts/util/getStoryBackground.ts b/ts/util/getStoryBackground.ts index ed34979a2e..17a3f95304 100644 --- a/ts/util/getStoryBackground.ts +++ b/ts/util/getStoryBackground.ts @@ -4,7 +4,7 @@ import type { AttachmentType, TextAttachmentType, -} from '../types/Attachment.js'; +} from '../types/Attachment.std.js'; const COLOR_BLACK_ALPHA_90 = 'rgba(0, 0, 0, 0.9)'; export const COLOR_BLACK_INT = 4278190080; diff --git a/ts/util/getStoryDuration.ts b/ts/util/getStoryDuration.ts index 234bf245d1..20a4b1f9ab 100644 --- a/ts/util/getStoryDuration.ts +++ b/ts/util/getStoryDuration.ts @@ -1,18 +1,18 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AttachmentType } from '../types/Attachment.js'; +import type { AttachmentType } from '../types/Attachment.std.js'; import { hasFailed, hasNotResolved, isDownloaded, isGIF, isVideo, -} from './Attachment.js'; -import { count } from './grapheme.js'; -import { SECOND } from './durations/index.js'; -import { createLogger } from '../logging/log.js'; -import * as Errors from '../types/errors.js'; +} from './Attachment.std.js'; +import { count } from './grapheme.std.js'; +import { SECOND } from './durations/index.std.js'; +import { createLogger } from '../logging/log.std.js'; +import * as Errors from '../types/errors.std.js'; const log = createLogger('getStoryDuration'); diff --git a/ts/util/getStoryReplyText.ts b/ts/util/getStoryReplyText.ts index 36c6458b1e..c890f48bee 100644 --- a/ts/util/getStoryReplyText.ts +++ b/ts/util/getStoryReplyText.ts @@ -1,9 +1,9 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AttachmentType } from '../types/Attachment.js'; -import type { LocalizerType } from '../types/Util.js'; -import { isGIF, isImage, isVideo } from './Attachment.js'; +import type { AttachmentType } from '../types/Attachment.std.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import { isGIF, isImage, isVideo } from './Attachment.std.js'; export function getStoryReplyText( i18n: LocalizerType, diff --git a/ts/util/getStreamWithTimeout.ts b/ts/util/getStreamWithTimeout.ts index fe7d39072a..a251213964 100644 --- a/ts/util/getStreamWithTimeout.ts +++ b/ts/util/getStreamWithTimeout.ts @@ -4,9 +4,9 @@ import { Transform } from 'node:stream'; import type { Readable } from 'node:stream'; -import * as Bytes from '../Bytes.js'; -import { clearTimeoutIfNecessary } from './clearTimeoutIfNecessary.js'; -import { explodePromise } from './explodePromise.js'; +import * as Bytes from '../Bytes.std.js'; +import { clearTimeoutIfNecessary } from './clearTimeoutIfNecessary.std.js'; +import { explodePromise } from './explodePromise.std.js'; export type OptionsType = Readonly<{ name: string; diff --git a/ts/util/getStringForConversationMerge.ts b/ts/util/getStringForConversationMerge.ts index ab4914dcc9..952e8f11e6 100644 --- a/ts/util/getStringForConversationMerge.ts +++ b/ts/util/getStringForConversationMerge.ts @@ -1,7 +1,7 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LocalizerType } from '../types/Util.js'; +import type { LocalizerType } from '../types/Util.std.js'; export function getStringForConversationMerge({ obsoleteConversationTitle, diff --git a/ts/util/getStringForPhoneNumberDiscovery.ts b/ts/util/getStringForPhoneNumberDiscovery.ts index 7d3510a95a..455d161c68 100644 --- a/ts/util/getStringForPhoneNumberDiscovery.ts +++ b/ts/util/getStringForPhoneNumberDiscovery.ts @@ -1,7 +1,7 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LocalizerType } from '../types/Util.js'; +import type { LocalizerType } from '../types/Util.std.js'; export function getStringForPhoneNumberDiscovery({ phoneNumber, diff --git a/ts/util/getStringForProfileChange.ts b/ts/util/getStringForProfileChange.ts index 9a18a6a827..c999183d3b 100644 --- a/ts/util/getStringForProfileChange.ts +++ b/ts/util/getStringForProfileChange.ts @@ -1,7 +1,7 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LocalizerType } from '../types/Util.js'; +import type { LocalizerType } from '../types/Util.std.js'; export type ProfileNameChangeType = { type: 'name'; diff --git a/ts/util/getThemeType.ts b/ts/util/getThemeType.ts index 7072c4080f..1f26286fd9 100644 --- a/ts/util/getThemeType.ts +++ b/ts/util/getThemeType.ts @@ -1,8 +1,8 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { SystemThemeType, ThemeType } from '../types/Util.js'; -import { missingCaseError } from './missingCaseError.js'; +import { SystemThemeType, ThemeType } from '../types/Util.std.js'; +import { missingCaseError } from './missingCaseError.std.js'; export async function getThemeType(): Promise { const themeSetting = await window.Events.getThemeSetting(); diff --git a/ts/util/getTitle.ts b/ts/util/getTitle.ts index 955934f51b..ec31ef1f72 100644 --- a/ts/util/getTitle.ts +++ b/ts/util/getTitle.ts @@ -5,12 +5,12 @@ import type { ConversationAttributesType, ConversationRenderInfoType, } from '../model-types.d.ts'; -import { combineNames } from './combineNames.js'; -import { getRegionCodeForNumber } from './libphonenumberUtil.js'; -import { instance, PhoneNumberFormat } from './libphonenumberInstance.js'; -import { isDirectConversation } from './whatTypeOfConversation.js'; -import { getE164 } from './getE164.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import { combineNames } from './combineNames.std.js'; +import { getRegionCodeForNumber } from './libphonenumberUtil.std.js'; +import { instance, PhoneNumberFormat } from './libphonenumberInstance.std.js'; +import { isDirectConversation } from './whatTypeOfConversation.dom.js'; +import { getE164 } from './getE164.std.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; type TitleOptions = { isShort?: boolean; diff --git a/ts/util/getUserAgent.ts b/ts/util/getUserAgent.ts index 66999da450..f931dad594 100644 --- a/ts/util/getUserAgent.ts +++ b/ts/util/getUserAgent.ts @@ -3,7 +3,7 @@ import os from 'node:os'; -import { getOwn } from './getOwn.js'; +import { getOwn } from './getOwn.std.js'; const PLATFORM_STRINGS: { [platform: string]: string } = { win32: 'Windows', diff --git a/ts/util/grapheme.ts b/ts/util/grapheme.ts index c9d09d47f5..15d8626097 100644 --- a/ts/util/grapheme.ts +++ b/ts/util/grapheme.ts @@ -3,7 +3,7 @@ import memoizee from 'memoizee'; -import { map, size, take, join } from './iterables.js'; +import { map, size, take, join } from './iterables.std.js'; const getSegmenter = memoizee((): Intl.Segmenter => new Intl.Segmenter()); diff --git a/ts/util/groupAndOrderReactions.ts b/ts/util/groupAndOrderReactions.ts index c913c0897a..4cb947da9f 100644 --- a/ts/util/groupAndOrderReactions.ts +++ b/ts/util/groupAndOrderReactions.ts @@ -5,7 +5,7 @@ import lodash from 'lodash'; import { useMemo } from 'react'; // eslint-disable-next-line import/no-restricted-paths -import type { Reaction } from '../components/conversation/ReactionViewer.js'; +import type { Reaction } from '../components/conversation/ReactionViewer.dom.js'; import { isEmojiVariantValue, getEmojiVariantKeyByValue, @@ -14,10 +14,10 @@ import { type EmojiVariantKey, type EmojiParentKey, // eslint-disable-next-line import/no-restricted-paths -} from '../components/fun/data/emojis.js'; -import { isNotNil } from './isNotNil.js'; +} from '../components/fun/data/emojis.std.js'; +import { isNotNil } from './isNotNil.std.js'; // eslint-disable-next-line import/no-restricted-paths -import { useFunEmojiLocalizer } from '../components/fun/useFunEmojiLocalizer.js'; +import { useFunEmojiLocalizer } from '../components/fun/useFunEmojiLocalizer.dom.js'; const { groupBy, orderBy } = lodash; diff --git a/ts/util/groupMemberNameCollisions.ts b/ts/util/groupMemberNameCollisions.ts index b221509291..61683b2ed6 100644 --- a/ts/util/groupMemberNameCollisions.ts +++ b/ts/util/groupMemberNameCollisions.ts @@ -3,11 +3,11 @@ import lodash from 'lodash'; import type { ReadonlyDeep } from 'type-fest'; -import { groupBy, map, filter } from './iterables.js'; -import { getOwn } from './getOwn.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import { isConversationNameKnown } from './isConversationNameKnown.js'; -import { isInSystemContacts } from './isInSystemContacts.js'; +import { groupBy, map, filter } from './iterables.std.js'; +import { getOwn } from './getOwn.std.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import { isConversationNameKnown } from './isConversationNameKnown.std.js'; +import { isInSystemContacts } from './isInSystemContacts.std.js'; const { mapValues, pickBy } = lodash; diff --git a/ts/util/groupMembershipUtils.ts b/ts/util/groupMembershipUtils.ts index 360630bdf0..6d38529282 100644 --- a/ts/util/groupMembershipUtils.ts +++ b/ts/util/groupMembershipUtils.ts @@ -3,10 +3,13 @@ import isNumber from 'lodash/isNumber.js'; import type { ConversationAttributesType } from '../model-types.d.ts'; -import type { ServiceIdString, AciString } from '../types/ServiceId.js'; -import { SignalService as Proto } from '../protobuf/index.js'; -import { isDirectConversation, isGroupV2 } from './whatTypeOfConversation.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import type { ServiceIdString, AciString } from '../types/ServiceId.std.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; +import { + isDirectConversation, + isGroupV2, +} from './whatTypeOfConversation.dom.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; export function isMemberPending( conversationAttrs: Pick< diff --git a/ts/util/groupSendEndorsements.ts b/ts/util/groupSendEndorsements.ts index 89785e90b8..13b2d5719c 100644 --- a/ts/util/groupSendEndorsements.ts +++ b/ts/util/groupSendEndorsements.ts @@ -5,35 +5,35 @@ import lodash from 'lodash'; import { groupSendEndorsementsDataSchema, toGroupSendToken, -} from '../types/GroupSendEndorsements.js'; +} from '../types/GroupSendEndorsements.std.js'; import type { GroupSendCombinedEndorsementRecord, GroupSendMemberEndorsementRecord, GroupSendToken, GroupSendEndorsementsData, -} from '../types/GroupSendEndorsements.js'; -import { devDebugger, strictAssert } from './assert.js'; +} from '../types/GroupSendEndorsements.std.js'; +import { devDebugger, strictAssert } from './assert.std.js'; import { GroupSecretParams, GroupSendEndorsement, GroupSendEndorsementsResponse, ServerPublicParams, -} from './zkgroup.js'; -import type { ServiceIdString } from '../types/ServiceId.js'; -import { fromAciObject } from '../types/ServiceId.js'; -import { createLogger } from '../logging/log.js'; -import type { GroupV2MemberType } from '../model-types.js'; -import { DurationInSeconds, MINUTE } from './durations/index.js'; -import { ToastType } from '../types/Toast.js'; -import * as Errors from '../types/errors.js'; -import { isTestOrMockEnvironment } from '../environment.js'; -import { isNightly } from './version.js'; -import { parseStrict } from './schemas.js'; -import { DataReader } from '../sql/Client.js'; -import { maybeUpdateGroup } from '../groups.js'; -import * as Bytes from '../Bytes.js'; -import { isGroupV2 } from './whatTypeOfConversation.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from './zkgroup.node.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; +import { fromAciObject } from '../types/ServiceId.std.js'; +import { createLogger } from '../logging/log.std.js'; +import type { GroupV2MemberType } from '../model-types.d.ts'; +import { DurationInSeconds, MINUTE } from './durations/index.std.js'; +import { ToastType } from '../types/Toast.dom.js'; +import * as Errors from '../types/errors.std.js'; +import { isTestOrMockEnvironment } from '../environment.std.js'; +import { isNightly } from './version.std.js'; +import { parseStrict } from './schemas.std.js'; +import { DataReader } from '../sql/Client.preload.js'; +import { maybeUpdateGroup } from '../groups.preload.js'; +import * as Bytes from '../Bytes.std.js'; +import { isGroupV2 } from './whatTypeOfConversation.dom.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const { throttle } = lodash; diff --git a/ts/util/handleEditMessage.ts b/ts/util/handleEditMessage.ts index 034a926def..5a7b5c170f 100644 --- a/ts/util/handleEditMessage.ts +++ b/ts/util/handleEditMessage.ts @@ -1,38 +1,38 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AttachmentType } from '../types/Attachment.js'; -import type { EditAttributesType } from '../messageModifiers/Edits.js'; +import type { AttachmentType } from '../types/Attachment.std.js'; +import type { EditAttributesType } from '../messageModifiers/Edits.preload.js'; import type { EditHistoryType, MessageAttributesType, } from '../model-types.d.ts'; -import * as Edits from '../messageModifiers/Edits.js'; -import { createLogger } from '../logging/log.js'; -import { ReadStatus } from '../messages/MessageReadStatus.js'; -import { DataWriter } from '../sql/Client.js'; -import { drop } from './drop.js'; -import { upgradeMessageSchema } from './migrations.js'; +import * as Edits from '../messageModifiers/Edits.preload.js'; +import { createLogger } from '../logging/log.std.js'; +import { ReadStatus } from '../messages/MessageReadStatus.std.js'; +import { DataWriter } from '../sql/Client.preload.js'; +import { drop } from './drop.std.js'; +import { upgradeMessageSchema } from './migrations.preload.js'; import { deliveryReceiptQueue, deliveryReceiptBatcher, -} from './deliveryReceipt.js'; +} from './deliveryReceipt.preload.js'; import { cacheAttachmentBySignature, getCachedAttachmentBySignature, isVoiceMessage, -} from './Attachment.js'; -import { isAciString } from './isAciString.js'; -import { getMessageIdForLogging } from './idForLogging.js'; -import { hasErrors } from '../state/selectors/message.js'; -import { isIncoming, isOutgoing } from '../messages/helpers.js'; -import { isDirectConversation } from './whatTypeOfConversation.js'; -import { isTooOldToModifyMessage } from './isTooOldToModifyMessage.js'; -import { queueAttachmentDownloads } from './queueAttachmentDownloads.js'; -import { modifyTargetMessage } from './modifyTargetMessage.js'; -import { isMessageNoteToSelf } from './isMessageNoteToSelf.js'; -import { MessageModel } from '../models/messages.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from './Attachment.std.js'; +import { isAciString } from './isAciString.std.js'; +import { getMessageIdForLogging } from './idForLogging.preload.js'; +import { hasErrors } from '../state/selectors/message.preload.js'; +import { isIncoming, isOutgoing } from '../messages/helpers.std.js'; +import { isDirectConversation } from './whatTypeOfConversation.dom.js'; +import { isTooOldToModifyMessage } from './isTooOldToModifyMessage.std.js'; +import { queueAttachmentDownloads } from './queueAttachmentDownloads.preload.js'; +import { modifyTargetMessage } from './modifyTargetMessage.preload.js'; +import { isMessageNoteToSelf } from './isMessageNoteToSelf.dom.js'; +import { MessageModel } from '../models/messages.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const log = createLogger('handleEditMessage'); diff --git a/ts/util/handleImageAttachment.ts b/ts/util/handleImageAttachment.ts index e24b628051..84642a5484 100644 --- a/ts/util/handleImageAttachment.ts +++ b/ts/util/handleImageAttachment.ts @@ -5,13 +5,13 @@ import path from 'node:path'; import { ipcRenderer } from 'electron'; import { v4 as genUuid } from 'uuid'; -import { blobToArrayBuffer } from '../types/VisualAttachment.js'; -import type { MIMEType } from '../types/MIME.js'; -import { IMAGE_JPEG, isHeic, stringToMIMEType } from '../types/MIME.js'; -import type { InMemoryAttachmentDraftType } from '../types/Attachment.js'; -import { canBeTranscoded } from './Attachment.js'; -import { imageToBlurHash } from './imageToBlurHash.js'; -import { scaleImageToLevel } from './scaleImageToLevel.js'; +import { blobToArrayBuffer } from '../types/VisualAttachment.dom.js'; +import type { MIMEType } from '../types/MIME.std.js'; +import { IMAGE_JPEG, isHeic, stringToMIMEType } from '../types/MIME.std.js'; +import type { InMemoryAttachmentDraftType } from '../types/Attachment.std.js'; +import { canBeTranscoded } from './Attachment.std.js'; +import { imageToBlurHash } from './imageToBlurHash.dom.js'; +import { scaleImageToLevel } from './scaleImageToLevel.preload.js'; export async function handleImageAttachment( file: File diff --git a/ts/util/handleMessageSend.ts b/ts/util/handleMessageSend.ts index 101ff3fd66..801f367c9c 100644 --- a/ts/util/handleMessageSend.ts +++ b/ts/util/handleMessageSend.ts @@ -4,17 +4,17 @@ import { z } from 'zod'; import lodash from 'lodash'; import type { CallbackResultType } from '../textsecure/Types.d.ts'; -import { DataWriter } from '../sql/Client.js'; -import { createLogger } from '../logging/log.js'; +import { DataWriter } from '../sql/Client.preload.js'; +import { createLogger } from '../logging/log.std.js'; import { OutgoingMessageError, SendMessageNetworkError, SendMessageProtoError, UnregisteredUserError, -} from '../textsecure/Errors.js'; -import { SEALED_SENDER } from '../types/SealedSender.js'; -import type { ServiceIdString } from '../types/ServiceId.js'; -import { drop } from './drop.js'; +} from '../textsecure/Errors.std.js'; +import { SEALED_SENDER } from '../types/SealedSender.std.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; +import { drop } from './drop.std.js'; const { isBoolean, isNumber } = lodash; diff --git a/ts/util/handleOutsideClick.ts b/ts/util/handleOutsideClick.ts index 18c7aa2313..8000249298 100644 --- a/ts/util/handleOutsideClick.ts +++ b/ts/util/handleOutsideClick.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { RefObject } from 'react'; -import { createLogger } from '../logging/log.js'; +import { createLogger } from '../logging/log.std.js'; const log = createLogger('handleOutsideClick'); diff --git a/ts/util/handleRetry.ts b/ts/util/handleRetry.ts index 784934fd82..644abd3f4f 100644 --- a/ts/util/handleRetry.ts +++ b/ts/util/handleRetry.ts @@ -8,23 +8,23 @@ import { import lodash from 'lodash'; import type PQueue from 'p-queue'; -import * as Bytes from '../Bytes.js'; -import { signalProtocolStore } from '../SignalProtocolStore.js'; -import { DataReader, DataWriter } from '../sql/Client.js'; -import { isProduction } from './version.js'; -import { strictAssert } from './assert.js'; -import { lightSessionResetQueue } from './lightSessionResetQueue.js'; -import { isGroupV2 } from './whatTypeOfConversation.js'; -import { isOlderThan } from './timestamp.js'; -import { parseIntOrThrow } from './parseIntOrThrow.js'; -import * as RemoteConfig from '../RemoteConfig.js'; -import { Address } from '../types/Address.js'; -import { QualifiedAddress } from '../types/QualifiedAddress.js'; -import type { AciString, ServiceIdString } from '../types/ServiceId.js'; -import { ToastType } from '../types/Toast.js'; -import * as Errors from '../types/errors.js'; +import * as Bytes from '../Bytes.std.js'; +import { signalProtocolStore } from '../SignalProtocolStore.preload.js'; +import { DataReader, DataWriter } from '../sql/Client.preload.js'; +import { isProduction } from './version.std.js'; +import { strictAssert } from './assert.std.js'; +import { lightSessionResetQueue } from './lightSessionResetQueue.std.js'; +import { isGroupV2 } from './whatTypeOfConversation.dom.js'; +import { isOlderThan } from './timestamp.std.js'; +import { parseIntOrThrow } from './parseIntOrThrow.std.js'; +import * as RemoteConfig from '../RemoteConfig.dom.js'; +import { Address } from '../types/Address.std.js'; +import { QualifiedAddress } from '../types/QualifiedAddress.std.js'; +import type { AciString, ServiceIdString } from '../types/ServiceId.std.js'; +import { ToastType } from '../types/Toast.dom.js'; +import * as Errors from '../types/errors.std.js'; -import type { ConversationModel } from '../models/conversations.js'; +import type { ConversationModel } from '../models/conversations.preload.js'; import type { DecryptionErrorEvent, DecryptionErrorEventData, @@ -32,21 +32,21 @@ import type { RetryRequestEvent, RetryRequestEventData, SuccessfulDecryptEvent, -} from '../textsecure/messageReceiverEvents.js'; +} from '../textsecure/messageReceiverEvents.std.js'; -import { SignalService as Proto } from '../protobuf/index.js'; -import { createLogger } from '../logging/log.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; +import { createLogger } from '../logging/log.std.js'; import { type MessageSender, messageSender, -} from '../textsecure/SendMessage.js'; -import type { StoryDistributionListDataType } from '../state/ducks/storyDistributionLists.js'; -import { drop } from './drop.js'; -import { conversationJobQueue } from '../jobs/conversationJobQueue.js'; -import { incrementMessageCounter } from './incrementMessageCounter.js'; -import { SECOND } from './durations/index.js'; -import { sleep } from './sleep.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from '../textsecure/SendMessage.preload.js'; +import type { StoryDistributionListDataType } from '../state/ducks/storyDistributionLists.preload.js'; +import { drop } from './drop.std.js'; +import { conversationJobQueue } from '../jobs/conversationJobQueue.preload.js'; +import { incrementMessageCounter } from './incrementMessageCounter.preload.js'; +import { SECOND } from './durations/index.std.js'; +import { sleep } from './sleep.std.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const { isNumber, random } = lodash; diff --git a/ts/util/handleServerAlerts.ts b/ts/util/handleServerAlerts.ts index 8ae2c0c6be..581096f1b5 100644 --- a/ts/util/handleServerAlerts.ts +++ b/ts/util/handleServerAlerts.ts @@ -1,14 +1,17 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log.js'; -import { isMoreRecentThan } from './timestamp.js'; -import { DAY, WEEK } from './durations/index.js'; -import { isNotNil } from './isNotNil.js'; -import { clearTimeoutIfNecessary } from './clearTimeoutIfNecessary.js'; -import { safeSetTimeout } from './timeout.js'; -import { itemStorage } from '../textsecure/Storage.js'; -import { ServerAlert, type ServerAlertsType } from '../types/ServerAlert.js'; +import { createLogger } from '../logging/log.std.js'; +import { isMoreRecentThan } from './timestamp.std.js'; +import { DAY, WEEK } from './durations/index.std.js'; +import { isNotNil } from './isNotNil.std.js'; +import { clearTimeoutIfNecessary } from './clearTimeoutIfNecessary.std.js'; +import { safeSetTimeout } from './timeout.std.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; +import { + ServerAlert, + type ServerAlertsType, +} from '../types/ServerAlert.std.js'; const log = createLogger('handleServerAlerts'); diff --git a/ts/util/handleVideoAttachment.ts b/ts/util/handleVideoAttachment.ts index 41c84ef40f..fe64792a07 100644 --- a/ts/util/handleVideoAttachment.ts +++ b/ts/util/handleVideoAttachment.ts @@ -5,13 +5,13 @@ import { blobToArrayBuffer } from 'blob-util'; import { sanitize } from '@signalapp/libsignal-client/dist/Mp4Sanitizer.js'; import { v4 as generateUuid } from 'uuid'; -import { makeVideoScreenshot } from '../types/VisualAttachment.js'; -import { IMAGE_PNG, stringToMIMEType } from '../types/MIME.js'; -import { toLogFormat } from '../types/errors.js'; -import type { InMemoryAttachmentDraftType } from '../types/Attachment.js'; -import { createLogger } from '../logging/log.js'; -import { MemoryStream } from './MemoryStream.js'; -import { fileToBytes } from './fileToBytes.js'; +import { makeVideoScreenshot } from '../types/VisualAttachment.dom.js'; +import { IMAGE_PNG, stringToMIMEType } from '../types/MIME.std.js'; +import { toLogFormat } from '../types/errors.std.js'; +import type { InMemoryAttachmentDraftType } from '../types/Attachment.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { MemoryStream } from './MemoryStream.node.js'; +import { fileToBytes } from './fileToBytes.std.js'; const log = createLogger('handleVideoAttachment'); diff --git a/ts/util/hasAttachmentDownloads.ts b/ts/util/hasAttachmentDownloads.ts index 1d1959976e..81488113bb 100644 --- a/ts/util/hasAttachmentDownloads.ts +++ b/ts/util/hasAttachmentDownloads.ts @@ -3,7 +3,7 @@ import lodash from 'lodash'; import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; -import { isLongMessage } from '../types/MIME.js'; +import { isLongMessage } from '../types/MIME.std.js'; const { partition } = lodash; diff --git a/ts/util/hasDraft.ts b/ts/util/hasDraft.ts index 2023e65b7b..0fee2f713c 100644 --- a/ts/util/hasDraft.ts +++ b/ts/util/hasDraft.ts @@ -1,7 +1,7 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types.js'; +import type { ConversationAttributesType } from '../model-types.d.ts'; export function hasDraft(attributes: ConversationAttributesType): boolean { const draftAttachments = attributes.draftAttachments || []; diff --git a/ts/util/hasDraftAttachments.ts b/ts/util/hasDraftAttachments.ts index e61a45b81b..fcbca83ecc 100644 --- a/ts/util/hasDraftAttachments.ts +++ b/ts/util/hasDraftAttachments.ts @@ -1,7 +1,7 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AttachmentDraftType } from '../types/Attachment.js'; +import type { AttachmentDraftType } from '../types/Attachment.std.js'; export function hasDraftAttachments( draftAttachments: ReadonlyArray | undefined, diff --git a/ts/util/hydrateStoryContext.ts b/ts/util/hydrateStoryContext.ts index 530a988c4b..5f7c77dce7 100644 --- a/ts/util/hydrateStoryContext.ts +++ b/ts/util/hydrateStoryContext.ts @@ -2,18 +2,18 @@ // SPDX-License-Identifier: AGPL-3.0-only import omit from 'lodash/omit.js'; -import { createLogger } from '../logging/log.js'; -import type { AttachmentType } from '../types/Attachment.js'; +import { createLogger } from '../logging/log.std.js'; +import type { AttachmentType } from '../types/Attachment.std.js'; import type { MessageAttributesType } from '../model-types.d.ts'; -import { getAttachmentsForMessage } from '../state/selectors/message.js'; -import { isAciString } from './isAciString.js'; -import { isDirectConversation } from './whatTypeOfConversation.js'; -import { softAssert, strictAssert } from './assert.js'; -import { getMessageSentTimestamp } from './getMessageSentTimestamp.js'; -import { isOlderThan } from './timestamp.js'; -import { DAY } from './durations/index.js'; -import { getMessageById } from '../messages/getMessageById.js'; -import { MessageModel } from '../models/messages.js'; +import { getAttachmentsForMessage } from '../state/selectors/message.preload.js'; +import { isAciString } from './isAciString.std.js'; +import { isDirectConversation } from './whatTypeOfConversation.dom.js'; +import { softAssert, strictAssert } from './assert.std.js'; +import { getMessageSentTimestamp } from './getMessageSentTimestamp.std.js'; +import { isOlderThan } from './timestamp.std.js'; +import { DAY } from './durations/index.std.js'; +import { getMessageById } from '../messages/getMessageById.preload.js'; +import { MessageModel } from '../models/messages.preload.js'; const log = createLogger('hydrateStoryContext'); diff --git a/ts/util/idForLogging.ts b/ts/util/idForLogging.ts index 7cb4437465..f1bd29b5ec 100644 --- a/ts/util/idForLogging.ts +++ b/ts/util/idForLogging.ts @@ -9,10 +9,13 @@ import { getSource, getSourceDevice, getSourceServiceId, -} from '../messages/sources.js'; -import { isDirectConversation, isGroupV2 } from './whatTypeOfConversation.js'; -import { getE164 } from './getE164.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; +} from '../messages/sources.preload.js'; +import { + isDirectConversation, + isGroupV2, +} from './whatTypeOfConversation.dom.js'; +import { getE164 } from './getE164.std.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; export function getMessageIdForLogging( message: Pick< diff --git a/ts/util/imagePathToBytes.ts b/ts/util/imagePathToBytes.ts index da2c369b52..8563cb6370 100644 --- a/ts/util/imagePathToBytes.ts +++ b/ts/util/imagePathToBytes.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { canvasToBytes } from './canvasToBytes.js'; +import { canvasToBytes } from './canvasToBytes.std.js'; export async function imagePathToBytes(src: string): Promise { const image = new Image(); diff --git a/ts/util/incrementMessageCounter.ts b/ts/util/incrementMessageCounter.ts index 1e2d09210d..471337b0d8 100644 --- a/ts/util/incrementMessageCounter.ts +++ b/ts/util/incrementMessageCounter.ts @@ -3,10 +3,10 @@ import lodash from 'lodash'; -import { strictAssert } from './assert.js'; -import { safeParseInteger } from './numbers.js'; -import { DataReader } from '../sql/Client.js'; -import { createLogger } from '../logging/log.js'; +import { strictAssert } from './assert.std.js'; +import { safeParseInteger } from './numbers.std.js'; +import { DataReader } from '../sql/Client.preload.js'; +import { createLogger } from '../logging/log.std.js'; const { debounce, isNumber } = lodash; diff --git a/ts/util/isAciString.ts b/ts/util/isAciString.ts index 8fd94e47cd..a3c401e283 100644 --- a/ts/util/isAciString.ts +++ b/ts/util/isAciString.ts @@ -1,8 +1,8 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AciString } from '../types/ServiceId.js'; -import { isValidUuid } from './isValidUuid.js'; +import type { AciString } from '../types/ServiceId.std.js'; +import { isValidUuid } from './isValidUuid.std.js'; export function isAciString(value?: string | null): value is AciString { return isValidUuid(value); diff --git a/ts/util/isBackupEnabled.ts b/ts/util/isBackupEnabled.ts index 302c5e96eb..2484c6865c 100644 --- a/ts/util/isBackupEnabled.ts +++ b/ts/util/isBackupEnabled.ts @@ -1,11 +1,11 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as RemoteConfig from '../RemoteConfig.js'; -import { isTestOrMockEnvironment } from '../environment.js'; -import { isStagingServer } from './isStagingServer.js'; -import { isBeta, isNightly } from './version.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import * as RemoteConfig from '../RemoteConfig.dom.js'; +import { isTestOrMockEnvironment } from '../environment.std.js'; +import { isStagingServer } from './isStagingServer.dom.js'; +import { isBeta, isNightly } from './version.std.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; export function areRemoteBackupsTurnedOn(): boolean { return isBackupFeatureEnabled() && itemStorage.get('backupTier') != null; diff --git a/ts/util/isBlocked.ts b/ts/util/isBlocked.ts index 5d16995c45..39cb904a64 100644 --- a/ts/util/isBlocked.ts +++ b/ts/util/isBlocked.ts @@ -1,9 +1,9 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types.js'; -import { isAciString } from './isAciString.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import type { ConversationAttributesType } from '../model-types.d.ts'; +import { isAciString } from './isAciString.std.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; export function isBlocked( attributes: Pick diff --git a/ts/util/isCallSafe.ts b/ts/util/isCallSafe.ts index 007a33c4cf..80cf6c4fb0 100644 --- a/ts/util/isCallSafe.ts +++ b/ts/util/isCallSafe.ts @@ -1,13 +1,13 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types.js'; +import type { ConversationAttributesType } from '../model-types.d.ts'; -import { createLogger } from '../logging/log.js'; -import { blockSendUntilConversationsAreVerified } from './blockSendUntilConversationsAreVerified.js'; -import { getRecipientsByConversation } from './getRecipientsByConversation.js'; +import { createLogger } from '../logging/log.std.js'; +import { blockSendUntilConversationsAreVerified } from './blockSendUntilConversationsAreVerified.dom.js'; +import { getRecipientsByConversation } from './getRecipientsByConversation.dom.js'; -import type { SafetyNumberChangeSource } from '../types/SafetyNumberChangeSource.js'; +import type { SafetyNumberChangeSource } from '../types/SafetyNumberChangeSource.std.js'; const log = createLogger('isCallSafe'); diff --git a/ts/util/isChatFoldersEnabled.ts b/ts/util/isChatFoldersEnabled.ts new file mode 100644 index 0000000000..92167b51b2 --- /dev/null +++ b/ts/util/isChatFoldersEnabled.ts @@ -0,0 +1,33 @@ +// Copyright 2025 Signal Messenger, LLC +// SPDX-License-Identifier: AGPL-3.0-only +import * as RemoteConfig from '../RemoteConfig.dom.js'; +import { + Environment, + getEnvironment, + isMockEnvironment, +} from '../environment.std.js'; +import { isAlpha, isBeta, isProduction } from './version.std.js'; + +export function isChatFoldersEnabled(version: string): boolean { + const env = getEnvironment(); + + if ( + env === Environment.Development || + env === Environment.Test || + isMockEnvironment() + ) { + return true; + } + + if (isProduction(version)) { + return RemoteConfig.isEnabled('desktop.chatFolders.prod'); + } + if (isBeta(version)) { + return RemoteConfig.isEnabled('desktop.chatFolders.beta'); + } + if (isAlpha(version)) { + return RemoteConfig.isEnabled('desktop.chatFolders.alpha'); + } + + return false; +} diff --git a/ts/util/isConversationAccepted.ts b/ts/util/isConversationAccepted.ts index 86b8e9de7a..d0d80b0e16 100644 --- a/ts/util/isConversationAccepted.ts +++ b/ts/util/isConversationAccepted.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { ConversationAttributesType } from '../model-types.d.ts'; -import { SignalService as Proto } from '../protobuf/index.js'; -import { isDirectConversation, isMe } from './whatTypeOfConversation.js'; -import { isInSystemContacts } from './isInSystemContacts.js'; -import { createLogger } from '../logging/log.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; +import { isDirectConversation, isMe } from './whatTypeOfConversation.dom.js'; +import { isInSystemContacts } from './isInSystemContacts.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; export type IsConversationAcceptedOptionsType = { ignoreEmptyConvo: boolean; diff --git a/ts/util/isConversationNameKnown.ts b/ts/util/isConversationNameKnown.ts index ec2297047a..7d4d4e017f 100644 --- a/ts/util/isConversationNameKnown.ts +++ b/ts/util/isConversationNameKnown.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationType } from '../state/ducks/conversations.js'; -import { missingCaseError } from './missingCaseError.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import { missingCaseError } from './missingCaseError.std.js'; export function isConversationNameKnown( conversation: Readonly< diff --git a/ts/util/isConversationSMSOnly.ts b/ts/util/isConversationSMSOnly.ts index 431e9cf440..b52bce24c2 100644 --- a/ts/util/isConversationSMSOnly.ts +++ b/ts/util/isConversationSMSOnly.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ServiceIdString } from '../types/ServiceId.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; export type MinimalConversationType = Readonly<{ discoveredUnregisteredAt?: number; diff --git a/ts/util/isConversationUnregistered.ts b/ts/util/isConversationUnregistered.ts index 3f4712bb52..6773e38566 100644 --- a/ts/util/isConversationUnregistered.ts +++ b/ts/util/isConversationUnregistered.ts @@ -1,10 +1,10 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ServiceIdString } from '../types/ServiceId.js'; -import { isMoreRecentThan, isOlderThan } from './timestamp.js'; -import { HOUR } from './durations/index.js'; -import { getMessageQueueTime } from './getMessageQueueTime.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; +import { isMoreRecentThan, isOlderThan } from './timestamp.std.js'; +import { HOUR } from './durations/index.std.js'; +import { getMessageQueueTime } from './getMessageQueueTime.dom.js'; const SIX_HOURS = 6 * HOUR; diff --git a/ts/util/isGroupInStoryMode.ts b/ts/util/isGroupInStoryMode.ts index 0ea45bd988..4c7efb9b96 100644 --- a/ts/util/isGroupInStoryMode.ts +++ b/ts/util/isGroupInStoryMode.ts @@ -1,9 +1,9 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationType } from '../state/ducks/conversations.js'; -import { StorySendMode } from '../types/Stories.js'; -import { assertDev } from './assert.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import { StorySendMode } from '../types/Stories.std.js'; +import { assertDev } from './assert.std.js'; export function isGroupInStoryMode( { id, type, storySendMode }: ConversationType, diff --git a/ts/util/isGroupOrAdhocCall.ts b/ts/util/isGroupOrAdhocCall.ts index 6c9798971b..6d3cdd006b 100644 --- a/ts/util/isGroupOrAdhocCall.ts +++ b/ts/util/isGroupOrAdhocCall.ts @@ -1,12 +1,15 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { CallMode } from '../types/CallDisposition.js'; -import type { ActiveCallType, ActiveGroupCallType } from '../types/Calling.js'; +import { CallMode } from '../types/CallDisposition.std.js'; +import type { + ActiveCallType, + ActiveGroupCallType, +} from '../types/Calling.std.js'; import type { DirectCallStateType, GroupCallStateType, -} from '../state/ducks/calling.js'; +} from '../state/ducks/calling.preload.js'; export function isGroupOrAdhocActiveCall( activeCall: ActiveCallType | undefined diff --git a/ts/util/isLinkAndSyncEnabled.ts b/ts/util/isLinkAndSyncEnabled.ts index 359d8fcd1b..2d21f63d5e 100644 --- a/ts/util/isLinkAndSyncEnabled.ts +++ b/ts/util/isLinkAndSyncEnabled.ts @@ -1,7 +1,7 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { everDone as wasRegistrationEverDone } from './registration.js'; +import { everDone as wasRegistrationEverDone } from './registration.preload.js'; export function isLinkAndSyncEnabled(): boolean { // Cannot overwrite existing message history diff --git a/ts/util/isLocalBackupsEnabled.ts b/ts/util/isLocalBackupsEnabled.ts index 6d3a5892ea..a236c6f91e 100644 --- a/ts/util/isLocalBackupsEnabled.ts +++ b/ts/util/isLocalBackupsEnabled.ts @@ -1,10 +1,10 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as RemoteConfig from '../RemoteConfig.js'; -import { isTestOrMockEnvironment } from '../environment.js'; -import { isStagingServer } from './isStagingServer.js'; -import { isNightly } from './version.js'; +import * as RemoteConfig from '../RemoteConfig.dom.js'; +import { isTestOrMockEnvironment } from '../environment.std.js'; +import { isStagingServer } from './isStagingServer.dom.js'; +import { isNightly } from './version.std.js'; export function isLocalBackupsEnabled( reduxConfig?: RemoteConfig.ConfigMapType diff --git a/ts/util/isMessageEmpty.ts b/ts/util/isMessageEmpty.ts index fdba842d2e..01fbde032d 100644 --- a/ts/util/isMessageEmpty.ts +++ b/ts/util/isMessageEmpty.ts @@ -1,8 +1,8 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { messageHasPaymentEvent } from '../messages/payments.js'; -import type { MessageAttributesType } from '../model-types.js'; +import { messageHasPaymentEvent } from '../messages/payments.std.js'; +import type { MessageAttributesType } from '../model-types.d.ts'; import { hasErrors, isCallHistory, @@ -22,7 +22,7 @@ import { isUniversalTimerNotification, isUnsupportedMessage, isVerifiedChange, -} from '../state/selectors/message.js'; +} from '../state/selectors/message.preload.js'; export function isMessageEmpty(attributes: MessageAttributesType): boolean { // Core message types - we check for all four because they can each stand alone diff --git a/ts/util/isMessageUnread.ts b/ts/util/isMessageUnread.ts index 09c5397dc4..8efd833921 100644 --- a/ts/util/isMessageUnread.ts +++ b/ts/util/isMessageUnread.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { ReadStatus } from '../messages/MessageReadStatus.js'; +import { ReadStatus } from '../messages/MessageReadStatus.std.js'; import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; export const isMessageUnread = ( diff --git a/ts/util/isProtoBinaryEncodingEnabled.ts b/ts/util/isProtoBinaryEncodingEnabled.ts index ca3b0a1fa6..e9a9c35cad 100644 --- a/ts/util/isProtoBinaryEncodingEnabled.ts +++ b/ts/util/isProtoBinaryEncodingEnabled.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { isTestOrMockEnvironment } from '../environment.js'; +import { isTestOrMockEnvironment } from '../environment.std.js'; export function isProtoBinaryEncodingEnabled(): boolean { if (isTestOrMockEnvironment()) { diff --git a/ts/util/isSafetyNumberNotAvailable.ts b/ts/util/isSafetyNumberNotAvailable.ts index cd41813652..e5c494aa7e 100644 --- a/ts/util/isSafetyNumberNotAvailable.ts +++ b/ts/util/isSafetyNumberNotAvailable.ts @@ -1,8 +1,8 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationType } from '../state/ducks/conversations.js'; -import { isAciString } from './isAciString.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import { isAciString } from './isAciString.std.js'; export const isSafetyNumberNotAvailable = ( contact?: ConversationType diff --git a/ts/util/isSameAvatarData.ts b/ts/util/isSameAvatarData.ts index f83d2bf53b..23bc9fe2f3 100644 --- a/ts/util/isSameAvatarData.ts +++ b/ts/util/isSameAvatarData.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AvatarDataType } from '../types/Avatar.js'; +import type { AvatarDataType } from '../types/Avatar.std.js'; export function isSameAvatarData( a?: AvatarDataType, diff --git a/ts/util/isSettingsInternalEnabled.ts b/ts/util/isSettingsInternalEnabled.ts index fd9fa55b43..672aadd0c8 100644 --- a/ts/util/isSettingsInternalEnabled.ts +++ b/ts/util/isSettingsInternalEnabled.ts @@ -1,8 +1,8 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as RemoteConfig from '../RemoteConfig.js'; -import { isNightly } from './version.js'; +import * as RemoteConfig from '../RemoteConfig.dom.js'; +import { isNightly } from './version.std.js'; export function isSettingsInternalEnabled(): boolean { if (RemoteConfig.isEnabled('desktop.internalUser')) { diff --git a/ts/util/isSignalConversation.ts b/ts/util/isSignalConversation.ts index 3b6e7b7fd4..a439a94e6a 100644 --- a/ts/util/isSignalConversation.ts +++ b/ts/util/isSignalConversation.ts @@ -1,8 +1,8 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { SIGNAL_ACI } from '../types/SignalConversation.js'; -import type { ServiceIdString } from '../types/ServiceId.js'; +import { SIGNAL_ACI } from '../types/SignalConversation.std.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; export function isSignalConversation(conversation: { id: string; diff --git a/ts/util/isStagingServer.ts b/ts/util/isStagingServer.ts index 1cfd477281..0a40fb7d52 100644 --- a/ts/util/isStagingServer.ts +++ b/ts/util/isStagingServer.ts @@ -1,8 +1,8 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { Environment, getEnvironment } from '../environment.js'; -import { isStaging } from './version.js'; +import { Environment, getEnvironment } from '../environment.std.js'; +import { isStaging } from './version.std.js'; export function isStagingServer( serverUrl = window.SignalContext.config.serverUrl diff --git a/ts/util/isTooOldToModifyMessage.ts b/ts/util/isTooOldToModifyMessage.ts index b410178f65..33460a05b5 100644 --- a/ts/util/isTooOldToModifyMessage.ts +++ b/ts/util/isTooOldToModifyMessage.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; -import { DAY } from './durations/index.js'; +import { DAY } from './durations/index.std.js'; export function isTooOldToModifyMessage( serverTimestamp: number, diff --git a/ts/util/isValidTapToView.ts b/ts/util/isValidTapToView.ts index d33f97ba1e..95b12754e5 100644 --- a/ts/util/isValidTapToView.ts +++ b/ts/util/isValidTapToView.ts @@ -1,8 +1,8 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { MessageAttributesType } from '../model-types.js'; -import * as GoogleChrome from './GoogleChrome.js'; +import type { MessageAttributesType } from '../model-types.d.ts'; +import * as GoogleChrome from './GoogleChrome.std.js'; export function isValidTapToView(message: MessageAttributesType): boolean { const { body } = message; diff --git a/ts/util/isVideoGoodForStories.ts b/ts/util/isVideoGoodForStories.ts index 14a64a53a9..04f9b030ba 100644 --- a/ts/util/isVideoGoodForStories.ts +++ b/ts/util/isVideoGoodForStories.ts @@ -2,9 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import MP4Box from 'mp4box'; -import { VIDEO_MP4, isVideo } from '../types/MIME.js'; -import { KIBIBYTE, getRenderDetailsForLimit } from '../types/AttachmentSize.js'; -import { explodePromise } from './explodePromise.js'; +import { VIDEO_MP4, isVideo } from '../types/MIME.std.js'; +import { + KIBIBYTE, + getRenderDetailsForLimit, +} from '../types/AttachmentSize.std.js'; +import { explodePromise } from './explodePromise.std.js'; const MAX_VIDEO_DURATION_IN_SEC = 30; diff --git a/ts/util/iterables.ts b/ts/util/iterables.ts index a2077a7a09..4f656b5700 100644 --- a/ts/util/iterables.ts +++ b/ts/util/iterables.ts @@ -3,7 +3,7 @@ /* eslint-disable max-classes-per-file */ -import { getOwn } from './getOwn.js'; +import { getOwn } from './getOwn.std.js'; export function isIterable(value: unknown): value is Iterable { return ( diff --git a/ts/util/keyboard.ts b/ts/util/keyboard.ts index 3801396167..b65686c1d5 100644 --- a/ts/util/keyboard.ts +++ b/ts/util/keyboard.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { LocaleDirection } from '../../app/locale.js'; +import type { LocaleDirection } from '../../app/locale.main.js'; export type LogicalDirection = 'start' | 'end'; export type HorizontalArrowKey = 'ArrowLeft' | 'ArrowRight'; diff --git a/ts/util/leftPaneWidth.ts b/ts/util/leftPaneWidth.ts index e3d15f8c65..0624047fa4 100644 --- a/ts/util/leftPaneWidth.ts +++ b/ts/util/leftPaneWidth.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import lodash from 'lodash'; -import { isSorted } from './isSorted.js'; -import { strictAssert } from './assert.js'; +import { isSorted } from './isSorted.std.js'; +import { strictAssert } from './assert.std.js'; const { clamp } = lodash; diff --git a/ts/util/libphonenumberUtil.ts b/ts/util/libphonenumberUtil.ts index a2c62daefd..1b9f7be506 100644 --- a/ts/util/libphonenumberUtil.ts +++ b/ts/util/libphonenumberUtil.ts @@ -4,7 +4,7 @@ import { instance as libphonenumber, PhoneNumberFormat, -} from './libphonenumberInstance.js'; +} from './libphonenumberInstance.std.js'; const FALLBACK_REGION_CODE = 'ZZ'; diff --git a/ts/util/lint/analyze_exceptions.ts b/ts/util/lint/analyze_exceptions.ts index c5c2b6d555..fea4b4e1aa 100644 --- a/ts/util/lint/analyze_exceptions.ts +++ b/ts/util/lint/analyze_exceptions.ts @@ -4,8 +4,8 @@ import lodash from 'lodash'; import { join } from 'node:path'; -import type { ExceptionType } from './types.js'; -import { loadJSON } from './util.js'; +import type { ExceptionType } from './types.std.js'; +import { loadJSON } from './util.node.js'; const { fromPairs, groupBy, map } = lodash; diff --git a/ts/util/lint/linter.ts b/ts/util/lint/linter.ts index e61f3dc3f4..382a7efc85 100644 --- a/ts/util/lint/linter.ts +++ b/ts/util/lint/linter.ts @@ -8,9 +8,14 @@ import normalizePath from 'normalize-path'; import pMap from 'p-map'; import FastGlob from 'fast-glob'; -import type { ExceptionType, RuleType } from './types.js'; -import { REASONS } from './types.js'; -import { ENCODING, loadJSON, sortExceptions, writeExceptions } from './util.js'; +import type { ExceptionType, RuleType } from './types.std.js'; +import { REASONS } from './types.std.js'; +import { + ENCODING, + loadJSON, + sortExceptions, + writeExceptions, +} from './util.node.js'; const ALL_REASONS = REASONS.join('|'); diff --git a/ts/util/lint/sort_exceptions.ts b/ts/util/lint/sort_exceptions.ts index ea846a99ce..973ba7d051 100644 --- a/ts/util/lint/sort_exceptions.ts +++ b/ts/util/lint/sort_exceptions.ts @@ -3,8 +3,8 @@ import { join } from 'node:path'; -import type { ExceptionType } from './types.js'; -import { loadJSON, writeExceptions } from './util.js'; +import type { ExceptionType } from './types.std.js'; +import { loadJSON, writeExceptions } from './util.node.js'; const exceptionsPath = join(__dirname, 'exceptions.json'); const exceptions: Array = loadJSON(exceptionsPath); diff --git a/ts/util/lint/util.ts b/ts/util/lint/util.ts index 5c46293f5d..e67f2fee68 100644 --- a/ts/util/lint/util.ts +++ b/ts/util/lint/util.ts @@ -5,7 +5,7 @@ import fsExtra from 'fs-extra'; import lodash from 'lodash'; -import type { ExceptionType } from './types.js'; +import type { ExceptionType } from './types.std.js'; const { readJsonSync, writeJsonSync } = fsExtra; diff --git a/ts/util/loadImage.ts b/ts/util/loadImage.ts index fcea2247a3..33bd6cafea 100644 --- a/ts/util/loadImage.ts +++ b/ts/util/loadImage.ts @@ -1,7 +1,7 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { explodePromise } from './explodePromise.js'; +import { explodePromise } from './explodePromise.std.js'; export async function loadImage(src: string): Promise { const { promise, resolve, reject } = explodePromise(); diff --git a/ts/util/loadRecentEmojis.ts b/ts/util/loadRecentEmojis.ts index be121da069..d6dd8edfed 100644 --- a/ts/util/loadRecentEmojis.ts +++ b/ts/util/loadRecentEmojis.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import lodash from 'lodash'; -import { DataReader } from '../sql/Client.js'; +import { DataReader } from '../sql/Client.preload.js'; const { take } = lodash; diff --git a/ts/util/logPadding.ts b/ts/util/logPadding.ts index 19b406ec5b..c1dc7aebe4 100644 --- a/ts/util/logPadding.ts +++ b/ts/util/logPadding.ts @@ -4,7 +4,7 @@ import { Transform } from 'node:stream'; import type { Duplex, Readable } from 'node:stream'; -import { logPadSize } from './logPadSize.js'; +import { logPadSize } from './logPadSize.std.js'; const PADDING_CHUNK_SIZE = 64 * 1024; diff --git a/ts/util/longAttachment.ts b/ts/util/longAttachment.ts index 00652eb36d..fa2baff9ab 100644 --- a/ts/util/longAttachment.ts +++ b/ts/util/longAttachment.ts @@ -1,7 +1,7 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { unicodeSlice } from './unicodeSlice.js'; +import { unicodeSlice } from './unicodeSlice.std.js'; const KIBIBYTE = 1024; const MAX_MESSAGE_BODY_BYTE_LENGTH = 2 * KIBIBYTE; diff --git a/ts/util/longRunningTaskWrapper.tsx b/ts/util/longRunningTaskWrapper.tsx index 85d53b16c8..7a61d0a42f 100644 --- a/ts/util/longRunningTaskWrapper.tsx +++ b/ts/util/longRunningTaskWrapper.tsx @@ -4,16 +4,16 @@ import React, { StrictMode } from 'react'; import { createRoot, type Root } from 'react-dom/client'; -import * as Errors from '../types/errors.js'; -import { createLogger } from '../logging/log.js'; +import * as Errors from '../types/errors.std.js'; +import { createLogger } from '../logging/log.std.js'; // eslint-disable-next-line import/no-restricted-paths -import { ProgressModal } from '../components/ProgressModal.js'; -import { clearTimeoutIfNecessary } from './clearTimeoutIfNecessary.js'; -import { sleep } from './sleep.js'; +import { ProgressModal } from '../components/ProgressModal.dom.js'; +import { clearTimeoutIfNecessary } from './clearTimeoutIfNecessary.std.js'; +import { sleep } from './sleep.std.js'; // eslint-disable-next-line import/no-restricted-paths -import { FunDefaultEnglishEmojiLocalizationProvider } from '../components/fun/FunEmojiLocalizationProvider.js'; +import { FunDefaultEnglishEmojiLocalizationProvider } from '../components/fun/FunEmojiLocalizationProvider.dom.js'; // eslint-disable-next-line import/no-restricted-paths -import { AxoProvider } from '../axo/AxoProvider.js'; +import { AxoProvider } from '../axo/AxoProvider.dom.js'; const log = createLogger('longRunningTaskWrapper'); diff --git a/ts/util/lookupConversationWithoutServiceId.ts b/ts/util/lookupConversationWithoutServiceId.ts index ea18d0fae0..d99c559c2e 100644 --- a/ts/util/lookupConversationWithoutServiceId.ts +++ b/ts/util/lookupConversationWithoutServiceId.ts @@ -3,16 +3,19 @@ import { usernames, LibSignalErrorBase } from '@signalapp/libsignal-client'; -import type { UserNotFoundModalStateType } from '../state/ducks/globalModals.js'; -import { createLogger } from '../logging/log.js'; -import type { AciString } from '../types/ServiceId.js'; -import { getAccountForUsername, cdsLookup } from '../textsecure/WebAPI.js'; -import * as Errors from '../types/errors.js'; -import { ToastType } from '../types/Toast.js'; -import { HTTPError } from '../types/HTTPError.js'; -import { strictAssert } from './assert.js'; -import type { UUIDFetchStateKeyType } from './uuidFetchState.js'; -import { getServiceIdsForE164s } from './getServiceIdsForE164s.js'; +import type { UserNotFoundModalStateType } from '../state/ducks/globalModals.preload.js'; +import { createLogger } from '../logging/log.std.js'; +import type { AciString } from '../types/ServiceId.std.js'; +import { + getAccountForUsername, + cdsLookup, +} from '../textsecure/WebAPI.preload.js'; +import * as Errors from '../types/errors.std.js'; +import { ToastType } from '../types/Toast.dom.js'; +import { HTTPError } from '../types/HTTPError.std.js'; +import { strictAssert } from './assert.std.js'; +import type { UUIDFetchStateKeyType } from './uuidFetchState.std.js'; +import { getServiceIdsForE164s } from './getServiceIdsForE164s.dom.js'; const log = createLogger('lookupConversationWithoutServiceId'); diff --git a/ts/util/makeQuote.ts b/ts/util/makeQuote.ts index 1f761b6006..58bd55ed64 100644 --- a/ts/util/makeQuote.ts +++ b/ts/util/makeQuote.ts @@ -1,25 +1,28 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AttachmentType } from '../types/Attachment.js'; +import type { AttachmentType } from '../types/Attachment.std.js'; import type { MessageAttributesType, QuotedAttachmentType, } from '../model-types.d.ts'; -import type { LinkPreviewType } from '../types/message/LinkPreviews.js'; -import type { StickerType } from '../types/Stickers.js'; -import { IMAGE_JPEG, IMAGE_GIF } from '../types/MIME.js'; -import { getAuthor } from '../messages/sources.js'; -import { getQuoteBodyText } from './getQuoteBodyText.js'; -import { isGIF } from './Attachment.js'; -import { isGiftBadge, isTapToView } from '../state/selectors/message.js'; -import { createLogger } from '../logging/log.js'; -import { map, take, collect } from './iterables.js'; -import { strictAssert } from './assert.js'; -import { loadAttachmentData } from './migrations.js'; -import { getMessageSentTimestamp } from './getMessageSentTimestamp.js'; -import { getLocalAttachmentUrl } from './getLocalAttachmentUrl.js'; -import type { QuotedMessageForComposerType } from '../state/ducks/composer.js'; +import type { LinkPreviewType } from '../types/message/LinkPreviews.std.js'; +import type { StickerType } from '../types/Stickers.preload.js'; +import { IMAGE_JPEG, IMAGE_GIF } from '../types/MIME.std.js'; +import { getAuthor } from '../messages/sources.preload.js'; +import { getQuoteBodyText } from './getQuoteBodyText.std.js'; +import { isGIF } from './Attachment.std.js'; +import { + isGiftBadge, + isTapToView, +} from '../state/selectors/message.preload.js'; +import { createLogger } from '../logging/log.std.js'; +import { map, take, collect } from './iterables.std.js'; +import { strictAssert } from './assert.std.js'; +import { loadAttachmentData } from './migrations.preload.js'; +import { getMessageSentTimestamp } from './getMessageSentTimestamp.std.js'; +import { getLocalAttachmentUrl } from './getLocalAttachmentUrl.std.js'; +import type { QuotedMessageForComposerType } from '../state/ducks/composer.preload.js'; const log = createLogger('makeQuote'); diff --git a/ts/util/mapUtil.ts b/ts/util/mapUtil.ts index acb8d9104c..8fab11ec7d 100644 --- a/ts/util/mapUtil.ts +++ b/ts/util/mapUtil.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { reduce } from './iterables.js'; +import { reduce } from './iterables.std.js'; /** * Like Lodash's `groupBy`, but returns a `Map`. diff --git a/ts/util/markConversationRead.ts b/ts/util/markConversationRead.ts index 53449e6e01..d793d72175 100644 --- a/ts/util/markConversationRead.ts +++ b/ts/util/markConversationRead.ts @@ -4,30 +4,30 @@ import lodash from 'lodash'; import type { ConversationAttributesType } from '../model-types.d.ts'; -import { DataWriter } from '../sql/Client.js'; -import { hasErrors } from '../state/selectors/message.js'; -import { readSyncJobQueue } from '../jobs/readSyncJobQueue.js'; -import { notificationService } from '../services/notifications.js'; -import { update as updateExpiringMessagesService } from '../services/expiringMessagesDeletion.js'; -import { tapToViewMessagesDeletionService } from '../services/tapToViewMessagesDeletionService.js'; -import { isGroup, isDirectConversation } from './whatTypeOfConversation.js'; -import { createLogger } from '../logging/log.js'; -import { getConversationIdForLogging } from './idForLogging.js'; -import { drop } from './drop.js'; -import { isNotNil } from './isNotNil.js'; -import { assertDev } from './assert.js'; -import { isConversationAccepted } from './isConversationAccepted.js'; -import { ReadStatus } from '../messages/MessageReadStatus.js'; +import { DataWriter } from '../sql/Client.preload.js'; +import { hasErrors } from '../state/selectors/message.preload.js'; +import { readSyncJobQueue } from '../jobs/readSyncJobQueue.preload.js'; +import { notificationService } from '../services/notifications.preload.js'; +import { update as updateExpiringMessagesService } from '../services/expiringMessagesDeletion.preload.js'; +import { tapToViewMessagesDeletionService } from '../services/tapToViewMessagesDeletionService.preload.js'; +import { isGroup, isDirectConversation } from './whatTypeOfConversation.dom.js'; +import { createLogger } from '../logging/log.std.js'; +import { getConversationIdForLogging } from './idForLogging.preload.js'; +import { drop } from './drop.std.js'; +import { isNotNil } from './isNotNil.std.js'; +import { assertDev } from './assert.std.js'; +import { isConversationAccepted } from './isConversationAccepted.preload.js'; +import { ReadStatus } from '../messages/MessageReadStatus.std.js'; import { conversationJobQueue, conversationQueueJobEnum, -} from '../jobs/conversationJobQueue.js'; -import { ReceiptType } from '../types/Receipt.js'; -import type { AciString } from '../types/ServiceId.js'; -import { isAciString } from './isAciString.js'; -import type { MessageModel } from '../models/messages.js'; -import { postSaveUpdates } from './cleanup.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from '../jobs/conversationJobQueue.preload.js'; +import { ReceiptType } from '../types/Receipt.std.js'; +import type { AciString } from '../types/ServiceId.std.js'; +import { isAciString } from './isAciString.std.js'; +import type { MessageModel } from '../models/messages.preload.js'; +import { postSaveUpdates } from './cleanup.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const { isNumber, pick } = lodash; diff --git a/ts/util/markOnboardingStoryAsRead.ts b/ts/util/markOnboardingStoryAsRead.ts index 6333e1e12a..a8bf6b9ca1 100644 --- a/ts/util/markOnboardingStoryAsRead.ts +++ b/ts/util/markOnboardingStoryAsRead.ts @@ -1,15 +1,15 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log.js'; -import { DataWriter } from '../sql/Client.js'; -import { getMessageById } from '../messages/getMessageById.js'; -import { isNotNil } from './isNotNil.js'; -import { DurationInSeconds } from './durations/index.js'; -import { markViewed } from '../services/MessageUpdater.js'; -import { storageServiceUploadJob } from '../services/storage.js'; -import { postSaveUpdates } from './cleanup.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import { createLogger } from '../logging/log.std.js'; +import { DataWriter } from '../sql/Client.preload.js'; +import { getMessageById } from '../messages/getMessageById.preload.js'; +import { isNotNil } from './isNotNil.std.js'; +import { DurationInSeconds } from './durations/index.std.js'; +import { markViewed } from '../services/MessageUpdater.preload.js'; +import { storageServiceUploadJob } from '../services/storage.preload.js'; +import { postSaveUpdates } from './cleanup.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const log = createLogger('markOnboardingStoryAsRead'); diff --git a/ts/util/maybeForwardMessages.ts b/ts/util/maybeForwardMessages.ts index b1d60a411a..36a49d9ad6 100644 --- a/ts/util/maybeForwardMessages.ts +++ b/ts/util/maybeForwardMessages.ts @@ -1,35 +1,35 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AttachmentType } from '../types/Attachment.js'; -import type { LinkPreviewWithHydratedData } from '../types/message/LinkPreviews.js'; -import type { QuotedMessageType } from '../model-types.js'; -import { createLogger } from '../logging/log.js'; -import { SafetyNumberChangeSource } from '../types/SafetyNumberChangeSource.js'; -import { blockSendUntilConversationsAreVerified } from './blockSendUntilConversationsAreVerified.js'; +import type { AttachmentType } from '../types/Attachment.std.js'; +import type { LinkPreviewWithHydratedData } from '../types/message/LinkPreviews.std.js'; +import type { QuotedMessageType } from '../model-types.d.ts'; +import { createLogger } from '../logging/log.std.js'; +import { SafetyNumberChangeSource } from '../types/SafetyNumberChangeSource.std.js'; +import { blockSendUntilConversationsAreVerified } from './blockSendUntilConversationsAreVerified.dom.js'; import { getMessageIdForLogging, getConversationIdForLogging, -} from './idForLogging.js'; -import { isNotNil } from './isNotNil.js'; -import { resetLinkPreview } from '../services/LinkPreview.js'; -import { getRecipientsByConversation } from './getRecipientsByConversation.js'; -import type { EmbeddedContactWithHydratedAvatar } from '../types/EmbeddedContact.js'; -import type { DraftBodyRanges } from '../types/BodyRange.js'; -import type { StickerWithHydratedData } from '../types/Stickers.js'; -import { drop } from './drop.js'; +} from './idForLogging.preload.js'; +import { isNotNil } from './isNotNil.std.js'; +import { resetLinkPreview } from '../services/LinkPreview.preload.js'; +import { getRecipientsByConversation } from './getRecipientsByConversation.dom.js'; +import type { EmbeddedContactWithHydratedAvatar } from '../types/EmbeddedContact.std.js'; +import type { DraftBodyRanges } from '../types/BodyRange.std.js'; +import type { StickerWithHydratedData } from '../types/Stickers.preload.js'; +import { drop } from './drop.std.js'; import { loadAttachmentData, loadContactData, loadPreviewData, loadStickerData, -} from './migrations.js'; -import { toLogFormat } from '../types/errors.js'; +} from './migrations.preload.js'; +import { toLogFormat } from '../types/errors.std.js'; import { sortByMessageOrder, type ForwardMessageData, -} from '../types/ForwardDraft.js'; -import { canForward } from '../state/selectors/message.js'; +} from '../types/ForwardDraft.std.js'; +import { canForward } from '../state/selectors/message.preload.js'; const log = createLogger('maybeForwardMessages'); diff --git a/ts/util/messageBatcher.ts b/ts/util/messageBatcher.ts index 6ac938a37a..6653464874 100644 --- a/ts/util/messageBatcher.ts +++ b/ts/util/messageBatcher.ts @@ -2,12 +2,12 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; -import { createWaitBatcher } from './waitBatcher.js'; -import { DataWriter } from '../sql/Client.js'; -import { createLogger } from '../logging/log.js'; -import { postSaveUpdates } from './cleanup.js'; -import { MessageModel } from '../models/messages.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import { createWaitBatcher } from './waitBatcher.std.js'; +import { DataWriter } from '../sql/Client.preload.js'; +import { createLogger } from '../logging/log.std.js'; +import { postSaveUpdates } from './cleanup.preload.js'; +import { MessageModel } from '../models/messages.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const log = createLogger('messageBatcher'); diff --git a/ts/util/messageFilePaths.ts b/ts/util/messageFilePaths.ts index fb18a2b67f..0118ffe0fc 100644 --- a/ts/util/messageFilePaths.ts +++ b/ts/util/messageFilePaths.ts @@ -1,8 +1,8 @@ // Copyright 2018 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { MessageAttributesType } from '../model-types.js'; -import type { AttachmentType } from '../types/Attachment.js'; +import type { MessageAttributesType } from '../model-types.d.ts'; +import type { AttachmentType } from '../types/Attachment.std.js'; export function getFilePathsOwnedByAttachment(attachment: AttachmentType): { externalAttachments: Set; diff --git a/ts/util/mightStillBeOnTransitTier.ts b/ts/util/mightStillBeOnTransitTier.ts new file mode 100644 index 0000000000..1c963a0c22 --- /dev/null +++ b/ts/util/mightStillBeOnTransitTier.ts @@ -0,0 +1,38 @@ +// Copyright 2025 Signal Messenger, LLC +// SPDX-License-Identifier: AGPL-3.0-only + +import type { AttachmentType } from '../types/Attachment.std.js'; +import { isMoreRecentThan } from './timestamp.std.js'; +import { DAY } from './durations/index.std.js'; +import { getMessageQueueTime } from './getMessageQueueTime.dom.js'; + +// Extend range in case the attachment is actually still there (this function is meant to +// be optimistic) +const BUFFER_TIME_ON_TRANSIT_TIER = 5 * DAY; + +export function mightStillBeOnTransitTier( + attachment: Pick +): boolean { + if (!attachment.cdnKey) { + return false; + } + if (attachment.cdnNumber == null) { + return false; + } + + if (!attachment.uploadTimestamp) { + // Let's be conservative and still assume it might be downloadable + return true; + } + + if ( + isMoreRecentThan( + attachment.uploadTimestamp, + getMessageQueueTime() + BUFFER_TIME_ON_TRANSIT_TIER + ) + ) { + return true; + } + + return false; +} diff --git a/ts/util/migrateColor.ts b/ts/util/migrateColor.ts index f5cea99974..3c6e2eb797 100644 --- a/ts/util/migrateColor.ts +++ b/ts/util/migrateColor.ts @@ -1,10 +1,10 @@ // Copyright 2018 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { AvatarColors } from '../types/Colors.js'; -import type { ConversationAttributesType } from '../model-types.js'; -import type { AvatarColorType, CustomColorType } from '../types/Colors.js'; -import { generateAvatarColor } from '../Crypto.js'; +import { AvatarColors } from '../types/Colors.std.js'; +import type { ConversationAttributesType } from '../model-types.d.ts'; +import type { AvatarColorType, CustomColorType } from '../types/Colors.std.js'; +import { generateAvatarColor } from '../Crypto.node.js'; const NEW_COLOR_NAMES = new Set(AvatarColors); diff --git a/ts/util/migrations.ts b/ts/util/migrations.ts index 76eb419774..16cfe3294f 100644 --- a/ts/util/migrations.ts +++ b/ts/util/migrations.ts @@ -12,15 +12,15 @@ import { writeNewAttachmentData as doWriteNewAttachmentData, createDeleter, copyIntoAttachmentsDirectory, -} from '../windows/main/attachments.js'; +} from '../windows/main/attachments.preload.js'; import { getImageDimensions, makeImageThumbnail, makeObjectUrl, makeVideoScreenshot, revokeObjectUrl, -} from '../types/VisualAttachment.js'; -import { loadData } from './Attachment.js'; +} from '../types/VisualAttachment.dom.js'; +import { loadData } from './Attachment.std.js'; import { loadContactData as doLoadContactData, loadPreviewData as doLoadPreviewData, @@ -31,16 +31,16 @@ import { deleteAllExternalFiles, createAttachmentLoader, upgradeSchema, -} from '../types/Message2.js'; +} from '../types/Message2.preload.js'; import type { AttachmentType, AddressableAttachmentType, LocalAttachmentV2Type, -} from '../types/Attachment.js'; -import type { MessageAttachmentType } from '../types/AttachmentDownload.js'; +} from '../types/Attachment.std.js'; +import type { MessageAttachmentType } from '../types/AttachmentDownload.std.js'; import type { MessageAttributesType } from '../model-types.d.ts'; -import { createLogger } from '../logging/log.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import { createLogger } from '../logging/log.std.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; import { ATTACHMENTS_PATH, STICKERS_PATH, @@ -49,7 +49,7 @@ import { TEMP_PATH, AVATARS_PATH, DOWNLOADS_PATH, -} from './basePaths.js'; +} from './basePaths.preload.js'; const logger = createLogger('migrations'); diff --git a/ts/util/missingCaseError.ts b/ts/util/missingCaseError.ts index 62093f666e..8edd8b30f6 100644 --- a/ts/util/missingCaseError.ts +++ b/ts/util/missingCaseError.ts @@ -1,7 +1,7 @@ // Copyright 2018 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { reallyJsonStringify } from './reallyJsonStringify.js'; +import { reallyJsonStringify } from './reallyJsonStringify.std.js'; // `missingCaseError` is useful for compile-time checking that all `case`s in // a `switch` statement have been handled, e.g. diff --git a/ts/util/modifyTargetMessage.ts b/ts/util/modifyTargetMessage.ts index 42291aeec1..13f046862d 100644 --- a/ts/util/modifyTargetMessage.ts +++ b/ts/util/modifyTargetMessage.ts @@ -3,51 +3,54 @@ import lodash from 'lodash'; import PQueue from 'p-queue'; -import type { ConversationModel } from '../models/conversations.js'; -import type { MessageModel } from '../models/messages.js'; -import type { SendStateByConversationId } from '../messages/MessageSendState.js'; +import type { ConversationModel } from '../models/conversations.preload.js'; +import type { MessageModel } from '../models/messages.preload.js'; +import type { SendStateByConversationId } from '../messages/MessageSendState.std.js'; -import * as Edits from '../messageModifiers/Edits.js'; -import { createLogger } from '../logging/log.js'; -import * as Deletes from '../messageModifiers/Deletes.js'; -import * as DeletesForMe from '../messageModifiers/DeletesForMe.js'; -import * as MessageReceipts from '../messageModifiers/MessageReceipts.js'; -import * as Reactions from '../messageModifiers/Reactions.js'; -import * as ReadSyncs from '../messageModifiers/ReadSyncs.js'; -import * as ViewOnceOpenSyncs from '../messageModifiers/ViewOnceOpenSyncs.js'; -import * as ViewSyncs from '../messageModifiers/ViewSyncs.js'; -import { ReadStatus } from '../messages/MessageReadStatus.js'; -import { SeenStatus } from '../MessageSeenStatus.js'; +import * as Edits from '../messageModifiers/Edits.preload.js'; +import { createLogger } from '../logging/log.std.js'; +import * as Deletes from '../messageModifiers/Deletes.preload.js'; +import * as DeletesForMe from '../messageModifiers/DeletesForMe.preload.js'; +import * as MessageReceipts from '../messageModifiers/MessageReceipts.preload.js'; +import * as Reactions from '../messageModifiers/Reactions.preload.js'; +import * as ReadSyncs from '../messageModifiers/ReadSyncs.preload.js'; +import * as ViewOnceOpenSyncs from '../messageModifiers/ViewOnceOpenSyncs.preload.js'; +import * as ViewSyncs from '../messageModifiers/ViewSyncs.preload.js'; +import { ReadStatus } from '../messages/MessageReadStatus.std.js'; +import { SeenStatus } from '../MessageSeenStatus.std.js'; import { SendActionType, sendStateReducer, -} from '../messages/MessageSendState.js'; -import { canConversationBeUnarchived } from './canConversationBeUnarchived.js'; -import { deleteForEveryone } from './deleteForEveryone.js'; -import { drop } from './drop.js'; -import { handleEditMessage } from './handleEditMessage.js'; -import { isGroup } from './whatTypeOfConversation.js'; -import { isStory, isTapToView } from '../state/selectors/message.js'; -import { getOwn } from './getOwn.js'; -import { getSourceServiceId } from '../messages/sources.js'; -import { missingCaseError } from './missingCaseError.js'; -import { reduce } from './iterables.js'; -import { strictAssert } from './assert.js'; -import { deleteAttachmentData, deleteDownloadData } from './migrations.js'; +} from '../messages/MessageSendState.std.js'; +import { canConversationBeUnarchived } from './canConversationBeUnarchived.preload.js'; +import { deleteForEveryone } from './deleteForEveryone.preload.js'; +import { drop } from './drop.std.js'; +import { handleEditMessage } from './handleEditMessage.preload.js'; +import { isGroup } from './whatTypeOfConversation.dom.js'; +import { isStory, isTapToView } from '../state/selectors/message.preload.js'; +import { getOwn } from './getOwn.std.js'; +import { getSourceServiceId } from '../messages/sources.preload.js'; +import { missingCaseError } from './missingCaseError.std.js'; +import { reduce } from './iterables.std.js'; +import { strictAssert } from './assert.std.js'; +import { + deleteAttachmentData, + deleteDownloadData, +} from './migrations.preload.js'; import { applyDeleteAttachmentFromMessage, applyDeleteMessage, -} from './deleteForMe.js'; -import { getMessageIdForLogging } from './idForLogging.js'; -import { markViewOnceMessageViewed } from '../services/MessageUpdater.js'; -import { handleReaction } from '../messageModifiers/Reactions.js'; +} from './deleteForMe.preload.js'; +import { getMessageIdForLogging } from './idForLogging.preload.js'; +import { markViewOnceMessageViewed } from '../services/MessageUpdater.preload.js'; +import { handleReaction } from '../messageModifiers/Reactions.preload.js'; import { drainCachedTerminatesForMessage as drainCachedPollTerminatesForMessage, drainCachedVotesForMessage as drainCachedPollVotesForMessage, handlePollTerminate, handlePollVote, -} from '../messageModifiers/Polls.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from '../messageModifiers/Polls.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const { isEqual } = lodash; diff --git a/ts/util/nicknames.ts b/ts/util/nicknames.ts index 6f2f54523e..39cdfef052 100644 --- a/ts/util/nicknames.ts +++ b/ts/util/nicknames.ts @@ -1,8 +1,8 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationType } from '../state/ducks/conversations.js'; -import { isSignalConversation } from './isSignalConversation.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import { isSignalConversation } from './isSignalConversation.dom.js'; export function canHaveNicknameAndNote( conversation: ConversationType diff --git a/ts/util/normalizeAci.ts b/ts/util/normalizeAci.ts index 685d09bc7b..1ec2052a51 100644 --- a/ts/util/normalizeAci.ts +++ b/ts/util/normalizeAci.ts @@ -1,11 +1,11 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { AciString } from '../types/ServiceId.js'; -import type { LoggerType } from '../types/Logging.js'; -import { createLogger } from '../logging/log.js'; -import { isAciString } from './isAciString.js'; -import { strictAssert } from './assert.js'; +import type { AciString } from '../types/ServiceId.std.js'; +import type { LoggerType } from '../types/Logging.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { isAciString } from './isAciString.std.js'; +import { strictAssert } from './assert.std.js'; const log = createLogger('normalizeAci'); diff --git a/ts/util/numbers.ts b/ts/util/numbers.ts index aca02c0461..879aa53073 100644 --- a/ts/util/numbers.ts +++ b/ts/util/numbers.ts @@ -1,6 +1,6 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { strictAssert } from './assert.js'; +import { strictAssert } from './assert.std.js'; export function safeParseNumber(value: number | string): number | null { if (typeof value === 'number') { diff --git a/ts/util/onCallEventSync.ts b/ts/util/onCallEventSync.ts index a8099bde22..2cc1b2741d 100644 --- a/ts/util/onCallEventSync.ts +++ b/ts/util/onCallEventSync.ts @@ -1,13 +1,13 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { CallEventSyncEvent } from '../textsecure/messageReceiverEvents.js'; -import { createLogger } from '../logging/log.js'; +import type { CallEventSyncEvent } from '../textsecure/messageReceiverEvents.std.js'; +import { createLogger } from '../logging/log.std.js'; import { peerIdToLog, updateCallHistoryFromRemoteEvent, -} from './callDisposition.js'; -import { CallMode } from '../types/CallDisposition.js'; +} from './callDisposition.preload.js'; +import { CallMode } from '../types/CallDisposition.std.js'; const log = createLogger('onCallEventSync'); diff --git a/ts/util/onCallLinkUpdateSync.ts b/ts/util/onCallLinkUpdateSync.ts index 4a11b0195f..523bc9e47a 100644 --- a/ts/util/onCallLinkUpdateSync.ts +++ b/ts/util/onCallLinkUpdateSync.ts @@ -2,14 +2,17 @@ // SPDX-License-Identifier: AGPL-3.0-only import { CallLinkRootKey } from '@signalapp/ringrtc'; -import type { CallLinkUpdateSyncEvent } from '../textsecure/messageReceiverEvents.js'; -import { createLogger } from '../logging/log.js'; -import * as Errors from '../types/errors.js'; -import { fromAdminKeyBytes } from './callLinks.js'; -import { fromEpochBytes, getRoomIdFromRootKey } from './callLinksRingrtc.js'; -import { strictAssert } from './assert.js'; -import { CallLinkUpdateSyncType } from '../types/CallLink.js'; -import { DataWriter } from '../sql/Client.js'; +import type { CallLinkUpdateSyncEvent } from '../textsecure/messageReceiverEvents.std.js'; +import { createLogger } from '../logging/log.std.js'; +import * as Errors from '../types/errors.std.js'; +import { fromAdminKeyBytes } from './callLinks.std.js'; +import { + fromEpochBytes, + getRoomIdFromRootKey, +} from './callLinksRingrtc.node.js'; +import { strictAssert } from './assert.std.js'; +import { CallLinkUpdateSyncType } from '../types/CallLink.std.js'; +import { DataWriter } from '../sql/Client.preload.js'; const log = createLogger('onCallLinkUpdateSync'); diff --git a/ts/util/onCallLogEventSync.ts b/ts/util/onCallLogEventSync.ts index ba82629d6f..fb7db316c8 100644 --- a/ts/util/onCallLogEventSync.ts +++ b/ts/util/onCallLogEventSync.ts @@ -1,14 +1,14 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { CallLogEventSyncEvent } from '../textsecure/messageReceiverEvents.js'; -import { createLogger } from '../logging/log.js'; -import { DataWriter } from '../sql/Client.js'; -import type { CallLogEventTarget } from '../types/CallDisposition.js'; -import { CallLogEvent } from '../types/CallDisposition.js'; -import { missingCaseError } from './missingCaseError.js'; -import { strictAssert } from './assert.js'; -import { updateDeletedMessages } from './callDisposition.js'; +import type { CallLogEventSyncEvent } from '../textsecure/messageReceiverEvents.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { DataWriter } from '../sql/Client.preload.js'; +import type { CallLogEventTarget } from '../types/CallDisposition.std.js'; +import { CallLogEvent } from '../types/CallDisposition.std.js'; +import { missingCaseError } from './missingCaseError.std.js'; +import { strictAssert } from './assert.std.js'; +import { updateDeletedMessages } from './callDisposition.preload.js'; const log = createLogger('onCallLogEventSync'); diff --git a/ts/util/onDeviceNameChangeSync.ts b/ts/util/onDeviceNameChangeSync.ts index f53c6e3a82..3c831443b1 100644 --- a/ts/util/onDeviceNameChangeSync.ts +++ b/ts/util/onDeviceNameChangeSync.ts @@ -2,16 +2,16 @@ // SPDX-License-Identifier: AGPL-3.0-only import PQueue from 'p-queue'; -import type { DeviceNameChangeSyncEvent } from '../textsecure/messageReceiverEvents.js'; -import { getDevices } from '../textsecure/WebAPI.js'; -import { MINUTE } from './durations/index.js'; -import { strictAssert } from './assert.js'; -import { parseIntOrThrow } from './parseIntOrThrow.js'; -import { createLogger } from '../logging/log.js'; -import { toLogFormat } from '../types/errors.js'; -import { drop } from './drop.js'; -import { itemStorage } from '../textsecure/Storage.js'; -import { accountManager } from '../textsecure/AccountManager.js'; +import type { DeviceNameChangeSyncEvent } from '../textsecure/messageReceiverEvents.std.js'; +import { getDevices } from '../textsecure/WebAPI.preload.js'; +import { MINUTE } from './durations/index.std.js'; +import { strictAssert } from './assert.std.js'; +import { parseIntOrThrow } from './parseIntOrThrow.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { toLogFormat } from '../types/errors.std.js'; +import { drop } from './drop.std.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; +import { accountManager } from '../textsecure/AccountManager.preload.js'; const log = createLogger('onDeviceNameChangeSync'); diff --git a/ts/util/onStoryRecipientUpdate.ts b/ts/util/onStoryRecipientUpdate.ts index 4032da7281..dcec3f9d07 100644 --- a/ts/util/onStoryRecipientUpdate.ts +++ b/ts/util/onStoryRecipientUpdate.ts @@ -2,19 +2,19 @@ // SPDX-License-Identifier: AGPL-3.0-only import lodash from 'lodash'; -import { DataReader } from '../sql/Client.js'; -import type { StoryRecipientUpdateEvent } from '../textsecure/messageReceiverEvents.js'; -import { normalizeStoryDistributionId } from '../types/StoryDistributionId.js'; -import { createLogger } from '../logging/log.js'; -import { SendStatus } from '../messages/MessageSendState.js'; -import { getConversationIdForLogging } from './idForLogging.js'; -import { isStory } from '../state/selectors/message.js'; -import { queueUpdateMessage } from './messageBatcher.js'; -import { isMe } from './whatTypeOfConversation.js'; -import { drop } from './drop.js'; -import { fromServiceIdBinaryOrString } from './ServiceId.js'; -import { handleDeleteForEveryone } from './deleteForEveryone.js'; -import { MessageModel } from '../models/messages.js'; +import { DataReader } from '../sql/Client.preload.js'; +import type { StoryRecipientUpdateEvent } from '../textsecure/messageReceiverEvents.std.js'; +import { normalizeStoryDistributionId } from '../types/StoryDistributionId.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { SendStatus } from '../messages/MessageSendState.std.js'; +import { getConversationIdForLogging } from './idForLogging.preload.js'; +import { isStory } from '../state/selectors/message.preload.js'; +import { queueUpdateMessage } from './messageBatcher.preload.js'; +import { isMe } from './whatTypeOfConversation.dom.js'; +import { drop } from './drop.std.js'; +import { fromServiceIdBinaryOrString } from './ServiceId.node.js'; +import { handleDeleteForEveryone } from './deleteForEveryone.preload.js'; +import { MessageModel } from '../models/messages.preload.js'; const { isEqual } = lodash; diff --git a/ts/util/openLinkInWebBrowser.ts b/ts/util/openLinkInWebBrowser.ts index 39c760efa6..230399db49 100644 --- a/ts/util/openLinkInWebBrowser.ts +++ b/ts/util/openLinkInWebBrowser.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { isValidLink } from '../types/LinkPreview.js'; +import { isValidLink } from '../types/LinkPreview.std.js'; export function openLinkInWebBrowser(url: string): void { if (!isValidLink(url)) { diff --git a/ts/util/os/osMain.ts b/ts/util/os/osMain.ts index 64d6d84674..b29b2f2a48 100644 --- a/ts/util/os/osMain.ts +++ b/ts/util/os/osMain.ts @@ -3,7 +3,7 @@ import os from 'node:os'; import fsExtra from 'fs-extra'; -import { getOSFunctions } from './shared.js'; +import { getOSFunctions } from './shared.std.js'; const { readFileSync } = fsExtra; diff --git a/ts/util/os/osPreload.ts b/ts/util/os/osPreload.ts index efa066f099..3bc45da99c 100644 --- a/ts/util/os/osPreload.ts +++ b/ts/util/os/osPreload.ts @@ -1,8 +1,8 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { config } from '../../context/config.js'; -import { getOSFunctions } from './shared.js'; +import { config } from '../../context/config.preload.js'; +import { getOSFunctions } from './shared.std.js'; const OS = getOSFunctions(config.osRelease); diff --git a/ts/util/os/promptOSAuthMain.ts b/ts/util/os/promptOSAuthMain.ts index e99a23fdbf..a1f3f3c0ab 100644 --- a/ts/util/os/promptOSAuthMain.ts +++ b/ts/util/os/promptOSAuthMain.ts @@ -8,9 +8,9 @@ import { requestVerification as requestVerificationWindowsUcv, } from '@signalapp/windows-ucv'; -import { createLogger } from '../../logging/log.js'; -import OS from './osMain.js'; -import { missingCaseError } from '../missingCaseError.js'; +import { createLogger } from '../../logging/log.std.js'; +import OS from './osMain.node.js'; +import { missingCaseError } from '../missingCaseError.std.js'; const log = createLogger('promptOSAuthMain'); diff --git a/ts/util/parseIntWithFallback.ts b/ts/util/parseIntWithFallback.ts index 2caf7ec921..98a89ab6c1 100644 --- a/ts/util/parseIntWithFallback.ts +++ b/ts/util/parseIntWithFallback.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { parseIntOrThrow } from './parseIntOrThrow.js'; +import { parseIntOrThrow } from './parseIntOrThrow.std.js'; export function parseIntWithFallback(value: unknown, fallback: number): number { try { diff --git a/ts/util/parseRetryAfter.ts b/ts/util/parseRetryAfter.ts index a4322606b3..c15cdb8b6f 100644 --- a/ts/util/parseRetryAfter.ts +++ b/ts/util/parseRetryAfter.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { SECOND, MINUTE } from './durations/index.js'; -import { isNormalNumber } from './isNormalNumber.js'; +import { SECOND, MINUTE } from './durations/index.std.js'; +import { isNormalNumber } from './isNormalNumber.std.js'; const DEFAULT_RETRY_AFTER = MINUTE; const MINIMAL_RETRY_AFTER = SECOND; diff --git a/ts/util/pemToDer.ts b/ts/util/pemToDer.ts index e3cc866e3c..f6e4825b28 100644 --- a/ts/util/pemToDer.ts +++ b/ts/util/pemToDer.ts @@ -1,7 +1,7 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import * as Bytes from '../Bytes.js'; +import * as Bytes from '../Bytes.std.js'; export function pemToDer(pem: string): Uint8Array { const pemContent = pem diff --git a/ts/util/phoneNumberDiscoverability.ts b/ts/util/phoneNumberDiscoverability.ts index b2b57248b2..85bf0a037b 100644 --- a/ts/util/phoneNumberDiscoverability.ts +++ b/ts/util/phoneNumberDiscoverability.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { makeEnumParser } from './enum.js'; +import { makeEnumParser } from './enum.std.js'; // These strings are saved to disk, so be careful when changing them. export enum PhoneNumberDiscoverability { diff --git a/ts/util/phoneNumberSharingMode.ts b/ts/util/phoneNumberSharingMode.ts index 50c4000768..d8a01b1816 100644 --- a/ts/util/phoneNumberSharingMode.ts +++ b/ts/util/phoneNumberSharingMode.ts @@ -6,10 +6,10 @@ import type { ConversationAttributesType } from '../model-types.d.ts'; import { PhoneNumberSharingMode, parsePhoneNumberSharingMode, -} from '../types/PhoneNumberSharingMode.js'; -import { missingCaseError } from './missingCaseError.js'; -import { isDirectConversation, isMe } from './whatTypeOfConversation.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from '../types/PhoneNumberSharingMode.std.js'; +import { missingCaseError } from './missingCaseError.std.js'; +import { isDirectConversation, isMe } from './whatTypeOfConversation.dom.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; export const isSharingPhoneNumberWithEverybody = (): boolean => { const phoneNumberSharingMode = parsePhoneNumberSharingMode( diff --git a/ts/util/preload.ts b/ts/util/preload.ts index a1cd5b68e6..e570e6b94a 100644 --- a/ts/util/preload.ts +++ b/ts/util/preload.ts @@ -3,14 +3,14 @@ import { ipcRenderer } from 'electron'; -import { strictAssert } from './assert.js'; -import * as Errors from '../types/errors.js'; -import type { UnwrapPromise } from '../types/Util.js'; +import { strictAssert } from './assert.std.js'; +import * as Errors from '../types/errors.std.js'; +import type { UnwrapPromise } from '../types/Util.std.js'; import type { IPCEventsCallbacksType, IPCEventsValuesType, -} from './createIPCEvents.js'; -import type { SystemTraySetting } from '../types/SystemTraySetting.js'; +} from './createIPCEvents.preload.js'; +import type { SystemTraySetting } from '../types/SystemTraySetting.std.js'; type SettingOptionsType = { getter?: boolean; diff --git a/ts/util/privacy.ts b/ts/util/privacy.ts index 625f043c49..9201a52bb4 100644 --- a/ts/util/privacy.ts +++ b/ts/util/privacy.ts @@ -9,7 +9,7 @@ import lodashFp from 'lodash/fp.js'; import lodash from 'lodash'; import type { ExtendedStorageID } from '../types/StorageService.d.ts'; -import type { ConversationModel } from '../models/conversations.js'; +import type { ConversationModel } from '../models/conversations.preload.js'; export const APP_ROOT_PATH = path.join(__dirname, '..', '..'); const { escapeRegExp, isString, isRegExp } = lodash; diff --git a/ts/util/processAttachment.ts b/ts/util/processAttachment.ts index ec9690def3..00d7cbb138 100644 --- a/ts/util/processAttachment.ts +++ b/ts/util/processAttachment.ts @@ -3,26 +3,29 @@ import { v4 as generateUuid } from 'uuid'; -import { createLogger } from '../logging/log.js'; +import { createLogger } from '../logging/log.std.js'; import type { AttachmentType, InMemoryAttachmentDraftType, -} from '../types/Attachment.js'; +} from '../types/Attachment.std.js'; import { getMaximumOutgoingAttachmentSizeInKb, getRenderDetailsForLimit, KIBIBYTE, -} from '../types/AttachmentSize.js'; -import * as Errors from '../types/errors.js'; -import { getValue as getRemoteConfigValue } from '../RemoteConfig.js'; -import { fileToBytes } from './fileToBytes.js'; -import { handleImageAttachment } from './handleImageAttachment.js'; -import { handleVideoAttachment } from './handleVideoAttachment.js'; -import { isHeic, stringToMIMEType } from '../types/MIME.js'; -import { ToastType } from '../types/Toast.js'; -import { isImageTypeSupported, isVideoTypeSupported } from './GoogleChrome.js'; -import { getAttachmentCiphertextSize } from './AttachmentCrypto.js'; -import { MediaTier } from '../types/AttachmentDownload.js'; +} from '../types/AttachmentSize.std.js'; +import * as Errors from '../types/errors.std.js'; +import { getValue as getRemoteConfigValue } from '../RemoteConfig.dom.js'; +import { fileToBytes } from './fileToBytes.std.js'; +import { handleImageAttachment } from './handleImageAttachment.preload.js'; +import { handleVideoAttachment } from './handleVideoAttachment.preload.js'; +import { isHeic, stringToMIMEType } from '../types/MIME.std.js'; +import { ToastType } from '../types/Toast.dom.js'; +import { + isImageTypeSupported, + isVideoTypeSupported, +} from './GoogleChrome.std.js'; +import { getAttachmentCiphertextSize } from './AttachmentCrypto.std.js'; +import { MediaTier } from '../types/AttachmentDownload.std.js'; const log = createLogger('processAttachment'); diff --git a/ts/util/processImageFile.ts b/ts/util/processImageFile.ts index 9f77eb9a66..ded5363bf1 100644 --- a/ts/util/processImageFile.ts +++ b/ts/util/processImageFile.ts @@ -3,7 +3,7 @@ import type { LoadImageOptions } from 'blueimp-load-image'; import loadImage from 'blueimp-load-image'; -import { canvasToBytes } from './canvasToBytes.js'; +import { canvasToBytes } from './canvasToBytes.std.js'; export async function processImageFile(file: File): Promise { const { image } = await loadImage(file, { diff --git a/ts/util/promptOSAuth.ts b/ts/util/promptOSAuth.ts index 3c90dec0c8..884797708e 100644 --- a/ts/util/promptOSAuth.ts +++ b/ts/util/promptOSAuth.ts @@ -5,7 +5,7 @@ import { ipcRenderer } from 'electron'; import type { PromptOSAuthReasonType, PromptOSAuthResultType, -} from './os/promptOSAuthMain.js'; +} from './os/promptOSAuthMain.main.js'; export async function promptOSAuth( reason: PromptOSAuthReasonType diff --git a/ts/util/queueAttachmentDownloads.ts b/ts/util/queueAttachmentDownloads.ts index 6b30309a5c..3c8e52e334 100644 --- a/ts/util/queueAttachmentDownloads.ts +++ b/ts/util/queueAttachmentDownloads.ts @@ -1,24 +1,24 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log.js'; -import { isAudio, isImage, isLongMessage, isVideo } from '../types/MIME.js'; -import { getMessageIdForLogging } from './idForLogging.js'; +import { createLogger } from '../logging/log.std.js'; +import { isAudio, isImage, isLongMessage, isVideo } from '../types/MIME.std.js'; +import { getMessageIdForLogging } from './idForLogging.preload.js'; import { copyStickerToAttachments, savePackMetadata, getStickerPackStatus, -} from '../types/Stickers.js'; -import { DataWriter } from '../sql/Client.js'; +} from '../types/Stickers.preload.js'; +import { DataWriter } from '../sql/Client.preload.js'; -import type { AttachmentType, ThumbnailType } from '../types/Attachment.js'; -import type { EmbeddedContactType } from '../types/EmbeddedContact.js'; +import type { AttachmentType, ThumbnailType } from '../types/Attachment.std.js'; +import type { EmbeddedContactType } from '../types/EmbeddedContact.std.js'; import type { EditHistoryType, MessageAttributesType, QuotedMessageType, } from '../model-types.d.ts'; -import * as Errors from '../types/errors.js'; +import * as Errors from '../types/errors.std.js'; import { isDownloading, isDownloaded, @@ -27,29 +27,29 @@ import { getCachedAttachmentBySignature, cacheAttachmentBySignature, getUndownloadedAttachmentSignature, -} from './Attachment.js'; -import { AttachmentDownloadUrgency } from '../types/AttachmentDownload.js'; -import type { StickerType } from '../types/Stickers.js'; -import type { LinkPreviewType } from '../types/message/LinkPreviews.js'; -import { strictAssert } from './assert.js'; -import { isNotNil } from './isNotNil.js'; -import { AttachmentDownloadManager } from '../jobs/AttachmentDownloadManager.js'; -import { AttachmentDownloadSource } from '../sql/Interface.js'; -import type { MessageModel } from '../models/messages.js'; -import type { ConversationModel } from '../models/conversations.js'; -import { isOutgoing, isStory } from '../messages/helpers.js'; -import { shouldDownloadStory } from './shouldDownloadStory.js'; -import { hasAttachmentDownloads } from './hasAttachmentDownloads.js'; +} from './Attachment.std.js'; +import { AttachmentDownloadUrgency } from '../types/AttachmentDownload.std.js'; +import type { StickerType } from '../types/Stickers.preload.js'; +import type { LinkPreviewType } from '../types/message/LinkPreviews.std.js'; +import { strictAssert } from './assert.std.js'; +import { isNotNil } from './isNotNil.std.js'; +import { AttachmentDownloadManager } from '../jobs/AttachmentDownloadManager.preload.js'; +import { AttachmentDownloadSource } from '../sql/Interface.std.js'; +import type { MessageModel } from '../models/messages.preload.js'; +import type { ConversationModel } from '../models/conversations.preload.js'; +import { isOutgoing, isStory } from '../messages/helpers.std.js'; +import { shouldDownloadStory } from './shouldDownloadStory.preload.js'; +import { hasAttachmentDownloads } from './hasAttachmentDownloads.std.js'; import { addToAttachmentDownloadQueue, shouldUseAttachmentDownloadQueue, -} from './attachmentDownloadQueue.js'; -import { queueUpdateMessage } from './messageBatcher.js'; -import type { LoggerType } from '../types/Logging.js'; +} from './attachmentDownloadQueue.preload.js'; +import { queueUpdateMessage } from './messageBatcher.preload.js'; +import type { LoggerType } from '../types/Logging.std.js'; import { itemStorage, DEFAULT_AUTO_DOWNLOAD_ATTACHMENT, -} from '../textsecure/Storage.js'; +} from '../textsecure/Storage.preload.js'; const defaultLogger = createLogger('queueAttachmentDownloads'); diff --git a/ts/util/randomBlurHash.ts b/ts/util/randomBlurHash.ts index 67b9e49e01..c8e1375d4b 100644 --- a/ts/util/randomBlurHash.ts +++ b/ts/util/randomBlurHash.ts @@ -3,7 +3,7 @@ import { encode } from 'blurhash'; -import { hslToRGB } from './hslToRGB.js'; +import { hslToRGB } from './hslToRGB.std.js'; export function randomBlurHash(): string { const data = new Uint8ClampedArray(2 * 2 * 4); diff --git a/ts/util/registration.ts b/ts/util/registration.ts index d820c2c1c0..542df555c2 100644 --- a/ts/util/registration.ts +++ b/ts/util/registration.ts @@ -1,6 +1,6 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { itemStorage } from '../textsecure/Storage.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; export async function markEverDone(): Promise { await itemStorage.put('chromiumRegistrationDoneEver', ''); diff --git a/ts/util/removePendingMember.ts b/ts/util/removePendingMember.ts index bc73c5ea56..75487399b7 100644 --- a/ts/util/removePendingMember.ts +++ b/ts/util/removePendingMember.ts @@ -2,13 +2,13 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { ConversationAttributesType } from '../model-types.d.ts'; -import type { SignalService as Proto } from '../protobuf/index.js'; -import type { ServiceIdString } from '../types/ServiceId.js'; -import { buildDeletePendingMemberChange } from '../groups.js'; -import { createLogger } from '../logging/log.js'; -import { getConversationIdForLogging } from './idForLogging.js'; -import { isMemberPending } from './groupMembershipUtils.js'; -import { isNotNil } from './isNotNil.js'; +import type { SignalService as Proto } from '../protobuf/index.std.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; +import { buildDeletePendingMemberChange } from '../groups.preload.js'; +import { createLogger } from '../logging/log.std.js'; +import { getConversationIdForLogging } from './idForLogging.preload.js'; +import { isMemberPending } from './groupMembershipUtils.preload.js'; +import { isNotNil } from './isNotNil.std.js'; const log = createLogger('removePendingMember'); diff --git a/ts/util/resolveAttachmentDraftData.ts b/ts/util/resolveAttachmentDraftData.ts index d93f0f0161..7a9191da4e 100644 --- a/ts/util/resolveAttachmentDraftData.ts +++ b/ts/util/resolveAttachmentDraftData.ts @@ -1,9 +1,9 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log.js'; -import type { AttachmentType } from '../types/Attachment.js'; -import { readDraftData } from './migrations.js'; +import { createLogger } from '../logging/log.std.js'; +import type { AttachmentType } from '../types/Attachment.std.js'; +import { readDraftData } from './migrations.preload.js'; const log = createLogger('resolveAttachmentDraftData'); diff --git a/ts/util/resolveDraftAttachmentOnDisk.ts b/ts/util/resolveDraftAttachmentOnDisk.ts index 87279fef98..159cd59835 100644 --- a/ts/util/resolveDraftAttachmentOnDisk.ts +++ b/ts/util/resolveDraftAttachmentOnDisk.ts @@ -1,14 +1,14 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log.js'; -import type { AttachmentDraftType } from '../types/Attachment.js'; -import { isVideoAttachment } from './Attachment.js'; +import { createLogger } from '../logging/log.std.js'; +import type { AttachmentDraftType } from '../types/Attachment.std.js'; +import { isVideoAttachment } from './Attachment.std.js'; import { getLocalAttachmentUrl, AttachmentDisposition, -} from './getLocalAttachmentUrl.js'; -import { getAbsoluteDraftPath } from './migrations.js'; +} from './getLocalAttachmentUrl.std.js'; +import { getAbsoluteDraftPath } from './migrations.preload.js'; const log = createLogger('resolveDraftAttachmentOnDisk'); diff --git a/ts/util/resolveStorySendStatus.ts b/ts/util/resolveStorySendStatus.ts index bd691b54e3..3de7105c48 100644 --- a/ts/util/resolveStorySendStatus.ts +++ b/ts/util/resolveStorySendStatus.ts @@ -1,10 +1,14 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { StorySendStateType } from '../types/Stories.js'; -import { ResolvedSendStatus } from '../types/Stories.js'; -import { isFailed, isPending, isSent } from '../messages/MessageSendState.js'; -import { softAssert } from './assert.js'; +import type { StorySendStateType } from '../types/Stories.std.js'; +import { ResolvedSendStatus } from '../types/Stories.std.js'; +import { + isFailed, + isPending, + isSent, +} from '../messages/MessageSendState.std.js'; +import { softAssert } from './assert.std.js'; export function resolveStorySendStatus( sendStates: Array diff --git a/ts/util/ringrtc/nonRenderedRemoteParticipant.ts b/ts/util/ringrtc/nonRenderedRemoteParticipant.ts index e2b2a0ac50..3f3230bf43 100644 --- a/ts/util/ringrtc/nonRenderedRemoteParticipant.ts +++ b/ts/util/ringrtc/nonRenderedRemoteParticipant.ts @@ -1,7 +1,7 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { GroupCallVideoRequest } from '../../types/Calling.js'; +import type { GroupCallVideoRequest } from '../../types/Calling.std.js'; export const nonRenderedRemoteParticipant = ({ demuxId, diff --git a/ts/util/rotatingPinoDest.ts b/ts/util/rotatingPinoDest.ts index 5c2ae8adb0..62292a33e8 100644 --- a/ts/util/rotatingPinoDest.ts +++ b/ts/util/rotatingPinoDest.ts @@ -4,8 +4,8 @@ import fs from 'node:fs'; import pino from 'pino'; -import { DAY, SECOND } from './durations/index.js'; -import { isMoreRecentThan } from './timestamp.js'; +import { DAY, SECOND } from './durations/index.std.js'; +import { isMoreRecentThan } from './timestamp.std.js'; export const DEFAULT_MAX_ROTATIONS = 3; diff --git a/ts/util/safetyNumber.ts b/ts/util/safetyNumber.ts index 3cd0ba91d6..f4c0dc35cd 100644 --- a/ts/util/safetyNumber.ts +++ b/ts/util/safetyNumber.ts @@ -2,15 +2,15 @@ // SPDX-License-Identifier: AGPL-3.0-only import { PublicKey, Fingerprint } from '@signalapp/libsignal-client'; -import type { ConversationType } from '../state/ducks/conversations.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; -import { assertDev } from './assert.js'; -import { uuidToBytes } from './uuidToBytes.js'; -import { createLogger } from '../logging/log.js'; -import type { SafetyNumberType } from '../types/safetyNumber.js'; -import { signalProtocolStore } from '../SignalProtocolStore.js'; -import { isAciString } from './isAciString.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import { assertDev } from './assert.std.js'; +import { uuidToBytes } from './uuidToBytes.std.js'; +import { createLogger } from '../logging/log.std.js'; +import type { SafetyNumberType } from '../types/safetyNumber.std.js'; +import { signalProtocolStore } from '../SignalProtocolStore.preload.js'; +import { isAciString } from './isAciString.std.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const log = createLogger('safetyNumber'); diff --git a/ts/util/scaleImageToLevel.ts b/ts/util/scaleImageToLevel.ts index b2a9266e8a..9a10037dad 100644 --- a/ts/util/scaleImageToLevel.ts +++ b/ts/util/scaleImageToLevel.ts @@ -4,12 +4,12 @@ import type { LoadImageResult } from 'blueimp-load-image'; import loadImage from 'blueimp-load-image'; -import type { MIMEType } from '../types/MIME.js'; -import { IMAGE_JPEG } from '../types/MIME.js'; -import { canvasToBlob } from './canvasToBlob.js'; -import { getValue } from '../RemoteConfig.js'; -import { parseNumber } from './libphonenumberUtil.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import type { MIMEType } from '../types/MIME.std.js'; +import { IMAGE_JPEG } from '../types/MIME.std.js'; +import { canvasToBlob } from './canvasToBlob.std.js'; +import { getValue } from '../RemoteConfig.dom.js'; +import { parseNumber } from './libphonenumberUtil.std.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; enum MediaQualityLevels { One = 1, diff --git a/ts/util/searchConversationTitles.ts b/ts/util/searchConversationTitles.ts index 6e0bce14a0..03c91b2886 100644 --- a/ts/util/searchConversationTitles.ts +++ b/ts/util/searchConversationTitles.ts @@ -3,8 +3,8 @@ import type Fuse from 'fuse.js'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import { fuseGetFnRemoveDiacritics, getCachedFuseIndex } from './fuse.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import { fuseGetFnRemoveDiacritics, getCachedFuseIndex } from './fuse.std.js'; const CONVERSATION_TITLE = 'title'; const MIN_SEARCH_TERM_LENGTH = 2; diff --git a/ts/util/sendCallLinkUpdateSync.ts b/ts/util/sendCallLinkUpdateSync.ts index 60f7126188..113effb726 100644 --- a/ts/util/sendCallLinkUpdateSync.ts +++ b/ts/util/sendCallLinkUpdateSync.ts @@ -3,16 +3,16 @@ import { ContentHint } from '@signalapp/libsignal-client'; -import * as Bytes from '../Bytes.js'; -import { CallLinkUpdateSyncType } from '../types/CallLink.js'; -import { createLogger } from '../logging/log.js'; -import * as Errors from '../types/errors.js'; -import { SignalService as Proto } from '../protobuf/index.js'; -import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue.js'; -import { MessageSender } from '../textsecure/SendMessage.js'; -import { toAdminKeyBytes } from './callLinks.js'; -import { toEpochBytes, toRootKeyBytes } from './callLinksRingrtc.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import * as Bytes from '../Bytes.std.js'; +import { CallLinkUpdateSyncType } from '../types/CallLink.std.js'; +import { createLogger } from '../logging/log.std.js'; +import * as Errors from '../types/errors.std.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; +import { singleProtoJobQueue } from '../jobs/singleProtoJobQueue.preload.js'; +import { MessageSender } from '../textsecure/SendMessage.preload.js'; +import { toAdminKeyBytes } from './callLinks.std.js'; +import { toEpochBytes, toRootKeyBytes } from './callLinksRingrtc.node.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const log = createLogger('sendCallLinkUpdateSync'); diff --git a/ts/util/sendDeleteForEveryoneMessage.ts b/ts/util/sendDeleteForEveryoneMessage.ts index 49bdadef59..6125d6194d 100644 --- a/ts/util/sendDeleteForEveryoneMessage.ts +++ b/ts/util/sendDeleteForEveryoneMessage.ts @@ -2,24 +2,24 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { ConversationAttributesType } from '../model-types.d.ts'; -import type { ConversationQueueJobData } from '../jobs/conversationJobQueue.js'; -import * as Errors from '../types/errors.js'; -import { DAY } from './durations/index.js'; -import { createLogger } from '../logging/log.js'; +import type { ConversationQueueJobData } from '../jobs/conversationJobQueue.preload.js'; +import * as Errors from '../types/errors.std.js'; +import { DAY } from './durations/index.std.js'; +import { createLogger } from '../logging/log.std.js'; import { conversationJobQueue, conversationQueueJobEnum, -} from '../jobs/conversationJobQueue.js'; -import { deleteForEveryone } from './deleteForEveryone.js'; +} from '../jobs/conversationJobQueue.preload.js'; +import { deleteForEveryone } from './deleteForEveryone.preload.js'; import { getConversationIdForLogging, getMessageIdForLogging, -} from './idForLogging.js'; -import { getMessageById } from '../messages/getMessageById.js'; -import { getRecipientConversationIds } from './getRecipientConversationIds.js'; -import { getRecipients } from './getRecipients.js'; -import { repeat, zipObject } from './iterables.js'; -import { isMe } from './whatTypeOfConversation.js'; +} from './idForLogging.preload.js'; +import { getMessageById } from '../messages/getMessageById.preload.js'; +import { getRecipientConversationIds } from './getRecipientConversationIds.dom.js'; +import { getRecipients } from './getRecipients.dom.js'; +import { repeat, zipObject } from './iterables.std.js'; +import { isMe } from './whatTypeOfConversation.dom.js'; const log = createLogger('sendDeleteForEveryoneMessage'); diff --git a/ts/util/sendEditedMessage.ts b/ts/util/sendEditedMessage.ts index a75256e7c6..eba393fd06 100644 --- a/ts/util/sendEditedMessage.ts +++ b/ts/util/sendEditedMessage.ts @@ -3,38 +3,45 @@ import { v4 as generateUuid } from 'uuid'; -import type { DraftBodyRanges } from '../types/BodyRange.js'; -import type { LinkPreviewType } from '../types/message/LinkPreviews.js'; +import type { DraftBodyRanges } from '../types/BodyRange.std.js'; +import type { LinkPreviewType } from '../types/message/LinkPreviews.std.js'; import type { MessageAttributesType, QuotedMessageType, } from '../model-types.d.ts'; -import { createLogger } from '../logging/log.js'; -import { DataReader, DataWriter } from '../sql/Client.js'; -import type { AttachmentType } from '../types/Attachment.js'; -import { ErrorWithToast } from '../types/ErrorWithToast.js'; -import { SendStatus } from '../messages/MessageSendState.js'; -import { ToastType } from '../types/Toast.js'; -import type { AciString } from '../types/ServiceId.js'; -import { canEditMessage, isWithinMaxEdits } from './canEditMessage.js'; +import { createLogger } from '../logging/log.std.js'; +import { DataReader, DataWriter } from '../sql/Client.preload.js'; +import type { AttachmentType } from '../types/Attachment.std.js'; +import { ErrorWithToast } from '../types/ErrorWithToast.std.js'; +import { SendStatus } from '../messages/MessageSendState.std.js'; +import { ToastType } from '../types/Toast.dom.js'; +import type { AciString } from '../types/ServiceId.std.js'; +import { canEditMessage, isWithinMaxEdits } from './canEditMessage.dom.js'; import { conversationJobQueue, conversationQueueJobEnum, -} from '../jobs/conversationJobQueue.js'; -import { concat, filter, map, repeat, zipObject, find } from './iterables.js'; -import { getConversationIdForLogging } from './idForLogging.js'; -import { isQuoteAMatch } from '../messages/quotes.js'; -import { getMessageById } from '../messages/getMessageById.js'; -import { handleEditMessage } from './handleEditMessage.js'; -import { incrementMessageCounter } from './incrementMessageCounter.js'; -import { isGroupV1 } from './whatTypeOfConversation.js'; -import { isNotNil } from './isNotNil.js'; -import { isSignalConversation } from './isSignalConversation.js'; -import { strictAssert } from './assert.js'; -import { timeAndLogIfTooLong } from './timeAndLogIfTooLong.js'; -import { makeQuote } from './makeQuote.js'; -import { getMessageSentTimestamp } from './getMessageSentTimestamp.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from '../jobs/conversationJobQueue.preload.js'; +import { + concat, + filter, + map, + repeat, + zipObject, + find, +} from './iterables.std.js'; +import { getConversationIdForLogging } from './idForLogging.preload.js'; +import { isQuoteAMatch } from '../messages/quotes.preload.js'; +import { getMessageById } from '../messages/getMessageById.preload.js'; +import { handleEditMessage } from './handleEditMessage.preload.js'; +import { incrementMessageCounter } from './incrementMessageCounter.preload.js'; +import { isGroupV1 } from './whatTypeOfConversation.dom.js'; +import { isNotNil } from './isNotNil.std.js'; +import { isSignalConversation } from './isSignalConversation.dom.js'; +import { strictAssert } from './assert.std.js'; +import { timeAndLogIfTooLong } from './timeAndLogIfTooLong.std.js'; +import { makeQuote } from './makeQuote.preload.js'; +import { getMessageSentTimestamp } from './getMessageSentTimestamp.std.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const log = createLogger('sendEditedMessage'); diff --git a/ts/util/sendReceipts.ts b/ts/util/sendReceipts.ts index 0d1ca96883..cfb8e2500e 100644 --- a/ts/util/sendReceipts.ts +++ b/ts/util/sendReceipts.ts @@ -2,19 +2,19 @@ // SPDX-License-Identifier: AGPL-3.0-only import lodash from 'lodash'; -import type { LoggerType } from '../types/Logging.js'; -import type { Receipt } from '../types/Receipt.js'; -import { ReceiptType } from '../types/Receipt.js'; -import { getSendOptions } from './getSendOptions.js'; -import { handleMessageSend } from './handleMessageSend.js'; -import { isConversationAccepted } from './isConversationAccepted.js'; -import { isConversationUnregistered } from './isConversationUnregistered.js'; -import { missingCaseError } from './missingCaseError.js'; -import type { ConversationModel } from '../models/conversations.js'; -import { mapEmplace } from './mapEmplace.js'; -import { isSignalConversation } from './isSignalConversation.js'; -import { messageSender } from '../textsecure/SendMessage.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import type { LoggerType } from '../types/Logging.std.js'; +import type { Receipt } from '../types/Receipt.std.js'; +import { ReceiptType } from '../types/Receipt.std.js'; +import { getSendOptions } from './getSendOptions.preload.js'; +import { handleMessageSend } from './handleMessageSend.preload.js'; +import { isConversationAccepted } from './isConversationAccepted.preload.js'; +import { isConversationUnregistered } from './isConversationUnregistered.dom.js'; +import { missingCaseError } from './missingCaseError.std.js'; +import type { ConversationModel } from '../models/conversations.preload.js'; +import { mapEmplace } from './mapEmplace.std.js'; +import { isSignalConversation } from './isSignalConversation.dom.js'; +import { messageSender } from '../textsecure/SendMessage.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const { chunk, map } = lodash; diff --git a/ts/util/sendStoryMessage.ts b/ts/util/sendStoryMessage.ts index 6bb7e4d280..bb9b17fbfc 100644 --- a/ts/util/sendStoryMessage.ts +++ b/ts/util/sendStoryMessage.ts @@ -3,37 +3,37 @@ import { v4 as generateUuid } from 'uuid'; -import type { AttachmentType } from '../types/Attachment.js'; +import type { AttachmentType } from '../types/Attachment.std.js'; import type { MessageAttributesType } from '../model-types.d.ts'; import type { SendState, SendStateByConversationId, -} from '../messages/MessageSendState.js'; -import type { StoryDistributionIdString } from '../types/StoryDistributionId.js'; -import type { ServiceIdString } from '../types/ServiceId.js'; -import { createLogger } from '../logging/log.js'; -import { DataReader, DataWriter } from '../sql/Client.js'; -import { MY_STORY_ID, StorySendMode } from '../types/Stories.js'; -import { getStoriesBlocked } from './stories.js'; -import { ReadStatus } from '../messages/MessageReadStatus.js'; -import { SeenStatus } from '../MessageSeenStatus.js'; -import { SendStatus } from '../messages/MessageSendState.js'; +} from '../messages/MessageSendState.std.js'; +import type { StoryDistributionIdString } from '../types/StoryDistributionId.std.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { DataReader, DataWriter } from '../sql/Client.preload.js'; +import { MY_STORY_ID, StorySendMode } from '../types/Stories.std.js'; +import { getStoriesBlocked } from './stories.preload.js'; +import { ReadStatus } from '../messages/MessageReadStatus.std.js'; +import { SeenStatus } from '../MessageSeenStatus.std.js'; +import { SendStatus } from '../messages/MessageSendState.std.js'; import { conversationJobQueue, conversationQueueJobEnum, -} from '../jobs/conversationJobQueue.js'; -import { getRecipients } from './getRecipients.js'; -import { getSignalConnections } from './getSignalConnections.js'; -import { incrementMessageCounter } from './incrementMessageCounter.js'; -import { isGroupV2 } from './whatTypeOfConversation.js'; -import { isNotNil } from './isNotNil.js'; -import { collect } from './iterables.js'; -import { loadPreviewData, upgradeMessageSchema } from './migrations.js'; -import { DurationInSeconds } from './durations/index.js'; -import { sanitizeLinkPreview } from '../services/LinkPreview.js'; -import type { DraftBodyRanges } from '../types/BodyRange.js'; -import { MessageModel } from '../models/messages.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from '../jobs/conversationJobQueue.preload.js'; +import { getRecipients } from './getRecipients.dom.js'; +import { getSignalConnections } from './getSignalConnections.preload.js'; +import { incrementMessageCounter } from './incrementMessageCounter.preload.js'; +import { isGroupV2 } from './whatTypeOfConversation.dom.js'; +import { isNotNil } from './isNotNil.std.js'; +import { collect } from './iterables.std.js'; +import { loadPreviewData, upgradeMessageSchema } from './migrations.preload.js'; +import { DurationInSeconds } from './durations/index.std.js'; +import { sanitizeLinkPreview } from '../services/LinkPreview.preload.js'; +import type { DraftBodyRanges } from '../types/BodyRange.std.js'; +import { MessageModel } from '../models/messages.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const log = createLogger('sendStoryMessage'); diff --git a/ts/util/sendToGroup.ts b/ts/util/sendToGroup.ts index 37fa29846c..293024807a 100644 --- a/ts/util/sendToGroup.ts +++ b/ts/util/sendToGroup.ts @@ -14,30 +14,33 @@ import { SenderCertificate, UnidentifiedSenderMessageContent, } from '@signalapp/libsignal-client'; -import { signalProtocolStore, GLOBAL_ZONE } from '../SignalProtocolStore.js'; -import { senderCertificateService } from '../services/senderCertificate.js'; -import type { SendLogCallbackType } from '../textsecure/OutgoingMessage.js'; +import { + signalProtocolStore, + GLOBAL_ZONE, +} from '../SignalProtocolStore.preload.js'; +import { senderCertificateService } from '../services/senderCertificate.preload.js'; +import type { SendLogCallbackType } from '../textsecure/OutgoingMessage.preload.js'; import { padMessage, SenderCertificateMode, -} from '../textsecure/OutgoingMessage.js'; -import { accountManager } from '../textsecure/AccountManager.js'; -import { Address } from '../types/Address.js'; -import { QualifiedAddress } from '../types/QualifiedAddress.js'; -import * as Errors from '../types/errors.js'; -import { DataWriter } from '../sql/Client.js'; -import { getValue } from '../RemoteConfig.js'; -import type { ServiceIdString } from '../types/ServiceId.js'; -import { ServiceIdKind } from '../types/ServiceId.js'; -import * as Bytes from '../Bytes.js'; -import { isRecord } from './isRecord.js'; +} from '../textsecure/OutgoingMessage.preload.js'; +import { accountManager } from '../textsecure/AccountManager.preload.js'; +import { Address } from '../types/Address.std.js'; +import { QualifiedAddress } from '../types/QualifiedAddress.std.js'; +import * as Errors from '../types/errors.std.js'; +import { DataWriter } from '../sql/Client.preload.js'; +import { getValue } from '../RemoteConfig.dom.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; +import { ServiceIdKind } from '../types/ServiceId.std.js'; +import * as Bytes from '../Bytes.std.js'; +import { isRecord } from './isRecord.std.js'; -import { isOlderThan } from './timestamp.js'; +import { isOlderThan } from './timestamp.std.js'; import type { GroupSendOptionsType, SendOptionsType, -} from '../textsecure/SendMessage.js'; -import { messageSender } from '../textsecure/SendMessage.js'; +} from '../textsecure/SendMessage.preload.js'; +import { messageSender } from '../textsecure/SendMessage.preload.js'; import { ConnectTimeoutError, IncorrectSenderKeyAuthError, @@ -45,20 +48,27 @@ import { SendMessageProtoError, UnknownRecipientError, UnregisteredUserError, -} from '../textsecure/Errors.js'; -import { IdentityKeys, SenderKeys, Sessions } from '../LibSignalStores.js'; -import type { ConversationModel } from '../models/conversations.js'; +} from '../textsecure/Errors.std.js'; +import { + IdentityKeys, + SenderKeys, + Sessions, +} from '../LibSignalStores.preload.js'; +import type { ConversationModel } from '../models/conversations.preload.js'; import type { DeviceType, CallbackResultType } from '../textsecure/Types.d.ts'; -import { getKeysForServiceId } from '../textsecure/getKeysForServiceId.js'; +import { getKeysForServiceId } from '../textsecure/getKeysForServiceId.preload.js'; import type { ConversationAttributesType, SenderKeyInfoType, } from '../model-types.d.ts'; -import type { SendTypesType } from './handleMessageSend.js'; -import { handleMessageSend, shouldSaveProto } from './handleMessageSend.js'; -import { SEALED_SENDER, ZERO_ACCESS_KEY } from '../types/SealedSender.js'; -import { HTTPError } from '../types/HTTPError.js'; -import { parseIntOrThrow } from './parseIntOrThrow.js'; +import type { SendTypesType } from './handleMessageSend.preload.js'; +import { + handleMessageSend, + shouldSaveProto, +} from './handleMessageSend.preload.js'; +import { SEALED_SENDER, ZERO_ACCESS_KEY } from '../types/SealedSender.std.js'; +import { HTTPError } from '../types/HTTPError.std.js'; +import { parseIntOrThrow } from './parseIntOrThrow.std.js'; import { sendWithSenderKey, getKeysForServiceId as doGetKeysForServiceId, @@ -66,21 +76,21 @@ import { multiRecipient200ResponseSchema, multiRecipient409ResponseSchema, multiRecipient410ResponseSchema, -} from '../textsecure/WebAPI.js'; -import { SignalService as Proto } from '../protobuf/index.js'; +} from '../textsecure/WebAPI.preload.js'; +import { SignalService as Proto } from '../protobuf/index.std.js'; -import { strictAssert } from './assert.js'; -import { createLogger } from '../logging/log.js'; -import { waitForAll } from './waitForAll.js'; -import type { GroupSendEndorsementState } from './groupSendEndorsements.js'; +import { strictAssert } from './assert.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { waitForAll } from './waitForAll.std.js'; +import type { GroupSendEndorsementState } from './groupSendEndorsements.preload.js'; import { maybeCreateGroupSendEndorsementState, onFailedToSendWithEndorsements, -} from './groupSendEndorsements.js'; -import type { GroupSendToken } from '../types/GroupSendEndorsements.js'; -import { isAciString } from './isAciString.js'; -import { safeParseStrict, safeParseUnknown } from './schemas.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from './groupSendEndorsements.preload.js'; +import type { GroupSendToken } from '../types/GroupSendEndorsements.std.js'; +import { isAciString } from './isAciString.std.js'; +import { safeParseStrict, safeParseUnknown } from './schemas.std.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const { differenceWith, omit } = lodash; diff --git a/ts/util/sessionTranslation.ts b/ts/util/sessionTranslation.ts index c737d6e6a3..d74324d56e 100644 --- a/ts/util/sessionTranslation.ts +++ b/ts/util/sessionTranslation.ts @@ -4,8 +4,8 @@ import lodash from 'lodash'; import { signal } from '../protobuf/compiled.js'; -import * as Bytes from '../Bytes.js'; -import { deriveSecrets } from '../Crypto.js'; +import * as Bytes from '../Bytes.std.js'; +import { deriveSecrets } from '../Crypto.node.js'; const { get, isFinite, isInteger, isString } = lodash; diff --git a/ts/util/setUtil.ts b/ts/util/setUtil.ts index 15b8249ace..ea38607f35 100644 --- a/ts/util/setUtil.ts +++ b/ts/util/setUtil.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { every } from './iterables.js'; +import { every } from './iterables.std.js'; const add = (set: Readonly>, item: T): Set => new Set(set).add(item); diff --git a/ts/util/setupI18n.tsx b/ts/util/setupI18n.tsx index 9556c28eb4..23acd0d422 100644 --- a/ts/util/setupI18n.tsx +++ b/ts/util/setupI18n.tsx @@ -3,18 +3,18 @@ import type { IntlShape } from 'react-intl'; import React from 'react'; -import type { LocaleMessagesType } from '../types/I18N.js'; -import type { LocalizerType } from '../types/Util.js'; +import type { LocaleMessagesType } from '../types/I18N.std.js'; +import type { LocalizerType } from '../types/Util.std.js'; // eslint-disable-next-line import/no-restricted-paths -import { Emojify } from '../components/conversation/Emojify.js'; +import { Emojify } from '../components/conversation/Emojify.dom.js'; import { createCachedIntl as createCachedIntlMain, setupI18n as setupI18nMain, -} from './setupI18nMain.js'; -import type { SetupI18nOptionsType } from './setupI18nMain.js'; -import { strictAssert } from './assert.js'; +} from './setupI18nMain.std.js'; +import type { SetupI18nOptionsType } from './setupI18nMain.std.js'; +import { strictAssert } from './assert.std.js'; -export { isLocaleMessageType } from './setupI18nMain.js'; +export { isLocaleMessageType } from './setupI18nMain.std.js'; export function renderEmojify(parts: ReadonlyArray): JSX.Element { strictAssert(parts.length === 1, ' must contain only one child'); @@ -23,17 +23,36 @@ export function renderEmojify(parts: ReadonlyArray): JSX.Element { return ; } +function getLocaleDirection() { + return window.SignalContext.getResolvedMessagesLocaleDirection(); +} +function getHourCyclePreference() { + return window.SignalContext.getHourCyclePreference(); +} + export function createCachedIntl( locale: string, icuMessages: Record ): IntlShape { - return createCachedIntlMain(locale, icuMessages, { renderEmojify }); + return createCachedIntlMain(locale, icuMessages, { + renderEmojify, + getLocaleDirection, + getHourCyclePreference, + }); } export function setupI18n( locale: string, messages: LocaleMessagesType, - options: Omit = {} + options: Omit< + SetupI18nOptionsType, + 'renderEmojify' | 'getLocaleDirection' | 'getHourCyclePreference' + > = {} ): LocalizerType { - return setupI18nMain(locale, messages, { ...options, renderEmojify }); + return setupI18nMain(locale, messages, { + ...options, + renderEmojify, + getLocaleDirection, + getHourCyclePreference, + }); } diff --git a/ts/util/setupI18nMain.ts b/ts/util/setupI18nMain.ts index 4bde605757..846f040864 100644 --- a/ts/util/setupI18nMain.ts +++ b/ts/util/setupI18nMain.ts @@ -4,17 +4,20 @@ import type { IntlShape } from 'react-intl'; import { createIntl, createIntlCache } from 'react-intl'; import type { ReactNode } from 'react'; -import type { LocaleMessageType, LocaleMessagesType } from '../types/I18N.js'; +import type { + LocaleMessageType, + LocaleMessagesType, +} from '../types/I18N.std.js'; import type { LocalizerType, ICUStringMessageParamsByKeyType, LocalizerOptions, -} from '../types/Util.js'; -import { strictAssert } from './assert.js'; -import { createLogger } from '../logging/log.js'; -import * as Errors from '../types/errors.js'; -import { Environment, getEnvironment } from '../environment.js'; -import { bidiIsolate, bidiStrip } from './unicodeBidi.js'; +} from '../types/Util.std.js'; +import { strictAssert } from './assert.std.js'; +import { createLogger } from '../logging/log.std.js'; +import * as Errors from '../types/errors.std.js'; +import { Environment, getEnvironment } from '../environment.std.js'; +import { bidiIsolate, bidiStrip } from './unicodeBidi.std.js'; const log = createLogger('setupI18nMain'); @@ -30,6 +33,8 @@ export function isLocaleMessageType( export type SetupI18nOptionsType = Readonly<{ renderEmojify: (parts: ReadonlyArray) => ReactNode; + getLocaleDirection: LocalizerType['getLocaleDirection']; + getHourCyclePreference: LocalizerType['getHourCyclePreference']; }>; export function createCachedIntl( @@ -111,7 +116,11 @@ function filterLegacyMessages( export function setupI18n( locale: string, messages: LocaleMessagesType, - { renderEmojify }: SetupI18nOptionsType + { + renderEmojify, + getLocaleDirection, + getHourCyclePreference, + }: SetupI18nOptionsType ): LocalizerType { if (!locale) { throw new Error('i18n: locale parameter is required'); @@ -122,6 +131,8 @@ export function setupI18n( const intl = createCachedIntl(locale, filterLegacyMessages(messages), { renderEmojify, + getLocaleDirection, + getHourCyclePreference, }); let usedStrings: Map | undefined; @@ -150,12 +161,8 @@ export function setupI18n( }; localizer.getLocale = () => locale; localizer.getLocaleMessages = () => messages; - localizer.getLocaleDirection = () => { - return window.SignalContext.getResolvedMessagesLocaleDirection(); - }; - localizer.getHourCyclePreference = () => { - return window.SignalContext.getHourCyclePreference(); - }; + localizer.getLocaleDirection = getLocaleDirection; + localizer.getHourCyclePreference = getHourCyclePreference; // Storybook localizer.trackUsage = () => { diff --git a/ts/util/shouldDownloadStory.ts b/ts/util/shouldDownloadStory.ts index 8431815523..0a602f6948 100644 --- a/ts/util/shouldDownloadStory.ts +++ b/ts/util/shouldDownloadStory.ts @@ -3,8 +3,8 @@ import type { ConversationAttributesType } from '../model-types.d.ts'; -import { DataReader } from '../sql/Client.js'; -import { isMe } from './whatTypeOfConversation.js'; +import { DataReader } from '../sql/Client.preload.js'; +import { isMe } from './whatTypeOfConversation.dom.js'; const MAX_NUM_STORIES_TO_PREFETCH = 5; diff --git a/ts/util/shouldNeverBeCalled.ts b/ts/util/shouldNeverBeCalled.ts index f5f4b89d42..4e5d80fef7 100644 --- a/ts/util/shouldNeverBeCalled.ts +++ b/ts/util/shouldNeverBeCalled.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { assertDev } from './assert.js'; +import { assertDev } from './assert.std.js'; export function shouldNeverBeCalled(..._args: ReadonlyArray): never { assertDev(false, 'This should never be called. Doing nothing'); diff --git a/ts/util/shouldRespondWithProfileKey.ts b/ts/util/shouldRespondWithProfileKey.ts index 8ea9b8fe42..6ce93858bb 100644 --- a/ts/util/shouldRespondWithProfileKey.ts +++ b/ts/util/shouldRespondWithProfileKey.ts @@ -1,8 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationModel } from '../models/conversations.js'; -import { isMe } from './whatTypeOfConversation.js'; +import type { ConversationModel } from '../models/conversations.preload.js'; +import { isMe } from './whatTypeOfConversation.dom.js'; export async function shouldRespondWithProfileKey( sender: ConversationModel diff --git a/ts/util/shouldShowInvalidMessageToast.ts b/ts/util/shouldShowInvalidMessageToast.ts index 4edc9938ae..f7773ea648 100644 --- a/ts/util/shouldShowInvalidMessageToast.ts +++ b/ts/util/shouldShowInvalidMessageToast.ts @@ -1,18 +1,18 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationAttributesType } from '../model-types.js'; -import { hasExpired } from '../state/selectors/expiration.js'; -import { isOSUnsupported } from '../state/selectors/updates.js'; +import type { ConversationAttributesType } from '../model-types.d.ts'; +import { hasExpired } from '../state/selectors/expiration.dom.js'; +import { isOSUnsupported } from '../state/selectors/updates.std.js'; -import type { AnyToast } from '../types/Toast.js'; -import { ToastType } from '../types/Toast.js'; +import type { AnyToast } from '../types/Toast.dom.js'; +import { ToastType } from '../types/Toast.dom.js'; import { isDirectConversation, isGroupV1, isGroupV2, -} from './whatTypeOfConversation.js'; -import { itemStorage } from '../textsecure/Storage.js'; +} from './whatTypeOfConversation.dom.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const MAX_MESSAGE_BODY_LENGTH = 64 * 1024; diff --git a/ts/util/shouldStoryReplyNotifyUser.ts b/ts/util/shouldStoryReplyNotifyUser.ts index b83176aae9..b3bdc22fd2 100644 --- a/ts/util/shouldStoryReplyNotifyUser.ts +++ b/ts/util/shouldStoryReplyNotifyUser.ts @@ -1,13 +1,13 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ConversationModel } from '../models/conversations.js'; +import type { ConversationModel } from '../models/conversations.preload.js'; import type { ReadonlyMessageAttributesType } from '../model-types.d.ts'; -import { createLogger } from '../logging/log.js'; -import { DataReader } from '../sql/Client.js'; -import { isGroup } from './whatTypeOfConversation.js'; -import { isMessageUnread } from './isMessageUnread.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import { createLogger } from '../logging/log.std.js'; +import { DataReader } from '../sql/Client.preload.js'; +import { isGroup } from './whatTypeOfConversation.dom.js'; +import { isMessageUnread } from './isMessageUnread.std.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const log = createLogger('shouldStoryReplyNotifyUser'); diff --git a/ts/util/showConfirmationDialog.tsx b/ts/util/showConfirmationDialog.tsx index 03c9c583de..fefce3427d 100644 --- a/ts/util/showConfirmationDialog.tsx +++ b/ts/util/showConfirmationDialog.tsx @@ -4,11 +4,11 @@ import React, { StrictMode } from 'react'; import { createRoot, type Root } from 'react-dom/client'; // eslint-disable-next-line import/no-restricted-paths -import { ConfirmationDialog } from '../components/ConfirmationDialog.js'; +import { ConfirmationDialog } from '../components/ConfirmationDialog.dom.js'; // eslint-disable-next-line import/no-restricted-paths -import { FunDefaultEnglishEmojiLocalizationProvider } from '../components/fun/FunEmojiLocalizationProvider.js'; +import { FunDefaultEnglishEmojiLocalizationProvider } from '../components/fun/FunEmojiLocalizationProvider.dom.js'; // eslint-disable-next-line import/no-restricted-paths -import { AxoProvider } from '../axo/AxoProvider.js'; +import { AxoProvider } from '../axo/AxoProvider.dom.js'; type ConfirmationDialogViewProps = { onTopOfEverything?: boolean; diff --git a/ts/util/showDownloadFailedToast.ts b/ts/util/showDownloadFailedToast.ts index 444ca3cbd3..f4dd6866b1 100644 --- a/ts/util/showDownloadFailedToast.ts +++ b/ts/util/showDownloadFailedToast.ts @@ -1,9 +1,9 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { ToastType } from '../types/Toast.js'; -import { SECOND } from './durations/index.js'; -import { isOlderThan } from './timestamp.js'; +import { ToastType } from '../types/Toast.dom.js'; +import { SECOND } from './durations/index.std.js'; +import { isOlderThan } from './timestamp.std.js'; const DOWNLOAD_FAILED_TIMESTAMP_REST = 10 * SECOND; diff --git a/ts/util/signalRoutes.ts b/ts/util/signalRoutes.ts index 14e3b3fb39..5ccced8017 100644 --- a/ts/util/signalRoutes.ts +++ b/ts/util/signalRoutes.ts @@ -8,10 +8,10 @@ import 'urlpattern-polyfill'; // eslint-disable-next-line import/enforce-node-protocol-usage import { URL as NodeURL } from 'url'; import { z } from 'zod'; -import { strictAssert } from './assert.js'; -import { createLogger } from '../logging/log.js'; -import * as Errors from '../types/errors.js'; -import { parsePartial, parseUnknown, safeParseUnknown } from './schemas.js'; +import { strictAssert } from './assert.std.js'; +import { createLogger } from '../logging/log.std.js'; +import * as Errors from '../types/errors.std.js'; +import { parsePartial, parseUnknown, safeParseUnknown } from './schemas.std.js'; const log = createLogger('signalRoutes'); diff --git a/ts/util/sleeper.ts b/ts/util/sleeper.ts index d28b8b85aa..f10d251e95 100644 --- a/ts/util/sleeper.ts +++ b/ts/util/sleeper.ts @@ -1,8 +1,8 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log.js'; -import * as Errors from '../types/errors.js'; +import { createLogger } from '../logging/log.std.js'; +import * as Errors from '../types/errors.std.js'; const log = createLogger('sleeper'); diff --git a/ts/util/smartling.ts b/ts/util/smartling.ts index 496ddfc822..4d4b2ffcc5 100644 --- a/ts/util/smartling.ts +++ b/ts/util/smartling.ts @@ -1,8 +1,8 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { version } from './packageJson.js'; -import { getUserAgent } from './getUserAgent.js'; +import { version } from './packageJson.node.js'; +import { getUserAgent } from './getUserAgent.node.js'; type AuthenticateOptionsType = Readonly<{ userIdentifier: string; diff --git a/ts/util/sniffImageMimeType.ts b/ts/util/sniffImageMimeType.ts index f5f7b33a12..dba89c5669 100644 --- a/ts/util/sniffImageMimeType.ts +++ b/ts/util/sniffImageMimeType.ts @@ -1,7 +1,7 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { MIMEType } from '../types/MIME.js'; +import type { MIMEType } from '../types/MIME.std.js'; import { IMAGE_BMP, IMAGE_GIF, @@ -9,7 +9,7 @@ import { IMAGE_JPEG, IMAGE_PNG, IMAGE_WEBP, -} from '../types/MIME.js'; +} from '../types/MIME.std.js'; /** * This follows the [MIME Sniffing Standard for images][0]. diff --git a/ts/util/startConversation.ts b/ts/util/startConversation.ts index 4356369262..a07a123474 100644 --- a/ts/util/startConversation.ts +++ b/ts/util/startConversation.ts @@ -1,8 +1,8 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { ServiceIdString } from '../types/ServiceId.js'; -import { strictAssert } from './assert.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; +import { strictAssert } from './assert.std.js'; export function startConversation( e164: string, diff --git a/ts/util/stories.ts b/ts/util/stories.ts index cf323b12c1..e698145f78 100644 --- a/ts/util/stories.ts +++ b/ts/util/stories.ts @@ -1,7 +1,7 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { itemStorage } from '../textsecure/Storage.js'; -import { onHasStoriesDisabledChange } from '../textsecure/WebAPI.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; +import { onHasStoriesDisabledChange } from '../textsecure/WebAPI.preload.js'; export const getStoriesDisabled = (): boolean => itemStorage.get('hasStoriesDisabled', false); diff --git a/ts/util/subscriptionConfiguration.ts b/ts/util/subscriptionConfiguration.ts index 0696db27e2..e63a4a8e52 100644 --- a/ts/util/subscriptionConfiguration.ts +++ b/ts/util/subscriptionConfiguration.ts @@ -1,11 +1,11 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { SubscriptionConfigurationResultType } from '../textsecure/WebAPI.js'; -import { getSubscriptionConfiguration } from '../textsecure/WebAPI.js'; -import type { OneTimeDonationHumanAmounts } from '../types/Donations.js'; -import { HOUR } from './durations/index.js'; -import { isInPast } from './timestamp.js'; +import type { SubscriptionConfigurationResultType } from '../textsecure/WebAPI.preload.js'; +import { getSubscriptionConfiguration } from '../textsecure/WebAPI.preload.js'; +import type { OneTimeDonationHumanAmounts } from '../types/Donations.std.js'; +import { HOUR } from './durations/index.std.js'; +import { isInPast } from './timestamp.std.js'; const SUBSCRIPTION_CONFIG_CACHE_TIME = HOUR; diff --git a/ts/util/syncIdentifiers.ts b/ts/util/syncIdentifiers.ts index 4b4a1e4b9d..1d95b916d9 100644 --- a/ts/util/syncIdentifiers.ts +++ b/ts/util/syncIdentifiers.ts @@ -4,26 +4,26 @@ import type { ConversationIdentifier, AddressableMessage, -} from '../textsecure/messageReceiverEvents.js'; +} from '../textsecure/messageReceiverEvents.std.js'; import type { ConversationAttributesType, ReadonlyMessageAttributesType, MessageAttributesType, -} from '../model-types.js'; -import type { AciString, PniString } from '../types/ServiceId.js'; -import { isPniString } from '../types/ServiceId.js'; -import { getAuthor } from '../messages/sources.js'; -import { createLogger } from '../logging/log.js'; -import type { ConversationModel } from '../models/conversations.js'; -import { DataReader } from '../sql/Client.js'; +} from '../model-types.d.ts'; +import type { AciString, PniString } from '../types/ServiceId.std.js'; +import { isPniString } from '../types/ServiceId.std.js'; +import { getAuthor } from '../messages/sources.preload.js'; +import { createLogger } from '../logging/log.std.js'; +import type { ConversationModel } from '../models/conversations.preload.js'; +import { DataReader } from '../sql/Client.preload.js'; import { getConversationIdForLogging, getMessageIdForLogging, -} from './idForLogging.js'; -import { isGroup, isGroupV2 } from './whatTypeOfConversation.js'; -import { getMessageSentTimestampSet } from './getMessageSentTimestampSet.js'; -import { isAciString } from './isAciString.js'; -import { missingCaseError } from './missingCaseError.js'; +} from './idForLogging.preload.js'; +import { isGroup, isGroupV2 } from './whatTypeOfConversation.dom.js'; +import { getMessageSentTimestampSet } from './getMessageSentTimestampSet.std.js'; +import { isAciString } from './isAciString.std.js'; +import { missingCaseError } from './missingCaseError.std.js'; const log = createLogger('syncIdentifiers'); diff --git a/ts/util/syncTasks.ts b/ts/util/syncTasks.ts index 564514001c..42231c6fdb 100644 --- a/ts/util/syncTasks.ts +++ b/ts/util/syncTasks.ts @@ -4,34 +4,34 @@ import { z } from 'zod'; import type { ZodSchema } from 'zod'; -import { drop } from './drop.js'; -import { createLogger } from '../logging/log.js'; -import * as DeletesForMe from '../messageModifiers/DeletesForMe.js'; +import { drop } from './drop.std.js'; +import { createLogger } from '../logging/log.std.js'; +import * as DeletesForMe from '../messageModifiers/DeletesForMe.preload.js'; import { deleteMessageSchema, deleteConversationSchema, deleteLocalConversationSchema, deleteAttachmentSchema, -} from '../textsecure/messageReceiverEvents.js'; +} from '../textsecure/messageReceiverEvents.std.js'; import { receiptSyncTaskSchema, onReceipt, -} from '../messageModifiers/MessageReceipts.js'; +} from '../messageModifiers/MessageReceipts.preload.js'; import { deleteConversation, deleteLocalOnlyConversation, -} from './deleteForMe.js'; -import { getConversationFromTarget } from './syncIdentifiers.js'; +} from './deleteForMe.preload.js'; +import { getConversationFromTarget } from './syncIdentifiers.preload.js'; import { onSync as onReadSync, readSyncTaskSchema, -} from '../messageModifiers/ReadSyncs.js'; +} from '../messageModifiers/ReadSyncs.preload.js'; import { onSync as onViewSync, viewSyncTaskSchema, -} from '../messageModifiers/ViewSyncs.js'; -import { safeParseUnknown } from './schemas.js'; -import { DataWriter } from '../sql/Client.js'; +} from '../messageModifiers/ViewSyncs.preload.js'; +import { safeParseUnknown } from './schemas.std.js'; +import { DataWriter } from '../sql/Client.preload.js'; const log = createLogger('syncTasks'); diff --git a/ts/util/theme.ts b/ts/util/theme.ts index 45bdd7e84c..9b3fdce219 100644 --- a/ts/util/theme.ts +++ b/ts/util/theme.ts @@ -1,8 +1,8 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { missingCaseError } from './missingCaseError.js'; -import { ThemeType } from '../types/Util.js'; +import { missingCaseError } from './missingCaseError.std.js'; +import { ThemeType } from '../types/Util.std.js'; export enum Theme { Light, diff --git a/ts/util/timeAndLogIfTooLong.ts b/ts/util/timeAndLogIfTooLong.ts index 0bbf837b89..66424dcf2f 100644 --- a/ts/util/timeAndLogIfTooLong.ts +++ b/ts/util/timeAndLogIfTooLong.ts @@ -1,7 +1,7 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log.js'; +import { createLogger } from '../logging/log.std.js'; const log = createLogger('timeAndLogIfTooLong'); diff --git a/ts/util/timelineUtil.ts b/ts/util/timelineUtil.ts index 7a6a52e384..dd2e689426 100644 --- a/ts/util/timelineUtil.ts +++ b/ts/util/timelineUtil.ts @@ -2,17 +2,17 @@ // SPDX-License-Identifier: AGPL-3.0-only import lodash from 'lodash'; -import { createLogger } from '../logging/log.js'; +import { createLogger } from '../logging/log.std.js'; // eslint-disable-next-line import/no-restricted-paths -import type { PropsType as TimelinePropsType } from '../components/conversation/Timeline.js'; +import type { PropsType as TimelinePropsType } from '../components/conversation/Timeline.dom.js'; // eslint-disable-next-line import/no-restricted-paths -import type { TimelineItemType } from '../components/conversation/TimelineItem.js'; +import type { TimelineItemType } from '../components/conversation/TimelineItem.dom.js'; // eslint-disable-next-line import/no-restricted-paths -import { WidthBreakpoint } from '../components/_util.js'; -import { toLogFormat } from '../types/errors.js'; -import { MINUTE } from './durations/index.js'; -import { missingCaseError } from './missingCaseError.js'; -import { isSameDay } from './timestamp.js'; +import { WidthBreakpoint } from '../components/_util.std.js'; +import { toLogFormat } from '../types/errors.std.js'; +import { MINUTE } from './durations/index.std.js'; +import { missingCaseError } from './missingCaseError.std.js'; +import { isSameDay } from './timestamp.std.js'; import type { LastMessageStatus } from '../model-types.d.ts'; const { isNumber } = lodash; diff --git a/ts/util/timeout.ts b/ts/util/timeout.ts index 7364f2ddbc..6a9131b2f7 100644 --- a/ts/util/timeout.ts +++ b/ts/util/timeout.ts @@ -1,6 +1,6 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log.js'; +import { createLogger } from '../logging/log.std.js'; const logging = createLogger('timeout'); diff --git a/ts/util/timestamp.ts b/ts/util/timestamp.ts index dab109d16f..ddb781baa3 100644 --- a/ts/util/timestamp.ts +++ b/ts/util/timestamp.ts @@ -3,11 +3,9 @@ import type { Moment } from 'moment'; import moment from 'moment'; -import type { LocalizerType } from '../types/Util.js'; -import { DAY, HOUR, MINUTE, MONTH, WEEK } from './durations/index.js'; -import { formatTimestamp } from './formatTimestamp.js'; +import { DAY } from './durations/index.std.js'; -type RawTimestamp = Readonly; +export type RawTimestamp = Readonly; export function isMoreRecentThan(timestamp: number, delta: number): boolean { return timestamp > Date.now() - delta; @@ -35,178 +33,9 @@ export const isSameDay = (a: RawTimestamp, b: RawTimestamp): boolean => export const isToday = (rawTimestamp: RawTimestamp): boolean => isSameDay(rawTimestamp, Date.now()); -const isYesterday = (rawTimestamp: RawTimestamp): boolean => +export const isYesterday = (rawTimestamp: RawTimestamp): boolean => isSameDay(rawTimestamp, moment().subtract(1, 'day')); -export function formatDateTimeShort( - i18n: LocalizerType, - rawTimestamp: RawTimestamp -): string { - const timestamp = rawTimestamp.valueOf(); - - const now = Date.now(); - const diff = now - timestamp; - - if (diff < HOUR || isToday(timestamp)) { - return formatTime(i18n, rawTimestamp, now); - } - - const m = moment(timestamp); - - if (diff < WEEK && m.isSame(now, 'month')) { - return formatTimestamp(timestamp, { weekday: 'short' }); - } - - if (m.isSame(now, 'year')) { - return formatTimestamp(timestamp, { - day: 'numeric', - month: 'short', - }); - } - - return formatTimestamp(timestamp, { - day: 'numeric', - month: 'short', - year: 'numeric', - }); -} - -export function formatDateTimeForAttachment( - i18n: LocalizerType, - rawTimestamp: RawTimestamp -): string { - const timestamp = rawTimestamp.valueOf(); - - const now = Date.now(); - const diff = now - timestamp; - - if (diff < HOUR || isToday(timestamp)) { - return formatTime(i18n, rawTimestamp, now); - } - - const m = moment(timestamp); - - if (diff < WEEK && m.isSame(now, 'month')) { - return formatTimestamp(timestamp, { - weekday: 'short', - hour: 'numeric', - minute: 'numeric', - }); - } - - if (m.isSame(now, 'year')) { - return formatTimestamp(timestamp, { - day: 'numeric', - month: 'short', - hour: 'numeric', - minute: 'numeric', - }); - } - - return formatTimestamp(timestamp, { - day: 'numeric', - month: 'short', - year: 'numeric', - hour: 'numeric', - minute: 'numeric', - }); -} - -export function formatDateTimeLong( - i18n: LocalizerType, - rawTimestamp: RawTimestamp -): string { - const timestamp = rawTimestamp.valueOf(); - - if (isToday(rawTimestamp)) { - return i18n('icu:timestampFormat__long--today', { - time: formatTimestamp(timestamp, { - hour: 'numeric', - minute: 'numeric', - }), - }); - } - - if (isYesterday(rawTimestamp)) { - return i18n('icu:timestampFormat__long--yesterday', { - time: formatTimestamp(timestamp, { - hour: 'numeric', - minute: 'numeric', - }), - }); - } - - return formatTimestamp(timestamp, { - day: 'numeric', - hour: 'numeric', - minute: 'numeric', - month: 'short', - year: 'numeric', - }); -} - -export function formatTime( - i18n: LocalizerType, - rawTimestamp: RawTimestamp, - now: RawTimestamp, - isRelativeTime?: boolean -): string { - const timestamp = rawTimestamp.valueOf(); - const diff = now.valueOf() - timestamp; - - if (diff < MINUTE) { - return i18n('icu:justNow'); - } - - if (diff < HOUR) { - return i18n('icu:minutesAgo', { - minutes: Math.floor(diff / MINUTE), - }); - } - - if (isRelativeTime) { - return i18n('icu:hoursAgo', { - hours: Math.floor(diff / HOUR), - }); - } - - return formatTimestamp(timestamp, { - hour: 'numeric', - minute: '2-digit', - }); -} - -export function formatDate( - i18n: LocalizerType, - rawTimestamp: RawTimestamp -): string { - if (isToday(rawTimestamp)) { - return i18n('icu:today'); - } - - if (isYesterday(rawTimestamp)) { - return i18n('icu:yesterday'); - } - - const m = moment(rawTimestamp); - - const timestamp = rawTimestamp.valueOf(); - - if (Math.abs(m.diff(Date.now())) < 6 * MONTH) { - return formatTimestamp(timestamp, { - day: 'numeric', - month: 'short', - weekday: 'short', - }); - } - - return formatTimestamp(timestamp, { - day: 'numeric', - month: 'short', - year: 'numeric', - }); -} - export const MAX_SAFE_DATE = 8640000000000000; export const MIN_SAFE_DATE = -8640000000000000; diff --git a/ts/util/timestampLongUtils.ts b/ts/util/timestampLongUtils.ts index bf149afa22..6c9a0e34fa 100644 --- a/ts/util/timestampLongUtils.ts +++ b/ts/util/timestampLongUtils.ts @@ -3,7 +3,7 @@ import Long from 'long'; -import { MAX_SAFE_DATE } from './timestamp.js'; +import { MAX_SAFE_DATE } from './timestamp.std.js'; export function getSafeLongFromTimestamp( timestamp = 0, diff --git a/ts/util/trimPadding.ts b/ts/util/trimPadding.ts index 53a2ec2f56..9fe911b3bd 100644 --- a/ts/util/trimPadding.ts +++ b/ts/util/trimPadding.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { Transform } from 'node:stream'; -import { strictAssert } from './assert.js'; +import { strictAssert } from './assert.std.js'; /** * Truncates the stream to the target size and analyzes padding type. diff --git a/ts/util/unicodeBidi.ts b/ts/util/unicodeBidi.ts index 5c9394e3d1..bf89b4d5df 100644 --- a/ts/util/unicodeBidi.ts +++ b/ts/util/unicodeBidi.ts @@ -1,7 +1,7 @@ // Copyright 2024 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { isTestOrMockEnvironment } from '../environment.js'; +import { isTestOrMockEnvironment } from '../environment.std.js'; /** * Left-to-Right Isolate diff --git a/ts/util/universalExpireTimer.ts b/ts/util/universalExpireTimer.ts index 02afec40ea..7087b09f1b 100644 --- a/ts/util/universalExpireTimer.ts +++ b/ts/util/universalExpireTimer.ts @@ -1,9 +1,9 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { DurationInSeconds } from './durations/index.js'; -import type { ItemsStateType } from '../state/ducks/items.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import { DurationInSeconds } from './durations/index.std.js'; +import type { ItemsStateType } from '../state/ducks/items.preload.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; export const ITEM_NAME = 'universalExpireTimer'; diff --git a/ts/util/updateBackupMediaDownloadProgress.ts b/ts/util/updateBackupMediaDownloadProgress.ts index 26306b25fd..827cf84b02 100644 --- a/ts/util/updateBackupMediaDownloadProgress.ts +++ b/ts/util/updateBackupMediaDownloadProgress.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import lodash from 'lodash'; -import type { BackupAttachmentDownloadProgress } from '../sql/Interface.js'; -import { itemStorage } from '../textsecure/Storage.js'; +import type { BackupAttachmentDownloadProgress } from '../sql/Interface.std.js'; +import { itemStorage } from '../textsecure/Storage.preload.js'; const { throttle } = lodash; diff --git a/ts/util/uploadAttachment.ts b/ts/util/uploadAttachment.ts index 3c50a898ad..e9d09b051a 100644 --- a/ts/util/uploadAttachment.ts +++ b/ts/util/uploadAttachment.ts @@ -5,28 +5,28 @@ import { createReadStream } from 'node:fs'; import type { AttachmentWithHydratedData, UploadedAttachmentType, -} from '../types/Attachment.js'; -import { MIMETypeToString, supportsIncrementalMac } from '../types/MIME.js'; -import { getRandomBytes } from '../Crypto.js'; -import { backupsService } from '../services/backups/index.js'; -import { tusUpload } from './uploads/tusProtocol.js'; -import { defaultFileReader } from './uploads/uploads.js'; +} from '../types/Attachment.std.js'; +import { MIMETypeToString, supportsIncrementalMac } from '../types/MIME.std.js'; +import { getRandomBytes } from '../Crypto.node.js'; +import { backupsService } from '../services/backups/index.preload.js'; +import { tusUpload } from './uploads/tusProtocol.node.js'; +import { defaultFileReader } from './uploads/uploads.node.js'; import { type AttachmentUploadFormResponseType, getAttachmentUploadForm, createFetchForAttachmentUpload, putEncryptedAttachment, -} from '../textsecure/WebAPI.js'; +} from '../textsecure/WebAPI.preload.js'; import { type EncryptedAttachmentV2, encryptAttachmentV2ToDisk, safeUnlink, type PlaintextSourceType, -} from '../AttachmentCrypto.js'; -import { missingCaseError } from './missingCaseError.js'; -import { uuidToBytes } from './uuidToBytes.js'; -import { isVisualMedia } from './Attachment.js'; -import { getAbsoluteAttachmentPath } from './migrations.js'; +} from '../AttachmentCrypto.node.js'; +import { missingCaseError } from './missingCaseError.std.js'; +import { uuidToBytes } from './uuidToBytes.std.js'; +import { isVisualMedia } from './Attachment.std.js'; +import { getAbsoluteAttachmentPath } from './migrations.preload.js'; const CDNS_SUPPORTING_TUS = new Set([3]); diff --git a/ts/util/uploads/tusProtocol.ts b/ts/util/uploads/tusProtocol.ts index 08489e6dd3..cd3e4f70c2 100644 --- a/ts/util/uploads/tusProtocol.ts +++ b/ts/util/uploads/tusProtocol.ts @@ -3,11 +3,11 @@ import { type Readable } from 'node:stream'; import fetch, { type RequestInit, type Response } from 'node-fetch'; -import { HTTPError } from '../../types/HTTPError.js'; -import { createLogger } from '../../logging/log.js'; -import * as Errors from '../../types/errors.js'; -import { sleep } from '../sleep.js'; -import { FIBONACCI_TIMEOUTS, BackOff } from '../BackOff.js'; +import { HTTPError } from '../../types/HTTPError.std.js'; +import { createLogger } from '../../logging/log.std.js'; +import * as Errors from '../../types/errors.std.js'; +import { sleep } from '../sleep.std.js'; +import { FIBONACCI_TIMEOUTS, BackOff } from '../BackOff.std.js'; const log = createLogger('tusProtocol'); diff --git a/ts/util/uploads/uploads.ts b/ts/util/uploads/uploads.ts index 2f35f550dc..5c171cddf4 100644 --- a/ts/util/uploads/uploads.ts +++ b/ts/util/uploads/uploads.ts @@ -3,9 +3,9 @@ import fetch from 'node-fetch'; import { createReadStream, createWriteStream } from 'node:fs'; import { pipeline } from 'node:stream/promises'; -import type { TusFileReader, FetchFunctionType } from './tusProtocol.js'; -import { tusResumeUpload, tusUpload } from './tusProtocol.js'; -import { HTTPError } from '../../types/HTTPError.js'; +import type { TusFileReader, FetchFunctionType } from './tusProtocol.node.js'; +import { tusResumeUpload, tusUpload } from './tusProtocol.node.js'; +import { HTTPError } from '../../types/HTTPError.std.js'; export const defaultFileReader: TusFileReader = (filePath, offset) => { return createReadStream(filePath, { start: offset }); diff --git a/ts/util/uuidToBytes.ts b/ts/util/uuidToBytes.ts index 5a8d931a94..2377d7dff0 100644 --- a/ts/util/uuidToBytes.ts +++ b/ts/util/uuidToBytes.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import lodash from 'lodash'; -import { UUID_BYTE_SIZE } from '../types/Crypto.js'; -import { createLogger } from '../logging/log.js'; -import * as Bytes from '../Bytes.js'; +import { UUID_BYTE_SIZE } from '../types/Crypto.std.js'; +import { createLogger } from '../logging/log.std.js'; +import * as Bytes from '../Bytes.std.js'; const { chunk } = lodash; diff --git a/ts/util/validateConversation.ts b/ts/util/validateConversation.ts index e06cb6d6cf..2140b6007c 100644 --- a/ts/util/validateConversation.ts +++ b/ts/util/validateConversation.ts @@ -6,8 +6,8 @@ import { isDirectConversation, isGroupV1, isGroupV2, -} from './whatTypeOfConversation.js'; -import { isServiceIdString } from '../types/ServiceId.js'; +} from './whatTypeOfConversation.dom.js'; +import { isServiceIdString } from '../types/ServiceId.std.js'; export function validateConversation( attributes: ValidateConversationType diff --git a/ts/util/verifyStoryListMembers.ts b/ts/util/verifyStoryListMembers.ts index 4bfd17d3f5..c94b0b7270 100644 --- a/ts/util/verifyStoryListMembers.ts +++ b/ts/util/verifyStoryListMembers.ts @@ -1,13 +1,13 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log.js'; -import { isNotNil } from './isNotNil.js'; -import { updateIdentityKey } from '../services/profiles.js'; -import type { ServiceIdString } from '../types/ServiceId.js'; -import { signalProtocolStore } from '../SignalProtocolStore.js'; -import { postBatchIdentityCheck } from '../textsecure/WebAPI.js'; -import * as Bytes from '../Bytes.js'; +import { createLogger } from '../logging/log.std.js'; +import { isNotNil } from './isNotNil.std.js'; +import { updateIdentityKey } from '../services/profiles.preload.js'; +import type { ServiceIdString } from '../types/ServiceId.std.js'; +import { signalProtocolStore } from '../SignalProtocolStore.preload.js'; +import { postBatchIdentityCheck } from '../textsecure/WebAPI.preload.js'; +import * as Bytes from '../Bytes.std.js'; const log = createLogger('verifyStoryListMembers'); diff --git a/ts/util/waitBatcher.ts b/ts/util/waitBatcher.ts index da604aee96..f3c2bb22ed 100644 --- a/ts/util/waitBatcher.ts +++ b/ts/util/waitBatcher.ts @@ -3,13 +3,13 @@ import PQueue from 'p-queue'; -import { sleep } from './sleep.js'; -import { createLogger } from '../logging/log.js'; -import * as Errors from '../types/errors.js'; -import { clearTimeoutIfNecessary } from './clearTimeoutIfNecessary.js'; -import { MINUTE } from './durations/index.js'; -import { drop } from './drop.js'; -import { explodePromise } from './explodePromise.js'; +import { sleep } from './sleep.std.js'; +import { createLogger } from '../logging/log.std.js'; +import * as Errors from '../types/errors.std.js'; +import { clearTimeoutIfNecessary } from './clearTimeoutIfNecessary.std.js'; +import { MINUTE } from './durations/index.std.js'; +import { drop } from './drop.std.js'; +import { explodePromise } from './explodePromise.std.js'; const log = createLogger('waitBatcher'); diff --git a/ts/util/waitForAll.ts b/ts/util/waitForAll.ts index c31f0fa050..7e965d9ef1 100644 --- a/ts/util/waitForAll.ts +++ b/ts/util/waitForAll.ts @@ -3,7 +3,7 @@ import PQueue from 'p-queue'; -import { MINUTE } from './durations/index.js'; +import { MINUTE } from './durations/index.std.js'; const MAX_CONCURRENCY = 5; diff --git a/ts/util/waitForOnline.ts b/ts/util/waitForOnline.ts index c84646ac50..47b4de0cda 100644 --- a/ts/util/waitForOnline.ts +++ b/ts/util/waitForOnline.ts @@ -1,7 +1,7 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { clearTimeoutIfNecessary } from './clearTimeoutIfNecessary.js'; +import { clearTimeoutIfNecessary } from './clearTimeoutIfNecessary.std.js'; export type WaitForOnlineOptionsType = Readonly<{ server: Readonly<{ isOnline: () => boolean | undefined }>; diff --git a/ts/util/whatTypeOfConversation.ts b/ts/util/whatTypeOfConversation.ts index c74af38cde..80dec1f985 100644 --- a/ts/util/whatTypeOfConversation.ts +++ b/ts/util/whatTypeOfConversation.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: AGPL-3.0-only import type { ConversationAttributesType } from '../model-types.d.ts'; -import type { ConversationType } from '../state/ducks/conversations.js'; -import * as Bytes from '../Bytes.js'; -import { createLogger } from '../logging/log.js'; -import { ID_V1_LENGTH, ID_LENGTH } from '../types/groups.js'; +import type { ConversationType } from '../state/ducks/conversations.preload.js'; +import * as Bytes from '../Bytes.std.js'; +import { createLogger } from '../logging/log.std.js'; +import { ID_V1_LENGTH, ID_LENGTH } from '../types/groups.std.js'; const log = createLogger('whatTypeOfConversation'); diff --git a/ts/util/windowsZoneIdentifier.ts b/ts/util/windowsZoneIdentifier.ts index 601ac13ecc..b6bb4c4479 100644 --- a/ts/util/windowsZoneIdentifier.ts +++ b/ts/util/windowsZoneIdentifier.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import * as fs from 'node:fs'; -import OS from './os/osMain.js'; +import OS from './os/osMain.node.js'; const ZONE_IDENTIFIER_CONTENTS = Buffer.from('[ZoneTransfer]\r\nZoneId=3'); diff --git a/ts/util/wrapWithSyncMessageSend.ts b/ts/util/wrapWithSyncMessageSend.ts index 808bc36232..aae27b9a3b 100644 --- a/ts/util/wrapWithSyncMessageSend.ts +++ b/ts/util/wrapWithSyncMessageSend.ts @@ -1,20 +1,20 @@ // Copyright 2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { createLogger } from '../logging/log.js'; +import { createLogger } from '../logging/log.std.js'; -import { SendMessageProtoError } from '../textsecure/Errors.js'; -import { getSendOptions } from './getSendOptions.js'; -import { handleMessageSend } from './handleMessageSend.js'; +import { SendMessageProtoError } from '../textsecure/Errors.std.js'; +import { getSendOptions } from './getSendOptions.preload.js'; +import { handleMessageSend } from './handleMessageSend.preload.js'; import type { CallbackResultType } from '../textsecure/Types.d.ts'; -import type { ConversationModel } from '../models/conversations.js'; -import type { SendTypesType } from './handleMessageSend.js'; +import type { ConversationModel } from '../models/conversations.preload.js'; +import type { SendTypesType } from './handleMessageSend.preload.js'; import { type MessageSender, messageSender, -} from '../textsecure/SendMessage.js'; -import { areAllErrorsUnregistered } from '../jobs/helpers/areAllErrorsUnregistered.js'; +} from '../textsecure/SendMessage.preload.js'; +import { areAllErrorsUnregistered } from '../jobs/helpers/areAllErrorsUnregistered.dom.js'; const log = createLogger('wrapWithSyncMessageSend'); diff --git a/ts/util/writeDraftAttachment.ts b/ts/util/writeDraftAttachment.ts index 91a243f980..d7b5e330c7 100644 --- a/ts/util/writeDraftAttachment.ts +++ b/ts/util/writeDraftAttachment.ts @@ -5,17 +5,17 @@ import lodash from 'lodash'; import type { InMemoryAttachmentDraftType, AttachmentDraftType, -} from '../types/Attachment.js'; -import { isImageAttachment } from './Attachment.js'; -import { getImageDimensions } from '../types/VisualAttachment.js'; -import { IMAGE_PNG } from '../types/MIME.js'; -import * as Errors from '../types/errors.js'; +} from '../types/Attachment.std.js'; +import { isImageAttachment } from './Attachment.std.js'; +import { getImageDimensions } from '../types/VisualAttachment.dom.js'; +import { IMAGE_PNG } from '../types/MIME.std.js'; +import * as Errors from '../types/errors.std.js'; import { getLocalAttachmentUrl, AttachmentDisposition, -} from './getLocalAttachmentUrl.js'; -import { writeNewDraftData } from './migrations.js'; -import { createLogger } from '../logging/log.js'; +} from './getLocalAttachmentUrl.std.js'; +import { writeNewDraftData } from './migrations.preload.js'; +import { createLogger } from '../logging/log.std.js'; const { omit } = lodash; diff --git a/ts/util/zkgroup.ts b/ts/util/zkgroup.ts index d4f377bc49..9480790676 100644 --- a/ts/util/zkgroup.ts +++ b/ts/util/zkgroup.ts @@ -23,15 +23,15 @@ import type { ServiceIdString, AciString, PniString, -} from '../types/ServiceId.js'; +} from '../types/ServiceId.std.js'; import { fromServiceIdObject, fromAciObject, fromPniObject, -} from '../types/ServiceId.js'; -import * as Bytes from '../Bytes.js'; -import { toServiceIdObject } from './ServiceId.js'; -import { strictAssert } from './assert.js'; +} from '../types/ServiceId.std.js'; +import * as Bytes from '../Bytes.std.js'; +import { toServiceIdObject } from './ServiceId.node.js'; +import { strictAssert } from './assert.std.js'; export * from '@signalapp/libsignal-client/zkgroup.js'; diff --git a/ts/window.d.ts b/ts/window.d.ts index ce0e3d9834..2e7b73bc04 100644 --- a/ts/window.d.ts +++ b/ts/window.d.ts @@ -9,21 +9,21 @@ import type { SystemPreferences } from 'electron'; import type { assert } from 'chai'; import type { MochaOptions } from 'mocha'; -import type { IPCRequest as IPCChallengeRequest } from './challenge.js'; -import type { OSType } from './util/os/shared.js'; -import type { SystemThemeType, ThemeType } from './types/Util.js'; -import type { ConversationController } from './ConversationController.js'; -import type { ReduxActions } from './state/types.js'; -import type { ScreenShareStatus } from './types/Calling.js'; -import type { MessageCache } from './services/MessageCache.js'; -import type { StateType } from './state/reducer.js'; -import type { CIType } from './CI.js'; -import type { IPCEventsType } from './util/createIPCEvents.js'; -import type { SignalContextType } from './windows/context.js'; -import type { PropsPreloadType as PreferencesPropsType } from './components/Preferences.js'; -import type { WindowsNotificationData } from './services/notifications.js'; -import type { QueryStatsOptions } from './sql/main.js'; -import type { SocketStatuses } from './textsecure/SocketManager.js'; +import type { IPCRequest as IPCChallengeRequest } from './challenge.dom.js'; +import type { OSType } from './util/os/shared.std.js'; +import type { SystemThemeType, ThemeType } from './types/Util.std.js'; +import type { ConversationController } from './ConversationController.preload.js'; +import type { ReduxActions } from './state/types.std.js'; +import type { ScreenShareStatus } from './types/Calling.std.js'; +import type { MessageCache } from './services/MessageCache.preload.js'; +import type { StateType } from './state/reducer.preload.js'; +import type { CIType } from './CI.preload.js'; +import type { IPCEventsType } from './util/createIPCEvents.preload.js'; +import type { SignalContextType } from './windows/context.preload.js'; +import type { PropsPreloadType as PreferencesPropsType } from './components/Preferences.dom.js'; +import type { WindowsNotificationData } from './services/notifications.preload.js'; +import type { QueryStatsOptions } from './sql/main.main.js'; +import type { SocketStatuses } from './textsecure/SocketManager.preload.js'; export type IPCType = { addSetupMenuItems: () => void; diff --git a/ts/windows/about/app.tsx b/ts/windows/about/app.tsx index b9f196b505..b89ba92738 100644 --- a/ts/windows/about/app.tsx +++ b/ts/windows/about/app.tsx @@ -4,11 +4,11 @@ import React, { StrictMode } from 'react'; import { createRoot } from 'react-dom/client'; -import '../sandboxedInit.js'; -import { About } from '../../components/About.js'; -import { strictAssert } from '../../util/assert.js'; -import { FunDefaultEnglishEmojiLocalizationProvider } from '../../components/fun/FunEmojiLocalizationProvider.js'; -import { AxoProvider } from '../../axo/AxoProvider.js'; +import '../sandboxedInit.dom.js'; +import { About } from '../../components/About.dom.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { FunDefaultEnglishEmojiLocalizationProvider } from '../../components/fun/FunEmojiLocalizationProvider.dom.js'; +import { AxoProvider } from '../../axo/AxoProvider.dom.js'; const { AboutWindowProps } = window.Signal; const { i18n } = window.SignalContext; diff --git a/ts/windows/about/preload.ts b/ts/windows/about/preload.ts index 255b00c3e4..830de81589 100644 --- a/ts/windows/about/preload.ts +++ b/ts/windows/about/preload.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { contextBridge } from 'electron'; -import { MinimalSignalContext } from '../minimalContext.js'; -import { config } from '../../context/config.js'; -import { environment } from '../../context/environment.js'; +import { MinimalSignalContext } from '../minimalContext.preload.js'; +import { config } from '../../context/config.preload.js'; +import { environment } from '../../context/environment.preload.js'; const environments: Array = [environment]; diff --git a/ts/windows/calling-tools/preload.ts b/ts/windows/calling-tools/preload.ts index 49647f8764..b5d3f669d6 100644 --- a/ts/windows/calling-tools/preload.ts +++ b/ts/windows/calling-tools/preload.ts @@ -3,7 +3,7 @@ import { contextBridge, ipcRenderer } from 'electron'; import type { Event } from 'electron/renderer'; -import { MinimalSignalContext } from '../minimalContext.js'; +import { MinimalSignalContext } from '../minimalContext.preload.js'; type RtcStatsReport = { conversationId: string; diff --git a/ts/windows/context.ts b/ts/windows/context.ts index f2c7fe2574..43d3ca0953 100644 --- a/ts/windows/context.ts +++ b/ts/windows/context.ts @@ -4,22 +4,25 @@ import type { MenuItemConstructorOptions } from 'electron'; import { ipcRenderer } from 'electron'; -import type { NativeThemeType } from '../context/createNativeThemeListener.js'; -import type { MenuOptionsType } from '../types/menu.js'; -import type { RendererConfigType } from '../types/RendererConfig.js'; -import type { LocalizerType } from '../types/Util.js'; -import type { SettingType, SettingsValuesType } from '../util/preload.js'; +import type { NativeThemeType } from '../context/createNativeThemeListener.std.js'; +import type { MenuOptionsType } from '../types/menu.std.js'; +import type { RendererConfigType } from '../types/RendererConfig.std.js'; +import type { LocalizerType } from '../types/Util.std.js'; +import type { + SettingType, + SettingsValuesType, +} from '../util/preload.preload.js'; -import { Bytes } from '../context/Bytes.js'; -import { Crypto } from '../context/Crypto.js'; -import { Timers } from '../context/Timers.js'; +import { Bytes } from '../context/Bytes.std.js'; +import { Crypto } from '../context/Crypto.node.js'; +import { Timers } from '../context/Timers.node.js'; -import type { LocaleDirection } from '../../app/locale.js'; -import { i18n } from '../context/i18n.js'; -import type { ActiveWindowServiceType } from '../services/ActiveWindowService.js'; -import type { LocaleEmojiListType } from '../types/emoji.js'; -import type { HourCyclePreference } from '../types/I18N.js'; -import { MinimalSignalContext } from './minimalContext.js'; +import type { LocaleDirection } from '../../app/locale.main.js'; +import { i18n } from '../context/i18n.preload.js'; +import type { ActiveWindowServiceType } from '../services/ActiveWindowService.std.js'; +import type { LocaleEmojiListType } from '../types/emoji.std.js'; +import type { HourCyclePreference } from '../types/I18N.std.js'; +import { MinimalSignalContext } from './minimalContext.preload.js'; export type MainWindowStatsType = Readonly<{ isMaximized: boolean; diff --git a/ts/windows/debuglog/app.tsx b/ts/windows/debuglog/app.tsx index 90368511b4..bdb4d71fc9 100644 --- a/ts/windows/debuglog/app.tsx +++ b/ts/windows/debuglog/app.tsx @@ -3,11 +3,11 @@ import React, { StrictMode } from 'react'; import { createRoot } from 'react-dom/client'; -import '../sandboxedInit.js'; -import { DebugLogWindow } from '../../components/DebugLogWindow.js'; -import { FunDefaultEnglishEmojiLocalizationProvider } from '../../components/fun/FunEmojiLocalizationProvider.js'; -import { strictAssert } from '../../util/assert.js'; -import { AxoProvider } from '../../axo/AxoProvider.js'; +import '../sandboxedInit.dom.js'; +import { DebugLogWindow } from '../../components/DebugLogWindow.dom.js'; +import { FunDefaultEnglishEmojiLocalizationProvider } from '../../components/fun/FunEmojiLocalizationProvider.dom.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { AxoProvider } from '../../axo/AxoProvider.dom.js'; const { DebugLogWindowProps } = window.Signal; const { i18n } = window.SignalContext; diff --git a/ts/windows/debuglog/preload.ts b/ts/windows/debuglog/preload.ts index 2034741cec..e14d319524 100644 --- a/ts/windows/debuglog/preload.ts +++ b/ts/windows/debuglog/preload.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { contextBridge, ipcRenderer } from 'electron'; -import { MinimalSignalContext } from '../minimalContext.js'; +import { MinimalSignalContext } from '../minimalContext.preload.js'; function downloadLog(logText: string) { ipcRenderer.send('show-debug-log-save-dialog', logText); diff --git a/ts/windows/loading/preload.ts b/ts/windows/loading/preload.ts index 959bb15e31..710cea2ee3 100644 --- a/ts/windows/loading/preload.ts +++ b/ts/windows/loading/preload.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import { contextBridge } from 'electron'; -import { config } from '../../context/config.js'; -import { localeMessages } from '../../context/localeMessages.js'; +import { config } from '../../context/config.preload.js'; +import { localeMessages } from '../../context/localeMessages.preload.js'; contextBridge.exposeInMainWorld('SignalContext', { getI18nLocale: () => config.resolvedTranslationsLocale, diff --git a/ts/windows/main/attachments.ts b/ts/windows/main/attachments.ts index 8847d193e9..d30859286d 100644 --- a/ts/windows/main/attachments.ts +++ b/ts/windows/main/attachments.ts @@ -8,19 +8,19 @@ import { existsSync } from 'node:fs'; import fse from 'fs-extra'; import { v4 as getGuid } from 'uuid'; -import { isPathInside } from '../../util/isPathInside.js'; -import { writeWindowsZoneIdentifier } from '../../util/windowsZoneIdentifier.js'; -import OS from '../../util/os/osMain.js'; -import { getRelativePath, createName } from '../../util/attachmentPath.js'; -import { toHex } from '../../Bytes.js'; -import { getRandomBytes } from '../../Crypto.js'; -import { createLogger } from '../../logging/log.js'; +import { isPathInside } from '../../util/isPathInside.node.js'; +import { writeWindowsZoneIdentifier } from '../../util/windowsZoneIdentifier.node.js'; +import OS from '../../util/os/osMain.node.js'; +import { getRelativePath, createName } from '../../util/attachmentPath.node.js'; +import { toHex } from '../../Bytes.std.js'; +import { getRandomBytes } from '../../Crypto.node.js'; +import { createLogger } from '../../logging/log.std.js'; const { isString, isTypedArray } = lodash; const log = createLogger('attachments'); -export * from '../../../app/attachments.js'; +export * from '../../../app/attachments.node.js'; type FSAttrType = { set: (path: string, attribute: string, value: string) => Promise; diff --git a/ts/windows/main/phase0-devtools.ts b/ts/windows/main/phase0-devtools.ts index 5d3337c620..6fda35aa24 100644 --- a/ts/windows/main/phase0-devtools.ts +++ b/ts/windows/main/phase0-devtools.ts @@ -1,7 +1,7 @@ // Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { Environment, getEnvironment } from '../../environment.js'; +import { Environment, getEnvironment } from '../../environment.std.js'; if ( process.env.NODE_ENV !== 'production' && diff --git a/ts/windows/main/phase1-ipc.ts b/ts/windows/main/phase1-ipc.ts index d08ed39415..b38dfd6e7b 100644 --- a/ts/windows/main/phase1-ipc.ts +++ b/ts/windows/main/phase1-ipc.ts @@ -7,28 +7,28 @@ import * as semver from 'semver'; import lodash, { throttle } from 'lodash'; import type { IPCType } from '../../window.d.ts'; -import { parseIntWithFallback } from '../../util/parseIntWithFallback.js'; -import { getSignalConnections } from '../../util/getSignalConnections.js'; -import { ThemeType } from '../../types/Util.js'; -import { Environment } from '../../environment.js'; -import { SignalContext } from '../context.js'; -import { createLogger } from '../../logging/log.js'; -import { formatCountForLogging } from '../../logging/formatCountForLogging.js'; -import * as Errors from '../../types/errors.js'; +import { parseIntWithFallback } from '../../util/parseIntWithFallback.std.js'; +import { getSignalConnections } from '../../util/getSignalConnections.preload.js'; +import { ThemeType } from '../../types/Util.std.js'; +import { Environment } from '../../environment.std.js'; +import { SignalContext } from '../context.preload.js'; +import { createLogger } from '../../logging/log.std.js'; +import { formatCountForLogging } from '../../logging/formatCountForLogging.std.js'; +import * as Errors from '../../types/errors.std.js'; -import { strictAssert } from '../../util/assert.js'; -import { drop } from '../../util/drop.js'; -import { explodePromise } from '../../util/explodePromise.js'; -import { DataReader } from '../../sql/Client.js'; -import type { WindowsNotificationData } from '../../services/notifications.js'; -import { finish3dsValidation } from '../../services/donations.js'; -import { AggregatedStats } from '../../textsecure/WebsocketResources.js'; -import { UNAUTHENTICATED_CHANNEL_NAME } from '../../textsecure/SocketManager.js'; -import { isProduction } from '../../util/version.js'; -import { ToastType } from '../../types/Toast.js'; -import { ConversationController } from '../../ConversationController.js'; -import { isEnabled } from '../../RemoteConfig.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { drop } from '../../util/drop.std.js'; +import { explodePromise } from '../../util/explodePromise.std.js'; +import { DataReader } from '../../sql/Client.preload.js'; +import type { WindowsNotificationData } from '../../services/notifications.preload.js'; +import { finish3dsValidation } from '../../services/donations.preload.js'; +import { AggregatedStats } from '../../textsecure/WebsocketResources.preload.js'; +import { UNAUTHENTICATED_CHANNEL_NAME } from '../../textsecure/SocketManager.preload.js'; +import { isProduction } from '../../util/version.std.js'; +import { ToastType } from '../../types/Toast.dom.js'; +import { ConversationController } from '../../ConversationController.preload.js'; +import { isEnabled } from '../../RemoteConfig.dom.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; const { mapValues } = lodash; diff --git a/ts/windows/main/phase2-dependencies.ts b/ts/windows/main/phase2-dependencies.ts index c9a1196462..2e286dc68a 100644 --- a/ts/windows/main/phase2-dependencies.ts +++ b/ts/windows/main/phase2-dependencies.ts @@ -5,16 +5,16 @@ import * as moment from 'moment'; // @ts-expect-error -- no types import 'moment/min/locales.min.js'; -import { initialize as initializeLogging } from '../../logging/set_up_renderer_logging.js'; -import { setup } from '../../signal.js'; -import { addSensitivePath } from '../../util/privacy.js'; -import * as dns from '../../util/dns.js'; +import { initialize as initializeLogging } from '../../logging/set_up_renderer_logging.preload.js'; +import { setup } from '../../signal.preload.js'; +import { addSensitivePath } from '../../util/privacy.node.js'; +import * as dns from '../../util/dns.node.js'; import { ATTACHMENTS_PATH, STICKERS_PATH, DRAFT_PATH, -} from '../../util/basePaths.js'; -import { SignalContext } from '../context.js'; +} from '../../util/basePaths.preload.js'; +import { SignalContext } from '../context.preload.js'; initializeLogging(); diff --git a/ts/windows/main/phase3-post-signal.ts b/ts/windows/main/phase3-post-signal.ts index d291cf27b6..f90ffa4b82 100644 --- a/ts/windows/main/phase3-post-signal.ts +++ b/ts/windows/main/phase3-post-signal.ts @@ -3,8 +3,8 @@ // These all need access to window.Signal: -import '../../models/messages.js'; -import '../../models/conversations.js'; +import '../../models/messages.preload.js'; +import '../../models/conversations.preload.js'; -import '../../SignalProtocolStore.js'; -import '../../background.js'; +import '../../SignalProtocolStore.preload.js'; +import '../../background.preload.js'; diff --git a/ts/windows/main/preload.ts b/ts/windows/main/preload.ts index 026d3a24e9..3456a44374 100644 --- a/ts/windows/main/preload.ts +++ b/ts/windows/main/preload.ts @@ -3,7 +3,7 @@ /* eslint-disable global-require */ -import { createLogger } from '../../logging/log.js'; +import { createLogger } from '../../logging/log.std.js'; const log = createLogger('preload'); diff --git a/ts/windows/main/preload_test.ts b/ts/windows/main/preload_test.ts index 3dcc0a32a5..d310f2c84b 100644 --- a/ts/windows/main/preload_test.ts +++ b/ts/windows/main/preload_test.ts @@ -14,12 +14,12 @@ import chaiAsPromised from 'chai-as-promised'; // eslint-disable-next-line import/no-extraneous-dependencies import { reporters, type MochaOptions } from 'mocha'; -import { initMessageCleanup } from '../../services/messageStateCleanup.js'; -import { initializeMessageCounter } from '../../util/incrementMessageCounter.js'; -import { initializeRedux } from '../../state/initializeRedux.js'; -import * as Stickers from '../../types/Stickers.js'; -import { ThemeType } from '../../types/Util.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +import { initMessageCleanup } from '../../services/messageStateCleanup.preload.js'; +import { initializeMessageCounter } from '../../util/incrementMessageCounter.preload.js'; +import { initializeRedux } from '../../state/initializeRedux.preload.js'; +import * as Stickers from '../../types/Stickers.preload.js'; +import { ThemeType } from '../../types/Util.std.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; chai.use(chaiAsPromised); diff --git a/ts/windows/main/start.ts b/ts/windows/main/start.ts index e12025cbea..25b646ecfb 100644 --- a/ts/windows/main/start.ts +++ b/ts/windows/main/start.ts @@ -4,33 +4,33 @@ import lodash from 'lodash'; import { contextBridge } from 'electron'; -import { createLogger } from '../../logging/log.js'; +import { createLogger } from '../../logging/log.std.js'; -import '../context.js'; +import '../context.preload.js'; // Connect websocket early -import '../../textsecure/preconnect.js'; +import '../../textsecure/preconnect.preload.js'; -import './phase0-devtools.js'; -import './phase1-ipc.js'; -import '../preload.js'; -import './phase2-dependencies.js'; -import './phase3-post-signal.js'; -import './phase4-test.js'; +import './phase0-devtools.node.js'; +import './phase1-ipc.preload.js'; +import '../preload.preload.js'; +import './phase2-dependencies.preload.js'; +import './phase3-post-signal.std.js'; +import './phase4-test.preload.js'; import type { CdsLookupOptionsType, GetIceServersResultType, -} from '../../textsecure/WebAPI.js'; -import { cdsLookup, getSocketStatus } from '../../textsecure/WebAPI.js'; +} from '../../textsecure/WebAPI.preload.js'; +import { cdsLookup, getSocketStatus } from '../../textsecure/WebAPI.preload.js'; import type { FeatureFlagType } from '../../window.d.ts'; import type { StorageAccessType } from '../../types/Storage.d.ts'; -import { initMessageCleanup } from '../../services/messageStateCleanup.js'; -import { calling } from '../../services/calling.js'; -import { Environment, getEnvironment } from '../../environment.js'; -import { isProduction } from '../../util/version.js'; -import { benchmarkConversationOpen } from '../../CI/benchmarkConversationOpen.js'; -import { itemStorage } from '../../textsecure/Storage.js'; +import { initMessageCleanup } from '../../services/messageStateCleanup.preload.js'; +import { calling } from '../../services/calling.preload.js'; +import { Environment, getEnvironment } from '../../environment.std.js'; +import { isProduction } from '../../util/version.std.js'; +import { benchmarkConversationOpen } from '../../CI/benchmarkConversationOpen.preload.js'; +import { itemStorage } from '../../textsecure/Storage.preload.js'; const { has } = lodash; diff --git a/ts/windows/minimalContext.ts b/ts/windows/minimalContext.ts index 710bfebc15..7a9c336498 100644 --- a/ts/windows/minimalContext.ts +++ b/ts/windows/minimalContext.ts @@ -4,27 +4,27 @@ import type { MenuItemConstructorOptions } from 'electron'; import { ipcRenderer } from 'electron'; -import type { MenuOptionsType } from '../types/menu.js'; -import type { LocaleEmojiListType } from '../types/emoji.js'; -import { LocaleEmojiListSchema } from '../types/emoji.js'; +import type { MenuOptionsType } from '../types/menu.std.js'; +import type { LocaleEmojiListType } from '../types/emoji.std.js'; +import { LocaleEmojiListSchema } from '../types/emoji.std.js'; import type { MainWindowStatsType, MinimalSignalContextType, -} from './context.js'; -import { activeWindowService } from '../context/activeWindowService.js'; -import { config } from '../context/config.js'; -import { createNativeThemeListener } from '../context/createNativeThemeListener.js'; -import { createSetting } from '../util/preload.js'; -import { setupI18n } from '../util/setupI18n.js'; -import { environment } from '../context/environment.js'; +} from './context.preload.js'; +import { activeWindowService } from '../context/activeWindowService.preload.js'; +import { config } from '../context/config.preload.js'; +import { createNativeThemeListener } from '../context/createNativeThemeListener.std.js'; +import { createSetting } from '../util/preload.preload.js'; +import { setupI18n } from '../util/setupI18n.dom.js'; +import { environment } from '../context/environment.preload.js'; import { localeDisplayNames, countryDisplayNames, localeMessages, -} from '../context/localeMessages.js'; -import { waitForSettingsChange } from '../context/waitForSettingsChange.js'; -import { isTestOrMockEnvironment } from '../environment.js'; -import { parseUnknown } from '../util/schemas.js'; +} from '../context/localeMessages.preload.js'; +import { waitForSettingsChange } from '../context/waitForSettingsChange.preload.js'; +import { isTestOrMockEnvironment } from '../environment.std.js'; +import { parseUnknown } from '../util/schemas.std.js'; const emojiListCache = new Map(); diff --git a/ts/windows/permissions/app.tsx b/ts/windows/permissions/app.tsx index f69b10a76b..e79b47de37 100644 --- a/ts/windows/permissions/app.tsx +++ b/ts/windows/permissions/app.tsx @@ -4,11 +4,11 @@ import React, { StrictMode } from 'react'; import { createRoot } from 'react-dom/client'; -import '../sandboxedInit.js'; -import { PermissionsPopup } from '../../components/PermissionsPopup.js'; -import { strictAssert } from '../../util/assert.js'; -import { FunDefaultEnglishEmojiLocalizationProvider } from '../../components/fun/FunEmojiLocalizationProvider.js'; -import { AxoProvider } from '../../axo/AxoProvider.js'; +import '../sandboxedInit.dom.js'; +import { PermissionsPopup } from '../../components/PermissionsPopup.dom.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { FunDefaultEnglishEmojiLocalizationProvider } from '../../components/fun/FunEmojiLocalizationProvider.dom.js'; +import { AxoProvider } from '../../axo/AxoProvider.dom.js'; const { PermissionsWindowProps } = window.Signal; const { i18n } = window.SignalContext; diff --git a/ts/windows/permissions/preload.ts b/ts/windows/permissions/preload.ts index 9e47be7185..0dbaabf395 100644 --- a/ts/windows/permissions/preload.ts +++ b/ts/windows/permissions/preload.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: AGPL-3.0-only import { contextBridge } from 'electron'; -import { MinimalSignalContext } from '../minimalContext.js'; -import { createSetting } from '../../util/preload.js'; -import { drop } from '../../util/drop.js'; +import { MinimalSignalContext } from '../minimalContext.preload.js'; +import { createSetting } from '../../util/preload.preload.js'; +import { drop } from '../../util/drop.std.js'; const mediaCameraPermissions = createSetting('mediaCameraPermissions', { getter: false, diff --git a/ts/windows/preload.ts b/ts/windows/preload.ts index 74f2aab5bc..6b669bb7ab 100644 --- a/ts/windows/preload.ts +++ b/ts/windows/preload.ts @@ -1,7 +1,7 @@ // Copyright 2017 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import { installEphemeralSetting } from '../util/preload.js'; +import { installEphemeralSetting } from '../util/preload.preload.js'; installEphemeralSetting('contentProtection'); installEphemeralSetting('localeOverride'); diff --git a/ts/windows/sandboxedInit.ts b/ts/windows/sandboxedInit.ts index 633a88e1ac..1ba0ae55c1 100644 --- a/ts/windows/sandboxedInit.ts +++ b/ts/windows/sandboxedInit.ts @@ -1,6 +1,6 @@ // Copyright 2023 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import './applyTheme.js'; +import './applyTheme.dom.js'; document.body.classList.add(window.SignalContext.OS.getClassName()); diff --git a/ts/windows/screenShare/app.tsx b/ts/windows/screenShare/app.tsx index 604e9001cd..6d2b46cae1 100644 --- a/ts/windows/screenShare/app.tsx +++ b/ts/windows/screenShare/app.tsx @@ -4,13 +4,13 @@ import React, { StrictMode } from 'react'; import { createRoot } from 'react-dom/client'; -import '../sandboxedInit.js'; -import { CallingScreenSharingController } from '../../components/CallingScreenSharingController.js'; -import { strictAssert } from '../../util/assert.js'; -import { drop } from '../../util/drop.js'; -import { parseEnvironment, setEnvironment } from '../../environment.js'; -import { FunDefaultEnglishEmojiLocalizationProvider } from '../../components/fun/FunEmojiLocalizationProvider.js'; -import { AxoProvider } from '../../axo/AxoProvider.js'; +import '../sandboxedInit.dom.js'; +import { CallingScreenSharingController } from '../../components/CallingScreenSharingController.dom.js'; +import { strictAssert } from '../../util/assert.std.js'; +import { drop } from '../../util/drop.std.js'; +import { parseEnvironment, setEnvironment } from '../../environment.std.js'; +import { FunDefaultEnglishEmojiLocalizationProvider } from '../../components/fun/FunEmojiLocalizationProvider.dom.js'; +import { AxoProvider } from '../../axo/AxoProvider.dom.js'; const { ScreenShareWindowProps } = window.Signal; const { i18n } = window.SignalContext; diff --git a/ts/windows/screenShare/preload.ts b/ts/windows/screenShare/preload.ts index 874f6ea6ac..748f38378d 100644 --- a/ts/windows/screenShare/preload.ts +++ b/ts/windows/screenShare/preload.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-only import { contextBridge, ipcRenderer } from 'electron'; -import { ScreenShareStatus } from '../../types/Calling.js'; -import { MinimalSignalContext } from '../minimalContext.js'; +import { ScreenShareStatus } from '../../types/Calling.std.js'; +import { MinimalSignalContext } from '../minimalContext.preload.js'; const params = new URLSearchParams(document.location.search); diff --git a/ts/workers/heicConverterWorker.ts b/ts/workers/heicConverterWorker.ts index 92b306b7dc..743245f3ee 100644 --- a/ts/workers/heicConverterWorker.ts +++ b/ts/workers/heicConverterWorker.ts @@ -7,7 +7,7 @@ import { parentPort } from 'node:worker_threads'; import type { WrappedWorkerRequest, WrappedWorkerResponse, -} from './heicConverterMain.js'; +} from './heicConverterMain.main.js'; if (!parentPort) { throw new Error('Must run as a worker thread');