From 6f919892b72ba06968b680ea6703589b0493de0c Mon Sep 17 00:00:00 2001 From: Sokratis Vidros Date: Thu, 10 Oct 2024 17:50:38 +0300 Subject: [PATCH 1/4] chore(root): Remove notification center packages @novu/notification-center is replaced by the in @novu/react and @novu/js. --- .../notification-center-angular/.editorconfig | 16 - .../notification-center-angular/.gitignore | 42 -- .../notification-center-angular/README.md | 28 - .../notification-center-angular/angular.json | 40 -- .../notification-center-angular/package.json | 44 -- .../notification-center-angular/README.md | 27 - .../ng-package.json | 7 - .../notification-center-angular/package.json | 37 - .../notification-center-angular/src/index.ts | 1 - .../src/lib/index.ts | 2 - .../src/lib/notification-center.component.ts | 80 --- .../src/lib/notification-center.module.ts | 10 - .../tsconfig.lib.json | 13 - .../tsconfig.lib.prod.json | 10 - .../tsconfig.spec.json | 10 - .../notification-center-angular/tsconfig.json | 31 - packages/notification-center-vue/.gitignore | 61 -- packages/notification-center-vue/package.json | 57 -- packages/notification-center-vue/src/index.ts | 33 - .../notification-center-vue/src/lib/index.ts | 1 - .../BellButton.vue | 116 --- .../NotificationCenterComponent.vue | 155 ----- .../notification-center-component/index.ts | 1 - .../notification-center-component/utils.ts | 58 -- .../notification-center-vue/src/noop.d.ts | 18 - .../notification-center-vue/src/vue-shim.d.ts | 8 - .../tsconfig.config.json | 8 - .../notification-center-vue/tsconfig.json | 17 - .../notification-center-vue/vite.config.js | 47 -- packages/notification-center/.babelrc.json | 18 - packages/notification-center/.gitignore | 26 - .../notification-center/.storybook/main.js | 34 - .../notification-center/.storybook/preview.js | 9 - packages/notification-center/jest.config.js | 8 - packages/notification-center/netlify.toml | 4 - packages/notification-center/package.json | 99 --- .../src/components/index.ts | 5 - .../notification-bell/NotificationBell.tsx | 57 -- .../src/components/notification-bell/index.ts | 1 - .../index.ts | 3 - .../notification-center-component.tsx | 154 ---- .../notification-center-component.types.ts | 65 -- .../notification-center-content-component.tsx | 97 --- .../NotificationCenter.tsx | 85 --- .../components/AppContent.tsx | 44 -- .../components/FeedsTabs.tsx | 75 -- .../notification-center/components/Loader.tsx | 26 - .../components/NotificationsList.tsx | 51 -- .../components/NotificationsListTab.tsx | 70 -- .../components/SeenAllBlock.tsx | 13 - .../components/UnseenBadge.tsx | 36 - .../notification-center/components/index.ts | 7 - .../components/layout/Layout.tsx | 70 -- .../components/layout/footer/Footer.tsx | 86 --- .../layout/footer/FooterContainer.tsx | 9 - .../components/layout/header/Header.tsx | 105 --- .../layout/header/UserPreferenceHeader.tsx | 56 -- .../components/layout/tabs/Tabs.styles.ts | 96 --- .../components/layout/tabs/Tabs.tsx | 42 -- .../notification-item/ActionContainer.tsx | 61 -- .../NotificationItemButton.tsx | 51 -- .../NotificationListItem.tsx | 464 ------------ .../user-preference/ChannelPreference.tsx | 181 ----- .../user-preference/SubscriberPreference.tsx | 75 -- .../user-preference/UserPreferenceItem.tsx | 70 -- .../user-preference/WorkflowHeader.tsx | 44 -- .../components/user-preference/channels.tsx | 14 - .../components/user-preference/styles.ts | 91 --- .../components/notification-center/index.ts | 2 - .../novu-provider/NovuProvider.test.tsx | 658 ------------------ .../components/novu-provider/NovuProvider.tsx | 178 ----- .../src/components/novu-provider/index.ts | 2 - .../PopoverNotificationCenter.tsx | 68 -- .../components/Popover.tsx | 71 -- .../popover-notification-center/index.ts | 1 - .../src/components/types.ts | 17 - packages/notification-center/src/emotion.d.ts | 6 - packages/notification-center/src/global.d.ts | 10 - .../notification-center/src/hooks/index.ts | 20 - .../src/hooks/queryKeys.ts | 8 - .../src/hooks/useDataRef.ts | 8 - .../src/hooks/useFeedUnseenCount.ts | 21 - .../src/hooks/useFeedUnseenCountQueryKey.ts | 12 - .../src/hooks/useFetchNotifications.ts | 39 -- .../hooks/useFetchNotificationsQueryKey.ts | 16 - .../src/hooks/useFetchOrganization.ts | 24 - .../hooks/useFetchUserGlobalPreferences.ts | 23 - .../useFetchUserGlobalPreferencesQueryKey.ts | 11 - .../src/hooks/useFetchUserPreferences.ts | 23 - .../hooks/useFetchUserPreferencesQueryKey.ts | 11 - .../src/hooks/useInitializeSocket.ts | 54 -- .../src/hooks/useMarkNotificationAsRead.ts | 52 -- .../src/hooks/useMarkNotificationAsSeen.ts | 56 -- .../src/hooks/useMarkNotificationsAs.ts | 71 -- .../src/hooks/useNotificationCenter.ts | 40 -- .../src/hooks/useNotifications.test.tsx | 599 ---------------- .../src/hooks/useNotifications.ts | 8 - .../src/hooks/useNovuContext.ts | 15 - .../src/hooks/useNovuTheme.ts | 17 - .../src/hooks/useProviderCheck.ts | 15 - .../src/hooks/useRemoveAllNotifications.ts | 35 - .../src/hooks/useRemoveNotification.ts | 33 - .../src/hooks/useRemoveNotifications.ts | 34 - .../src/hooks/useSession.ts | 26 - .../src/hooks/useSetQueryKey.ts | 12 - .../src/hooks/useSocket.ts | 9 - .../notification-center/src/hooks/useStore.ts | 7 - .../src/hooks/useTranslations.ts | 18 - .../src/hooks/useUnreadCount.ts | 87 --- .../src/hooks/useUnreadCountQueryKey.ts | 13 - .../src/hooks/useUnseenCount.ts | 74 -- .../src/hooks/useUnseenCountQueryKey.ts | 13 - .../src/hooks/useUpdateAction.ts | 60 -- .../hooks/useUpdateUserGlobalPreferences.ts | 74 -- .../src/hooks/useUpdateUserPreferences.ts | 84 --- packages/notification-center/src/i18n/lang.ts | 248 ------- .../src/i18n/languages/af.ts | 12 - .../src/i18n/languages/am.ts | 12 - .../src/i18n/languages/ar.ts | 12 - .../src/i18n/languages/as.ts | 12 - .../src/i18n/languages/az.ts | 12 - .../src/i18n/languages/ba.ts | 12 - .../src/i18n/languages/be.ts | 12 - .../src/i18n/languages/bg.ts | 12 - .../src/i18n/languages/bh.ts | 12 - .../src/i18n/languages/bn.ts | 12 - .../src/i18n/languages/bs.ts | 12 - .../src/i18n/languages/ca.ts | 12 - .../src/i18n/languages/cs.ts | 12 - .../src/i18n/languages/da.ts | 12 - .../src/i18n/languages/de.ts | 12 - .../src/i18n/languages/el.ts | 12 - .../src/i18n/languages/en.ts | 15 - .../src/i18n/languages/es.ts | 15 - .../src/i18n/languages/eu.ts | 12 - .../src/i18n/languages/fa.ts | 12 - .../src/i18n/languages/fi.ts | 12 - .../src/i18n/languages/fr.ts | 12 - .../src/i18n/languages/ga.ts | 12 - .../src/i18n/languages/gl.ts | 12 - .../src/i18n/languages/gu.ts | 12 - .../src/i18n/languages/he.ts | 12 - .../src/i18n/languages/hi.ts | 12 - .../src/i18n/languages/hr.ts | 12 - .../src/i18n/languages/hu.ts | 12 - .../src/i18n/languages/hy.ts | 12 - .../src/i18n/languages/id.ts | 12 - .../src/i18n/languages/ig.ts | 12 - .../src/i18n/languages/it.ts | 12 - .../src/i18n/languages/ja.ts | 12 - .../src/i18n/languages/ka.ts | 15 - .../src/i18n/languages/kk.ts | 12 - .../src/i18n/languages/km.ts | 12 - .../src/i18n/languages/kn.ts | 12 - .../src/i18n/languages/ko.ts | 12 - .../src/i18n/languages/ku.ts | 12 - .../src/i18n/languages/lo.ts | 12 - .../src/i18n/languages/lt.ts | 12 - .../src/i18n/languages/lv.ts | 12 - .../src/i18n/languages/ml.ts | 12 - .../src/i18n/languages/mr.ts | 12 - .../src/i18n/languages/ms.ts | 12 - .../src/i18n/languages/nb.ts | 15 - .../src/i18n/languages/ne.ts | 12 - .../src/i18n/languages/nl.ts | 12 - .../src/i18n/languages/or.ts | 12 - .../src/i18n/languages/pa.ts | 12 - .../src/i18n/languages/pl.ts | 12 - .../src/i18n/languages/pt.ts | 12 - .../src/i18n/languages/ro.ts | 12 - .../src/i18n/languages/ru.ts | 12 - .../src/i18n/languages/sa.ts | 12 - .../src/i18n/languages/sd.ts | 12 - .../src/i18n/languages/si.ts | 12 - .../src/i18n/languages/sm.ts | 12 - .../src/i18n/languages/sq.ts | 12 - .../src/i18n/languages/sv.ts | 15 - .../src/i18n/languages/ta.ts | 12 - .../src/i18n/languages/te.ts | 12 - .../src/i18n/languages/th.ts | 12 - .../src/i18n/languages/tl.ts | 12 - .../src/i18n/languages/tr.ts | 12 - .../src/i18n/languages/uk.ts | 12 - .../src/i18n/languages/ur.ts | 12 - .../src/i18n/languages/uz.ts | 12 - .../src/i18n/languages/vi.ts | 12 - .../src/i18n/languages/zh.ts | 12 - .../src/i18n/languages/zu.ts | 12 - .../src/images/NoNewNotifications.tsx | 82 --- .../src/images/NoSettings.tsx | 45 -- .../notification-center/src/index.test.ts | 215 ------ packages/notification-center/src/index.ts | 20 - packages/notification-center/src/lang.ts | 20 - .../src/shared/config/colors.ts | 22 - .../src/shared/config/shadows.ts | 6 - .../src/shared/config/themeDefaultValues.ts | 138 ---- .../src/shared/icons/ArrowLeft.tsx | 12 - .../src/shared/icons/Bell.tsx | 22 - .../src/shared/icons/Check.tsx | 12 - .../src/shared/icons/Cogs.tsx | 29 - .../src/shared/icons/DotsHorizontal.tsx | 12 - .../src/shared/icons/GradientDot.tsx | 36 - .../src/shared/icons/Read.tsx | 12 - .../src/shared/icons/Trash.tsx | 12 - .../icons/avatar-system-icons/Avatar.tsx | 13 - .../icons/avatar-system-icons/ErrorIcon.tsx | 18 - .../shared/icons/avatar-system-icons/Info.tsx | 18 - .../icons/avatar-system-icons/Question.tsx | 18 - .../icons/avatar-system-icons/Success.tsx | 10 - .../shared/icons/avatar-system-icons/Up.tsx | 18 - .../icons/avatar-system-icons/Warning.tsx | 18 - .../src/shared/icons/channels/Chat.tsx | 15 - .../src/shared/icons/channels/Mail.tsx | 15 - .../src/shared/icons/channels/Mobile.tsx | 15 - .../src/shared/icons/channels/Sms.tsx | 15 - .../src/shared/icons/index.ts | 18 - .../src/shared/interfaces/index.ts | 155 ----- .../src/shared/utils/When.tsx | 1 - .../src/shared/utils/applyToken.ts | 1 - .../src/store/i18n.context.tsx | 36 - .../src/store/notification-center.context.ts | 24 - .../store/notifications-provider.context.tsx | 180 ----- .../src/store/notifications.context.ts | 4 - .../src/store/novu-provider.context.ts | 4 - .../src/store/novu-theme-provider.context.tsx | 36 - .../src/store/novu-theme.context.ts | 118 ---- .../src/store/store-provider.context.tsx | 31 - .../src/store/store.context.ts | 5 - .../src/store/styles/index.ts | 2 - .../src/store/styles/styles-provider.tsx | 48 -- .../src/store/styles/styles-provider.types.ts | 121 ---- .../src/stories/Introduction.stories.mdx | 213 ------ .../src/stories/assets/code-brackets.svg | 1 - .../src/stories/assets/colors.svg | 1 - .../src/stories/assets/comments.svg | 1 - .../src/stories/assets/direction.svg | 1 - .../src/stories/assets/flow.svg | 1 - .../src/stories/assets/plugin.svg | 1 - .../src/stories/assets/repo.svg | 1 - .../src/stories/assets/stackalt.svg | 1 - .../notification-center/src/utils/date.ts | 39 -- .../src/utils/defaultTheme.ts | 53 -- .../notification-center/src/utils/index.ts | 1 - .../src/utils/pagination.test.ts | 22 - .../src/utils/pagination.ts | 5 - .../src/utils/react-to-webcomponent.ts | 280 -------- .../notification-center/src/utils/styles.ts | 29 - .../notification-center/src/utils/token.ts | 26 - .../notification-center/src/web-component.ts | 3 - .../notification-center/tsconfig.esm.json | 7 - packages/notification-center/tsconfig.json | 22 - .../notification-center/webpack.config.js | 64 -- 252 files changed, 9766 deletions(-) delete mode 100644 packages/notification-center-angular/.editorconfig delete mode 100644 packages/notification-center-angular/.gitignore delete mode 100644 packages/notification-center-angular/README.md delete mode 100644 packages/notification-center-angular/angular.json delete mode 100644 packages/notification-center-angular/package.json delete mode 100644 packages/notification-center-angular/projects/notification-center-angular/README.md delete mode 100644 packages/notification-center-angular/projects/notification-center-angular/ng-package.json delete mode 100644 packages/notification-center-angular/projects/notification-center-angular/package.json delete mode 100644 packages/notification-center-angular/projects/notification-center-angular/src/index.ts delete mode 100644 packages/notification-center-angular/projects/notification-center-angular/src/lib/index.ts delete mode 100644 packages/notification-center-angular/projects/notification-center-angular/src/lib/notification-center.component.ts delete mode 100644 packages/notification-center-angular/projects/notification-center-angular/src/lib/notification-center.module.ts delete mode 100644 packages/notification-center-angular/projects/notification-center-angular/tsconfig.lib.json delete mode 100644 packages/notification-center-angular/projects/notification-center-angular/tsconfig.lib.prod.json delete mode 100644 packages/notification-center-angular/projects/notification-center-angular/tsconfig.spec.json delete mode 100644 packages/notification-center-angular/tsconfig.json delete mode 100644 packages/notification-center-vue/.gitignore delete mode 100644 packages/notification-center-vue/package.json delete mode 100644 packages/notification-center-vue/src/index.ts delete mode 100644 packages/notification-center-vue/src/lib/index.ts delete mode 100644 packages/notification-center-vue/src/lib/notification-center-component/BellButton.vue delete mode 100644 packages/notification-center-vue/src/lib/notification-center-component/NotificationCenterComponent.vue delete mode 100644 packages/notification-center-vue/src/lib/notification-center-component/index.ts delete mode 100644 packages/notification-center-vue/src/lib/notification-center-component/utils.ts delete mode 100644 packages/notification-center-vue/src/noop.d.ts delete mode 100644 packages/notification-center-vue/src/vue-shim.d.ts delete mode 100644 packages/notification-center-vue/tsconfig.config.json delete mode 100644 packages/notification-center-vue/tsconfig.json delete mode 100644 packages/notification-center-vue/vite.config.js delete mode 100644 packages/notification-center/.babelrc.json delete mode 100644 packages/notification-center/.gitignore delete mode 100644 packages/notification-center/.storybook/main.js delete mode 100644 packages/notification-center/.storybook/preview.js delete mode 100644 packages/notification-center/jest.config.js delete mode 100644 packages/notification-center/netlify.toml delete mode 100644 packages/notification-center/package.json delete mode 100644 packages/notification-center/src/components/index.ts delete mode 100644 packages/notification-center/src/components/notification-bell/NotificationBell.tsx delete mode 100644 packages/notification-center/src/components/notification-bell/index.ts delete mode 100644 packages/notification-center/src/components/notification-center-web-component/index.ts delete mode 100644 packages/notification-center/src/components/notification-center-web-component/notification-center-component.tsx delete mode 100644 packages/notification-center/src/components/notification-center-web-component/notification-center-component.types.ts delete mode 100644 packages/notification-center/src/components/notification-center-web-component/notification-center-content-component.tsx delete mode 100644 packages/notification-center/src/components/notification-center/NotificationCenter.tsx delete mode 100644 packages/notification-center/src/components/notification-center/components/AppContent.tsx delete mode 100644 packages/notification-center/src/components/notification-center/components/FeedsTabs.tsx delete mode 100644 packages/notification-center/src/components/notification-center/components/Loader.tsx delete mode 100644 packages/notification-center/src/components/notification-center/components/NotificationsList.tsx delete mode 100644 packages/notification-center/src/components/notification-center/components/NotificationsListTab.tsx delete mode 100644 packages/notification-center/src/components/notification-center/components/SeenAllBlock.tsx delete mode 100644 packages/notification-center/src/components/notification-center/components/UnseenBadge.tsx delete mode 100644 packages/notification-center/src/components/notification-center/components/index.ts delete mode 100644 packages/notification-center/src/components/notification-center/components/layout/Layout.tsx delete mode 100644 packages/notification-center/src/components/notification-center/components/layout/footer/Footer.tsx delete mode 100644 packages/notification-center/src/components/notification-center/components/layout/footer/FooterContainer.tsx delete mode 100644 packages/notification-center/src/components/notification-center/components/layout/header/Header.tsx delete mode 100644 packages/notification-center/src/components/notification-center/components/layout/header/UserPreferenceHeader.tsx delete mode 100644 packages/notification-center/src/components/notification-center/components/layout/tabs/Tabs.styles.ts delete mode 100644 packages/notification-center/src/components/notification-center/components/layout/tabs/Tabs.tsx delete mode 100644 packages/notification-center/src/components/notification-center/components/notification-item/ActionContainer.tsx delete mode 100644 packages/notification-center/src/components/notification-center/components/notification-item/NotificationItemButton.tsx delete mode 100644 packages/notification-center/src/components/notification-center/components/notification-item/NotificationListItem.tsx delete mode 100644 packages/notification-center/src/components/notification-center/components/user-preference/ChannelPreference.tsx delete mode 100644 packages/notification-center/src/components/notification-center/components/user-preference/SubscriberPreference.tsx delete mode 100644 packages/notification-center/src/components/notification-center/components/user-preference/UserPreferenceItem.tsx delete mode 100644 packages/notification-center/src/components/notification-center/components/user-preference/WorkflowHeader.tsx delete mode 100644 packages/notification-center/src/components/notification-center/components/user-preference/channels.tsx delete mode 100644 packages/notification-center/src/components/notification-center/components/user-preference/styles.ts delete mode 100644 packages/notification-center/src/components/notification-center/index.ts delete mode 100644 packages/notification-center/src/components/novu-provider/NovuProvider.test.tsx delete mode 100644 packages/notification-center/src/components/novu-provider/NovuProvider.tsx delete mode 100644 packages/notification-center/src/components/novu-provider/index.ts delete mode 100644 packages/notification-center/src/components/popover-notification-center/PopoverNotificationCenter.tsx delete mode 100644 packages/notification-center/src/components/popover-notification-center/components/Popover.tsx delete mode 100644 packages/notification-center/src/components/popover-notification-center/index.ts delete mode 100644 packages/notification-center/src/components/types.ts delete mode 100644 packages/notification-center/src/emotion.d.ts delete mode 100644 packages/notification-center/src/global.d.ts delete mode 100644 packages/notification-center/src/hooks/index.ts delete mode 100644 packages/notification-center/src/hooks/queryKeys.ts delete mode 100644 packages/notification-center/src/hooks/useDataRef.ts delete mode 100644 packages/notification-center/src/hooks/useFeedUnseenCount.ts delete mode 100644 packages/notification-center/src/hooks/useFeedUnseenCountQueryKey.ts delete mode 100644 packages/notification-center/src/hooks/useFetchNotifications.ts delete mode 100644 packages/notification-center/src/hooks/useFetchNotificationsQueryKey.ts delete mode 100644 packages/notification-center/src/hooks/useFetchOrganization.ts delete mode 100644 packages/notification-center/src/hooks/useFetchUserGlobalPreferences.ts delete mode 100644 packages/notification-center/src/hooks/useFetchUserGlobalPreferencesQueryKey.ts delete mode 100644 packages/notification-center/src/hooks/useFetchUserPreferences.ts delete mode 100644 packages/notification-center/src/hooks/useFetchUserPreferencesQueryKey.ts delete mode 100644 packages/notification-center/src/hooks/useInitializeSocket.ts delete mode 100644 packages/notification-center/src/hooks/useMarkNotificationAsRead.ts delete mode 100644 packages/notification-center/src/hooks/useMarkNotificationAsSeen.ts delete mode 100644 packages/notification-center/src/hooks/useMarkNotificationsAs.ts delete mode 100644 packages/notification-center/src/hooks/useNotificationCenter.ts delete mode 100644 packages/notification-center/src/hooks/useNotifications.test.tsx delete mode 100644 packages/notification-center/src/hooks/useNotifications.ts delete mode 100644 packages/notification-center/src/hooks/useNovuContext.ts delete mode 100644 packages/notification-center/src/hooks/useNovuTheme.ts delete mode 100644 packages/notification-center/src/hooks/useProviderCheck.ts delete mode 100644 packages/notification-center/src/hooks/useRemoveAllNotifications.ts delete mode 100644 packages/notification-center/src/hooks/useRemoveNotification.ts delete mode 100644 packages/notification-center/src/hooks/useRemoveNotifications.ts delete mode 100644 packages/notification-center/src/hooks/useSession.ts delete mode 100644 packages/notification-center/src/hooks/useSetQueryKey.ts delete mode 100644 packages/notification-center/src/hooks/useSocket.ts delete mode 100644 packages/notification-center/src/hooks/useStore.ts delete mode 100644 packages/notification-center/src/hooks/useTranslations.ts delete mode 100644 packages/notification-center/src/hooks/useUnreadCount.ts delete mode 100644 packages/notification-center/src/hooks/useUnreadCountQueryKey.ts delete mode 100644 packages/notification-center/src/hooks/useUnseenCount.ts delete mode 100644 packages/notification-center/src/hooks/useUnseenCountQueryKey.ts delete mode 100644 packages/notification-center/src/hooks/useUpdateAction.ts delete mode 100644 packages/notification-center/src/hooks/useUpdateUserGlobalPreferences.ts delete mode 100644 packages/notification-center/src/hooks/useUpdateUserPreferences.ts delete mode 100644 packages/notification-center/src/i18n/lang.ts delete mode 100644 packages/notification-center/src/i18n/languages/af.ts delete mode 100644 packages/notification-center/src/i18n/languages/am.ts delete mode 100644 packages/notification-center/src/i18n/languages/ar.ts delete mode 100644 packages/notification-center/src/i18n/languages/as.ts delete mode 100644 packages/notification-center/src/i18n/languages/az.ts delete mode 100644 packages/notification-center/src/i18n/languages/ba.ts delete mode 100644 packages/notification-center/src/i18n/languages/be.ts delete mode 100644 packages/notification-center/src/i18n/languages/bg.ts delete mode 100644 packages/notification-center/src/i18n/languages/bh.ts delete mode 100644 packages/notification-center/src/i18n/languages/bn.ts delete mode 100644 packages/notification-center/src/i18n/languages/bs.ts delete mode 100644 packages/notification-center/src/i18n/languages/ca.ts delete mode 100644 packages/notification-center/src/i18n/languages/cs.ts delete mode 100644 packages/notification-center/src/i18n/languages/da.ts delete mode 100644 packages/notification-center/src/i18n/languages/de.ts delete mode 100644 packages/notification-center/src/i18n/languages/el.ts delete mode 100644 packages/notification-center/src/i18n/languages/en.ts delete mode 100644 packages/notification-center/src/i18n/languages/es.ts delete mode 100644 packages/notification-center/src/i18n/languages/eu.ts delete mode 100644 packages/notification-center/src/i18n/languages/fa.ts delete mode 100644 packages/notification-center/src/i18n/languages/fi.ts delete mode 100644 packages/notification-center/src/i18n/languages/fr.ts delete mode 100644 packages/notification-center/src/i18n/languages/ga.ts delete mode 100644 packages/notification-center/src/i18n/languages/gl.ts delete mode 100644 packages/notification-center/src/i18n/languages/gu.ts delete mode 100644 packages/notification-center/src/i18n/languages/he.ts delete mode 100644 packages/notification-center/src/i18n/languages/hi.ts delete mode 100644 packages/notification-center/src/i18n/languages/hr.ts delete mode 100644 packages/notification-center/src/i18n/languages/hu.ts delete mode 100644 packages/notification-center/src/i18n/languages/hy.ts delete mode 100644 packages/notification-center/src/i18n/languages/id.ts delete mode 100644 packages/notification-center/src/i18n/languages/ig.ts delete mode 100644 packages/notification-center/src/i18n/languages/it.ts delete mode 100644 packages/notification-center/src/i18n/languages/ja.ts delete mode 100644 packages/notification-center/src/i18n/languages/ka.ts delete mode 100644 packages/notification-center/src/i18n/languages/kk.ts delete mode 100644 packages/notification-center/src/i18n/languages/km.ts delete mode 100644 packages/notification-center/src/i18n/languages/kn.ts delete mode 100644 packages/notification-center/src/i18n/languages/ko.ts delete mode 100644 packages/notification-center/src/i18n/languages/ku.ts delete mode 100644 packages/notification-center/src/i18n/languages/lo.ts delete mode 100644 packages/notification-center/src/i18n/languages/lt.ts delete mode 100644 packages/notification-center/src/i18n/languages/lv.ts delete mode 100644 packages/notification-center/src/i18n/languages/ml.ts delete mode 100644 packages/notification-center/src/i18n/languages/mr.ts delete mode 100644 packages/notification-center/src/i18n/languages/ms.ts delete mode 100644 packages/notification-center/src/i18n/languages/nb.ts delete mode 100644 packages/notification-center/src/i18n/languages/ne.ts delete mode 100644 packages/notification-center/src/i18n/languages/nl.ts delete mode 100644 packages/notification-center/src/i18n/languages/or.ts delete mode 100644 packages/notification-center/src/i18n/languages/pa.ts delete mode 100644 packages/notification-center/src/i18n/languages/pl.ts delete mode 100644 packages/notification-center/src/i18n/languages/pt.ts delete mode 100644 packages/notification-center/src/i18n/languages/ro.ts delete mode 100644 packages/notification-center/src/i18n/languages/ru.ts delete mode 100644 packages/notification-center/src/i18n/languages/sa.ts delete mode 100644 packages/notification-center/src/i18n/languages/sd.ts delete mode 100644 packages/notification-center/src/i18n/languages/si.ts delete mode 100644 packages/notification-center/src/i18n/languages/sm.ts delete mode 100644 packages/notification-center/src/i18n/languages/sq.ts delete mode 100644 packages/notification-center/src/i18n/languages/sv.ts delete mode 100644 packages/notification-center/src/i18n/languages/ta.ts delete mode 100644 packages/notification-center/src/i18n/languages/te.ts delete mode 100644 packages/notification-center/src/i18n/languages/th.ts delete mode 100644 packages/notification-center/src/i18n/languages/tl.ts delete mode 100644 packages/notification-center/src/i18n/languages/tr.ts delete mode 100644 packages/notification-center/src/i18n/languages/uk.ts delete mode 100644 packages/notification-center/src/i18n/languages/ur.ts delete mode 100644 packages/notification-center/src/i18n/languages/uz.ts delete mode 100644 packages/notification-center/src/i18n/languages/vi.ts delete mode 100644 packages/notification-center/src/i18n/languages/zh.ts delete mode 100644 packages/notification-center/src/i18n/languages/zu.ts delete mode 100644 packages/notification-center/src/images/NoNewNotifications.tsx delete mode 100644 packages/notification-center/src/images/NoSettings.tsx delete mode 100644 packages/notification-center/src/index.test.ts delete mode 100644 packages/notification-center/src/index.ts delete mode 100644 packages/notification-center/src/lang.ts delete mode 100644 packages/notification-center/src/shared/config/colors.ts delete mode 100644 packages/notification-center/src/shared/config/shadows.ts delete mode 100644 packages/notification-center/src/shared/config/themeDefaultValues.ts delete mode 100644 packages/notification-center/src/shared/icons/ArrowLeft.tsx delete mode 100644 packages/notification-center/src/shared/icons/Bell.tsx delete mode 100644 packages/notification-center/src/shared/icons/Check.tsx delete mode 100644 packages/notification-center/src/shared/icons/Cogs.tsx delete mode 100644 packages/notification-center/src/shared/icons/DotsHorizontal.tsx delete mode 100644 packages/notification-center/src/shared/icons/GradientDot.tsx delete mode 100644 packages/notification-center/src/shared/icons/Read.tsx delete mode 100644 packages/notification-center/src/shared/icons/Trash.tsx delete mode 100644 packages/notification-center/src/shared/icons/avatar-system-icons/Avatar.tsx delete mode 100644 packages/notification-center/src/shared/icons/avatar-system-icons/ErrorIcon.tsx delete mode 100644 packages/notification-center/src/shared/icons/avatar-system-icons/Info.tsx delete mode 100644 packages/notification-center/src/shared/icons/avatar-system-icons/Question.tsx delete mode 100644 packages/notification-center/src/shared/icons/avatar-system-icons/Success.tsx delete mode 100644 packages/notification-center/src/shared/icons/avatar-system-icons/Up.tsx delete mode 100644 packages/notification-center/src/shared/icons/avatar-system-icons/Warning.tsx delete mode 100644 packages/notification-center/src/shared/icons/channels/Chat.tsx delete mode 100644 packages/notification-center/src/shared/icons/channels/Mail.tsx delete mode 100644 packages/notification-center/src/shared/icons/channels/Mobile.tsx delete mode 100644 packages/notification-center/src/shared/icons/channels/Sms.tsx delete mode 100644 packages/notification-center/src/shared/icons/index.ts delete mode 100644 packages/notification-center/src/shared/interfaces/index.ts delete mode 100644 packages/notification-center/src/shared/utils/When.tsx delete mode 100644 packages/notification-center/src/shared/utils/applyToken.ts delete mode 100644 packages/notification-center/src/store/i18n.context.tsx delete mode 100644 packages/notification-center/src/store/notification-center.context.ts delete mode 100644 packages/notification-center/src/store/notifications-provider.context.tsx delete mode 100644 packages/notification-center/src/store/notifications.context.ts delete mode 100644 packages/notification-center/src/store/novu-provider.context.ts delete mode 100644 packages/notification-center/src/store/novu-theme-provider.context.tsx delete mode 100644 packages/notification-center/src/store/novu-theme.context.ts delete mode 100644 packages/notification-center/src/store/store-provider.context.tsx delete mode 100644 packages/notification-center/src/store/store.context.ts delete mode 100644 packages/notification-center/src/store/styles/index.ts delete mode 100644 packages/notification-center/src/store/styles/styles-provider.tsx delete mode 100644 packages/notification-center/src/store/styles/styles-provider.types.ts delete mode 100644 packages/notification-center/src/stories/Introduction.stories.mdx delete mode 100644 packages/notification-center/src/stories/assets/code-brackets.svg delete mode 100644 packages/notification-center/src/stories/assets/colors.svg delete mode 100644 packages/notification-center/src/stories/assets/comments.svg delete mode 100644 packages/notification-center/src/stories/assets/direction.svg delete mode 100644 packages/notification-center/src/stories/assets/flow.svg delete mode 100644 packages/notification-center/src/stories/assets/plugin.svg delete mode 100644 packages/notification-center/src/stories/assets/repo.svg delete mode 100644 packages/notification-center/src/stories/assets/stackalt.svg delete mode 100644 packages/notification-center/src/utils/date.ts delete mode 100644 packages/notification-center/src/utils/defaultTheme.ts delete mode 100644 packages/notification-center/src/utils/index.ts delete mode 100644 packages/notification-center/src/utils/pagination.test.ts delete mode 100644 packages/notification-center/src/utils/pagination.ts delete mode 100644 packages/notification-center/src/utils/react-to-webcomponent.ts delete mode 100644 packages/notification-center/src/utils/styles.ts delete mode 100644 packages/notification-center/src/utils/token.ts delete mode 100644 packages/notification-center/src/web-component.ts delete mode 100644 packages/notification-center/tsconfig.esm.json delete mode 100644 packages/notification-center/tsconfig.json delete mode 100644 packages/notification-center/webpack.config.js diff --git a/packages/notification-center-angular/.editorconfig b/packages/notification-center-angular/.editorconfig deleted file mode 100644 index 59d9a3a3e73..00000000000 --- a/packages/notification-center-angular/.editorconfig +++ /dev/null @@ -1,16 +0,0 @@ -# Editor configuration, see https://editorconfig.org -root = true - -[*] -charset = utf-8 -indent_style = space -indent_size = 2 -insert_final_newline = true -trim_trailing_whitespace = true - -[*.ts] -quote_type = single - -[*.md] -max_line_length = off -trim_trailing_whitespace = false diff --git a/packages/notification-center-angular/.gitignore b/packages/notification-center-angular/.gitignore deleted file mode 100644 index 0711527ef9d..00000000000 --- a/packages/notification-center-angular/.gitignore +++ /dev/null @@ -1,42 +0,0 @@ -# See http://help.github.com/ignore-files/ for more about ignoring files. - -# Compiled output -/dist -/tmp -/out-tsc -/bazel-out - -# Node -/node_modules -npm-debug.log -yarn-error.log - -# IDEs and editors -.idea/ -.project -.classpath -.c9/ -*.launch -.settings/ -*.sublime-workspace - -# Visual Studio Code -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json -.history/* - -# Miscellaneous -/.angular/cache -.sass-cache/ -/connect.lock -/coverage -/libpeerconnection.log -testem.log -/typings - -# System files -.DS_Store -Thumbs.db diff --git a/packages/notification-center-angular/README.md b/packages/notification-center-angular/README.md deleted file mode 100644 index 788833d55a2..00000000000 --- a/packages/notification-center-angular/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# NotificationCenterAngular - -This is the Angular workspace root project for Novu Angular libraries and components. The libraries are located under `/projects/*`. -New libraries should also be added under `/projects/*` by using the `ng generate library ` command. - -## Publishing -To publish the `@novu/notification-center-angular` package, simply run `npm run publish:npm`. The following steps will be executed: - -1. Build package into the `/dist/notification-center-angular` directory -2. Publish the `/dist/notification-center-angular` to NPM under @novu/notification-center-angular` - -> ⚠️ Ensure that the `/projects/notification-center-angular/package.json` has the correct `@novu/*` version values before publishing - -## Build - -Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. - -## Running unit tests - -Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). - -## Running end-to-end tests - -Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities. - -## Further help - -To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page. diff --git a/packages/notification-center-angular/angular.json b/packages/notification-center-angular/angular.json deleted file mode 100644 index 3bd0836892c..00000000000 --- a/packages/notification-center-angular/angular.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "$schema": "./node_modules/@angular/cli/lib/config/schema.json", - "version": 1, - "newProjectRoot": "projects", - "projects": { - "notification-center-angular": { - "projectType": "library", - "root": "projects/notification-center-angular", - "sourceRoot": "projects/notification-center-angular/src", - "prefix": "lib", - "architect": { - "build": { - "builder": "@angular-devkit/build-angular:ng-packagr", - "options": { - "project": "projects/notification-center-angular/ng-package.json" - }, - "configurations": { - "production": { - "tsConfig": "projects/notification-center-angular/tsconfig.lib.prod.json" - }, - "development": { - "tsConfig": "projects/notification-center-angular/tsconfig.lib.json" - } - }, - "defaultConfiguration": "production" - }, - "test": { - "builder": "@angular-devkit/build-angular:karma", - "options": { - "tsConfig": "projects/notification-center-angular/tsconfig.spec.json", - "polyfills": ["zone.js", "zone.js/testing"] - } - } - } - } - }, - "cli": { - "analytics": false - } -} diff --git a/packages/notification-center-angular/package.json b/packages/notification-center-angular/package.json deleted file mode 100644 index 616e293fbd4..00000000000 --- a/packages/notification-center-angular/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "@novu/angular-workspace", - "version": "2.0.0", - "scripts": { - "ng": "ng", - "start": "ng serve", - "build": "ng build", - "watch": "ng build --watch --configuration development", - "test": "echo \"no tests\"", - "lint": "echo \"No linting configured\"" - }, - "private": true, - "dependencies": { - "@angular/animations": "^16.2.0", - "@angular/common": "^16.2.0", - "@angular/compiler": "^16.2.0", - "@angular/core": "^16.2.0", - "@angular/forms": "^16.2.0", - "@angular/platform-browser": "^16.2.0", - "@angular/platform-browser-dynamic": "^16.2.0", - "@angular/router": "^16.2.0", - "@novu/notification-center": "workspace:*", - "rxjs": "7.8.1", - "tslib": "^2.3.0", - "zone.js": "~0.13.0" - }, - "devDependencies": { - "@angular-devkit/build-angular": "^16.2.5", - "@angular/cli": "^16.2.5", - "@angular/compiler-cli": "^16.2.0", - "@types/jasmine": "~4.3.0", - "jasmine-core": "~4.6.0", - "karma": "~6.4.0", - "karma-chrome-launcher": "~3.2.0", - "karma-coverage": "~2.2.0", - "karma-jasmine": "~5.1.0", - "karma-jasmine-html-reporter": "~2.1.0", - "ng-packagr": "^16.2.0", - "typescript": "5.6.2" - }, - "nx": { - "tags": ["package:public"] - } -} diff --git a/packages/notification-center-angular/projects/notification-center-angular/README.md b/packages/notification-center-angular/projects/notification-center-angular/README.md deleted file mode 100644 index 78770371ac7..00000000000 --- a/packages/notification-center-angular/projects/notification-center-angular/README.md +++ /dev/null @@ -1,27 +0,0 @@ -
- - - - Logo - - -
- -# @novu/notification-center-angular - -[![Version](https://img.shields.io/npm/v/@novu/notification-center-angular.svg)](https://www.npmjs.com/package/@novu/notification-center-angular) -[![Downloads](https://img.shields.io/npm/dm/@novu/notification-center-angular.svg)](https://www.npmjs.com/package/@novu/notification-center-angular) - -This library contains a wrapper for the Novu Notification Center web component, allowing you to quickly integrate product notifications into your Angular application. - -## 📖 Client Installation - -For our client installation guide, visit our [Angular Client docs](https://docs.novu.co/notification-center/client/angular?utm_campaign=github-notificationcenter-angular-readme). - -## 🏃‍♂️ Quickstart - -For a quickstart, visit our [Angular Quickstart docs](https://docs.novu.co/quickstarts/angular). - -## 💻 Need Help? - -We are more than happy to help you. If you are getting any errors or facing problems while working on this project, join our [Discord server](https://discord.novu.co) and ask for help. We are open to discussing anything related to the project. diff --git a/packages/notification-center-angular/projects/notification-center-angular/ng-package.json b/packages/notification-center-angular/projects/notification-center-angular/ng-package.json deleted file mode 100644 index c8873ed79fe..00000000000 --- a/packages/notification-center-angular/projects/notification-center-angular/ng-package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "$schema": "../../node_modules/ng-packagr/ng-package.schema.json", - "lib": { - "entryFile": "src/index.ts" - }, - "allowedNonPeerDependencies": ["react", "react-dom", "@novu/notification-center"] -} diff --git a/packages/notification-center-angular/projects/notification-center-angular/package.json b/packages/notification-center-angular/projects/notification-center-angular/package.json deleted file mode 100644 index d027dc00509..00000000000 --- a/packages/notification-center-angular/projects/notification-center-angular/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "@novu/notification-center-angular", - "version": "2.0.0", - "peerDependencies": { - "@angular/common": "^15.0.0 || ^16.0.0 || ^17.0.0", - "@angular/core": "^15.0.0 || ^16.0.0 || ^17.0.0", - "@angular/platform-browser": "^15.0.0 || ^16.0.0 || ^17.0.0", - "@angular/platform-browser-dynamic": "^15.0.0 || ^16.0.0 || ^17.0.0" - }, - "dependencies": { - "@novu/notification-center": "workspace:*", - "@types/react": "^18.3.3", - "react": "^18.3.1", - "react-dom": "^18.3.1", - "tslib": "^2.3.0" - }, - "files": [ - "dist/esm2022", - "dist/fesm2022", - "dist/lib", - "dist/index.d.ts" - ], - "module": "dist/fesm2022/novu-notification-center-angular.mjs", - "typings": "dist/index.d.ts", - "exports": { - "./package.json": { - "default": "./package.json" - }, - ".": { - "types": "./dist/index.d.ts", - "esm2022": "./dist/esm2022/novu-notification-center-angular.mjs", - "esm": "./dist/esm2022/novu-notification-center-angular.mjs", - "default": "./dist/fesm2022/novu-notification-center-angular.mjs" - } - }, - "sideEffects": false -} diff --git a/packages/notification-center-angular/projects/notification-center-angular/src/index.ts b/packages/notification-center-angular/projects/notification-center-angular/src/index.ts deleted file mode 100644 index f41a696fd20..00000000000 --- a/packages/notification-center-angular/projects/notification-center-angular/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './lib'; diff --git a/packages/notification-center-angular/projects/notification-center-angular/src/lib/index.ts b/packages/notification-center-angular/projects/notification-center-angular/src/lib/index.ts deleted file mode 100644 index 4a63c6fee82..00000000000 --- a/packages/notification-center-angular/projects/notification-center-angular/src/lib/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './notification-center.component'; -export * from './notification-center.module'; diff --git a/packages/notification-center-angular/projects/notification-center-angular/src/lib/notification-center.component.ts b/packages/notification-center-angular/projects/notification-center-angular/src/lib/notification-center.component.ts deleted file mode 100644 index 5fb3090ea0e..00000000000 --- a/packages/notification-center-angular/projects/notification-center-angular/src/lib/notification-center.component.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { Component, Input } from '@angular/core'; -import { NotificationCenterWebComponent, NotificationCenterComponentProps } from '@novu/notification-center'; - -customElements.define('notification-center-web-component', NotificationCenterWebComponent); - -@Component({ - selector: 'notification-center-component', - template: ``, - inputs: [ - 'backendUrl', - 'socketUrl', - 'subscriberId', - 'applicationIdentifier', - 'subscriberHash', - 'stores', - 'tabs', - 'showUserPreferences', - 'allowedNotificationActions', - 'popover', - 'popoverConfig', - 'theme', - 'styles', - 'colorScheme', - 'i18n', - 'sessionLoaded', - 'notificationClicked', - 'unseenCountChanged', - 'actionClicked', - 'tabClicked', - 'preferenceFilter', - ], -}) -export class NotificationCenterComponent { - @Input() backendUrl: NotificationCenterComponentProps['backendUrl']; - @Input() socketUrl: NotificationCenterComponentProps['socketUrl']; - @Input() subscriberId: NotificationCenterComponentProps['subscriberId']; - @Input() applicationIdentifier: NotificationCenterComponentProps['applicationIdentifier'] = ''; - @Input() subscriberHash: NotificationCenterComponentProps['subscriberHash']; - @Input() stores: NotificationCenterComponentProps['stores']; - @Input() tabs: NotificationCenterComponentProps['tabs']; - @Input() showUserPreferences: NotificationCenterComponentProps['showUserPreferences']; - @Input() allowedNotificationActions: NotificationCenterComponentProps['allowedNotificationActions']; - /** - * @deprecated Use popoverConfig instead - */ - @Input() popover: NotificationCenterComponentProps['popover']; - @Input() popoverConfig: NotificationCenterComponentProps['popoverConfig']; - @Input() theme: NotificationCenterComponentProps['theme']; - @Input() styles: NotificationCenterComponentProps['styles']; - @Input() colorScheme?: NotificationCenterComponentProps['colorScheme']; - @Input() i18n: NotificationCenterComponentProps['i18n']; - @Input() sessionLoaded: NotificationCenterComponentProps['sessionLoaded']; - @Input() notificationClicked?: NotificationCenterComponentProps['notificationClicked']; - @Input() unseenCountChanged: NotificationCenterComponentProps['unseenCountChanged']; - @Input() actionClicked: NotificationCenterComponentProps['actionClicked']; - @Input() tabClicked: NotificationCenterComponentProps['tabClicked']; - @Input() preferenceFilter: NotificationCenterComponentProps['preferenceFilter']; -} diff --git a/packages/notification-center-angular/projects/notification-center-angular/src/lib/notification-center.module.ts b/packages/notification-center-angular/projects/notification-center-angular/src/lib/notification-center.module.ts deleted file mode 100644 index 2057c8b4666..00000000000 --- a/packages/notification-center-angular/projects/notification-center-angular/src/lib/notification-center.module.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; - -import { NotificationCenterComponent } from './notification-center.component'; - -@NgModule({ - declarations: [NotificationCenterComponent], - exports: [NotificationCenterComponent], - schemas: [CUSTOM_ELEMENTS_SCHEMA], -}) -export class NotificationCenterModule {} diff --git a/packages/notification-center-angular/projects/notification-center-angular/tsconfig.lib.json b/packages/notification-center-angular/projects/notification-center-angular/tsconfig.lib.json deleted file mode 100644 index 1680e858ece..00000000000 --- a/packages/notification-center-angular/projects/notification-center-angular/tsconfig.lib.json +++ /dev/null @@ -1,13 +0,0 @@ -/* To learn more about this file see: https://angular.io/config/tsconfig. */ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "dist", - "declaration": true, - "declarationMap": true, - "inlineSources": true, - "types": [], - "skipLibCheck": true - }, - "exclude": ["node_modules", "**/*.spec.ts", "../../node_modules"] -} diff --git a/packages/notification-center-angular/projects/notification-center-angular/tsconfig.lib.prod.json b/packages/notification-center-angular/projects/notification-center-angular/tsconfig.lib.prod.json deleted file mode 100644 index 06de549e107..00000000000 --- a/packages/notification-center-angular/projects/notification-center-angular/tsconfig.lib.prod.json +++ /dev/null @@ -1,10 +0,0 @@ -/* To learn more about this file see: https://angular.io/config/tsconfig. */ -{ - "extends": "./tsconfig.lib.json", - "compilerOptions": { - "declarationMap": false - }, - "angularCompilerOptions": { - "compilationMode": "partial" - } -} diff --git a/packages/notification-center-angular/projects/notification-center-angular/tsconfig.spec.json b/packages/notification-center-angular/projects/notification-center-angular/tsconfig.spec.json deleted file mode 100644 index 9436a07122e..00000000000 --- a/packages/notification-center-angular/projects/notification-center-angular/tsconfig.spec.json +++ /dev/null @@ -1,10 +0,0 @@ -/* To learn more about this file see: https://angular.io/config/tsconfig. */ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "../../out-tsc/spec", - "types": ["jasmine"] - }, - "include": ["**/*.spec.ts", "**/*.d.ts"], - "exclude": ["node_modules", "../../node_modules"] -} diff --git a/packages/notification-center-angular/tsconfig.json b/packages/notification-center-angular/tsconfig.json deleted file mode 100644 index 18d24685050..00000000000 --- a/packages/notification-center-angular/tsconfig.json +++ /dev/null @@ -1,31 +0,0 @@ -/* To learn more about this file see: https://angular.io/config/tsconfig. */ -{ - "compileOnSave": false, - "compilerOptions": { - "baseUrl": "./", - "outDir": "./dist/out-tsc", - "forceConsistentCasingInFileNames": true, - "strict": true, - "noImplicitOverride": true, - "noPropertyAccessFromIndexSignature": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true, - "sourceMap": true, - "declaration": false, - "downlevelIteration": true, - "experimentalDecorators": true, - "moduleResolution": "node", - "importHelpers": true, - "target": "ES2022", - "module": "ES2022", - "useDefineForClassFields": false, - "lib": ["ES2022", "dom"], - "skipLibCheck": true - }, - "angularCompilerOptions": { - "enableI18nLegacyMessageIdFormat": false, - "strictInjectionParameters": true, - "strictInputAccessModifiers": true, - "strictTemplates": true - } -} diff --git a/packages/notification-center-vue/.gitignore b/packages/notification-center-vue/.gitignore deleted file mode 100644 index 02637bde856..00000000000 --- a/packages/notification-center-vue/.gitignore +++ /dev/null @@ -1,61 +0,0 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# TypeScript v1 declaration files -typings/ - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# next.js build output -.next - -# Produced build files -dist diff --git a/packages/notification-center-vue/package.json b/packages/notification-center-vue/package.json deleted file mode 100644 index 97ce8a5f1d8..00000000000 --- a/packages/notification-center-vue/package.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "name": "@novu/notification-center-vue", - "sideEffects": false, - "version": "2.0.0", - "description": "Vue specific wrapper for notification-center", - "repository": { - "type": "git", - "url": "https://github.com/novuhq/novu.git" - }, - "scripts": { - "prebuild": "rimraf dist", - "build": "vite build && vue-tsc --declaration --emitDeclarationOnly --declarationMap --declarationDir dist -p tsconfig.json", - "test": "jest --passWithNoTests", - "lint": "echo \"No linting configured\"" - }, - "main": "dist/index.cjs.js", - "module": "dist/index.es.js", - "types": "dist/index.d.ts", - "files": [ - "dist" - ], - "dependencies": { - "@emotion/css": "^11.10.5", - "@novu/floating-vue": "^2.0.3", - "@novu/notification-center": "workspace:*", - "react": "^18.3.1", - "react-dom": "^18.3.1" - }, - "peerDependencies": { - "vue": ">=3.0.0" - }, - "devDependencies": { - "@rushstack/eslint-patch": "^1.1.4", - "@types/node": "^20.15.0", - "@vitejs/plugin-vue": "^4.0.0", - "@vitejs/plugin-vue-jsx": "^3.0.0", - "@vue/eslint-config-prettier": "^7.0.0", - "@vue/eslint-config-typescript": "^11.0.0", - "@vue/tsconfig": "^0.1.3", - "npm-run-all": "^4.1.5", - "prettier": "~2.8.0", - "typescript": "5.6.2", - "vite": "^4.5.2", - "vue": "^3.2.45", - "vue-tsc": "^1.2.0" - }, - "jest": { - "preset": "ts-jest", - "testPathIgnorePatterns": [ - "node_modules", - "dist" - ] - }, - "nx": { - "tags": ["package:public"] - } -} diff --git a/packages/notification-center-vue/src/index.ts b/packages/notification-center-vue/src/index.ts deleted file mode 100644 index a571d2f418c..00000000000 --- a/packages/notification-center-vue/src/index.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type { App } from 'vue'; -import FloatingVue from '@novu/floating-vue'; -// eslint-disable-next-line no-restricted-imports -import '@novu/floating-vue/dist/style.css'; -import { NotificationCenterContentWebComponent } from '@novu/notification-center'; - -import { NotificationCenterComponent } from './lib'; - -export { NotificationCenterComponent } from './lib'; - -const ONE_DAY = 24 * 60 * 60 * 1000; - -export default { - install(app: App) { - customElements.define('notification-center-content-component', NotificationCenterContentWebComponent); - - app.use(FloatingVue, { - disposeTimeout: ONE_DAY, - themes: { - dark: { - $extend: 'dropdown', - distance: 10, - }, - light: { - $extend: 'dropdown', - distance: 10, - }, - }, - }); - - app.component('NotificationCenterComponent', NotificationCenterComponent); - }, -}; diff --git a/packages/notification-center-vue/src/lib/index.ts b/packages/notification-center-vue/src/lib/index.ts deleted file mode 100644 index 56d5ad3450c..00000000000 --- a/packages/notification-center-vue/src/lib/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './notification-center-component'; diff --git a/packages/notification-center-vue/src/lib/notification-center-component/BellButton.vue b/packages/notification-center-vue/src/lib/notification-center-component/BellButton.vue deleted file mode 100644 index 27697f4f714..00000000000 --- a/packages/notification-center-vue/src/lib/notification-center-component/BellButton.vue +++ /dev/null @@ -1,116 +0,0 @@ - - - - - diff --git a/packages/notification-center-vue/src/lib/notification-center-component/NotificationCenterComponent.vue b/packages/notification-center-vue/src/lib/notification-center-component/NotificationCenterComponent.vue deleted file mode 100644 index 4854cc44373..00000000000 --- a/packages/notification-center-vue/src/lib/notification-center-component/NotificationCenterComponent.vue +++ /dev/null @@ -1,155 +0,0 @@ - - - - - \ No newline at end of file diff --git a/packages/notification-center-vue/src/lib/notification-center-component/index.ts b/packages/notification-center-vue/src/lib/notification-center-component/index.ts deleted file mode 100644 index fe04d5ac19a..00000000000 --- a/packages/notification-center-vue/src/lib/notification-center-component/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as NotificationCenterComponent } from './NotificationCenterComponent.vue'; diff --git a/packages/notification-center-vue/src/lib/notification-center-component/utils.ts b/packages/notification-center-vue/src/lib/notification-center-component/utils.ts deleted file mode 100644 index 7e0a00ba80d..00000000000 --- a/packages/notification-center-vue/src/lib/notification-center-component/utils.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { css } from '@emotion/css'; -import { getStyleByPath, getDefaultTheme, getDefaultBellColors } from '@novu/notification-center'; -import type { NotificationCenterContentComponentProps } from '@novu/notification-center'; - -export const calculateStyles = ({ - styles, - theme: propsTheme, - colorScheme, -}: Pick) => { - const { theme, common } = getDefaultTheme({ - colorScheme, - theme: propsTheme, - }); - const { bellColors } = getDefaultBellColors({ - colorScheme, - bellColors: {}, - }); - - return { - popoverArrowClass: css( - getStyleByPath({ - styles, - path: 'popover.arrow', - theme, - common, - colorScheme, - }) - ), - popoverDropdownClass: css( - getStyleByPath({ - styles, - path: 'popover.dropdown', - theme, - common, - colorScheme, - }) - ), - bellButtonClass: css( - getStyleByPath({ - styles, - path: 'bellButton.root', - theme, - common, - colorScheme, - }) - ), - gradientDotClass: css( - getStyleByPath({ - styles, - path: 'bellButton.dot', - theme, - common, - colorScheme, - }) - ), - bellColors, - }; -}; diff --git a/packages/notification-center-vue/src/noop.d.ts b/packages/notification-center-vue/src/noop.d.ts deleted file mode 100644 index d6393028bbf..00000000000 --- a/packages/notification-center-vue/src/noop.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* eslint-disable */ - -/** - * The @novu/notification-center package overrides the Vue JSX namespace - * with the one provided by the React JSX namespace. This is a workaround to fix that. - * During the development types will be any, but after the build they will be correct. - * GH issue: https://github.com/vuejs/core/issues/1033 - */ -declare module '@novu/notification-center' { - export const colors: any; - export const getStyleByPath: any; - export const getDefaultTheme: any; - export const getDefaultBellColors: any; - export const NotificationCenterContentWebComponent: any; - export interface NotificationCenterContentComponentProps { - [key: string]: any; - } -} diff --git a/packages/notification-center-vue/src/vue-shim.d.ts b/packages/notification-center-vue/src/vue-shim.d.ts deleted file mode 100644 index 1412099f6a4..00000000000 --- a/packages/notification-center-vue/src/vue-shim.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/// - -declare module '*.vue' { - import type { DefineComponent } from 'vue'; - - const component: DefineComponent; - export default component; -} diff --git a/packages/notification-center-vue/tsconfig.config.json b/packages/notification-center-vue/tsconfig.config.json deleted file mode 100644 index 1d7e7dde3c9..00000000000 --- a/packages/notification-center-vue/tsconfig.config.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "@vue/tsconfig/tsconfig.node.json", - "include": ["vite.config.*", "vitest.config.*", "playwright.config.*"], - "compilerOptions": { - "composite": true, - "types": ["node"] - } -} diff --git a/packages/notification-center-vue/tsconfig.json b/packages/notification-center-vue/tsconfig.json deleted file mode 100644 index 9a4b2282ea3..00000000000 --- a/packages/notification-center-vue/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "@vue/tsconfig/tsconfig.web.json", - "include": ["*.d.ts", "src/*", "src/**/*", "src/**/*.vue"], - "exclude": ["node_modules", "**/node_modules", "**/dist", "**/*.stories.*"], - "compilerOptions": { - "baseUrl": ".", - "paths": { - "@/*": ["./src/*"], - "@novu/notification-center": ["./src/noop.d.ts"] - } - }, - "references": [ - { - "path": "./tsconfig.config.json" - } - ] -} diff --git a/packages/notification-center-vue/vite.config.js b/packages/notification-center-vue/vite.config.js deleted file mode 100644 index c6c019e8f45..00000000000 --- a/packages/notification-center-vue/vite.config.js +++ /dev/null @@ -1,47 +0,0 @@ -import { defineConfig } from 'vite'; -import vue from '@vitejs/plugin-vue'; -import typescript2 from 'rollup-plugin-typescript2'; - -// https://vitejs.dev/config/ -export default defineConfig({ - plugins: [ - vue({ - template: { - compilerOptions: { - // treat all tags with a dash as custom elements - isCustomElement: (tag) => tag.includes('-'), - }, - }, - }), - typescript2({ - check: false, - include: ['src/components/**/*.vue'], - tsconfigOverride: { - compilerOptions: { - outDir: 'dist', - sourceMap: true, - declaration: true, - declarationMap: true, - }, - }, - exclude: ['vite.config.ts'], - }), - ], - build: { - cssCodeSplit: false, - lib: { - entry: './src/index.ts', - formats: ['es', 'cjs'], - fileName: (format) => `index.${format}.js`, - }, - rollupOptions: { - external: ['vue'], - output: { - exports: 'named', - globals: { - vue: 'Vue', - }, - }, - }, - }, -}); diff --git a/packages/notification-center/.babelrc.json b/packages/notification-center/.babelrc.json deleted file mode 100644 index 9164ce7ce48..00000000000 --- a/packages/notification-center/.babelrc.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "sourceType": "unambiguous", - "presets": [ - [ - "@babel/preset-env", - { - "targets": { - "chrome": 100, - "safari": 15, - "firefox": 91 - } - } - ], - "@babel/preset-typescript", - "@babel/preset-react" - ], - "plugins": [] -} diff --git a/packages/notification-center/.gitignore b/packages/notification-center/.gitignore deleted file mode 100644 index e2d42847914..00000000000 --- a/packages/notification-center/.gitignore +++ /dev/null @@ -1,26 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - - -# production -build - -.npmrc -.idea/* -.nyc_output - -test - -src/**.js -coverage -*.log -package-lock.json - -storybook-static diff --git a/packages/notification-center/.storybook/main.js b/packages/notification-center/.storybook/main.js deleted file mode 100644 index 3d127b523d2..00000000000 --- a/packages/notification-center/.storybook/main.js +++ /dev/null @@ -1,34 +0,0 @@ -import { dirname, join } from "path"; -module.exports = { - stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'], - - addons: [ - getAbsolutePath("@storybook/addon-links"), - getAbsolutePath("@storybook/addon-essentials"), - getAbsolutePath("@storybook/addon-interactions"), - getAbsolutePath("@storybook/addon-mdx-gfm") - ], - - framework: { - name: getAbsolutePath("@storybook/react-webpack5"), - options: {} - }, - - typescript: { - check: false, - checkOptions: {}, - reactDocgen: false, - reactDocgenTypescriptOptions: { - shouldExtractLiteralValuesFromEnum: true, - propFilter: (prop) => (prop.parent ? !/node_modules/.test(prop.parent.fileName) : true), - }, - }, - - docs: { - autodocs: true - } -}; - -function getAbsolutePath(value) { - return dirname(require.resolve(join(value, "package.json"))); -} diff --git a/packages/notification-center/.storybook/preview.js b/packages/notification-center/.storybook/preview.js deleted file mode 100644 index 786b0e25fe7..00000000000 --- a/packages/notification-center/.storybook/preview.js +++ /dev/null @@ -1,9 +0,0 @@ -export const parameters = { - actions: { argTypesRegex: "^on[A-Z].*" }, - controls: { - matchers: { - color: /(background|color)$/i, - date: /Date$/, - }, - }, -} diff --git a/packages/notification-center/jest.config.js b/packages/notification-center/jest.config.js deleted file mode 100644 index 8b2ac4831f9..00000000000 --- a/packages/notification-center/jest.config.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - preset: 'ts-jest', - testEnvironment: 'jsdom', - transform: { - '.+\\.(css|styl|less|sass|scss|png|jpg|webp|ttf|woff|woff2|svg)$': 'jest-transform-stub', - }, - testPathIgnorePatterns: ['dist'] -}; diff --git a/packages/notification-center/netlify.toml b/packages/notification-center/netlify.toml deleted file mode 100644 index 1b157a31555..00000000000 --- a/packages/notification-center/netlify.toml +++ /dev/null @@ -1,4 +0,0 @@ -[[redirects]] - from = "/*" - to = "/index.js" - status = 200 diff --git a/packages/notification-center/package.json b/packages/notification-center/package.json deleted file mode 100644 index 3e04409b5c7..00000000000 --- a/packages/notification-center/package.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "name": "@novu/notification-center", - "version": "2.0.0", - "repository": "https://github.com/novuhq/novu", - "description": "", - "scripts": { - "start": "npm run build:watch", - "prebuild": "rimraf dist", - "lint": "eslint src", - "lint:fix": "pnpm lint -- --fix", - "build": "npm run build:cjs && npm run build:esm && npm run build:umd && npm run build:types", - "build:cjs": "cross-env node_modules/.bin/tsc -p tsconfig.json", - "build:esm": "cross-env node_modules/.bin/tsc -p tsconfig.esm.json", - "build:esm:watch": "cross-env node_modules/.bin/tsc -p tsconfig.esm.json -w --preserveWatchOutput", - "build:umd": "webpack --config webpack.config.js", - "build:types": "tsc --declaration --emitDeclarationOnly --declarationMap --declarationDir dist/types -p tsconfig.json", - "build:watch": "npm run build:esm:watch", - "storybook": "storybook dev -p 6006", - "build-storybook": "storybook build", - "test": "jest" - }, - "author": "", - "license": "ISC", - "main": "dist/cjs/index.js", - "module": "dist/esm/index.js", - "files": [ - "dist/cjs", - "dist/esm", - "dist/types" - ], - "sideEffects": false, - "types": "dist/types/index.d.ts", - "devDependencies": { - "@babel/preset-env": "^7.23.2", - "@babel/preset-react": "^7.13.13", - "@babel/preset-typescript": "^7.13.0", - "@storybook/addon-actions": "^7.4.2", - "@storybook/addon-essentials": "^7.4.2", - "@storybook/addon-interactions": "^7.4.2", - "@storybook/addon-links": "^7.4.2", - "@storybook/addon-mdx-gfm": "^7.4.2", - "@storybook/react": "^7.4.2", - "@storybook/react-webpack5": "^7.4.2", - "@testing-library/dom": "^9.3.0", - "@testing-library/jest-dom": "^4.2.4", - "@testing-library/react": "^11.1.0", - "@testing-library/react-hooks": "^8.0.1", - "@testing-library/user-event": "^12.1.10", - "@types/jest": "^29.2.3", - "@types/node": "^20.15.0", - "@types/react": "^18.3.3", - "@types/react-dom": "^18.3.0", - "acorn": "^8.7.1", - "babel-loader": "^8.2.4", - "compression-webpack-plugin": "^10.0.0", - "jest": "^29.3.1", - "jest-environment-jsdom": "^29.3.1", - "jest-transform-stub": "^2.0.0", - "react": "^18.3.1", - "react-dom": "^18.3.1", - "rimraf": "^3.0.2", - "storybook": "^7.4.2", - "terser-webpack-plugin": "^5.3.9", - "ts-jest": "^29.0.3", - "ts-loader": "~9.4.0", - "tslib": "^2.3.1", - "typescript": "5.6.2", - "url-loader": "^4.1.1", - "webpack": "^5.74.0", - "webpack-bundle-analyzer": "^4.9.0", - "webpack-cli": "^5.1.4" - }, - "peerDependencies": { - "react": ">=16.8.0", - "react-dom": ">=16.8.0" - }, - "dependencies": { - "@emotion/css": "^11.10.5", - "@emotion/react": "^11.7.1", - "@emotion/styled": "^11.6.0", - "@mantine/core": "^5.7.1", - "@mantine/hooks": "^5.7.1", - "@novu/client": "workspace:*", - "@novu/shared": "workspace:*", - "@tanstack/react-query": "^4.20.4", - "acorn-jsx": "^5.3.2", - "axios": "^1.6.8", - "lodash.clonedeep": "^4.5.0", - "lodash.debounce": "^4.0.8", - "lodash.merge": "^4.6.2", - "react-infinite-scroll-component": "^6.0.0", - "socket.io-client": "4.7.2", - "tslib": "^2.3.1", - "webfontloader": "^1.6.28" - }, - "nx": { - "tags": ["package:public"] - } -} diff --git a/packages/notification-center/src/components/index.ts b/packages/notification-center/src/components/index.ts deleted file mode 100644 index c30acdb33c9..00000000000 --- a/packages/notification-center/src/components/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './notification-center'; -export * from './novu-provider'; -export * from './notification-bell'; -export * from './popover-notification-center'; -export * from './notification-center-web-component'; diff --git a/packages/notification-center/src/components/notification-bell/NotificationBell.tsx b/packages/notification-center/src/components/notification-bell/NotificationBell.tsx deleted file mode 100644 index 0f87a37d110..00000000000 --- a/packages/notification-center/src/components/notification-bell/NotificationBell.tsx +++ /dev/null @@ -1,57 +0,0 @@ -import React from 'react'; -import { ActionIcon } from '@mantine/core'; -import styled from '@emotion/styled'; -import { cx, css } from '@emotion/css'; - -import { colors, ColorScheme } from '../../shared/config/colors'; -import { Bell as BellIcon, GradientDot } from '../../shared/icons'; -import { useNotifications } from '../../hooks'; -import { getDefaultBellColors } from '../../utils/defaultTheme'; -import type { ISvgStopColor } from '../../store/novu-theme.context'; -import { useStyles } from '../../store/styles'; - -const headerIconsSettings = { color: colors.B60, width: 30, height: 30 }; - -export interface INotificationBellProps { - unseenCount?: number; - unseenBadgeColor?: string | ISvgStopColor; - unseenBadgeBackgroundColor?: string; - colorScheme?: ColorScheme; -} - -export function NotificationBell(props: INotificationBellProps) { - const { unseenCount } = useNotifications(); - const { bellColors } = getDefaultBellColors({ - bellColors: { - unseenBadgeColor: props?.unseenBadgeColor, - unseenBadgeBackgroundColor: props?.unseenBadgeBackgroundColor, - }, - colorScheme: props?.colorScheme, - }); - const [bellButtonStyles, bellDotStyles] = useStyles(['bellButton.root', 'bellButton.dot']); - - return ( - - - {unseenCount > 0 ? ( - - ) : null} - - ); -} - -export function GradientDotWrap({ bellColors, ...props }) { - return ; -} - -const StyledGradientDot = styled(GradientDotWrap)` - position: absolute; - top: -3%; - right: 10%; - width: 12px; - height: 12px; -`; diff --git a/packages/notification-center/src/components/notification-bell/index.ts b/packages/notification-center/src/components/notification-bell/index.ts deleted file mode 100644 index 1a0bf6d07c9..00000000000 --- a/packages/notification-center/src/components/notification-bell/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './NotificationBell'; diff --git a/packages/notification-center/src/components/notification-center-web-component/index.ts b/packages/notification-center/src/components/notification-center-web-component/index.ts deleted file mode 100644 index fb33a3a4c73..00000000000 --- a/packages/notification-center/src/components/notification-center-web-component/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './notification-center-component'; -export * from './notification-center-content-component'; -export * from './notification-center-component.types'; diff --git a/packages/notification-center/src/components/notification-center-web-component/notification-center-component.tsx b/packages/notification-center/src/components/notification-center-web-component/notification-center-component.tsx deleted file mode 100644 index eb44498c7dd..00000000000 --- a/packages/notification-center/src/components/notification-center-web-component/notification-center-component.tsx +++ /dev/null @@ -1,154 +0,0 @@ -import React, { FunctionComponent } from 'react'; -import { IMessage, MessageActionStatusEnum, ButtonTypeEnum } from '@novu/shared'; - -import { NovuProvider } from '../novu-provider'; -import { PopoverNotificationCenter } from '../popover-notification-center'; -import { NotificationBell } from '../notification-bell'; -import { reactToWebComponent } from '../../utils'; -import type { NotificationCenterComponentProps, PopoverWrapperProps } from './notification-center-component.types'; -import { useUpdateAction } from '../../hooks'; - -/* - * This array represents the public API of the web component. - * All the props defined in the NotificationCenterComponentProps should be added here. - */ -export const NOTIFICATION_CENTER_PROPS = [ - 'backendUrl', - 'socketUrl', - 'subscriberId', - 'applicationIdentifier', - 'subscriberHash', - 'stores', - 'tabs', - 'showUserPreferences', - 'allowedNotificationActions', - 'popover', - 'popoverConfig', - 'theme', - 'styles', - 'colorScheme', - 'i18n', - 'onLoad', - 'sessionLoaded', - 'onNotificationClick', - 'notificationClicked', - 'onUnseenCountChanged', - 'unseenCountChanged', - 'onActionClick', - 'actionClicked', - 'onTabClick', - 'tabClicked', - 'preferenceFilter', -]; - -export const NotificationCenterComponent: FunctionComponent = ({ - backendUrl, - socketUrl, - subscriberId, - applicationIdentifier, - subscriberHash, - stores, - tabs, - showUserPreferences, - allowedNotificationActions, - popover, - popoverConfig, - theme, - styles, - colorScheme = 'dark', - i18n, - sessionLoaded, - onLoad = sessionLoaded, - notificationClicked, - onNotificationClick = notificationClicked, - unseenCountChanged, - onUnseenCountChanged = unseenCountChanged, - actionClicked, - onActionClick = actionClicked, - tabClicked, - onTabClick = tabClicked, - preferenceFilter, -}) => { - return ( - - - - ); -}; - -function PopoverWrapper({ - onNotificationClick, - onUnseenCountChanged, - onActionClick, - onTabClick, - colorScheme = 'dark', - theme, - tabs, - showUserPreferences, - allowedNotificationActions, - popover, - popoverConfig, - unseenBadgeColor, - unseenBadgeBackgroundColor, - preferenceFilter, -}: PopoverWrapperProps) { - const { updateAction } = useUpdateAction(); - - function handlerOnActionClick(templateIdentifier: string, type: ButtonTypeEnum, message: IMessage) { - updateAction({ messageId: message._id, actionButtonType: type, status: MessageActionStatusEnum.DONE }); - onActionClick?.(templateIdentifier, type, message); - } - - return ( - - {({ unseenCount }) => ( - - )} - - ); -} - -export const NotificationCenterWebComponent = reactToWebComponent(NotificationCenterComponent, { - props: NOTIFICATION_CENTER_PROPS, -}); diff --git a/packages/notification-center/src/components/notification-center-web-component/notification-center-component.types.ts b/packages/notification-center/src/components/notification-center-web-component/notification-center-component.types.ts deleted file mode 100644 index 4f411ef420c..00000000000 --- a/packages/notification-center/src/components/notification-center-web-component/notification-center-component.types.ts +++ /dev/null @@ -1,65 +0,0 @@ -import type { INovuProviderProps } from '../novu-provider'; -import type { IPopoverNotificationCenterProps } from '../popover-notification-center'; -import type { ColorScheme } from '../../shared/config/colors'; -import type { INotificationCenterStyles } from '../../store/styles'; - -type SelectedProviderProps = Pick< - INovuProviderProps, - | 'onLoad' - | 'stores' - | 'backendUrl' - | 'socketUrl' - | 'subscriberId' - | 'applicationIdentifier' - | 'subscriberHash' - | 'i18n' ->; -type NovuProviderProps = SelectedProviderProps & { - // Angular/Vue props - sessionLoaded?: INovuProviderProps['onLoad']; -}; - -// Angular/Vue props -interface PopoverAdditionalProps { - notificationClicked?: IPopoverNotificationCenterProps['onNotificationClick']; - unseenCountChanged?: IPopoverNotificationCenterProps['onUnseenCountChanged']; - actionClicked?: IPopoverNotificationCenterProps['onActionClick']; - tabClicked?: IPopoverNotificationCenterProps['onTabClick']; -} - -type SelectedPopoverProps = Pick< - IPopoverNotificationCenterProps, - | 'onUnseenCountChanged' - | 'onActionClick' - | 'onTabClick' - | 'theme' - | 'tabs' - | 'showUserPreferences' - | 'allowedNotificationActions' - | 'preferenceFilter' -> & { - popoverConfig?: { - offset?: IPopoverNotificationCenterProps['offset']; - position?: IPopoverNotificationCenterProps['position']; - }; -} & { - /** - * @deprecated Use popoverConfig instead - */ - popover?: { - offset?: IPopoverNotificationCenterProps['offset']; - position?: IPopoverNotificationCenterProps['position']; - }; -}; - -type PopoverProps = SelectedPopoverProps & { - onNotificationClick?: IPopoverNotificationCenterProps['onNotificationClick']; - colorScheme?: ColorScheme; -} & PopoverAdditionalProps; - -type BellProps = { unseenBadgeColor?: string; unseenBadgeBackgroundColor?: string }; - -export type PopoverWrapperProps = PopoverProps & BellProps; - -export type NotificationCenterComponentProps = NovuProviderProps & - PopoverWrapperProps & { styles?: INotificationCenterStyles }; diff --git a/packages/notification-center/src/components/notification-center-web-component/notification-center-content-component.tsx b/packages/notification-center/src/components/notification-center-web-component/notification-center-content-component.tsx deleted file mode 100644 index 4b8313a31cd..00000000000 --- a/packages/notification-center/src/components/notification-center-web-component/notification-center-content-component.tsx +++ /dev/null @@ -1,97 +0,0 @@ -import React, { FunctionComponent } from 'react'; - -import { NovuProvider } from '../novu-provider'; -import { reactToWebComponent } from '../../utils'; -import type { NotificationCenterComponentProps, PopoverWrapperProps } from './notification-center-component.types'; -import { NotificationCenter } from '../notification-center'; - -/* - * This array represents the public API of the web component. - * All the props defined in the NotificationCenterComponentProps should be added here. - */ -export const NOTIFICATION_CENTER_CONTENT_PROPS = [ - 'backendUrl', - 'socketUrl', - 'subscriberId', - 'applicationIdentifier', - 'subscriberHash', - 'stores', - 'tabs', - 'showUserPreferences', - 'allowedNotificationActions', - 'theme', - 'styles', - 'colorScheme', - 'i18n', - 'onLoad', - 'sessionLoaded', - 'onNotificationClick', - 'notificationClicked', - 'onUnseenCountChanged', - 'unseenCountChanged', - 'onActionClick', - 'actionClicked', - 'onTabClick', - 'tabClicked', - 'preferenceFilter', -]; - -export type NotificationCenterContentComponentProps = Omit; - -export const NotificationCenterContentComponent: FunctionComponent = ({ - backendUrl, - socketUrl, - subscriberId, - applicationIdentifier, - subscriberHash, - stores, - tabs, - showUserPreferences, - allowedNotificationActions, - theme, - styles, - colorScheme = 'dark', - i18n, - sessionLoaded, - onLoad = sessionLoaded, - notificationClicked, - onNotificationClick = notificationClicked, - unseenCountChanged, - onUnseenCountChanged = unseenCountChanged, - actionClicked, - onActionClick = actionClicked, - tabClicked, - onTabClick = tabClicked, - preferenceFilter, -}) => { - return ( - - - - ); -}; - -export const NotificationCenterContentWebComponent = reactToWebComponent(NotificationCenterContentComponent, { - props: NOTIFICATION_CENTER_CONTENT_PROPS, -}); diff --git a/packages/notification-center/src/components/notification-center/NotificationCenter.tsx b/packages/notification-center/src/components/notification-center/NotificationCenter.tsx deleted file mode 100644 index 09b6ad86283..00000000000 --- a/packages/notification-center/src/components/notification-center/NotificationCenter.tsx +++ /dev/null @@ -1,85 +0,0 @@ -import React, { useEffect, useRef } from 'react'; - -import { IMessage, IMessageAction, ButtonTypeEnum } from '@novu/shared'; -import { IUserPreferenceSettings } from '@novu/client'; - -import { AppContent } from './components'; -import { useNotifications, useNovuContext } from '../../hooks'; -import { NotificationCenterContext } from '../../store/notification-center.context'; -import { ITab, ListItem, ScreensEnum } from '../../shared/interfaces'; -import { ColorScheme } from '../../shared/config/colors'; -import { INovuThemeProvider, NovuThemeProvider } from '../../store/novu-theme-provider.context'; - -export interface INotificationCenterProps { - onUrlChange?: (url: string) => void; - onNotificationClick?: (notification: IMessage) => void; - onUnseenCountChanged?: (unseenCount: number) => void; - onActionClick?: (templateIdentifier: string, type: ButtonTypeEnum, message: IMessage) => void; - actionsResultBlock?: (templateIdentifier: string, messageAction: IMessageAction) => JSX.Element; - preferenceFilter?: (userPreference: IUserPreferenceSettings) => boolean; - header?: ({ setScreen, screen }: { setScreen: (screen: ScreensEnum) => void; screen: ScreensEnum }) => JSX.Element; - footer?: () => JSX.Element; - emptyState?: JSX.Element; - listItem?: ListItem; - colorScheme: ColorScheme; - theme?: INovuThemeProvider; - tabs?: ITab[]; - showUserPreferences?: boolean; - allowedNotificationActions?: boolean; - onTabClick?: (tab: ITab) => void; -} - -export function NotificationCenter({ - onUnseenCountChanged, - onUrlChange, - onNotificationClick, - onActionClick, - preferenceFilter, - header, - footer, - emptyState, - listItem, - actionsResultBlock, - tabs, - showUserPreferences, - allowedNotificationActions, - onTabClick, - colorScheme, - theme, -}: INotificationCenterProps) { - const { applicationIdentifier } = useNovuContext(); - const { unseenCount } = useNotifications(); - const onUnseenCountChangedRef = useRef(onUnseenCountChanged); - onUnseenCountChangedRef.current = onUnseenCountChanged; - - useEffect(() => { - if (onUnseenCountChangedRef.current) { - onUnseenCountChangedRef.current(unseenCount); - } - }, [unseenCount, (window as any).parentIFrame, onUnseenCountChangedRef]); - - return ( - {}), - preferenceFilter, - isLoading: !applicationIdentifier, - header, - footer, - emptyState, - listItem, - actionsResultBlock, - tabs, - showUserPreferences: showUserPreferences ?? true, - allowedNotificationActions: allowedNotificationActions ?? true, - }} - > - - - - - ); -} diff --git a/packages/notification-center/src/components/notification-center/components/AppContent.tsx b/packages/notification-center/src/components/notification-center/components/AppContent.tsx deleted file mode 100644 index 7267a08c894..00000000000 --- a/packages/notification-center/src/components/notification-center/components/AppContent.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import React from 'react'; -import { MantineProvider, MantineThemeOverride } from '@mantine/core'; -import { css } from '@emotion/css'; - -import { Layout } from './layout/Layout'; -import { useNovuTheme, useFetchOrganization } from '../../../hooks'; - -export function AppContent() { - const { theme, common } = useNovuTheme(); - const { data: organization } = useFetchOrganization(); - - const primaryColor = organization?.branding?.color ?? theme.loaderColor; - const fontFamily = common.fontFamily || organization?.branding?.fontFamily; - const dir = (organization?.branding?.direction === 'rtl' ? 'rtl' : 'ltr') as 'ltr' | 'rtl'; - const themeConfig: MantineThemeOverride = { - fontFamily, - dir, - }; - - return ( - -
- -
-
- ); -} - -const wrapperClassName = (primaryColor: string, fontFamily: string, dir: string) => css` - margin: 0; - font-family: ${fontFamily === 'inherit' ? fontFamily : `${fontFamily}, Helvetica, sans-serif`}; - color: #333737; - direction: ${dir}; - width: 420px; - z-index: 999; - - ::-moz-selection { - background: ${primaryColor}; - } - - *::selection { - background: ${primaryColor}; - } -`; diff --git a/packages/notification-center/src/components/notification-center/components/FeedsTabs.tsx b/packages/notification-center/src/components/notification-center/components/FeedsTabs.tsx deleted file mode 100644 index 45442ac5334..00000000000 --- a/packages/notification-center/src/components/notification-center/components/FeedsTabs.tsx +++ /dev/null @@ -1,75 +0,0 @@ -import React, { useMemo, useLayoutEffect } from 'react'; -import { Tabs as MantineTabs } from '@mantine/core'; -import styled from '@emotion/styled'; - -import { NotificationsListTab } from './NotificationsListTab'; -import { UnseenBadge } from './UnseenBadge'; -import { Tabs } from './layout/tabs/Tabs'; -import { useNotificationCenter, useNotifications, useFeedUnseenCount, useNovuContext } from '../../../hooks'; - -export function FeedsTabs() { - const { tabs, onTabClick } = useNotificationCenter(); - const { storeId, setStore, markFetchedNotificationsAsSeen } = useNotifications(); - const { setFetchingStrategy } = useNovuContext(); - - async function handleOnTabChange(newStoreId: string) { - markFetchedNotificationsAsSeen(); - setStore(newStoreId); - } - - useLayoutEffect(() => { - setFetchingStrategy({ fetchNotifications: true }); - }, [setFetchingStrategy]); - - return ( - <> - {tabs?.length ? ( - - - {tabs.map((tab, index) => ( - { - onTabClick(tab); - }} - key={index} - data-test-id={`tab-${tab.storeId}`} - value={tab.storeId} - > - - {tab.name} - - - - ))} - - {tabs.map((tab, index) => ( - - - - ))} - - ) : ( - - )} - - ); -} - -const TabLabelWrapper = styled.div` - margin-bottom: 13px; - min-height: 22px; - line-height: 19px; -`; - -function UnseenBadgeContainer({ storeId }: { storeId: string }) { - const { stores } = useNotifications(); - const query = useMemo(() => { - const foundQuery = stores?.find((i) => i.storeId === storeId)?.query || {}; - - return { ...foundQuery, seen: false, limit: 100 }; - }, [stores]); - const { data } = useFeedUnseenCount({ query }); - const unseenCount = query.seen ? 0 : (data?.count ?? 0); - - return ; -} diff --git a/packages/notification-center/src/components/notification-center/components/Loader.tsx b/packages/notification-center/src/components/notification-center/components/Loader.tsx deleted file mode 100644 index 1908fa16a5c..00000000000 --- a/packages/notification-center/src/components/notification-center/components/Loader.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import React from 'react'; -import { Loader as MantineLoader } from '@mantine/core'; -import { cx, css } from '@emotion/css'; - -import { useNovuTheme } from '../../../hooks'; -import { useStyles } from '../../../store/styles'; - -export const Loader = ({ color }: { color?: string }) => { - const { theme } = useNovuTheme(); - const [loaderStyles] = useStyles(['loader.root']); - const loaderColor = color || theme.loaderColor; - - return ( -
- -
- ); -}; diff --git a/packages/notification-center/src/components/notification-center/components/NotificationsList.tsx b/packages/notification-center/src/components/notification-center/components/NotificationsList.tsx deleted file mode 100644 index bf6b5c08fdd..00000000000 --- a/packages/notification-center/src/components/notification-center/components/NotificationsList.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import React from 'react'; -import { cx, css } from '@emotion/css'; -import { IMessage, ButtonTypeEnum } from '@novu/shared'; -import InfiniteScroll from 'react-infinite-scroll-component'; - -import { NotificationListItem } from './notification-item/NotificationListItem'; -import { Loader } from './Loader'; -import { useStyles } from '../../../store/styles'; - -export function NotificationsList({ - notifications, - onFetch, - hasNextPage, - onNotificationClicked, -}: { - notifications: IMessage[] | never; - onFetch: () => void; - hasNextPage: boolean; - onNotificationClicked: (notification: IMessage, actionButtonType?: ButtonTypeEnum) => void; -}) { - const totalCount = notifications?.length; - const [notificationsListStyles] = useStyles('notifications.root'); - - return ( -
- } - endMessage={false} - scrollableTarget="notifications-list" - > - {notifications.map((notification) => { - return ( - - ); - })} - -
- ); -} - -const notificationsListCss = css` - height: 400px; - overflow-y: auto; -`; diff --git a/packages/notification-center/src/components/notification-center/components/NotificationsListTab.tsx b/packages/notification-center/src/components/notification-center/components/NotificationsListTab.tsx deleted file mode 100644 index df2793bb945..00000000000 --- a/packages/notification-center/src/components/notification-center/components/NotificationsListTab.tsx +++ /dev/null @@ -1,70 +0,0 @@ -import React from 'react'; -import { IMessage, ChannelCTATypeEnum } from '@novu/shared'; - -import { useNotifications, useNotificationCenter, useNovuContext, useTranslations } from '../../../hooks'; -import { NotificationsList } from './NotificationsList'; -import { Loader } from './Loader'; -import { colors } from '../../../shared/config/colors'; -import { NoNewNotifications } from '../../../images/NoNewNotifications'; - -export function NotificationsListTab() { - const { apiService } = useNovuContext(); - const { onNotificationClick, onUrlChange, emptyState } = useNotificationCenter(); - const { notifications, isLoading, hasNextPage, markNotificationAsRead, fetchNextPage } = useNotifications(); - const { t } = useTranslations(); - - async function fetchNext() { - await fetchNextPage(); - } - - async function onNotificationClicked(notification: IMessage) { - markNotificationAsRead(notification._id); - - if (onNotificationClick) { - onNotificationClick(notification); - } - const hasCta = notification.cta?.type === ChannelCTATypeEnum.REDIRECT && notification.cta?.data?.url; - - apiService.postUsageLog('Notification Click', { - notificationId: notification._id, - hasCta, - }); - - if (hasCta && notification.cta?.data?.url && onUrlChange) { - onUrlChange(notification.cta.data.url); - } - } - - return isLoading ? ( - - ) : ( - <> - {!isLoading && notifications?.length === 0 ? ( - <> - {emptyState || ( -
- - {t('noNewNotification')} -
- )} - - ) : ( - - )} - - ); -} diff --git a/packages/notification-center/src/components/notification-center/components/SeenAllBlock.tsx b/packages/notification-center/src/components/notification-center/components/SeenAllBlock.tsx deleted file mode 100644 index 788e9c8db06..00000000000 --- a/packages/notification-center/src/components/notification-center/components/SeenAllBlock.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import React from 'react'; -import styled from '@emotion/styled'; - -export function SeenAllBlock() { - return Yay! You have seen it all; -} - -const Wrapper = styled.div` - text-align: center; - margin: 10px 0; - font-size: 10px; - color: #b1b1b1; -`; diff --git a/packages/notification-center/src/components/notification-center/components/UnseenBadge.tsx b/packages/notification-center/src/components/notification-center/components/UnseenBadge.tsx deleted file mode 100644 index 99e47eb80af..00000000000 --- a/packages/notification-center/src/components/notification-center/components/UnseenBadge.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import React from 'react'; -import { Badge } from '@mantine/core'; -import { cx, css } from '@emotion/css'; - -import { useNovuTheme } from '../../../hooks'; -import { useStyles } from '../../../store/styles'; - -export function UnseenBadge({ unseenCount }: { unseenCount: number }) { - const { theme, common } = useNovuTheme(); - const [unseenBadgeStyles] = useStyles('unseenBadge.root'); - const showUnseenBadge = unseenCount && unseenCount > 0; - - return showUnseenBadge ? ( - - {unseenCount > 99 ? '99+' : unseenCount} - - ) : null; -} diff --git a/packages/notification-center/src/components/notification-center/components/index.ts b/packages/notification-center/src/components/notification-center/components/index.ts deleted file mode 100644 index 2fe800d9920..00000000000 --- a/packages/notification-center/src/components/notification-center/components/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * from './layout/Layout'; -export * from './layout/footer/FooterContainer'; -export * from './Loader'; -export * from './notification-item/NotificationListItem'; -export * from './SeenAllBlock'; -export * from './NotificationsList'; -export * from './AppContent'; diff --git a/packages/notification-center/src/components/notification-center/components/layout/Layout.tsx b/packages/notification-center/src/components/notification-center/components/layout/Layout.tsx deleted file mode 100644 index 76f6aea7020..00000000000 --- a/packages/notification-center/src/components/notification-center/components/layout/Layout.tsx +++ /dev/null @@ -1,70 +0,0 @@ -import React, { useState } from 'react'; -import styled from '@emotion/styled'; -import { css, cx } from '@emotion/css'; - -import { Header } from './header/Header'; -import { UserPreferenceHeader } from './header/UserPreferenceHeader'; -import { FooterContainer as Footer } from './footer/FooterContainer'; - -import { Loader } from '../Loader'; -import { useNotificationCenter, useNovuContext, useNovuTheme } from '../../../../hooks'; -import { SubscriberPreference } from '../user-preference/SubscriberPreference'; -import { FeedsTabs } from '../FeedsTabs'; -import { INovuTheme } from '../../../../store/novu-theme.context'; -import { useStyles } from '../../../../store/styles'; -import { ScreensEnum } from '../../../../shared/interfaces'; - -export function Layout() { - const { header } = useNotificationCenter(); - const { isSessionInitialized } = useNovuContext(); - const { theme } = useNovuTheme(); - const [layoutStyles] = useStyles(['layout.root']); - const [screen, setScreen] = useState(ScreensEnum.NOTIFICATIONS); - - return ( -
- {screen === ScreensEnum.SETTINGS ? ( - <> - {header ? ( - header({ setScreen, screen }) - ) : ( - setScreen(ScreensEnum.NOTIFICATIONS)} /> - )} - - - - - ) : ( - <> - {header ? header({ setScreen, screen }) :
setScreen(ScreensEnum.SETTINGS)} />} - - {isSessionInitialized ? ( - - - - ) : ( - - )} - - - )} - -
-
- ); -} - -const ContentWrapper = styled.div` - overflow: auto; - min-height: 400px; -`; - -const layoutWrapperCss = (novuTheme: INovuTheme) => css` - padding: 15px 0; - height: auto; - border-radius: 7px; - box-shadow: ${novuTheme.layout.boxShadow}; - background: ${novuTheme.layout.background}; -`; - -const MainWrapper = styled.div``; diff --git a/packages/notification-center/src/components/notification-center/components/layout/footer/Footer.tsx b/packages/notification-center/src/components/notification-center/components/layout/footer/Footer.tsx deleted file mode 100644 index 58b2780f35a..00000000000 --- a/packages/notification-center/src/components/notification-center/components/layout/footer/Footer.tsx +++ /dev/null @@ -1,86 +0,0 @@ -/* eslint-disable max-len */ -import React from 'react'; -import { css, cx } from '@emotion/css'; - -import { useNovuTheme, useTranslations } from '../../../../../hooks'; -import { INovuTheme } from '../../../../../store/novu-theme.context'; -import { useStyles } from '../../../../../store/styles'; - -export function Footer() { - const { theme } = useNovuTheme(); - const { t } = useTranslations(); - const [footerStyles, footerTitleStyles] = useStyles(['footer.root', 'footer.title']); - - return ( -
- {t('poweredBy')} - - - - - - - - - - - - - - - -
- ); -} -const footerPoweredByClassName = (novuTheme: INovuTheme) => css` - color: ${novuTheme.footer.logoPrefixFontColor}; - font-size: 10px; - font-weight: 400; -`; - -const footerClassName = css` - text-align: center; - border-radius: 7px; - margin-top: 10px; - height: 25px; - display: flex; - justify-content: center; - align-items: center; - direction: ltr; - - svg { - margin-left: 10px; - width: 60px; - position: relative; - top: -1px; - } -`; diff --git a/packages/notification-center/src/components/notification-center/components/layout/footer/FooterContainer.tsx b/packages/notification-center/src/components/notification-center/components/layout/footer/FooterContainer.tsx deleted file mode 100644 index 12ea2a64eef..00000000000 --- a/packages/notification-center/src/components/notification-center/components/layout/footer/FooterContainer.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react'; -import { Footer } from './Footer'; -import { useNotificationCenter } from '../../../../../hooks'; - -export function FooterContainer() { - const { footer } = useNotificationCenter(); - - return <>{footer ? footer() :