From b0881673504953fa8e7385337334f1cfee261ed1 Mon Sep 17 00:00:00 2001 From: Christiaan Scheermeijer Date: Fri, 17 Nov 2023 17:14:03 +0100 Subject: [PATCH 01/38] refactor: initialize workspace and separate services, stores and utils --- .github/workflows/test-e2e.yml | 4 + .../workflows/test-preview-and-lighthouse.yml | 4 + .github/workflows/test-unit-snapshot.yml | 5 + .gitignore | 2 +- docs/features/video-analytics.md | 4 +- docs/initialization-file.md | 6 +- firebase.json | 2 +- lint-staged.config.js | 2 +- package.json | 118 +- packages/common/package.json | 21 + .../common/src/constants.ts | 1 + .../common/src}/modules/container.ts | 2 +- .../common/src}/modules/register.ts | 56 +- packages/common/src/queryClient.ts | 12 + .../common/src}/services/account.service.ts | 24 +- .../common/src}/services/api.service.ts | 15 +- .../common/src}/services/checkout.service.ts | 6 +- .../src}/services/cleeng.account.service.ts | 38 +- .../src}/services/cleeng.checkout.service.ts | 10 +- .../common/src}/services/cleeng.service.ts | 10 +- .../services/cleeng.subscription.service.ts | 10 +- .../common/src}/services/config.service.ts | 14 +- .../common/src}/services/epg.service.test.ts | 10 +- .../common/src}/services/epg.service.ts | 8 +- .../common/src}/services/favorites.service.ts | 12 +- .../services/genericEntitlement.service.ts | 3 +- .../src}/services/inplayer.account.service.ts | 24 +- .../services/inplayer.checkout.service.ts | 8 +- .../src}/services/inplayer.profile.service.ts | 6 +- .../services/inplayer.subscription.service.ts | 14 +- .../src}/services/jwpEntitlement.service.ts | 0 .../common/src}/services/profile.service.ts | 2 +- .../common/src}/services/settings.service.ts | 8 +- .../src}/services/subscription.service.ts | 8 +- .../src}/services/watchhistory.service.ts | 10 +- .../common/src}/stores/AccountController.ts | 44 +- .../common/src}/stores/AccountStore.ts | 9 +- .../common/src}/stores/AppController.ts | 14 +- .../common/src}/stores/CheckoutController.ts | 33 +- .../common/src}/stores/CheckoutStore.ts | 7 +- .../common/src}/stores/ConfigStore.ts | 8 +- .../common/src}/stores/FavoritesController.ts | 21 +- .../common/src}/stores/FavoritesStore.ts | 8 +- .../common/src}/stores/ProfileController.ts | 22 +- .../common/src}/stores/ProfileStore.ts | 8 +- .../common/src}/stores/UIStore.ts | 0 .../src}/stores/WatchHistoryController.ts | 21 +- .../common/src}/stores/WatchHistoryStore.ts | 8 +- {src => packages/common/src}/stores/utils.ts | 2 +- {src => packages/common/src}/utils/api.ts | 2 +- .../common/src}/utils/broadcaster.test.ts | 2 +- .../common/src}/utils/broadcaster.ts | 2 +- .../common/src}/utils/collection.ts | 13 +- {src => packages/common/src}/utils/common.ts | 2 +- .../common/src}/utils/configSchema.ts | 2 +- .../common/src}/utils/datetime.ts | 0 {src => packages/common/src}/utils/dom.ts | 1 + .../common/src}/utils/domHelpers.ts | 1 + .../common/src}/utils/entitlements.ts | 11 +- {src => packages/common/src}/utils/epg.ts | 2 +- {src => packages/common/src}/utils/error.ts | 0 .../common/src}/utils/formatting.ts | 4 +- .../common/src}/utils/liveEvent.ts | 2 +- .../common/src}/utils/location.ts | 0 .../common/src}/utils/matchMedia.ts | 0 {src => packages/common/src}/utils/media.ts | 4 +- {src => packages/common/src}/utils/persist.ts | 0 .../common/src}/utils/promiseQueue.test.ts | 0 .../common/src}/utils/promiseQueue.ts | 0 {src => packages/common/src}/utils/series.ts | 2 +- .../common/src}/utils/structuredData.ts | 6 +- .../common/src}/utils/subscription.ts | 5 +- .../common/src}/utils/yupSchemaCreator.ts | 2 +- packages/common/tsconfig.json | 14 + {types => packages/common/types}/account.d.ts | 59 +- .../common/types}/ad-schedule.d.ts | 0 {types => packages/common/types}/adyen.d.ts | 0 .../common/types}/checkout.d.ts | 9 +- {types => packages/common/types}/cleeng.d.ts | 0 .../common/types/config.d.ts | 0 packages/common/types/entitlement.d.ts | 6 + {types => packages/common/types}/env.d.ts | 0 {types => packages/common/types}/epg.d.ts | 0 .../common/types}/favorite.d.ts | 0 {types => packages/common/types}/form.d.ts | 0 {types => packages/common/types}/global.d.ts | 0 {types => packages/common/types}/i18next.d.ts | 0 .../common/types}/inplayer.d.ts | 2 - .../common/types}/jwplayer.d.ts | 0 {types => packages/common/types}/jwpltx.d.ts | 0 {types => packages/common/types}/media.d.ts | 0 .../common/types}/pagination.d.ts | 0 .../common/types}/playlist.d.ts | 0 {types => packages/common/types}/screens.d.ts | 0 {types => packages/common/types}/series.d.ts | 0 {types => packages/common/types}/service.d.ts | 0 .../common/types}/settings.d.ts | 0 {types => packages/common/types}/static.d.ts | 0 .../common/types}/subscription.d.ts | 2 +- .../common/types}/watchHistory.d.ts | 0 packages/hooks-react/package.json | 4 + packages/i18n/package.json | 4 + packages/theme/package.json | 4 + packages/ui-react/package.json | 16 + packages/ui-react/tsconfig.json | 28 + src/hooks/useLiveEvent.ts | 9 - tsconfig.json | 50 +- tsconfig.vite.json | 33 + types/entitlement.d.ts | 6 - .env => web/.env | 0 .env.jwdev => web/.env.jwdev | 0 index.html => web/index.html | 0 web/ini/.webapp.dev.ini | 4 + {ini/templates => web/ini}/.webapp.prod.ini | 0 {ini/templates => web/ini}/.webapp.test.ini | 0 {ini => web/ini}/templates/.webapp.demo.ini | 0 {ini => web/ini}/templates/.webapp.dev.ini | 0 {ini => web/ini}/templates/.webapp.jwdev.ini | 0 .../ini}/templates/.webapp.preview.ini | 0 web/ini/templates/.webapp.prod.ini | 15 + web/ini/templates/.webapp.test.ini | 9 + web/package.json | 104 + {public => web/public}/browserconfig.xml | 0 {public => web/public}/favicon.ico | Bin .../public}/images/android-chrome-144x144.png | Bin .../public}/images/apple-touch-icon.png | Bin .../public}/images/avatars/Alien.svg | 0 .../public}/images/avatars/Bear.svg | 0 .../public}/images/avatars/Brainy.svg | 0 .../public}/images/avatars/Cooool.svg | 0 .../public}/images/avatars/Dummy.svg | 0 .../public}/images/avatars/Frog.svg | 0 .../public}/images/avatars/Goofball.svg | 0 .../public}/images/avatars/Marilyn.svg | 0 .../public}/images/avatars/Smiley.svg | 0 .../public}/images/avatars/ToughGuy.svg | 0 .../public}/images/avatars/UhOh.svg | 0 .../public}/images/avatars/Vibe.svg | 0 .../public}/images/favicon-16x16.png | Bin .../public}/images/favicon-32x32.png | Bin {public => web/public}/images/logo.png | Bin {public => web/public}/images/logo.svg | 0 .../public}/images/mstile-150x150.png | Bin .../public}/images/payments/amex.svg | 0 .../public}/images/payments/diners.svg | 0 .../public}/images/payments/discover.svg | 0 .../public}/images/payments/hiper.svg | 0 .../public}/images/payments/maestro.svg | 0 .../public}/images/payments/mastercard.svg | 0 .../public}/images/payments/unionpay.svg | 0 .../public}/images/payments/visa.svg | 0 .../public}/images/safari-pinned-tab.svg | 0 {public => web/public}/jwpltx.js | 0 .../public}/locales/en/account.json | 0 {public => web/public}/locales/en/common.json | 0 .../public}/locales/en/country.json | 0 {public => web/public}/locales/en/demo.json | 0 {public => web/public}/locales/en/epg.json | 0 {public => web/public}/locales/en/error.json | 0 {public => web/public}/locales/en/menu.json | 0 {public => web/public}/locales/en/search.json | 0 .../public}/locales/en/us_state.json | 0 {public => web/public}/locales/en/user.json | 0 {public => web/public}/locales/en/video.json | 0 .../public}/locales/es/account.json | 0 {public => web/public}/locales/es/common.json | 0 .../public}/locales/es/country.json | 0 {public => web/public}/locales/es/demo.json | 0 {public => web/public}/locales/es/epg.json | 0 {public => web/public}/locales/es/error.json | 0 {public => web/public}/locales/es/menu.json | 0 {public => web/public}/locales/es/search.json | 0 .../public}/locales/es/us_state.json | 0 {public => web/public}/locales/es/user.json | 0 {public => web/public}/locales/es/video.json | 0 {public => web/public}/manifest.json | 0 {public => web/public}/robots.txt | 0 .../scripts}/build-tools/settings.ts | 0 {scripts => web/scripts}/compressIni.sh | 0 {scripts => web/scripts}/waitOnConfig.js | 0 {src => web/src}/App.tsx | 17 +- {src => web/src}/assets/icons/facebook.svg | 0 {src => web/src}/assets/icons/google.svg | 0 {src => web/src}/assets/icons/twitter.svg | 0 .../src}/assets/profiles/default_avatar.png | Bin .../components/Account/Account.module.scss | 0 .../src}/components/Account/Account.test.tsx | 14 +- .../src}/components/Account/Account.tsx | 40 +- .../__snapshots__/Account.test.tsx.snap | 0 .../src}/components/Adyen/Adyen.module.scss | 4 +- {src => web/src}/components/Adyen/Adyen.tsx | 6 +- .../src}/components/Adyen/AdyenForm.scss | 6 +- .../src}/components/Alert/Alert.module.scss | 4 +- .../src}/components/Alert/Alert.test.tsx | 0 {src => web/src}/components/Alert/Alert.tsx | 6 +- .../Alert/__snapshots__/Alert.test.tsx.snap | 0 .../src}/components/Animation/Animation.tsx | 0 .../src}/components/Animation/Fade/Fade.tsx | 2 +- .../src}/components/Animation/Grow/Grow.tsx | 4 +- .../src}/components/Animation/Slide/Slide.tsx | 4 +- .../BackButton/BackButton.module.scss | 4 +- .../src}/components/BackButton/BackButton.tsx | 0 .../src}/components/Button/Button.module.scss | 6 +- .../src}/components/Button/Button.test.tsx | 0 {src => web/src}/components/Button/Button.tsx | 4 +- .../Button/__snapshots__/Button.test.tsx.snap | 0 .../CancelSubscriptionForm.module.scss | 4 +- .../CancelSubscriptionForm.test.tsx | 0 .../CancelSubscriptionForm.tsx | 6 +- .../CancelSubscriptionForm.test.tsx.snap | 0 .../src}/components/Card/Card.module.scss | 6 +- .../src}/components/Card/Card.test.tsx | 6 +- {src => web/src}/components/Card/Card.tsx | 16 +- .../Card/__snapshots__/Card.test.tsx.snap | 0 .../components/CardGrid/CardGrid.module.scss | 0 .../components/CardGrid/CardGrid.test.tsx | 8 +- .../src}/components/CardGrid/CardGrid.tsx | 16 +- .../__snapshots__/CardGrid.test.tsx.snap | 0 .../components/Checkbox/Checkbox.module.scss | 4 +- .../components/Checkbox/Checkbox.test.tsx | 0 .../src}/components/Checkbox/Checkbox.tsx | 6 +- .../__snapshots__/Checkbox.test.tsx.snap | 0 .../CheckoutForm/CheckoutForm.module.scss | 4 +- .../CheckoutForm/CheckoutForm.test.tsx | 8 +- .../components/CheckoutForm/CheckoutForm.tsx | 24 +- .../__snapshots__/CheckoutForm.test.tsx.snap | 0 .../ChooseOfferForm.module.scss | 6 +- .../ChooseOfferForm/ChooseOfferForm.test.tsx | 10 +- .../ChooseOfferForm/ChooseOfferForm.tsx | 24 +- .../ChooseOfferForm.test.tsx.snap | 0 .../CollapsibleText.module.scss | 4 +- .../CollapsibleText/CollapsibleText.test.tsx | 0 .../CollapsibleText/CollapsibleText.tsx | 8 +- .../CollapsibleText.test.tsx.snap | 0 .../ConfirmationDialog.module.scss | 4 +- .../ConfirmationDialog.test.tsx | 0 .../ConfirmationDialog/ConfirmationDialog.tsx | 6 +- .../ConfirmationDialog.test.tsx.snap | 0 .../ConfirmationForm.module.scss | 4 +- .../ConfirmationForm.test.tsx | 4 +- .../ConfirmationForm/ConfirmationForm.tsx | 6 +- .../ConfirmationForm.test.tsx.snap | 0 .../CreditCardCVCField.test.tsx | 0 .../CreditCardCVCField/CreditCardCVCField.tsx | 0 .../CreditCardCVCField.test.tsx.snap | 0 .../CreditCardExpiryField.test.tsx | 0 .../CreditCardExpiryField.tsx | 0 .../CreditCardExpiryField.test.tsx.snap | 0 .../CreditCardNumberField.module.scss | 0 .../CreditCardNumberField.test.tsx | 0 .../CreditCardNumberField.tsx | 0 .../CreditCardNumberField.test.tsx.snap | 0 .../CustomRegisterField.test.tsx | 2 +- .../CustomRegisterField.tsx | 22 +- .../CustomRegisterField.test.tsx.snap | 0 .../DateField/DateField.module.scss | 4 +- .../src}/components/DateField/DateField.tsx | 8 +- .../DeleteAccountModal.module.scss | 2 +- .../DeleteAccountModal/DeleteAccountModal.tsx | 17 +- .../DeleteAccountPasswordWarning.module.scss | 4 +- .../DeleteAccountPasswordWarning.tsx | 13 +- .../DemoConfigDialog.module.scss | 4 +- .../DemoConfigDialog.test.tsx | 5 +- .../DemoConfigDialog/DemoConfigDialog.tsx | 20 +- .../DemoConfigDialog.test.tsx.snap | 0 .../DetectOutsideClick/DetectOutsideClick.tsx | 0 .../DevConfigSelector.module.scss | 0 .../DevConfigSelector/DevConfigSelector.tsx | 10 +- .../DevStackTrace/DevStackTrace.module.scss | 0 .../DevStackTrace/DevStackTrace.tsx | 0 .../src}/components/Dialog/Dialog.module.scss | 4 +- .../src}/components/Dialog/Dialog.test.tsx | 0 {src => web/src}/components/Dialog/Dialog.tsx | 8 +- .../Dialog/__snapshots__/Dialog.test.tsx.snap | 0 .../DialogBackButton.module.scss | 4 +- .../DialogBackButton.test.tsx | 0 .../DialogBackButton/DialogBackButton.tsx | 6 +- .../DialogBackButton.test.tsx.snap | 0 .../components/Dropdown/Dropdown.module.scss | 6 +- .../components/Dropdown/Dropdown.test.tsx | 1 + .../src}/components/Dropdown/Dropdown.tsx | 6 +- .../EditCardPaymentForm.module.scss | 0 .../EditCardPaymentForm.tsx | 9 +- .../EditForm/EditCardDetailsForm.module.scss | 4 +- .../EditForm/EditCardDetailsForm.tsx | 3 +- .../EditPasswordForm.module.scss | 6 +- .../EditPasswordForm.test.tsx | 0 .../EditPasswordForm/EditPasswordForm.tsx | 13 +- .../EditPasswordForm.test.tsx.snap | 0 .../src}/components/Epg/Epg.module.scss | 6 +- {src => web/src}/components/Epg/Epg.tsx | 26 +- .../EpgChannel/EpgChannelItem.module.scss | 6 +- .../components/EpgChannel/EpgChannelItem.tsx | 6 +- .../EpgProgramItem/EpgProgramItem.module.scss | 6 +- .../EpgProgramItem/EpgProgramItem.tsx | 3 +- .../EpgTimeline/EpgTimeline.module.scss | 4 +- .../components/EpgTimeline/EpgTimeline.tsx | 0 .../ErrorPage/ErrorPage.module.scss | 6 +- .../components/ErrorPage/ErrorPage.test.tsx | 0 .../src}/components/ErrorPage/ErrorPage.tsx | 8 +- .../__snapshots__/ErrorPage.test.tsx.snap | 0 .../Favorites/Favorites.module.scss | 6 +- .../components/Favorites/Favorites.test.tsx | 12 +- .../src}/components/Favorites/Favorites.tsx | 18 +- .../__snapshots__/Favorites.test.tsx.snap | 0 .../src}/components/Filter/Filter.module.scss | 6 +- .../src}/components/Filter/Filter.test.tsx | 0 {src => web/src}/components/Filter/Filter.tsx | 10 +- .../Filter/__snapshots__/Filter.test.tsx.snap | 0 .../FinalizePayment.module.scss | 0 .../FinalizePayment/FinalizePayment.tsx | 20 +- .../ForgotPasswordForm.module.scss | 4 +- .../ForgotPasswordForm.test.tsx | 0 .../ForgotPasswordForm/ForgotPasswordForm.tsx | 14 +- .../ForgotPasswordForm.test.tsx.snap | 0 .../src}/components/Form/Form.module.scss | 6 +- .../src}/components/Form/Form.test.tsx | 0 {src => web/src}/components/Form/Form.tsx | 3 +- .../src}/components/Form/FormSection.tsx | 12 +- .../Form/__snapshots__/Form.test.tsx.snap | 0 .../FormFeedback/FormFeedback.module.scss | 4 +- .../FormFeedback/FormFeedback.test.tsx | 0 .../components/FormFeedback/FormFeedback.tsx | 0 .../__snapshots__/FormFeedback.test.tsx.snap | 0 .../src}/components/Header/Header.module.scss | 8 +- .../src}/components/Header/Header.test.tsx | 8 +- {src => web/src}/components/Header/Header.tsx | 36 +- .../Header/__snapshots__/Header.test.tsx.snap | 0 .../HelperText/HelperText.module.scss | 4 +- .../components/HelperText/HelperText.test.tsx | 0 .../src}/components/HelperText/HelperText.tsx | 0 .../__snapshots__/HelperText.test.tsx.snap | 0 .../src}/components/Hero/Hero.module.scss | 8 +- {src => web/src}/components/Hero/Hero.tsx | 4 +- .../IconButton/IconButton.module.scss | 4 +- .../components/IconButton/IconButton.test.tsx | 4 +- .../src}/components/IconButton/IconButton.tsx | 0 .../__snapshots__/IconButton.test.tsx.snap | 0 .../src}/components/Image/Image.module.scss | 0 .../src}/components/Image/Image.test.tsx | 0 {src => web/src}/components/Image/Image.tsx | 3 +- .../InfiniteScrollLoader.module.scss | 0 .../InfiniteScrollLoader.tsx | 4 +- .../LanguageMenu/LanguageMenu.module.scss | 4 +- .../LanguageMenu/LanguageMenu.test.tsx | 4 +- .../components/LanguageMenu/LanguageMenu.tsx | 6 +- .../__snapshots__/LanguageMenu.test.tsx.snap | 0 .../__snapshots__/UserMenu.test.tsx.snap | 0 .../src}/components/Link/Link.module.scss | 4 +- .../src}/components/Link/Link.test.tsx | 0 {src => web/src}/components/Link/Link.tsx | 0 .../Link/__snapshots__/Link.test.tsx.snap | 0 .../LoadingOverlay/LoadingOverlay.module.scss | 4 +- .../LoadingOverlay/LoadingOverlay.tsx | 4 +- .../LoginForm/LoginForm.module.scss | 4 +- .../components/LoginForm/LoginForm.test.tsx | 10 +- .../src}/components/LoginForm/LoginForm.tsx | 30 +- .../__snapshots__/LoginForm.test.tsx.snap | 0 .../src}/components/Logo/Logo.module.scss | 6 +- .../src}/components/Logo/Logo.test.tsx | 4 +- {src => web/src}/components/Logo/Logo.tsx | 0 .../Logo/__snapshots__/Logo.test.tsx.snap | 0 .../MarkdownComponent.module.scss | 4 +- .../MarkdownComponent.test.tsx | 0 .../MarkdownComponent/MarkdownComponent.tsx | 0 .../MarkdownComponent.test.tsx.snap | 0 .../MenuButton/MenuButton.module.scss | 8 +- .../components/MenuButton/MenuButton.test.tsx | 0 .../src}/components/MenuButton/MenuButton.tsx | 0 .../__snapshots__/MenuButton.test.tsx.snap | 0 .../src}/components/Modal/Modal.module.scss | 6 +- .../src}/components/Modal/Modal.test.tsx | 0 {src => web/src}/components/Modal/Modal.tsx | 10 +- .../Modal/__snapshots__/Modal.test.tsx.snap | 0 .../ModalCloseButton.module.scss | 6 +- .../ModalCloseButton.test.tsx | 0 .../ModalCloseButton/ModalCloseButton.tsx | 6 +- .../ModalCloseButton.test.tsx.snap | 0 .../NoPaymentRequired.module.scss | 4 +- .../NoPaymentRequired.test.tsx | 0 .../NoPaymentRequired/NoPaymentRequired.tsx | 6 +- .../NoPaymentRequired.test.tsx.snap | 0 .../OfferSwitch/OfferSwitch.module.scss | 4 +- .../components/OfferSwitch/OfferSwitch.tsx | 8 +- .../src}/components/Panel/Panel.module.scss | 4 +- {src => web/src}/components/Panel/Panel.tsx | 0 .../PasswordField/PasswordField.test.tsx | 0 .../PasswordField/PasswordField.tsx | 7 +- .../__snapshots__/PasswordField.test.tsx.snap | 0 .../PasswordStrength.module.scss | 4 +- .../PasswordStrength.test.tsx | 0 .../PasswordStrength/PasswordStrength.tsx | 0 .../PasswordStrength.test.tsx.snap | 0 .../src}/components/PayPal/PayPal.module.scss | 4 +- .../src}/components/PayPal/PayPal.test.tsx | 0 {src => web/src}/components/PayPal/PayPal.tsx | 6 +- .../PayPal/__snapshots__/PayPal.test.tsx.snap | 0 .../components/Payment/Payment.module.scss | 6 +- .../src}/components/Payment/Payment.test.tsx | 16 +- .../src}/components/Payment/Payment.tsx | 27 +- .../__snapshots__/Payment.test.tsx.snap | 0 .../PaymentFailed/PaymentFailed.module.scss | 4 +- .../PaymentFailed/PaymentFailed.test.tsx | 0 .../PaymentFailed/PaymentFailed.tsx | 4 +- .../__snapshots__/PaymentFailed.test.tsx.snap | 0 .../PaymentForm/PaymentForm.module.scss | 0 .../components/PaymentForm/PaymentForm.tsx | 9 +- .../PaymentMethodForm.module.scss | 6 +- .../PaymentMethodForm/PaymentMethodForm.tsx | 12 +- .../PersonalDetailsForm.module.scss | 4 +- .../PersonalDetailsForm.test.tsx | 2 +- .../PersonalDetailsForm.tsx | 24 +- .../PersonalDetailsForm.test.tsx.snap | 0 .../src}/components/Player/Player.module.scss | 0 .../src}/components/Player/Player.test.tsx | 6 +- {src => web/src}/components/Player/Player.tsx | 22 +- .../Player/__snapshots__/Player.test.tsx.snap | 0 .../components/Popover/Popover.module.scss | 4 +- .../src}/components/Popover/Popover.test.tsx | 6 +- .../src}/components/Popover/Popover.tsx | 6 +- .../__snapshots__/Popover.test.tsx.snap | 0 .../components/ProfileBox/AddNewProfile.tsx | 4 +- .../ProfileBox/ProfileBox.module.scss | 2 +- .../src}/components/ProfileBox/ProfileBox.tsx | 8 +- .../src}/components/Radio/Radio.module.scss | 4 +- .../src}/components/Radio/Radio.test.tsx | 0 {src => web/src}/components/Radio/Radio.tsx | 6 +- .../Radio/__snapshots__/Radio.test.tsx.snap | 0 .../RegistrationForm.module.scss | 4 +- .../RegistrationForm.test.tsx | 4 +- .../RegistrationForm/RegistrationForm.tsx | 34 +- .../RegistrationForm.test.tsx.snap | 0 .../RenewSubscriptionForm.module.scss | 4 +- .../RenewSubscriptionForm.test.tsx | 10 +- .../RenewSubscriptionForm.tsx | 12 +- .../RenewSubscriptionForm.test.tsx.snap | 0 .../ResetPasswordForm.module.scss | 4 +- .../ResetPasswordForm.test.tsx | 0 .../ResetPasswordForm/ResetPasswordForm.tsx | 4 +- .../ResetPasswordForm.test.tsx.snap | 0 {src => web/src}/components/Root/Root.tsx | 20 +- .../RootErrorPage/RootErrorPage.tsx | 2 +- .../SearchBar/SearchBar.module.scss | 4 +- .../components/SearchBar/SearchBar.test.tsx | 2 +- .../src}/components/SearchBar/SearchBar.tsx | 8 +- .../__snapshots__/SearchBar.test.tsx.snap | 0 .../ShareButton/ShareButton.test.tsx | 0 .../components/ShareButton/ShareButton.tsx | 10 +- .../__snapshots__/ShareButton.test.tsx.snap | 0 .../src}/components/Shelf/Shelf.module.scss | 0 .../src}/components/Shelf/Shelf.test.tsx | 5 +- {src => web/src}/components/Shelf/Shelf.tsx | 22 +- .../Shelf/__snapshots__/Shelf.test.tsx.snap | 0 .../components/Sidebar/Sidebar.module.scss | 6 +- .../src}/components/Sidebar/Sidebar.test.tsx | 6 +- .../src}/components/Sidebar/Sidebar.tsx | 6 +- .../__snapshots__/Sidebar.test.tsx.snap | 0 .../SocialButton/SocialButton.module.scss | 4 +- .../components/SocialButton/SocialButton.tsx | 0 .../SocialButtonsList.module.scss | 0 .../SocialButtonsList/SocialButtonsList.tsx | 5 +- .../components/Spinner/Spinner.module.scss | 4 +- .../src}/components/Spinner/Spinner.tsx | 0 .../src}/components/StatusIcon/StatusIcon.tsx | 6 +- .../SubscriptionCancelled.module.scss | 4 +- .../SubscriptionCancelled.test.tsx | 0 .../SubscriptionCancelled.tsx | 4 +- .../SubscriptionCancelled.test.tsx.snap | 0 .../SubscriptionRenewed.module.scss | 4 +- .../SubscriptionRenewed.test.tsx | 10 +- .../SubscriptionRenewed.tsx | 10 +- .../SubscriptionRenewed.test.tsx.snap | 0 .../src}/components/Tag/Tag.module.scss | 6 +- {src => web/src}/components/Tag/Tag.tsx | 0 .../TextField/TextField.module.scss | 4 +- .../components/TextField/TextField.test.tsx | 0 .../src}/components/TextField/TextField.tsx | 10 +- .../__snapshots__/TextField.test.tsx.snap | 0 .../components/TileDock/TileDock.module.scss | 2 +- .../src}/components/TileDock/TileDock.tsx | 0 .../UpgradeSubscription.module.scss | 4 +- .../UpgradeSubscription.tsx | 4 +- .../UserMenu/ProfilesMenu/ProfilesMenu.tsx | 11 +- .../components/UserMenu/UserMenu.module.scss | 4 +- .../components/UserMenu/UserMenu.test.tsx | 8 +- .../src}/components/UserMenu/UserMenu.tsx | 22 +- .../__snapshots__/UserMenu.test.tsx.snap | 0 .../VideoDetails/VideoDetails.module.scss | 10 +- .../VideoDetails/VideoDetails.test.tsx | 0 .../components/VideoDetails/VideoDetails.tsx | 10 +- .../__snapshots__/VideoDetails.test.tsx.snap | 0 .../VideoDetailsInline.module.scss | 8 +- .../VideoDetailsInline/VideoDetailsInline.tsx | 8 +- .../VideoLayout/VideoLayout.module.scss | 6 +- .../components/VideoLayout/VideoLayout.tsx | 20 +- .../VideoList/VideoList.module.scss | 8 +- .../src}/components/VideoList/VideoList.tsx | 14 +- .../VideoListItem/VideoListItem.module.scss | 8 +- .../VideoListItem/VideoListItem.tsx | 18 +- .../WaitingForPayment.module.scss | 0 .../WaitingForPayment/WaitingForPayment.tsx | 3 +- .../components/Welcome/Welcome.module.scss | 4 +- .../src}/components/Welcome/Welcome.test.tsx | 0 .../src}/components/Welcome/Welcome.tsx | 6 +- .../__snapshots__/Welcome.test.tsx.snap | 0 .../AccountModal/AccountModal.module.scss | 4 +- .../AccountModal/AccountModal.test.tsx | 8 +- .../containers/AccountModal/AccountModal.tsx | 52 +- .../__snapshots__/AccountModal.test.tsx.snap | 0 .../AccountModal/forms/CancelSubscription.tsx | 18 +- .../AccountModal/forms/Checkout.tsx | 30 +- .../AccountModal/forms/ChooseOffer.tsx | 32 +- .../AccountModal/forms/EditCardDetails.tsx | 6 +- .../AccountModal/forms/EditPassword.tsx | 16 +- .../containers/AccountModal/forms/Login.tsx | 14 +- .../AccountModal/forms/PersonalDetails.tsx | 22 +- .../AccountModal/forms/Registration.tsx | 20 +- .../AccountModal/forms/RenewSubscription.tsx | 16 +- .../AccountModal/forms/ResetPassword.tsx | 24 +- .../AdyenInitialPayment.tsx | 18 +- .../AdyenPaymentDetails.tsx | 24 +- .../src}/containers/AppRoutes/AppRoutes.tsx | 40 +- .../src}/containers/Cinema/Cinema.module.scss | 8 +- .../src}/containers/Cinema/Cinema.test.tsx | 10 +- {src => web/src}/containers/Cinema/Cinema.tsx | 12 +- .../Cinema/__snapshots__/Cinema.test.tsx.snap | 0 .../FavoriteButton/FavoriteButton.tsx | 20 +- .../InlinePlayer/InlinePlayer.module.scss | 6 +- .../containers/InlinePlayer/InlinePlayer.tsx | 18 +- .../src}/containers/Layout/Layout.module.scss | 4 +- .../src}/containers/Layout/Layout.test.tsx | 8 +- {src => web/src}/containers/Layout/Layout.tsx | 38 +- .../Layout/__snapshots__/Layout.test.tsx.snap | 0 .../PaymentContainer/PaymentContainer.tsx | 27 +- .../PlayerContainer.module.scss | 8 +- .../PlayerContainer/PlayerContainer.tsx | 16 +- .../PlaylistContainer/PlaylistContainer.tsx | 12 +- .../containers/Profiles/CreateProfile.tsx | 18 +- .../containers/Profiles/DeleteProfile.tsx | 14 +- .../src}/containers/Profiles/EditProfile.tsx | 26 +- {src => web/src}/containers/Profiles/Form.tsx | 26 +- .../containers/Profiles/Profiles.module.scss | 2 +- .../src}/containers/Profiles/Profiles.tsx | 19 +- .../src}/containers/Profiles/avatarUrls.json | 0 .../src}/containers/Profiles/types.d.ts | 2 +- .../QueryProvider/QueryProvider.tsx | 0 .../ShelfList/ShelfList.module.scss | 6 +- .../src}/containers/ShelfList/ShelfList.tsx | 24 +- .../StartWatchingButton.module.scss | 6 +- .../StartWatchingButton.tsx | 20 +- .../TrailerModal/TrailerModal.module.scss | 8 +- .../containers/TrailerModal/TrailerModal.tsx | 12 +- .../UpdatePaymentMethod.tsx | 22 +- {src => web/src}/hooks/series/useEpisodes.ts | 11 +- .../src}/hooks/series/useNextEpisode.ts | 9 +- {src => web/src}/hooks/series/useSeries.ts | 11 +- .../src}/hooks/series/useSeriesLookup.ts | 7 +- {src => web/src}/hooks/useAds.ts | 7 +- {src => web/src}/hooks/useBootstrapApp.ts | 14 +- {src => web/src}/hooks/useBreakpoint.ts | 5 +- {src => web/src}/hooks/useCheckAccess.ts | 9 +- .../src}/hooks/useContentProtection.ts | 16 +- {src => web/src}/hooks/useCountdown.ts | 0 {src => web/src}/hooks/useDebounce.ts | 3 +- {src => web/src}/hooks/useEntitlement.ts | 17 +- {src => web/src}/hooks/useEventCallback.ts | 0 {src => web/src}/hooks/useFirstRender.ts | 0 {src => web/src}/hooks/useForm.ts | 5 +- .../src}/hooks/useLiveChannels.test.ts | 19 +- {src => web/src}/hooks/useLiveChannels.ts | 13 +- web/src/hooks/useLiveEvent.ts | 9 + {src => web/src}/hooks/useLiveProgram.test.ts | 7 +- {src => web/src}/hooks/useLiveProgram.ts | 5 +- {src => web/src}/hooks/useMedia.ts | 9 +- {src => web/src}/hooks/useNotifications.ts | 10 +- {src => web/src}/hooks/useOffers.ts | 17 +- {src => web/src}/hooks/useOpaqueId.ts | 0 {src => web/src}/hooks/useOttAnalytics.ts | 7 +- {src => web/src}/hooks/usePlanByEpg.test.ts | 7 +- {src => web/src}/hooks/usePlanByEpg.ts | 5 +- {src => web/src}/hooks/usePlaylist.ts | 17 +- .../src}/hooks/usePlaylistItemCallback.ts | 7 +- {src => web/src}/hooks/useProfiles.ts | 22 +- {src => web/src}/hooks/useProtectedMedia.ts | 8 +- {src => web/src}/hooks/useQueryParam.ts | 0 .../src}/hooks/useSearchQueryUpdater.ts | 4 +- .../src}/hooks/useStartWatchingButton.ts | 3 +- .../src}/hooks/useSubscriptionChange.ts | 11 +- {src => web/src}/hooks/useToggle.ts | 0 .../src}/hooks/useTrackConfigKeyChange.ts | 5 +- {src => web/src}/hooks/useWatchHistory.ts | 12 +- .../src}/hooks/useWatchHistoryListener.ts | 12 +- {src => web/src}/i18n/config.ts | 2 +- {src => web/src}/i18n/resources.ts | 0 {src => web/src}/icons/AccountCircle.tsx | 0 {src => web/src}/icons/ArrowLeft.tsx | 0 {src => web/src}/icons/ArrowLeftRight.tsx | 0 {src => web/src}/icons/BalanceWallet.tsx | 0 {src => web/src}/icons/Cancel.tsx | 0 {src => web/src}/icons/Check.tsx | 0 {src => web/src}/icons/CheckCircle.tsx | 0 {src => web/src}/icons/ChevronLeft.tsx | 0 {src => web/src}/icons/ChevronRight.tsx | 0 {src => web/src}/icons/Close.tsx | 0 {src => web/src}/icons/CreditCard.tsx | 0 {src => web/src}/icons/Edit.tsx | 0 {src => web/src}/icons/Exit.tsx | 0 {src => web/src}/icons/ExternalLink.tsx | 0 {src => web/src}/icons/Favorite.tsx | 0 {src => web/src}/icons/FavoriteBorder.tsx | 0 {src => web/src}/icons/Icon.module.scss | 2 +- {src => web/src}/icons/Icon.tsx | 0 {src => web/src}/icons/Language.tsx | 0 {src => web/src}/icons/Lock.tsx | 0 {src => web/src}/icons/Menu.tsx | 0 {src => web/src}/icons/PayPal.tsx | 0 {src => web/src}/icons/Play.tsx | 0 {src => web/src}/icons/PlayTrailer.tsx | 0 {src => web/src}/icons/Plus.tsx | 0 {src => web/src}/icons/ProfileCircle.tsx | 0 {src => web/src}/icons/Search.tsx | 0 {src => web/src}/icons/Share.tsx | 0 {src => web/src}/icons/Today.tsx | 0 {src => web/src}/icons/Visibility.tsx | 0 {src => web/src}/icons/VisibilityOff.tsx | 0 {src => web/src}/index.tsx | 3 +- .../src}/pages/About/About.module.scss | 4 +- {src => web/src}/pages/About/About.test.tsx | 0 {src => web/src}/pages/About/About.tsx | 4 +- .../About/__snapshots__/About.test.tsx.snap | 0 {src => web/src}/pages/Home/Home.test.tsx | 10 +- {src => web/src}/pages/Home/Home.tsx | 6 +- .../Home/__snapshots__/Home.test.tsx.snap | 0 .../src}/pages/LegacySeries/LegacySeries.tsx | 50 +- {src => web/src}/pages/LegacySeries/utils.ts | 9 +- .../src}/pages/Loading/Loading.module.scss | 0 {src => web/src}/pages/Loading/Loading.tsx | 4 +- .../pages/ScreenRouting/MediaScreenRouter.tsx | 24 +- .../ScreenRouting/PlaylistScreenRouter.tsx | 17 +- .../src}/pages/ScreenRouting/ScreenMap.ts | 4 +- .../MediaEpisode/MediaEpisode.tsx | 12 +- .../mediaScreens/MediaEvent/MediaEvent.tsx | 50 +- .../mediaScreens/MediaHub/MediaHub.tsx | 10 +- .../MediaLiveChannel/MediaLiveChannel.tsx | 12 +- .../mediaScreens/MediaMovie/MediaMovie.tsx | 44 +- .../mediaScreens/MediaSeries/MediaSeries.tsx | 60 +- .../MediaStaticPage.module.scss | 4 +- .../MediaStaticPage/MediaStaticPage.tsx | 12 +- .../PlaylistGrid/PlaylistGrid.module.scss | 6 +- .../PlaylistGrid/PlaylistGrid.tsx | 18 +- .../PlaylistLiveChannels.module.scss | 4 +- .../PlaylistLiveChannels.tsx | 36 +- .../src}/pages/Search/Search.module.scss | 6 +- {src => web/src}/pages/Search/Search.tsx | 22 +- {src => web/src}/pages/User/User.module.scss | 6 +- {src => web/src}/pages/User/User.test.tsx | 26 +- {src => web/src}/pages/User/User.tsx | 46 +- .../User/__snapshots__/User.test.tsx.snap | 0 {src => web/src}/screenMapping.ts | 10 +- {src => web/src}/styles/_theme.scss | 0 {src => web/src}/styles/_variables.scss | 0 {src => web/src}/styles/main.scss | 0 .../src}/styles/mixins/_responsive.scss | 2 +- .../src}/styles/mixins/_typography.scss | 4 +- {src => web/src}/styles/mixins/_utils.scss | 2 +- .../test-cases}/analytics/adv.feature | 0 .../test-cases}/analytics/init.feature | 0 .../test-cases}/analytics/params.feature | 0 .../test-cases}/analytics/quantile.feature | 0 {test-e2e => web/test-e2e}/.eslintrc.js | 0 .../test-e2e}/codecept.desktop.js | 0 {test-e2e => web/test-e2e}/codecept.mobile.js | 0 .../test-e2e}/tests/account_test.ts | 0 .../test-e2e}/tests/favorites_test.ts | 0 {test-e2e => web/test-e2e}/tests/home_test.ts | 0 .../test-e2e}/tests/inline_layout_test.ts | 0 .../test-e2e}/tests/language_test.ts | 0 .../test-e2e}/tests/live_channel_test.ts | 0 .../test-e2e}/tests/login/account_test.ts | 0 .../test-e2e}/tests/login/home_test.ts | 0 .../test-e2e}/tests/payments/coupons_test.ts | 0 .../tests/payments/subscription_test.ts | 0 .../test-e2e}/tests/playlist_test.ts | 0 .../test-e2e}/tests/register_test.ts | 0 .../test-e2e}/tests/search_test.ts | 0 {test-e2e => web/test-e2e}/tests/seo_test.ts | 0 .../test-e2e}/tests/series_test.ts | 0 .../test-e2e}/tests/video_detail_test.ts | 0 .../tests/watch_history/local_test.ts | 0 .../tests/watch_history/logged_in_test.ts | 0 {test-e2e => web/test-e2e}/tsconfig.json | 12 +- {test-e2e => web/test-e2e}/utils/constants.ts | 0 {test-e2e => web/test-e2e}/utils/login.ts | 0 .../test-e2e}/utils/password_utils.ts | 0 {test-e2e => web/test-e2e}/utils/payments.ts | 4 +- .../test-e2e}/utils/randomizers.ts | 0 {test-e2e => web/test-e2e}/utils/steps.d.ts | 0 .../test-e2e}/utils/steps_file.ts | 0 .../test-e2e}/utils/watch_history.ts | 0 {test => web/test}/constants.ts | 2 - {test => web/test}/epg/channel1.json | 0 {test => web/test}/epg/channel2.json | 0 {test => web/test}/epg/channel4.json | 0 {test => web/test}/fixtures/config.json | 0 {test => web/test}/fixtures/customer.json | 0 {test => web/test}/fixtures/epgChannels.json | 0 .../test}/fixtures/epgChannelsUpdate.json | 0 {test => web/test}/fixtures/livePlaylist.json | 0 {test => web/test}/fixtures/monthlyOffer.json | 0 {test => web/test}/fixtures/order.json | 0 .../test}/fixtures/paymentDetail.json | 0 {test => web/test}/fixtures/playlist.json | 0 {test => web/test}/fixtures/schedule.json | 0 {test => web/test}/fixtures/subscription.json | 0 {test => web/test}/fixtures/transactions.json | 0 {test => web/test}/fixtures/tvodOffer.json | 0 {test => web/test}/fixtures/yearlyOffer.json | 0 {test => web/test}/testUtils.tsx | 2 +- {test => web/test}/types.ts | 0 {test => web/test}/vitest.setup.ts | 0 web/tsconfig.json | 21 + web/types/env.d.ts | 15 + web/types/global.d.ts | 12 + web/types/i18next.d.ts | 10 + web/types/jwpltx.d.ts | 18 + web/types/static.d.ts | 59 + vite.config.ts => web/vite.config.ts | 2 + yarn.lock | 3798 +++++++++-------- 728 files changed, 4448 insertions(+), 3742 deletions(-) create mode 100644 packages/common/package.json rename src/config.ts => packages/common/src/constants.ts (97%) rename {src => packages/common/src}/modules/container.ts (97%) rename {src => packages/common/src}/modules/register.ts (50%) create mode 100644 packages/common/src/queryClient.ts rename {src => packages/common/src}/services/account.service.ts (96%) rename {src => packages/common/src}/services/api.service.ts (95%) rename {src => packages/common/src}/services/checkout.service.ts (98%) rename {src => packages/common/src}/services/cleeng.account.service.ts (98%) rename {src => packages/common/src}/services/cleeng.checkout.service.ts (98%) rename {src => packages/common/src}/services/cleeng.service.ts (97%) rename {src => packages/common/src}/services/cleeng.subscription.service.ts (96%) rename {src => packages/common/src}/services/config.service.ts (93%) rename {src => packages/common/src}/services/epg.service.test.ts (97%) rename {src => packages/common/src}/services/epg.service.ts (96%) rename {src => packages/common/src}/services/favorites.service.ts (84%) rename {src => packages/common/src}/services/genericEntitlement.service.ts (86%) rename {src => packages/common/src}/services/inplayer.account.service.ts (96%) rename {src => packages/common/src}/services/inplayer.checkout.service.ts (98%) rename {src => packages/common/src}/services/inplayer.profile.service.ts (91%) rename {src => packages/common/src}/services/inplayer.subscription.service.ts (97%) rename {src => packages/common/src}/services/jwpEntitlement.service.ts (100%) rename {src => packages/common/src}/services/profile.service.ts (69%) rename {src => packages/common/src}/services/settings.service.ts (95%) rename {src => packages/common/src}/services/subscription.service.ts (95%) rename {src => packages/common/src}/services/watchhistory.service.ts (96%) rename {src => packages/common/src}/stores/AccountController.ts (95%) rename {src => packages/common/src}/stores/AccountStore.ts (79%) rename {src => packages/common/src}/stores/AppController.ts (90%) rename {src => packages/common/src}/stores/CheckoutController.ts (94%) rename {src => packages/common/src}/stores/CheckoutStore.ts (85%) rename {src => packages/common/src}/stores/ConfigStore.ts (82%) rename {src => packages/common/src}/stores/FavoritesController.ts (85%) rename {src => packages/common/src}/stores/FavoritesStore.ts (84%) rename {src => packages/common/src}/stores/ProfileController.ts (82%) rename {src => packages/common/src}/stores/ProfileStore.ts (75%) rename {src => packages/common/src}/stores/UIStore.ts (100%) rename {src => packages/common/src}/stores/WatchHistoryController.ts (84%) rename {src => packages/common/src}/stores/WatchHistoryStore.ts (89%) rename {src => packages/common/src}/stores/utils.ts (88%) rename {src => packages/common/src}/utils/api.ts (95%) rename {src => packages/common/src}/utils/broadcaster.test.ts (97%) rename {src => packages/common/src}/utils/broadcaster.ts (98%) rename {src => packages/common/src}/utils/collection.ts (93%) rename {src => packages/common/src}/utils/common.ts (98%) rename {src => packages/common/src}/utils/configSchema.ts (96%) rename {src => packages/common/src}/utils/datetime.ts (100%) rename {src => packages/common/src}/utils/dom.ts (98%) rename {src => packages/common/src}/utils/domHelpers.ts (92%) rename {src => packages/common/src}/utils/entitlements.ts (86%) rename {src => packages/common/src}/utils/epg.ts (94%) rename {src => packages/common/src}/utils/error.ts (100%) rename {src => packages/common/src}/utils/formatting.ts (98%) rename {src => packages/common/src}/utils/liveEvent.ts (96%) rename {src => packages/common/src}/utils/location.ts (100%) rename {src => packages/common/src}/utils/matchMedia.ts (100%) rename {src => packages/common/src}/utils/media.ts (94%) rename {src => packages/common/src}/utils/persist.ts (100%) rename {src => packages/common/src}/utils/promiseQueue.test.ts (100%) rename {src => packages/common/src}/utils/promiseQueue.ts (100%) rename {src => packages/common/src}/utils/series.ts (90%) rename {src => packages/common/src}/utils/structuredData.ts (93%) rename {src => packages/common/src}/utils/subscription.ts (67%) rename {src => packages/common/src}/utils/yupSchemaCreator.ts (100%) create mode 100644 packages/common/tsconfig.json rename {types => packages/common/types}/account.d.ts (75%) rename {types => packages/common/types}/ad-schedule.d.ts (100%) rename {types => packages/common/types}/adyen.d.ts (100%) rename {types => packages/common/types}/checkout.d.ts (97%) rename {types => packages/common/types}/cleeng.d.ts (100%) rename types/Config.d.ts => packages/common/types/config.d.ts (100%) create mode 100644 packages/common/types/entitlement.d.ts rename {types => packages/common/types}/env.d.ts (100%) rename {types => packages/common/types}/epg.d.ts (100%) rename {types => packages/common/types}/favorite.d.ts (100%) rename {types => packages/common/types}/form.d.ts (100%) rename {types => packages/common/types}/global.d.ts (100%) rename {types => packages/common/types}/i18next.d.ts (100%) rename {types => packages/common/types}/inplayer.d.ts (80%) rename {types => packages/common/types}/jwplayer.d.ts (100%) rename {types => packages/common/types}/jwpltx.d.ts (100%) rename {types => packages/common/types}/media.d.ts (100%) rename {types => packages/common/types}/pagination.d.ts (100%) rename {types => packages/common/types}/playlist.d.ts (100%) rename {types => packages/common/types}/screens.d.ts (100%) rename {types => packages/common/types}/series.d.ts (100%) rename {types => packages/common/types}/service.d.ts (100%) rename {types => packages/common/types}/settings.d.ts (100%) rename {types => packages/common/types}/static.d.ts (100%) rename {types => packages/common/types}/subscription.d.ts (96%) rename {types => packages/common/types}/watchHistory.d.ts (100%) create mode 100644 packages/hooks-react/package.json create mode 100644 packages/i18n/package.json create mode 100644 packages/theme/package.json create mode 100644 packages/ui-react/package.json create mode 100644 packages/ui-react/tsconfig.json delete mode 100644 src/hooks/useLiveEvent.ts create mode 100644 tsconfig.vite.json delete mode 100644 types/entitlement.d.ts rename .env => web/.env (100%) rename .env.jwdev => web/.env.jwdev (100%) rename index.html => web/index.html (100%) create mode 100644 web/ini/.webapp.dev.ini rename {ini/templates => web/ini}/.webapp.prod.ini (100%) rename {ini/templates => web/ini}/.webapp.test.ini (100%) rename {ini => web/ini}/templates/.webapp.demo.ini (100%) rename {ini => web/ini}/templates/.webapp.dev.ini (100%) rename {ini => web/ini}/templates/.webapp.jwdev.ini (100%) rename {ini => web/ini}/templates/.webapp.preview.ini (100%) create mode 100644 web/ini/templates/.webapp.prod.ini create mode 100644 web/ini/templates/.webapp.test.ini create mode 100644 web/package.json rename {public => web/public}/browserconfig.xml (100%) rename {public => web/public}/favicon.ico (100%) rename {public => web/public}/images/android-chrome-144x144.png (100%) rename {public => web/public}/images/apple-touch-icon.png (100%) rename {public => web/public}/images/avatars/Alien.svg (100%) rename {public => web/public}/images/avatars/Bear.svg (100%) rename {public => web/public}/images/avatars/Brainy.svg (100%) rename {public => web/public}/images/avatars/Cooool.svg (100%) rename {public => web/public}/images/avatars/Dummy.svg (100%) rename {public => web/public}/images/avatars/Frog.svg (100%) rename {public => web/public}/images/avatars/Goofball.svg (100%) rename {public => web/public}/images/avatars/Marilyn.svg (100%) rename {public => web/public}/images/avatars/Smiley.svg (100%) rename {public => web/public}/images/avatars/ToughGuy.svg (100%) rename {public => web/public}/images/avatars/UhOh.svg (100%) rename {public => web/public}/images/avatars/Vibe.svg (100%) rename {public => web/public}/images/favicon-16x16.png (100%) rename {public => web/public}/images/favicon-32x32.png (100%) rename {public => web/public}/images/logo.png (100%) rename {public => web/public}/images/logo.svg (100%) rename {public => web/public}/images/mstile-150x150.png (100%) rename {public => web/public}/images/payments/amex.svg (100%) rename {public => web/public}/images/payments/diners.svg (100%) rename {public => web/public}/images/payments/discover.svg (100%) rename {public => web/public}/images/payments/hiper.svg (100%) rename {public => web/public}/images/payments/maestro.svg (100%) rename {public => web/public}/images/payments/mastercard.svg (100%) rename {public => web/public}/images/payments/unionpay.svg (100%) rename {public => web/public}/images/payments/visa.svg (100%) rename {public => web/public}/images/safari-pinned-tab.svg (100%) rename {public => web/public}/jwpltx.js (100%) rename {public => web/public}/locales/en/account.json (100%) rename {public => web/public}/locales/en/common.json (100%) rename {public => web/public}/locales/en/country.json (100%) rename {public => web/public}/locales/en/demo.json (100%) rename {public => web/public}/locales/en/epg.json (100%) rename {public => web/public}/locales/en/error.json (100%) rename {public => web/public}/locales/en/menu.json (100%) rename {public => web/public}/locales/en/search.json (100%) rename {public => web/public}/locales/en/us_state.json (100%) rename {public => web/public}/locales/en/user.json (100%) rename {public => web/public}/locales/en/video.json (100%) rename {public => web/public}/locales/es/account.json (100%) rename {public => web/public}/locales/es/common.json (100%) rename {public => web/public}/locales/es/country.json (100%) rename {public => web/public}/locales/es/demo.json (100%) rename {public => web/public}/locales/es/epg.json (100%) rename {public => web/public}/locales/es/error.json (100%) rename {public => web/public}/locales/es/menu.json (100%) rename {public => web/public}/locales/es/search.json (100%) rename {public => web/public}/locales/es/us_state.json (100%) rename {public => web/public}/locales/es/user.json (100%) rename {public => web/public}/locales/es/video.json (100%) rename {public => web/public}/manifest.json (100%) rename {public => web/public}/robots.txt (100%) rename {scripts => web/scripts}/build-tools/settings.ts (100%) rename {scripts => web/scripts}/compressIni.sh (100%) rename {scripts => web/scripts}/waitOnConfig.js (100%) rename {src => web/src}/App.tsx (73%) rename {src => web/src}/assets/icons/facebook.svg (100%) rename {src => web/src}/assets/icons/google.svg (100%) rename {src => web/src}/assets/icons/twitter.svg (100%) rename {src => web/src}/assets/profiles/default_avatar.png (100%) rename {src => web/src}/components/Account/Account.module.scss (100%) rename {src => web/src}/components/Account/Account.test.tsx (66%) rename {src => web/src}/components/Account/Account.tsx (91%) rename {src => web/src}/components/Account/__snapshots__/Account.test.tsx.snap (100%) rename {src => web/src}/components/Adyen/Adyen.module.scss (57%) rename {src => web/src}/components/Adyen/Adyen.tsx (93%) rename {src => web/src}/components/Adyen/AdyenForm.scss (89%) rename {src => web/src}/components/Alert/Alert.module.scss (79%) rename {src => web/src}/components/Alert/Alert.test.tsx (100%) rename {src => web/src}/components/Alert/Alert.tsx (89%) rename {src => web/src}/components/Alert/__snapshots__/Alert.test.tsx.snap (100%) rename {src => web/src}/components/Animation/Animation.tsx (100%) rename {src => web/src}/components/Animation/Fade/Fade.tsx (93%) rename {src => web/src}/components/Animation/Grow/Grow.tsx (87%) rename {src => web/src}/components/Animation/Slide/Slide.tsx (91%) rename {src => web/src}/components/BackButton/BackButton.module.scss (64%) rename {src => web/src}/components/BackButton/BackButton.tsx (100%) rename {src => web/src}/components/Button/Button.module.scss (96%) rename {src => web/src}/components/Button/Button.test.tsx (100%) rename {src => web/src}/components/Button/Button.tsx (97%) rename {src => web/src}/components/Button/__snapshots__/Button.test.tsx.snap (100%) rename {src => web/src}/components/CancelSubscriptionForm/CancelSubscriptionForm.module.scss (75%) rename {src => web/src}/components/CancelSubscriptionForm/CancelSubscriptionForm.test.tsx (100%) rename {src => web/src}/components/CancelSubscriptionForm/CancelSubscriptionForm.tsx (90%) rename {src => web/src}/components/CancelSubscriptionForm/__snapshots__/CancelSubscriptionForm.test.tsx.snap (100%) rename {src => web/src}/components/Card/Card.module.scss (98%) rename {src => web/src}/components/Card/Card.test.tsx (92%) rename {src => web/src}/components/Card/Card.tsx (91%) rename {src => web/src}/components/Card/__snapshots__/Card.test.tsx.snap (100%) rename {src => web/src}/components/CardGrid/CardGrid.module.scss (100%) rename {src => web/src}/components/CardGrid/CardGrid.test.tsx (72%) rename {src => web/src}/components/CardGrid/CardGrid.tsx (85%) rename {src => web/src}/components/CardGrid/__snapshots__/CardGrid.test.tsx.snap (100%) rename {src => web/src}/components/Checkbox/Checkbox.module.scss (97%) rename {src => web/src}/components/Checkbox/Checkbox.test.tsx (100%) rename {src => web/src}/components/Checkbox/Checkbox.tsx (92%) rename {src => web/src}/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap (100%) rename {src => web/src}/components/CheckoutForm/CheckoutForm.module.scss (98%) rename {src => web/src}/components/CheckoutForm/CheckoutForm.test.tsx (81%) rename {src => web/src}/components/CheckoutForm/CheckoutForm.tsx (92%) rename {src => web/src}/components/CheckoutForm/__snapshots__/CheckoutForm.test.tsx.snap (100%) rename {src => web/src}/components/ChooseOfferForm/ChooseOfferForm.module.scss (95%) rename {src => web/src}/components/ChooseOfferForm/ChooseOfferForm.test.tsx (92%) rename {src => web/src}/components/ChooseOfferForm/ChooseOfferForm.tsx (88%) rename {src => web/src}/components/ChooseOfferForm/__snapshots__/ChooseOfferForm.test.tsx.snap (100%) rename {src => web/src}/components/CollapsibleText/CollapsibleText.module.scss (93%) rename {src => web/src}/components/CollapsibleText/CollapsibleText.test.tsx (100%) rename {src => web/src}/components/CollapsibleText/CollapsibleText.tsx (90%) rename {src => web/src}/components/CollapsibleText/__snapshots__/CollapsibleText.test.tsx.snap (100%) rename {src => web/src}/components/ConfirmationDialog/ConfirmationDialog.module.scss (79%) rename {src => web/src}/components/ConfirmationDialog/ConfirmationDialog.test.tsx (100%) rename {src => web/src}/components/ConfirmationDialog/ConfirmationDialog.tsx (91%) rename {src => web/src}/components/ConfirmationDialog/__snapshots__/ConfirmationDialog.test.tsx.snap (100%) rename {src => web/src}/components/ConfirmationForm/ConfirmationForm.module.scss (88%) rename {src => web/src}/components/ConfirmationForm/ConfirmationForm.test.tsx (83%) rename {src => web/src}/components/ConfirmationForm/ConfirmationForm.tsx (90%) rename {src => web/src}/components/ConfirmationForm/__snapshots__/ConfirmationForm.test.tsx.snap (100%) rename {src => web/src}/components/CreditCardCVCField/CreditCardCVCField.test.tsx (100%) rename {src => web/src}/components/CreditCardCVCField/CreditCardCVCField.tsx (100%) rename {src => web/src}/components/CreditCardCVCField/__snapshots__/CreditCardCVCField.test.tsx.snap (100%) rename {src => web/src}/components/CreditCardExpiryField/CreditCardExpiryField.test.tsx (100%) rename {src => web/src}/components/CreditCardExpiryField/CreditCardExpiryField.tsx (100%) rename {src => web/src}/components/CreditCardExpiryField/__snapshots__/CreditCardExpiryField.test.tsx.snap (100%) rename {src => web/src}/components/CreditCardNumberField/CreditCardNumberField.module.scss (100%) rename {src => web/src}/components/CreditCardNumberField/CreditCardNumberField.test.tsx (100%) rename {src => web/src}/components/CreditCardNumberField/CreditCardNumberField.tsx (100%) rename {src => web/src}/components/CreditCardNumberField/__snapshots__/CreditCardNumberField.test.tsx.snap (100%) rename {src => web/src}/components/CustomRegisterField/CustomRegisterField.test.tsx (97%) rename {src => web/src}/components/CustomRegisterField/CustomRegisterField.tsx (73%) rename {src => web/src}/components/CustomRegisterField/__snapshots__/CustomRegisterField.test.tsx.snap (100%) rename {src => web/src}/components/DateField/DateField.module.scss (96%) rename {src => web/src}/components/DateField/DateField.tsx (97%) rename {src => web/src}/components/DeleteAccountModal/DeleteAccountModal.module.scss (97%) rename {src => web/src}/components/DeleteAccountModal/DeleteAccountModal.tsx (89%) rename {src => web/src}/components/DeleteAccountPasswordWarning/DeleteAccountPasswordWarning.module.scss (96%) rename {src => web/src}/components/DeleteAccountPasswordWarning/DeleteAccountPasswordWarning.tsx (81%) rename {src => web/src}/components/DemoConfigDialog/DemoConfigDialog.module.scss (94%) rename {src => web/src}/components/DemoConfigDialog/DemoConfigDialog.test.tsx (87%) rename {src => web/src}/components/DemoConfigDialog/DemoConfigDialog.tsx (92%) rename {src => web/src}/components/DemoConfigDialog/__snapshots__/DemoConfigDialog.test.tsx.snap (100%) rename {src => web/src}/components/DetectOutsideClick/DetectOutsideClick.tsx (100%) rename {src => web/src}/components/DevConfigSelector/DevConfigSelector.module.scss (100%) rename {src => web/src}/components/DevConfigSelector/DevConfigSelector.tsx (79%) rename {src => web/src}/components/DevStackTrace/DevStackTrace.module.scss (100%) rename {src => web/src}/components/DevStackTrace/DevStackTrace.tsx (100%) rename {src => web/src}/components/Dialog/Dialog.module.scss (87%) rename {src => web/src}/components/Dialog/Dialog.test.tsx (100%) rename {src => web/src}/components/Dialog/Dialog.tsx (76%) rename {src => web/src}/components/Dialog/__snapshots__/Dialog.test.tsx.snap (100%) rename {src => web/src}/components/DialogBackButton/DialogBackButton.module.scss (65%) rename {src => web/src}/components/DialogBackButton/DialogBackButton.test.tsx (100%) rename {src => web/src}/components/DialogBackButton/DialogBackButton.tsx (78%) rename {src => web/src}/components/DialogBackButton/__snapshots__/DialogBackButton.test.tsx.snap (100%) rename {src => web/src}/components/Dropdown/Dropdown.module.scss (96%) rename {src => web/src}/components/Dropdown/Dropdown.test.tsx (99%) rename {src => web/src}/components/Dropdown/Dropdown.tsx (95%) rename {src => web/src}/components/EditCardPaymentForm/EditCardPaymentForm.module.scss (100%) rename {src => web/src}/components/EditCardPaymentForm/EditCardPaymentForm.tsx (94%) rename {src => web/src}/components/EditForm/EditCardDetailsForm.module.scss (71%) rename {src => web/src}/components/EditForm/EditCardDetailsForm.tsx (92%) rename {src => web/src}/components/EditPasswordForm/EditPasswordForm.module.scss (89%) rename {src => web/src}/components/EditPasswordForm/EditPasswordForm.test.tsx (100%) rename {src => web/src}/components/EditPasswordForm/EditPasswordForm.tsx (90%) rename {src => web/src}/components/EditPasswordForm/__snapshots__/EditPasswordForm.test.tsx.snap (100%) rename {src => web/src}/components/Epg/Epg.module.scss (95%) rename {src => web/src}/components/Epg/Epg.tsx (83%) rename {src => web/src}/components/EpgChannel/EpgChannelItem.module.scss (87%) rename {src => web/src}/components/EpgChannel/EpgChannelItem.tsx (91%) rename {src => web/src}/components/EpgProgramItem/EpgProgramItem.module.scss (96%) rename {src => web/src}/components/EpgProgramItem/EpgProgramItem.tsx (96%) rename {src => web/src}/components/EpgTimeline/EpgTimeline.module.scss (92%) rename {src => web/src}/components/EpgTimeline/EpgTimeline.tsx (100%) rename {src => web/src}/components/ErrorPage/ErrorPage.module.scss (90%) rename {src => web/src}/components/ErrorPage/ErrorPage.test.tsx (100%) rename {src => web/src}/components/ErrorPage/ErrorPage.tsx (91%) rename {src => web/src}/components/ErrorPage/__snapshots__/ErrorPage.test.tsx.snap (100%) rename {src => web/src}/components/Favorites/Favorites.module.scss (81%) rename {src => web/src}/components/Favorites/Favorites.test.tsx (71%) rename {src => web/src}/components/Favorites/Favorites.tsx (76%) rename {src => web/src}/components/Favorites/__snapshots__/Favorites.test.tsx.snap (100%) rename {src => web/src}/components/Filter/Filter.module.scss (69%) rename {src => web/src}/components/Filter/Filter.test.tsx (100%) rename {src => web/src}/components/Filter/Filter.tsx (89%) rename {src => web/src}/components/Filter/__snapshots__/Filter.test.tsx.snap (100%) rename {src => web/src}/components/FinalizePayment/FinalizePayment.module.scss (100%) rename {src => web/src}/components/FinalizePayment/FinalizePayment.tsx (78%) rename {src => web/src}/components/ForgotPasswordForm/ForgotPasswordForm.module.scss (76%) rename {src => web/src}/components/ForgotPasswordForm/ForgotPasswordForm.test.tsx (100%) rename {src => web/src}/components/ForgotPasswordForm/ForgotPasswordForm.tsx (80%) rename {src => web/src}/components/ForgotPasswordForm/__snapshots__/ForgotPasswordForm.test.tsx.snap (100%) rename {src => web/src}/components/Form/Form.module.scss (75%) rename {src => web/src}/components/Form/Form.test.tsx (100%) rename {src => web/src}/components/Form/Form.tsx (96%) rename {src => web/src}/components/Form/FormSection.tsx (95%) rename {src => web/src}/components/Form/__snapshots__/Form.test.tsx.snap (100%) rename {src => web/src}/components/FormFeedback/FormFeedback.module.scss (91%) rename {src => web/src}/components/FormFeedback/FormFeedback.test.tsx (100%) rename {src => web/src}/components/FormFeedback/FormFeedback.tsx (100%) rename {src => web/src}/components/FormFeedback/__snapshots__/FormFeedback.test.tsx.snap (100%) rename {src => web/src}/components/Header/Header.module.scss (95%) rename {src => web/src}/components/Header/Header.test.tsx (87%) rename {src => web/src}/components/Header/Header.tsx (86%) rename {src => web/src}/components/Header/__snapshots__/Header.test.tsx.snap (100%) rename {src => web/src}/components/HelperText/HelperText.module.scss (71%) rename {src => web/src}/components/HelperText/HelperText.test.tsx (100%) rename {src => web/src}/components/HelperText/HelperText.tsx (100%) rename {src => web/src}/components/HelperText/__snapshots__/HelperText.test.tsx.snap (100%) rename {src => web/src}/components/Hero/Hero.module.scss (87%) rename {src => web/src}/components/Hero/Hero.tsx (91%) rename {src => web/src}/components/IconButton/IconButton.module.scss (85%) rename {src => web/src}/components/IconButton/IconButton.test.tsx (90%) rename {src => web/src}/components/IconButton/IconButton.tsx (100%) rename {src => web/src}/components/IconButton/__snapshots__/IconButton.test.tsx.snap (100%) rename {src => web/src}/components/Image/Image.module.scss (100%) rename {src => web/src}/components/Image/Image.test.tsx (100%) rename {src => web/src}/components/Image/Image.tsx (89%) rename {src => web/src}/components/InfiniteScrollLoader/InfiniteScrollLoader.module.scss (100%) rename {src => web/src}/components/InfiniteScrollLoader/InfiniteScrollLoader.tsx (83%) rename {src => web/src}/components/LanguageMenu/LanguageMenu.module.scss (86%) rename {src => web/src}/components/LanguageMenu/LanguageMenu.test.tsx (95%) rename {src => web/src}/components/LanguageMenu/LanguageMenu.tsx (87%) rename {src => web/src}/components/LanguageMenu/__snapshots__/LanguageMenu.test.tsx.snap (100%) rename {src => web/src}/components/LanguageMenu/__snapshots__/UserMenu.test.tsx.snap (100%) rename {src => web/src}/components/Link/Link.module.scss (82%) rename {src => web/src}/components/Link/Link.test.tsx (100%) rename {src => web/src}/components/Link/Link.tsx (100%) rename {src => web/src}/components/Link/__snapshots__/Link.test.tsx.snap (100%) rename {src => web/src}/components/LoadingOverlay/LoadingOverlay.module.scss (92%) rename {src => web/src}/components/LoadingOverlay/LoadingOverlay.tsx (93%) rename {src => web/src}/components/LoginForm/LoginForm.module.scss (81%) rename {src => web/src}/components/LoginForm/LoginForm.test.tsx (93%) rename {src => web/src}/components/LoginForm/LoginForm.tsx (79%) rename {src => web/src}/components/LoginForm/__snapshots__/LoginForm.test.tsx.snap (100%) rename {src => web/src}/components/Logo/Logo.module.scss (78%) rename {src => web/src}/components/Logo/Logo.test.tsx (93%) rename {src => web/src}/components/Logo/Logo.tsx (100%) rename {src => web/src}/components/Logo/__snapshots__/Logo.test.tsx.snap (100%) rename {src => web/src}/components/MarkdownComponent/MarkdownComponent.module.scss (94%) rename {src => web/src}/components/MarkdownComponent/MarkdownComponent.test.tsx (100%) rename {src => web/src}/components/MarkdownComponent/MarkdownComponent.tsx (100%) rename {src => web/src}/components/MarkdownComponent/__snapshots__/MarkdownComponent.test.tsx.snap (100%) rename {src => web/src}/components/MenuButton/MenuButton.module.scss (90%) rename {src => web/src}/components/MenuButton/MenuButton.test.tsx (100%) rename {src => web/src}/components/MenuButton/MenuButton.tsx (100%) rename {src => web/src}/components/MenuButton/__snapshots__/MenuButton.test.tsx.snap (100%) rename {src => web/src}/components/Modal/Modal.module.scss (80%) rename {src => web/src}/components/Modal/Modal.test.tsx (100%) rename {src => web/src}/components/Modal/Modal.tsx (93%) rename {src => web/src}/components/Modal/__snapshots__/Modal.test.tsx.snap (100%) rename {src => web/src}/components/ModalCloseButton/ModalCloseButton.module.scss (85%) rename {src => web/src}/components/ModalCloseButton/ModalCloseButton.test.tsx (100%) rename {src => web/src}/components/ModalCloseButton/ModalCloseButton.tsx (85%) rename {src => web/src}/components/ModalCloseButton/__snapshots__/ModalCloseButton.test.tsx.snap (100%) rename {src => web/src}/components/NoPaymentRequired/NoPaymentRequired.module.scss (70%) rename {src => web/src}/components/NoPaymentRequired/NoPaymentRequired.test.tsx (100%) rename {src => web/src}/components/NoPaymentRequired/NoPaymentRequired.tsx (85%) rename {src => web/src}/components/NoPaymentRequired/__snapshots__/NoPaymentRequired.test.tsx.snap (100%) rename {src => web/src}/components/OfferSwitch/OfferSwitch.module.scss (94%) rename {src => web/src}/components/OfferSwitch/OfferSwitch.tsx (91%) rename {src => web/src}/components/Panel/Panel.module.scss (82%) rename {src => web/src}/components/Panel/Panel.tsx (100%) rename {src => web/src}/components/PasswordField/PasswordField.test.tsx (100%) rename {src => web/src}/components/PasswordField/PasswordField.tsx (90%) rename {src => web/src}/components/PasswordField/__snapshots__/PasswordField.test.tsx.snap (100%) rename {src => web/src}/components/PasswordStrength/PasswordStrength.module.scss (94%) rename {src => web/src}/components/PasswordStrength/PasswordStrength.test.tsx (100%) rename {src => web/src}/components/PasswordStrength/PasswordStrength.tsx (100%) rename {src => web/src}/components/PasswordStrength/__snapshots__/PasswordStrength.test.tsx.snap (100%) rename {src => web/src}/components/PayPal/PayPal.module.scss (68%) rename {src => web/src}/components/PayPal/PayPal.test.tsx (100%) rename {src => web/src}/components/PayPal/PayPal.tsx (84%) rename {src => web/src}/components/PayPal/__snapshots__/PayPal.test.tsx.snap (100%) rename {src => web/src}/components/Payment/Payment.module.scss (94%) rename {src => web/src}/components/Payment/Payment.test.tsx (69%) rename {src => web/src}/components/Payment/Payment.tsx (94%) rename {src => web/src}/components/Payment/__snapshots__/Payment.test.tsx.snap (100%) rename {src => web/src}/components/PaymentFailed/PaymentFailed.module.scss (66%) rename {src => web/src}/components/PaymentFailed/PaymentFailed.test.tsx (100%) rename {src => web/src}/components/PaymentFailed/PaymentFailed.tsx (94%) rename {src => web/src}/components/PaymentFailed/__snapshots__/PaymentFailed.test.tsx.snap (100%) rename {src => web/src}/components/PaymentForm/PaymentForm.module.scss (100%) rename {src => web/src}/components/PaymentForm/PaymentForm.tsx (93%) rename {src => web/src}/components/PaymentMethodForm/PaymentMethodForm.module.scss (92%) rename {src => web/src}/components/PaymentMethodForm/PaymentMethodForm.tsx (91%) rename {src => web/src}/components/PersonalDetailsForm/PersonalDetailsForm.module.scss (73%) rename {src => web/src}/components/PersonalDetailsForm/PersonalDetailsForm.test.tsx (97%) rename {src => web/src}/components/PersonalDetailsForm/PersonalDetailsForm.tsx (91%) rename {src => web/src}/components/PersonalDetailsForm/__snapshots__/PersonalDetailsForm.test.tsx.snap (100%) rename {src => web/src}/components/Player/Player.module.scss (100%) rename {src => web/src}/components/Player/Player.test.tsx (84%) rename {src => web/src}/components/Player/Player.tsx (91%) rename {src => web/src}/components/Player/__snapshots__/Player.test.tsx.snap (100%) rename {src => web/src}/components/Popover/Popover.module.scss (80%) rename {src => web/src}/components/Popover/Popover.test.tsx (78%) rename {src => web/src}/components/Popover/Popover.tsx (80%) rename {src => web/src}/components/Popover/__snapshots__/Popover.test.tsx.snap (100%) rename {src => web/src}/components/ProfileBox/AddNewProfile.tsx (95%) rename {src => web/src}/components/ProfileBox/ProfileBox.module.scss (99%) rename {src => web/src}/components/ProfileBox/ProfileBox.tsx (90%) rename {src => web/src}/components/Radio/Radio.module.scss (95%) rename {src => web/src}/components/Radio/Radio.test.tsx (100%) rename {src => web/src}/components/Radio/Radio.tsx (92%) rename {src => web/src}/components/Radio/__snapshots__/Radio.test.tsx.snap (100%) rename {src => web/src}/components/RegistrationForm/RegistrationForm.module.scss (90%) rename {src => web/src}/components/RegistrationForm/RegistrationForm.test.tsx (91%) rename {src => web/src}/components/RegistrationForm/RegistrationForm.tsx (82%) rename {src => web/src}/components/RegistrationForm/__snapshots__/RegistrationForm.test.tsx.snap (100%) rename {src => web/src}/components/RenewSubscriptionForm/RenewSubscriptionForm.module.scss (93%) rename {src => web/src}/components/RenewSubscriptionForm/RenewSubscriptionForm.test.tsx (66%) rename {src => web/src}/components/RenewSubscriptionForm/RenewSubscriptionForm.tsx (83%) rename {src => web/src}/components/RenewSubscriptionForm/__snapshots__/RenewSubscriptionForm.test.tsx.snap (100%) rename {src => web/src}/components/ResetPasswordForm/ResetPasswordForm.module.scss (77%) rename {src => web/src}/components/ResetPasswordForm/ResetPasswordForm.test.tsx (100%) rename {src => web/src}/components/ResetPasswordForm/ResetPasswordForm.tsx (94%) rename {src => web/src}/components/ResetPasswordForm/__snapshots__/ResetPasswordForm.test.tsx.snap (100%) rename {src => web/src}/components/Root/Root.tsx (78%) rename {src => web/src}/components/RootErrorPage/RootErrorPage.tsx (80%) rename {src => web/src}/components/SearchBar/SearchBar.module.scss (93%) rename {src => web/src}/components/SearchBar/SearchBar.test.tsx (95%) rename {src => web/src}/components/SearchBar/SearchBar.tsx (88%) rename {src => web/src}/components/SearchBar/__snapshots__/SearchBar.test.tsx.snap (100%) rename {src => web/src}/components/ShareButton/ShareButton.test.tsx (100%) rename {src => web/src}/components/ShareButton/ShareButton.tsx (78%) rename {src => web/src}/components/ShareButton/__snapshots__/ShareButton.test.tsx.snap (100%) rename {src => web/src}/components/Shelf/Shelf.module.scss (100%) rename {src => web/src}/components/Shelf/Shelf.test.tsx (95%) rename {src => web/src}/components/Shelf/Shelf.tsx (87%) rename {src => web/src}/components/Shelf/__snapshots__/Shelf.test.tsx.snap (100%) rename {src => web/src}/components/Sidebar/Sidebar.module.scss (92%) rename {src => web/src}/components/Sidebar/Sidebar.test.tsx (79%) rename {src => web/src}/components/Sidebar/Sidebar.tsx (91%) rename {src => web/src}/components/Sidebar/__snapshots__/Sidebar.test.tsx.snap (100%) rename {src => web/src}/components/SocialButton/SocialButton.module.scss (95%) rename {src => web/src}/components/SocialButton/SocialButton.tsx (100%) rename {src => web/src}/components/SocialButtonsList/SocialButtonsList.module.scss (100%) rename {src => web/src}/components/SocialButtonsList/SocialButtonsList.tsx (84%) rename {src => web/src}/components/Spinner/Spinner.module.scss (95%) rename {src => web/src}/components/Spinner/Spinner.tsx (100%) rename {src => web/src}/components/StatusIcon/StatusIcon.tsx (74%) rename {src => web/src}/components/SubscriptionCancelled/SubscriptionCancelled.module.scss (69%) rename {src => web/src}/components/SubscriptionCancelled/SubscriptionCancelled.test.tsx (100%) rename {src => web/src}/components/SubscriptionCancelled/SubscriptionCancelled.tsx (93%) rename {src => web/src}/components/SubscriptionCancelled/__snapshots__/SubscriptionCancelled.test.tsx.snap (100%) rename {src => web/src}/components/SubscriptionRenewed/SubscriptionRenewed.module.scss (69%) rename {src => web/src}/components/SubscriptionRenewed/SubscriptionRenewed.test.tsx (60%) rename {src => web/src}/components/SubscriptionRenewed/SubscriptionRenewed.tsx (76%) rename {src => web/src}/components/SubscriptionRenewed/__snapshots__/SubscriptionRenewed.test.tsx.snap (100%) rename {src => web/src}/components/Tag/Tag.module.scss (86%) rename {src => web/src}/components/Tag/Tag.tsx (100%) rename {src => web/src}/components/TextField/TextField.module.scss (96%) rename {src => web/src}/components/TextField/TextField.test.tsx (100%) rename {src => web/src}/components/TextField/TextField.tsx (91%) rename {src => web/src}/components/TextField/__snapshots__/TextField.test.tsx.snap (100%) rename {src => web/src}/components/TileDock/TileDock.module.scss (95%) rename {src => web/src}/components/TileDock/TileDock.tsx (100%) rename {src => web/src}/components/UpgradeSubscription/UpgradeSubscription.module.scss (73%) rename {src => web/src}/components/UpgradeSubscription/UpgradeSubscription.tsx (95%) rename {src => web/src}/components/UserMenu/ProfilesMenu/ProfilesMenu.tsx (84%) rename {src => web/src}/components/UserMenu/UserMenu.module.scss (94%) rename {src => web/src}/components/UserMenu/UserMenu.test.tsx (67%) rename {src => web/src}/components/UserMenu/UserMenu.tsx (84%) rename {src => web/src}/components/UserMenu/__snapshots__/UserMenu.test.tsx.snap (100%) rename {src => web/src}/components/VideoDetails/VideoDetails.module.scss (96%) rename {src => web/src}/components/VideoDetails/VideoDetails.test.tsx (100%) rename {src => web/src}/components/VideoDetails/VideoDetails.tsx (88%) rename {src => web/src}/components/VideoDetails/__snapshots__/VideoDetails.test.tsx.snap (100%) rename {src => web/src}/components/VideoDetailsInline/VideoDetailsInline.module.scss (94%) rename {src => web/src}/components/VideoDetailsInline/VideoDetailsInline.tsx (85%) rename {src => web/src}/components/VideoLayout/VideoLayout.module.scss (97%) rename {src => web/src}/components/VideoLayout/VideoLayout.tsx (90%) rename {src => web/src}/components/VideoList/VideoList.module.scss (63%) rename {src => web/src}/components/VideoList/VideoList.tsx (82%) rename {src => web/src}/components/VideoListItem/VideoListItem.module.scss (95%) rename {src => web/src}/components/VideoListItem/VideoListItem.tsx (86%) rename {src => web/src}/components/WaitingForPayment/WaitingForPayment.module.scss (100%) rename {src => web/src}/components/WaitingForPayment/WaitingForPayment.tsx (92%) rename {src => web/src}/components/Welcome/Welcome.module.scss (63%) rename {src => web/src}/components/Welcome/Welcome.test.tsx (100%) rename {src => web/src}/components/Welcome/Welcome.tsx (88%) rename {src => web/src}/components/Welcome/__snapshots__/Welcome.test.tsx.snap (100%) rename {src => web/src}/containers/AccountModal/AccountModal.module.scss (56%) rename {src => web/src}/containers/AccountModal/AccountModal.test.tsx (68%) rename {src => web/src}/containers/AccountModal/AccountModal.tsx (80%) rename {src => web/src}/containers/AccountModal/__snapshots__/AccountModal.test.tsx.snap (100%) rename {src => web/src}/containers/AccountModal/forms/CancelSubscription.tsx (69%) rename {src => web/src}/containers/AccountModal/forms/Checkout.tsx (87%) rename {src => web/src}/containers/AccountModal/forms/ChooseOffer.tsx (80%) rename {src => web/src}/containers/AccountModal/forms/EditCardDetails.tsx (79%) rename {src => web/src}/containers/AccountModal/forms/EditPassword.tsx (85%) rename {src => web/src}/containers/AccountModal/forms/Login.tsx (79%) rename {src => web/src}/containers/AccountModal/forms/PersonalDetails.tsx (88%) rename {src => web/src}/containers/AccountModal/forms/Registration.tsx (86%) rename {src => web/src}/containers/AccountModal/forms/RenewSubscription.tsx (74%) rename {src => web/src}/containers/AccountModal/forms/ResetPassword.tsx (79%) rename {src => web/src}/containers/AdyenInitialPayment/AdyenInitialPayment.tsx (85%) rename {src => web/src}/containers/AdyenPaymentDetails/AdyenPaymentDetails.tsx (84%) rename {src => web/src}/containers/AppRoutes/AppRoutes.tsx (66%) rename {src => web/src}/containers/Cinema/Cinema.module.scss (92%) rename {src => web/src}/containers/Cinema/Cinema.test.tsx (79%) rename {src => web/src}/containers/Cinema/Cinema.tsx (91%) rename {src => web/src}/containers/Cinema/__snapshots__/Cinema.test.tsx.snap (100%) rename {src => web/src}/containers/FavoriteButton/FavoriteButton.tsx (69%) rename {src => web/src}/containers/InlinePlayer/InlinePlayer.module.scss (94%) rename {src => web/src}/containers/InlinePlayer/InlinePlayer.tsx (82%) rename {src => web/src}/containers/Layout/Layout.module.scss (93%) rename {src => web/src}/containers/Layout/Layout.test.tsx (65%) rename {src => web/src}/containers/Layout/Layout.tsx (84%) rename {src => web/src}/containers/Layout/__snapshots__/Layout.test.tsx.snap (100%) rename {src => web/src}/containers/PaymentContainer/PaymentContainer.tsx (82%) rename {src => web/src}/containers/PlayerContainer/PlayerContainer.module.scss (56%) rename {src => web/src}/containers/PlayerContainer/PlayerContainer.tsx (81%) rename {src => web/src}/containers/PlaylistContainer/PlaylistContainer.tsx (80%) rename {src => web/src}/containers/Profiles/CreateProfile.tsx (83%) rename {src => web/src}/containers/Profiles/DeleteProfile.tsx (82%) rename {src => web/src}/containers/Profiles/EditProfile.tsx (84%) rename {src => web/src}/containers/Profiles/Form.tsx (86%) rename {src => web/src}/containers/Profiles/Profiles.module.scss (98%) rename {src => web/src}/containers/Profiles/Profiles.tsx (86%) rename {src => web/src}/containers/Profiles/avatarUrls.json (100%) rename {src => web/src}/containers/Profiles/types.d.ts (68%) rename {src => web/src}/containers/QueryProvider/QueryProvider.tsx (100%) rename {src => web/src}/containers/ShelfList/ShelfList.module.scss (86%) rename {src => web/src}/containers/ShelfList/ShelfList.tsx (77%) rename {src => web/src}/containers/StartWatchingButton/StartWatchingButton.module.scss (75%) rename {src => web/src}/containers/StartWatchingButton/StartWatchingButton.tsx (81%) rename {src => web/src}/containers/TrailerModal/TrailerModal.module.scss (79%) rename {src => web/src}/containers/TrailerModal/TrailerModal.tsx (81%) rename {src => web/src}/containers/UpdatePaymentMethod/UpdatePaymentMethod.tsx (80%) rename {src => web/src}/hooks/series/useEpisodes.ts (80%) rename {src => web/src}/hooks/series/useNextEpisode.ts (68%) rename {src => web/src}/hooks/series/useSeries.ts (72%) rename {src => web/src}/hooks/series/useSeriesLookup.ts (74%) rename {src => web/src}/hooks/useAds.ts (89%) rename {src => web/src}/hooks/useBootstrapApp.ts (61%) rename {src => web/src}/hooks/useBreakpoint.ts (94%) rename {src => web/src}/hooks/useCheckAccess.ts (83%) rename {src => web/src}/hooks/useContentProtection.ts (76%) rename {src => web/src}/hooks/useCountdown.ts (100%) rename {src => web/src}/hooks/useDebounce.ts (87%) rename {src => web/src}/hooks/useEntitlement.ts (78%) rename {src => web/src}/hooks/useEventCallback.ts (100%) rename {src => web/src}/hooks/useFirstRender.ts (100%) rename {src => web/src}/hooks/useForm.ts (95%) rename {src => web/src}/hooks/useLiveChannels.test.ts (94%) rename {src => web/src}/hooks/useLiveChannels.ts (90%) create mode 100644 web/src/hooks/useLiveEvent.ts rename {src => web/src}/hooks/useLiveProgram.test.ts (94%) rename {src => web/src}/hooks/useLiveProgram.ts (92%) rename {src => web/src}/hooks/useMedia.ts (68%) rename {src => web/src}/hooks/useNotifications.ts (86%) rename {src => web/src}/hooks/useOffers.ts (79%) rename {src => web/src}/hooks/useOpaqueId.ts (100%) rename {src => web/src}/hooks/useOttAnalytics.ts (90%) rename {src => web/src}/hooks/usePlanByEpg.test.ts (93%) rename {src => web/src}/hooks/usePlanByEpg.ts (95%) rename {src => web/src}/hooks/usePlaylist.ts (67%) rename {src => web/src}/hooks/usePlaylistItemCallback.ts (81%) rename {src => web/src}/hooks/useProfiles.ts (85%) rename {src => web/src}/hooks/useProtectedMedia.ts (58%) rename {src => web/src}/hooks/useQueryParam.ts (100%) rename {src => web/src}/hooks/useSearchQueryUpdater.ts (88%) rename {src => web/src}/hooks/useStartWatchingButton.ts (95%) rename {src => web/src}/hooks/useSubscriptionChange.ts (71%) rename {src => web/src}/hooks/useToggle.ts (100%) rename {src => web/src}/hooks/useTrackConfigKeyChange.ts (90%) rename {src => web/src}/hooks/useWatchHistory.ts (69%) rename {src => web/src}/hooks/useWatchHistoryListener.ts (90%) rename {src => web/src}/i18n/config.ts (97%) rename {src => web/src}/i18n/resources.ts (100%) rename {src => web/src}/icons/AccountCircle.tsx (100%) rename {src => web/src}/icons/ArrowLeft.tsx (100%) rename {src => web/src}/icons/ArrowLeftRight.tsx (100%) rename {src => web/src}/icons/BalanceWallet.tsx (100%) rename {src => web/src}/icons/Cancel.tsx (100%) rename {src => web/src}/icons/Check.tsx (100%) rename {src => web/src}/icons/CheckCircle.tsx (100%) rename {src => web/src}/icons/ChevronLeft.tsx (100%) rename {src => web/src}/icons/ChevronRight.tsx (100%) rename {src => web/src}/icons/Close.tsx (100%) rename {src => web/src}/icons/CreditCard.tsx (100%) rename {src => web/src}/icons/Edit.tsx (100%) rename {src => web/src}/icons/Exit.tsx (100%) rename {src => web/src}/icons/ExternalLink.tsx (100%) rename {src => web/src}/icons/Favorite.tsx (100%) rename {src => web/src}/icons/FavoriteBorder.tsx (100%) rename {src => web/src}/icons/Icon.module.scss (82%) rename {src => web/src}/icons/Icon.tsx (100%) rename {src => web/src}/icons/Language.tsx (100%) rename {src => web/src}/icons/Lock.tsx (100%) rename {src => web/src}/icons/Menu.tsx (100%) rename {src => web/src}/icons/PayPal.tsx (100%) rename {src => web/src}/icons/Play.tsx (100%) rename {src => web/src}/icons/PlayTrailer.tsx (100%) rename {src => web/src}/icons/Plus.tsx (100%) rename {src => web/src}/icons/ProfileCircle.tsx (100%) rename {src => web/src}/icons/Search.tsx (100%) rename {src => web/src}/icons/Share.tsx (100%) rename {src => web/src}/icons/Today.tsx (100%) rename {src => web/src}/icons/Visibility.tsx (100%) rename {src => web/src}/icons/VisibilityOff.tsx (100%) rename {src => web/src}/index.tsx (85%) rename {src => web/src}/pages/About/About.module.scss (72%) rename {src => web/src}/pages/About/About.test.tsx (100%) rename {src => web/src}/pages/About/About.tsx (97%) rename {src => web/src}/pages/About/__snapshots__/About.test.tsx.snap (100%) rename {src => web/src}/pages/Home/Home.test.tsx (90%) rename {src => web/src}/pages/Home/Home.tsx (59%) rename {src => web/src}/pages/Home/__snapshots__/Home.test.tsx.snap (100%) rename {src => web/src}/pages/LegacySeries/LegacySeries.tsx (85%) rename {src => web/src}/pages/LegacySeries/utils.ts (91%) rename {src => web/src}/pages/Loading/Loading.module.scss (100%) rename {src => web/src}/pages/Loading/Loading.tsx (76%) rename {src => web/src}/pages/ScreenRouting/MediaScreenRouter.tsx (64%) rename {src => web/src}/pages/ScreenRouting/PlaylistScreenRouter.tsx (61%) rename {src => web/src}/pages/ScreenRouting/ScreenMap.ts (86%) rename {src => web/src}/pages/ScreenRouting/mediaScreens/MediaEpisode/MediaEpisode.tsx (73%) rename {src => web/src}/pages/ScreenRouting/mediaScreens/MediaEvent/MediaEvent.tsx (79%) rename {src => web/src}/pages/ScreenRouting/mediaScreens/MediaHub/MediaHub.tsx (72%) rename {src => web/src}/pages/ScreenRouting/mediaScreens/MediaLiveChannel/MediaLiveChannel.tsx (55%) rename {src => web/src}/pages/ScreenRouting/mediaScreens/MediaMovie/MediaMovie.tsx (80%) rename {src => web/src}/pages/ScreenRouting/mediaScreens/MediaSeries/MediaSeries.tsx (84%) rename {src => web/src}/pages/ScreenRouting/mediaScreens/MediaStaticPage/MediaStaticPage.module.scss (73%) rename {src => web/src}/pages/ScreenRouting/mediaScreens/MediaStaticPage/MediaStaticPage.tsx (70%) rename {src => web/src}/pages/ScreenRouting/playlistScreens/PlaylistGrid/PlaylistGrid.module.scss (90%) rename {src => web/src}/pages/ScreenRouting/playlistScreens/PlaylistGrid/PlaylistGrid.tsx (75%) rename {src => web/src}/pages/ScreenRouting/playlistScreens/PlaylistLiveChannels/PlaylistLiveChannels.module.scss (86%) rename {src => web/src}/pages/ScreenRouting/playlistScreens/PlaylistLiveChannels/PlaylistLiveChannels.tsx (87%) rename {src => web/src}/pages/Search/Search.module.scss (90%) rename {src => web/src}/pages/Search/Search.tsx (79%) rename {src => web/src}/pages/User/User.module.scss (95%) rename {src => web/src}/pages/User/User.test.tsx (79%) rename {src => web/src}/pages/User/User.tsx (78%) rename {src => web/src}/pages/User/__snapshots__/User.test.tsx.snap (100%) rename {src => web/src}/screenMapping.ts (86%) rename {src => web/src}/styles/_theme.scss (100%) rename {src => web/src}/styles/_variables.scss (100%) rename {src => web/src}/styles/main.scss (100%) rename {src => web/src}/styles/mixins/_responsive.scss (97%) rename {src => web/src}/styles/mixins/_typography.scss (90%) rename {src => web/src}/styles/mixins/_utils.scss (92%) rename {test-cases => web/test-cases}/analytics/adv.feature (100%) rename {test-cases => web/test-cases}/analytics/init.feature (100%) rename {test-cases => web/test-cases}/analytics/params.feature (100%) rename {test-cases => web/test-cases}/analytics/quantile.feature (100%) rename {test-e2e => web/test-e2e}/.eslintrc.js (100%) rename {test-e2e => web/test-e2e}/codecept.desktop.js (100%) rename {test-e2e => web/test-e2e}/codecept.mobile.js (100%) rename {test-e2e => web/test-e2e}/tests/account_test.ts (100%) rename {test-e2e => web/test-e2e}/tests/favorites_test.ts (100%) rename {test-e2e => web/test-e2e}/tests/home_test.ts (100%) rename {test-e2e => web/test-e2e}/tests/inline_layout_test.ts (100%) rename {test-e2e => web/test-e2e}/tests/language_test.ts (100%) rename {test-e2e => web/test-e2e}/tests/live_channel_test.ts (100%) rename {test-e2e => web/test-e2e}/tests/login/account_test.ts (100%) rename {test-e2e => web/test-e2e}/tests/login/home_test.ts (100%) rename {test-e2e => web/test-e2e}/tests/payments/coupons_test.ts (100%) rename {test-e2e => web/test-e2e}/tests/payments/subscription_test.ts (100%) rename {test-e2e => web/test-e2e}/tests/playlist_test.ts (100%) rename {test-e2e => web/test-e2e}/tests/register_test.ts (100%) rename {test-e2e => web/test-e2e}/tests/search_test.ts (100%) rename {test-e2e => web/test-e2e}/tests/seo_test.ts (100%) rename {test-e2e => web/test-e2e}/tests/series_test.ts (100%) rename {test-e2e => web/test-e2e}/tests/video_detail_test.ts (100%) rename {test-e2e => web/test-e2e}/tests/watch_history/local_test.ts (100%) rename {test-e2e => web/test-e2e}/tests/watch_history/logged_in_test.ts (100%) rename {test-e2e => web/test-e2e}/tsconfig.json (83%) rename {test-e2e => web/test-e2e}/utils/constants.ts (100%) rename {test-e2e => web/test-e2e}/utils/login.ts (100%) rename {test-e2e => web/test-e2e}/utils/password_utils.ts (100%) rename {test-e2e => web/test-e2e}/utils/payments.ts (98%) rename {test-e2e => web/test-e2e}/utils/randomizers.ts (100%) rename {test-e2e => web/test-e2e}/utils/steps.d.ts (100%) rename {test-e2e => web/test-e2e}/utils/steps_file.ts (100%) rename {test-e2e => web/test-e2e}/utils/watch_history.ts (100%) rename {test => web/test}/constants.ts (94%) rename {test => web/test}/epg/channel1.json (100%) rename {test => web/test}/epg/channel2.json (100%) rename {test => web/test}/epg/channel4.json (100%) rename {test => web/test}/fixtures/config.json (100%) rename {test => web/test}/fixtures/customer.json (100%) rename {test => web/test}/fixtures/epgChannels.json (100%) rename {test => web/test}/fixtures/epgChannelsUpdate.json (100%) rename {test => web/test}/fixtures/livePlaylist.json (100%) rename {test => web/test}/fixtures/monthlyOffer.json (100%) rename {test => web/test}/fixtures/order.json (100%) rename {test => web/test}/fixtures/paymentDetail.json (100%) rename {test => web/test}/fixtures/playlist.json (100%) rename {test => web/test}/fixtures/schedule.json (100%) rename {test => web/test}/fixtures/subscription.json (100%) rename {test => web/test}/fixtures/transactions.json (100%) rename {test => web/test}/fixtures/tvodOffer.json (100%) rename {test => web/test}/fixtures/yearlyOffer.json (100%) rename {test => web/test}/testUtils.tsx (95%) rename {test => web/test}/types.ts (100%) rename {test => web/test}/vitest.setup.ts (100%) create mode 100644 web/tsconfig.json create mode 100644 web/types/env.d.ts create mode 100644 web/types/global.d.ts create mode 100644 web/types/i18next.d.ts create mode 100644 web/types/jwpltx.d.ts create mode 100644 web/types/static.d.ts rename vite.config.ts => web/vite.config.ts (96%) diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index a2188c410..70c365580 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -8,6 +8,10 @@ on: - cron: '30 3 * * 1-5' workflow_dispatch: +defaults: + run: + working-directory: ./web + jobs: test-e2e: runs-on: ubuntu-latest diff --git a/.github/workflows/test-preview-and-lighthouse.yml b/.github/workflows/test-preview-and-lighthouse.yml index f6e304754..9fb9afd6c 100644 --- a/.github/workflows/test-preview-and-lighthouse.yml +++ b/.github/workflows/test-preview-and-lighthouse.yml @@ -3,6 +3,10 @@ name: Test - Deploy Preview and Lighthouse Test on: pull_request: +defaults: + run: + working-directory: ./web + jobs: build_and_preview: name: Build and preview diff --git a/.github/workflows/test-unit-snapshot.yml b/.github/workflows/test-unit-snapshot.yml index 9983e7620..f926188f6 100644 --- a/.github/workflows/test-unit-snapshot.yml +++ b/.github/workflows/test-unit-snapshot.yml @@ -5,6 +5,11 @@ on: branches: [ 'develop', 'release' ] pull_request: +# TODO: this needs to run for all packages +defaults: + run: + working-directory: ./web + jobs: test: runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index 54b1538c5..89b43d1f4 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ build .snowpack coverage output -public/locales/**/*_old.json +web/public/locales/**/*_old.json yarn-error.log .firebase firebase-debug.log diff --git a/docs/features/video-analytics.md b/docs/features/video-analytics.md index 1546e6d1b..c51b6fac4 100644 --- a/docs/features/video-analytics.md +++ b/docs/features/video-analytics.md @@ -41,7 +41,7 @@ The app sends the following events (param `e`) to JW platform: ## Event JS Script -The event trigger implementation for the ott web app can be found at [jwpltx.js](/public/jwpltx.js) +The event trigger implementation for the ott web app can be found at [jwpltx.js](/web/public/jwpltx.js) Note that `navigator.sendBeacon()` is used to call the endpoints. The browser will not do CORS checks on this operation. It furthermore minimizes performance impact as the browser doesn't wait for the response of the server. @@ -51,7 +51,7 @@ It also lets us to use `beforeunload` event in order to send remaining data to a A special data parameter is the Analytics ID (`aid`). It determines to which JW Player account & property the events belong. Each property has its unique analytics ID and is provided by a JW PLayer Solution Engineer or Account manager. -For the OTT Web App the Analytics ID is stored in [`config.json`](/public/config.json) as `analyticsToken` +For the OTT Web App the Analytics ID is stored in [`config.json`](/web/public/config.json) as `analyticsToken` ## Metrics diff --git a/docs/initialization-file.md b/docs/initialization-file.md index e9cdc850d..73bfd302d 100644 --- a/docs/initialization-file.md +++ b/docs/initialization-file.md @@ -1,11 +1,11 @@ # Initialization (ini) File The JW OTT Web App loads a small initialization (.ini) file at startup. This file provides a mechanism to set key startup parameters without modifying the source code. -Template ini files are included in the repo and with the pre-compiled production release builds ([.webapp.prod.ini](/ini/templates/.webapp.prod.ini)). +Template ini files are included in the repo and with the pre-compiled production release builds ([.webapp.prod.ini](/web/ini/templates/.webapp.prod.ini)). Make sure you include a copy of the ini file edited to include your account data at `/public/.webapp.ini` for the application to load correctly. For all manual builds (`yarn start` or `yarn build`), the ini file is copied from `/ini/.webapp..ini` to `build/public/.webapp.ini`, which the application fetches and parses at startup. For production builds, the ini file is stripped of comments and extra whitespace. -If a file doesn't exist in /ini/.webapp..ini, then the template file will first be copied from [`/ini/templates`](/ini/templates). +If a file doesn't exist in /ini/.webapp..ini, then the template file will first be copied from [`/ini/templates`](/web/ini/templates). All of the .ini files directly inside of `/ini` are ignored in git, so you can create your own files locally to run the application with your account parameters without creating conflicts with committed code or leaking your details into source control. ## Ini Parameters @@ -47,7 +47,7 @@ Keep in mind, if the playerLicenseKey ini setting is provided, it will be used e An array of 8-character IDs (entered 1 per line) for app configs in your JWP account (or url paths) that can be used with the [`app-config=` query param](configuration.md#switching-between-app-configs). This may be useful for example if you have a staging or experimental config that you want to be able to test on your site using the [`app-config` query parameter](configuration.md#switching-between-app-configs) without changing the default config that the application loads with for all of your users. -See [.webapp.test.ini](/ini/templates/.webapp.test.ini) for an example. +See [.webapp.test.ini](/web/ini/templates/.webapp.test.ini) for an example. ### UNSAFE_allowAnyConfigSource diff --git a/firebase.json b/firebase.json index f5b1779d3..b24b2cf26 100644 --- a/firebase.json +++ b/firebase.json @@ -1,6 +1,6 @@ { "hosting": { - "public": "build/public", + "public": "web/build/public", "ignore": [ "firebase.json", "**/node_modules/**" diff --git a/lint-staged.config.js b/lint-staged.config.js index 0a1a86b72..ae9c893fe 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -1,5 +1,5 @@ module.exports = { '{**/*,*}.{js,ts,jsx,tsx}': ['eslint --fix', 'prettier --write'], - 'src/**/*.scss': ['stylelint --fix'], + '{web,packages/ui-react}/src/**/*.scss': ['stylelint --fix'], '{**/*,*}.{ts,tsx}': [() => 'tsc --pretty --noEmit'], }; diff --git a/package.json b/package.json index 5cdec55e9..6a357cf7d 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "jw-ott-webapp", + "name": "@jwplayer/ott", "version": "4.31.1", "main": "index.js", "repository": "https://github.com/jwplayer/ott-web-app.git", @@ -8,148 +8,66 @@ "engines": { "node": ">=18.13.0" }, + "workspaces": [ + "packages/*", + "web" + ], "scripts": { - "prepare": "husky install", - "start": "vite", - "start:test": "vite build --mode test && vite preview --port 8080", - "build": "vite build --mode ${MODE:=prod} && sh scripts/compressIni.sh build/public/.webapp.ini", - "test": "TZ=UTC LC_ALL=en_US.UTF-8 vitest run", - "test-watch": "TZ=UTC LC_ALL=en_US.UTF-8 vitest", - "test-coverage": "TZ=UTC LC_ALL=en_US.UTF-8 vitest run --coverage", - "test-commit": "TZ=UTC LC_ALL=en_US.UTF-8 vitest run --changed HEAD~1 --coverage", - "test-update": "TZ=UTC LC_ALL=en_US.UTF-8 vitest run --update", - "i18next": "i18next src/{components,containers,pages,services,stores,hooks}/**/{**/,/}*.{ts,tsx} && node ./scripts/i18next/generate.js", - "i18next-diff": "npx ts-node ./scripts/i18next/diff-translations", - "i18next-update": "npx ts-node ./scripts/i18next/update-translations && yarn i18next", + "commit-msg": "commitlint --edit $1", "format": "run-s -c format:*", "format:eslint": "eslint \"{**/*,*}.{js,ts,jsx,tsx}\" --fix", "format:prettier": "prettier --write \"{**/*,*}.{js,ts,jsx,tsx}\"", "format:stylelint": "stylelint --fix '**/*.{css,scss}'", + "pre-commit": "depcheck && lint-staged && TZ=UTC yarn test-commit", + "prepare": "husky install", "lint": "run-s -c lint:*", "lint:eslint": "eslint \"{**/*,*}.{js,ts,jsx,tsx}\"", "lint:prettier": "prettier --check \"{**/*,*}.{js,ts,jsx,tsx}\"", - "lint:ts": "tsc --pretty --noEmit -p .", + "lint:ts": "tsc --pretty --noEmit -p ./web", "lint:stylelint": "stylelint '**/*.{css,scss}'", - "commit-msg": "commitlint --edit $1", - "codecept:mobile": "cd test-e2e && rm -rf \"./output/mobile\" && codeceptjs run-workers --suites ${WORKER_COUNT:=8} --config ./codecept.mobile.js", - "codecept:desktop": "cd test-e2e && rm -rf \"./output/desktop\" && codeceptjs run-workers --suites ${WORKER_COUNT:=8} --config ./codecept.desktop.js", - "serve-report:mobile": "cd test-e2e && allure serve \"./output/mobile\"", - "serve-report:desktop": "cd test-e2e && allure serve \"./output/desktop\"", - "codecept-serve:mobile": "yarn codecept:mobile ; yarn serve-report:mobile", - "codecept-serve:desktop": "yarn codecept:desktop ; yarn serve-report:desktop", - "pre-commit": "depcheck && lint-staged && TZ=UTC yarn test-commit", - "load-content-types": "npx ts-node ./scripts/content-types/load-content-types" - }, - "dependencies": { - "@adyen/adyen-web": "^5.42.1", - "@codeceptjs/allure-legacy": "^1.0.2", - "@inplayer-org/inplayer.js": "^3.13.24", - "classnames": "^2.3.1", - "date-fns": "^2.28.0", - "dompurify": "^2.3.8", - "i18next": "^22.4.15", - "i18next-browser-languagedetector": "^6.1.1", - "i18next-http-backend": "^2.2.0", - "ini": "^3.0.1", - "inversify": "^6.0.1", - "jwt-decode": "^3.1.2", - "lodash.merge": "^4.6.2", - "marked": "^4.1.1", - "payment": "^2.4.6", - "planby": "^0.3.0", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "react-helmet": "^6.1.0", - "react-i18next": "^12.2.2", - "react-infinite-scroller": "^1.2.6", - "react-query": "^3.39.0", - "react-router-dom": "^6.4.0", - "reflect-metadata": "^0.1.13", - "wicg-inert": "^3.1.1", - "yup": "^0.32.9", - "zustand": "^3.6.9" + "i18next": "i18next src/{components,containers,pages,services,stores,hooks}/**/{**/,/}*.{ts,tsx} && node ./scripts/i18next/generate.js", + "i18next-diff": "npx ts-node ./scripts/i18next/diff-translations", + "i18next-update": "npx ts-node ./scripts/i18next/update-translations && yarn i18next" }, "devDependencies": { - "@babel/core": "^7.22.11", - "@babel/plugin-proposal-decorators": "^7.22.10", - "@codeceptjs/configure": "^0.8.0", "@commitlint/cli": "^12.1.1", "@commitlint/config-conventional": "^12.1.1", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^14.0.0", - "@types/dompurify": "^2.3.4", - "@types/ini": "^1.3.31", - "@types/jwplayer": "^8.2.13", - "@types/lodash.merge": "^4.6.6", - "@types/luxon": "^3.0.2", - "@types/marked": "^4.0.7", "@types/node": "^17.0.23", - "@types/payment": "^2.1.4", - "@types/react": "^18.2.15", - "@types/react-dom": "18.2.7", - "@types/react-helmet": "^6.1.2", - "@types/react-infinite-scroller": "^1.2.3", - "@typescript-eslint/eslint-plugin": "^5.17.0", - "@typescript-eslint/parser": "^5.17.0", - "@vitejs/plugin-react": "^4.0.4", - "@vitest/coverage-v8": "^0.33.0", - "allure-commandline": "^2.17.2", - "babel-plugin-transform-typescript-metadata": "^0.3.2", - "codeceptjs": "3.5.5", - "confusing-browser-globals": "^1.0.10", "csv-parse": "^5.4.0", + "confusing-browser-globals": "^1.0.10", "depcheck": "^1.4.3", "eslint": "^7.31.0", "eslint-plugin-codeceptjs": "^1.3.0", "eslint-plugin-import": "^2.23.4", "eslint-plugin-react": "^7.24.0", "eslint-plugin-react-hooks": "^4.2.0", + "lint-staged": "^10.5.4", "husky": "^6.0.0", "i18next-parser": "^8.0.0", - "jsdom": "^22.1.0", - "lint-staged": "^10.5.4", - "luxon": "^3.2.1", "npm-run-all": "^4.1.5", - "playwright": "^1.38.1", "postcss": "^8.3.5", "postcss-import": "^14.0.2", + "postcss-load-config": "^4.0.1", "postcss-scss": "^4.0.4", "prettier": "^2.8.8", - "react-app-polyfill": "^3.0.0", - "read": "^2.1.0", "sass": "^1.49.10", "stylelint": "^13.13.1", "stylelint-config-recommended-scss": "^4.3.0", "stylelint-declaration-strict-value": "^1.7.12", "stylelint-order": "^4.1.0", "stylelint-scss": "^3.20.0", - "timezone-mock": "^1.3.4", "ts-node": "^10.9.1", "tsconfig-paths": "^4.1.0", - "typescript": "^4.3.4", - "vi-fetch": "^0.8.0", - "vite": "^4.4.8", - "vite-plugin-eslint": "^1.8.1", - "vite-plugin-html": "^3.2.0", - "vite-plugin-pwa": "^0.14.0", - "vite-plugin-static-copy": "^0.17.0", - "vite-plugin-stylelint": "^4.3.0", - "vitest": "^0.34.1", - "workbox-build": "^6.5.4", - "workbox-window": "^6.5.4" - }, - "peerDependencies": { - "react-router": "^6.4.0" - }, - "optionalDependencies": { - "gh-pages": "^3.2.3", - "lighthouse": "^9.6.7" + "typescript": "^4.3.4" }, "resolutions": { "glob-parent": "^5.1.2", "codeceptjs/**/ansi-regex": "^4.1.1", "codeceptjs/**/minimatch": "^3.0.5", "flat": "^5.0.1", - "json5": "^2.2.2" + "json5": "^2.2.2", + "vite": "^4.4.8" } } diff --git a/packages/common/package.json b/packages/common/package.json new file mode 100644 index 000000000..36a1e5ce1 --- /dev/null +++ b/packages/common/package.json @@ -0,0 +1,21 @@ +{ + "name": "@jwplayer/ott-common", + "version": "4.30.0", + "main": "./src", + "dependencies": { + "inversify": "^6.0.1", + "lodash.merge": "^4.6.2", + "jwt-decode": "^3.1.2", + "reflect-metadata": "^0.1.13", + "zustand": "^3.6.9" + }, + "devDependencies": { + "@types/lodash.merge": "^4.6.6" + }, + "peerDependencies": { + "@inplayer-org/inplayer.js": "^3.13.24", + "date-fns": "^2.28.0", + "i18next": "^22.4.15", + "react-query": "^3.39.0" + } +} diff --git a/src/config.ts b/packages/common/src/constants.ts similarity index 97% rename from src/config.ts rename to packages/common/src/constants.ts index 0259d9a98..e474f386c 100644 --- a/src/config.ts +++ b/packages/common/src/constants.ts @@ -73,3 +73,4 @@ export const DEFAULT_FEATURES = { hasProfiles: false, hasNotifications: false, }; +export const overrideIPCookieKey = 'overrideIP'; diff --git a/src/modules/container.ts b/packages/common/src/modules/container.ts similarity index 97% rename from src/modules/container.ts rename to packages/common/src/modules/container.ts index 1513fef69..ab2f6dc63 100644 --- a/src/modules/container.ts +++ b/packages/common/src/modules/container.ts @@ -1,6 +1,6 @@ import { Container, interfaces } from 'inversify'; -import type { IntegrationType } from '#types/Config'; +import type { IntegrationType } from '../../types/config'; export const container = new Container({ defaultScope: 'Singleton', skipBaseClassChecks: true }); diff --git a/src/modules/register.ts b/packages/common/src/modules/register.ts similarity index 50% rename from src/modules/register.ts rename to packages/common/src/modules/register.ts index 53dafcbbf..bca2db574 100644 --- a/src/modules/register.ts +++ b/packages/common/src/modules/register.ts @@ -1,42 +1,42 @@ // To organize imports in a better way /* eslint-disable import/order */ import 'reflect-metadata'; // include once in the app for inversify (see: https://github.com/inversify/InversifyJS/blob/master/README.md#-installation) -import { INTEGRATION } from '#src/config'; -import { container } from '#src/modules/container'; +import { INTEGRATION } from '../constants'; +import { container } from './container'; -import ApiService from '#src/services/api.service'; -import WatchHistoryService from '#src/services/watchhistory.service'; -import EpgService from '#src/services/epg.service'; -import GenericEntitlementService from '#src/services/genericEntitlement.service'; -import JWPEntitlementService from '#src/services/jwpEntitlement.service'; -import FavoritesService from '#src/services/favorites.service'; -import ConfigService from '#src/services/config.service'; -import SettingsService from '#src/services/settings.service'; +import ApiService from '../services/api.service'; +import WatchHistoryService from '../services/watchhistory.service'; +import EpgService from '../services/epg.service'; +import GenericEntitlementService from '../services/genericEntitlement.service'; +import JWPEntitlementService from '../services/jwpEntitlement.service'; +import FavoritesService from '../services/favorites.service'; +import ConfigService from '../services/config.service'; +import SettingsService from '../services/settings.service'; -import WatchHistoryController from '#src/stores/WatchHistoryController'; -import CheckoutController from '#src/stores/CheckoutController'; -import AccountController from '#src/stores/AccountController'; -import ProfileController from '#src/stores/ProfileController'; -import FavoritesController from '#src/stores/FavoritesController'; -import AppController from '#src/stores/AppController'; +import WatchHistoryController from '../stores/WatchHistoryController'; +import CheckoutController from '../stores/CheckoutController'; +import AccountController from '../stores/AccountController'; +import ProfileController from '../stores/ProfileController'; +import FavoritesController from '../stores/FavoritesController'; +import AppController from '../stores/AppController'; // Integration interfaces -import AccountService from '#src/services/account.service'; -import CheckoutService from '#src/services/checkout.service'; -import SubscriptionService from '#src/services/subscription.service'; -import ProfileService from '#src/services/profile.service'; +import AccountService from '../services/account.service'; +import CheckoutService from '../services/checkout.service'; +import SubscriptionService from '../services/subscription.service'; +import ProfileService from '../services/profile.service'; // Cleeng integration -import CleengService from '#src/services/cleeng.service'; -import CleengAccountService from '#src/services/cleeng.account.service'; -import CleengCheckoutService from '#src/services/cleeng.checkout.service'; -import CleengSubscriptionService from '#src/services/cleeng.subscription.service'; +import CleengService from '../services/cleeng.service'; +import CleengAccountService from '../services/cleeng.account.service'; +import CleengCheckoutService from '../services/cleeng.checkout.service'; +import CleengSubscriptionService from '../services/cleeng.subscription.service'; // InPlayer integration -import InplayerAccountService from '#src/services/inplayer.account.service'; -import InplayerCheckoutService from '#src/services/inplayer.checkout.service'; -import InplayerSubscriptionService from '#src/services/inplayer.subscription.service'; -import InplayerProfileService from '#src/services/inplayer.profile.service'; +import InplayerAccountService from '../services/inplayer.account.service'; +import InplayerCheckoutService from '../services/inplayer.checkout.service'; +import InplayerSubscriptionService from '../services/inplayer.subscription.service'; +import InplayerProfileService from '../services/inplayer.profile.service'; // Common services container.bind(ConfigService).toSelf(); diff --git a/packages/common/src/queryClient.ts b/packages/common/src/queryClient.ts new file mode 100644 index 000000000..edb940a7f --- /dev/null +++ b/packages/common/src/queryClient.ts @@ -0,0 +1,12 @@ +import { QueryClient } from 'react-query'; + +// @TODO: replace with `@tanstack/query-core` to remove React dependency +export const queryClient = new QueryClient({ + defaultOptions: { + queries: { + staleTime: 60 * 60 * 1000, + refetchOnWindowFocus: false, + retryOnMount: false, + }, + }, +}); diff --git a/src/services/account.service.ts b/packages/common/src/services/account.service.ts similarity index 96% rename from src/services/account.service.ts rename to packages/common/src/services/account.service.ts index 52649ad99..faeafd087 100644 --- a/src/services/account.service.ts +++ b/packages/common/src/services/account.service.ts @@ -1,25 +1,25 @@ -import type { Config } from '#types/Config'; +import type { Config } from '../../types/config'; import type { + AuthData, ChangePassword, + ChangePasswordWithOldPassword, + Customer, + CustomerConsent, + DeleteAccount, + ExportAccountData, + GetCaptureStatus, GetCustomerConsents, GetPublisherConsents, Login, + NotificationsData, Register, ResetPassword, + SocialURLSData, + UpdateCaptureAnswers, UpdateCustomer, UpdateCustomerConsents, - GetCaptureStatus, - UpdateCaptureAnswers, - AuthData, - SocialURLSData, - ChangePasswordWithOldPassword, UpdatePersonalShelves, - ExportAccountData, - NotificationsData, - DeleteAccount, - Customer, - CustomerConsent, -} from '#types/account'; +} from '../../types/account'; export type AccountServiceFeatures = { readonly canUpdateEmail: boolean; diff --git a/src/services/api.service.ts b/packages/common/src/services/api.service.ts similarity index 95% rename from src/services/api.service.ts rename to packages/common/src/services/api.service.ts index f804bba66..fe7661d0e 100644 --- a/src/services/api.service.ts +++ b/packages/common/src/services/api.service.ts @@ -2,14 +2,13 @@ import { parseISO, isValid } from 'date-fns'; import { injectable } from 'inversify'; import { getMediaStatusFromEventState } from '../utils/liveEvent'; - -import { addQueryParams } from '#src/utils/formatting'; -import { getDataOrThrow } from '#src/utils/api'; -import { filterMediaOffers } from '#src/utils/entitlements'; -import type { GetPlaylistParams, Playlist, PlaylistItem } from '#types/playlist'; -import type { AdSchedule } from '#types/ad-schedule'; -import type { EpisodesRes, EpisodesWithPagination, GetSeriesParams, Series, EpisodeInSeries } from '#types/series'; -import { useConfigStore as ConfigStore } from '#src/stores/ConfigStore'; +import { addQueryParams } from '../utils/formatting'; +import { getDataOrThrow } from '../utils/api'; +import { filterMediaOffers } from '../utils/entitlements'; +import { useConfigStore as ConfigStore } from '../stores/ConfigStore'; +import type { GetPlaylistParams, Playlist, PlaylistItem } from '../../types/playlist'; +import type { AdSchedule } from '../../types/ad-schedule'; +import type { EpisodeInSeries, EpisodesRes, EpisodesWithPagination, GetSeriesParams, Series } from '../../types/series'; // change the values below to change the property used to look up the alternate image enum ImageProperty { diff --git a/src/services/checkout.service.ts b/packages/common/src/services/checkout.service.ts similarity index 98% rename from src/services/checkout.service.ts rename to packages/common/src/services/checkout.service.ts index 2bbceab13..a5e83ef47 100644 --- a/src/services/checkout.service.ts +++ b/packages/common/src/services/checkout.service.ts @@ -4,9 +4,11 @@ import type { DeletePaymentMethod, FinalizeAdyenPaymentDetails, GetAdyenPaymentSession, + GetDirectPostCardPayment, GetEntitlements, GetFinalizeAdyenPayment, GetInitialAdyenPayment, + GetOffer, GetOffers, GetOrder, GetPaymentMethods, @@ -15,11 +17,9 @@ import type { PaymentWithoutDetails, PaymentWithPayPal, SwitchSubscription, - GetDirectPostCardPayment, UpdateOrder, UpdatePaymentWithPayPal, - GetOffer, -} from '#types/checkout'; +} from '../../types/checkout'; export default abstract class CheckoutService { abstract getOffers: GetOffers; diff --git a/src/services/cleeng.account.service.ts b/packages/common/src/services/cleeng.account.service.ts similarity index 98% rename from src/services/cleeng.account.service.ts rename to packages/common/src/services/cleeng.account.service.ts index 7d7e57eb0..fe88600c6 100644 --- a/src/services/cleeng.account.service.ts +++ b/packages/common/src/services/cleeng.account.service.ts @@ -1,38 +1,38 @@ import jwtDecode from 'jwt-decode'; import { injectable } from 'inversify'; -import AccountService from './account.service'; -import CleengService from './cleeng.service'; - -import type { Config } from '#types/Config'; -import { getOverrideIP } from '#src/utils/common'; +import { getOverrideIP } from '../utils/common'; +import type { Config } from '../../types/config'; import type { + AuthData, + Capture, ChangePassword, + ChangePasswordWithOldPassword, + GetCaptureStatus, + GetCaptureStatusResponse, GetCustomer, GetCustomerConsents, + GetCustomerConsentsResponse, + GetLocales, GetPublisherConsents, + JwtDetails, Login, + LoginPayload, + NotificationsData, Register, + RegisterPayload, ResetPassword, - UpdateCustomer, - UpdateCustomerConsents, - GetCaptureStatus, UpdateCaptureAnswers, - AuthData, - JwtDetails, - GetCustomerConsentsResponse, - GetCaptureStatusResponse, - Capture, - GetLocales, - LoginPayload, - RegisterPayload, UpdateCaptureAnswersPayload, + UpdateCustomer, + UpdateCustomerConsents, UpdateCustomerConsentsPayload, UpdateCustomerPayload, - ChangePasswordWithOldPassword, UpdatePersonalShelves, - NotificationsData, -} from '#types/account'; +} from '../../types/account'; + +import AccountService from './account.service'; +import CleengService from './cleeng.service'; @injectable() export default class CleengAccountService extends AccountService { diff --git a/src/services/cleeng.checkout.service.ts b/packages/common/src/services/cleeng.checkout.service.ts similarity index 98% rename from src/services/cleeng.checkout.service.ts rename to packages/common/src/services/cleeng.checkout.service.ts index 17d02478f..8f8e0a39a 100644 --- a/src/services/cleeng.checkout.service.ts +++ b/packages/common/src/services/cleeng.checkout.service.ts @@ -1,8 +1,6 @@ import { injectable } from 'inversify'; -import CheckoutService from './checkout.service'; -import CleengService from './cleeng.service'; - +import { getOverrideIP } from '../utils/common'; import type { AddAdyenPaymentDetails, CreateOrder, @@ -24,8 +22,10 @@ import type { SwitchSubscription, UpdateOrder, UpdatePaymentWithPayPal, -} from '#types/checkout'; -import { getOverrideIP } from '#src/utils/common'; +} from '../../types/checkout'; + +import CheckoutService from './checkout.service'; +import CleengService from './cleeng.service'; @injectable() export default class CleengCheckoutService extends CheckoutService { diff --git a/src/services/cleeng.service.ts b/packages/common/src/services/cleeng.service.ts similarity index 97% rename from src/services/cleeng.service.ts rename to packages/common/src/services/cleeng.service.ts index 67f857c49..3ec732c19 100644 --- a/src/services/cleeng.service.ts +++ b/packages/common/src/services/cleeng.service.ts @@ -2,11 +2,11 @@ import jwtDecode from 'jwt-decode'; import { object, string } from 'yup'; import { injectable } from 'inversify'; -import { removeItem, getItem, setItem } from '#src/utils/persist'; -import { Broadcaster } from '#src/utils/broadcaster'; -import { getOverrideIP, IS_DEVELOPMENT_BUILD, logDev } from '#src/utils/common'; -import { PromiseQueue } from '#src/utils/promiseQueue'; -import type { GetLocales } from '#types/account'; +import { getItem, removeItem, setItem } from '../utils/persist'; +import { Broadcaster } from '../utils/broadcaster'; +import { getOverrideIP, IS_DEVELOPMENT_BUILD, logDev } from '../utils/common'; +import { PromiseQueue } from '../utils/promiseQueue'; +import type { GetLocales } from '../../types/account'; const AUTH_PERSIST_KEY = 'auth'; diff --git a/src/services/cleeng.subscription.service.ts b/packages/common/src/services/cleeng.subscription.service.ts similarity index 96% rename from src/services/cleeng.subscription.service.ts rename to packages/common/src/services/cleeng.subscription.service.ts index dc5c81c0d..3efb88309 100644 --- a/src/services/cleeng.subscription.service.ts +++ b/packages/common/src/services/cleeng.subscription.service.ts @@ -1,9 +1,6 @@ import { injectable } from 'inversify'; -import SubscriptionService from './subscription.service'; -import CleengService from './cleeng.service'; - -import { addQueryParams } from '#src/utils/formatting'; +import { addQueryParams } from '../utils/formatting'; import type { FetchReceipt, GetActivePayment, @@ -13,7 +10,10 @@ import type { GetSubscriptions, GetTransactions, UpdateSubscription, -} from '#types/subscription'; +} from '../../types/subscription'; + +import SubscriptionService from './subscription.service'; +import CleengService from './cleeng.service'; @injectable() export default class CleengSubscriptionService extends SubscriptionService { diff --git a/src/services/config.service.ts b/packages/common/src/services/config.service.ts similarity index 93% rename from src/services/config.service.ts rename to packages/common/src/services/config.service.ts index 6d873c06e..f5f810231 100644 --- a/src/services/config.service.ts +++ b/packages/common/src/services/config.service.ts @@ -2,14 +2,14 @@ import i18next from 'i18next'; import { injectable } from 'inversify'; import { getI18n } from 'react-i18next'; -import ApiService from './api.service'; +import { ACCESS_MODEL, INTEGRATION } from '../constants'; +import { configSchema } from '../utils/configSchema'; +import { calculateContrastColor } from '../utils/common'; +import { addScript } from '../utils/dom'; +import { AppError } from '../utils/error'; +import type { AccessModel, Config, Styling } from '../../types/config'; -import { configSchema } from '#src/utils/configSchema'; -import { calculateContrastColor } from '#src/utils/common'; -import { addScript } from '#src/utils/dom'; -import type { AccessModel, Config, Styling } from '#types/Config'; -import { ACCESS_MODEL, INTEGRATION } from '#src/config'; -import { AppError } from '#src/utils/error'; +import ApiService from './api.service'; /** * Set config setup changes in both config.service.ts and config.d.ts diff --git a/src/services/epg.service.test.ts b/packages/common/src/services/epg.service.test.ts similarity index 97% rename from src/services/epg.service.test.ts rename to packages/common/src/services/epg.service.test.ts index 6599d9b02..7cb051599 100644 --- a/src/services/epg.service.test.ts +++ b/packages/common/src/services/epg.service.test.ts @@ -1,13 +1,13 @@ import { afterEach, beforeEach, describe, expect } from 'vitest'; import { mockFetch, mockGet } from 'vi-fetch'; import { register, unregister } from 'timezone-mock'; +import livePlaylistFixture from '@jwplayer/ott-web/test/fixtures/livePlaylist.json'; -import EpgService from './epg.service'; +import type { EpgProgram } from '../../types/epg'; +import scheduleFixture from '../../../../web/test/fixtures/schedule.json'; +import type { Playlist } from '../../types/playlist'; -import type { EpgProgram } from '#types/epg'; -import scheduleFixture from '#test/fixtures/schedule.json'; -import livePlaylistFixture from '#test/fixtures/livePlaylist.json'; -import type { Playlist } from '#types/playlist'; +import EpgService from './epg.service'; const livePlaylist = livePlaylistFixture as Playlist; const scheduleData = scheduleFixture as EpgProgram[]; diff --git a/src/services/epg.service.ts b/packages/common/src/services/epg.service.ts similarity index 96% rename from src/services/epg.service.ts rename to packages/common/src/services/epg.service.ts index d77426350..cd2a1501f 100644 --- a/src/services/epg.service.ts +++ b/packages/common/src/services/epg.service.ts @@ -2,10 +2,10 @@ import { array, object, string } from 'yup'; import { addDays, differenceInDays, isValid } from 'date-fns'; import { injectable } from 'inversify'; -import type { PlaylistItem } from '#types/playlist'; -import { getDataOrThrow } from '#src/utils/api'; -import { logDev } from '#src/utils/common'; -import type { EpgProgram, EpgChannel } from '#types/epg'; +import { getDataOrThrow } from '../utils/api'; +import { logDev } from '../utils/common'; +import type { PlaylistItem } from '../../types/playlist'; +import type { EpgChannel, EpgProgram } from '../../types/epg'; const AUTHENTICATION_HEADER = 'API-KEY'; diff --git a/src/services/favorites.service.ts b/packages/common/src/services/favorites.service.ts similarity index 84% rename from src/services/favorites.service.ts rename to packages/common/src/services/favorites.service.ts index ba9babff1..6c1e7fd7d 100644 --- a/src/services/favorites.service.ts +++ b/packages/common/src/services/favorites.service.ts @@ -1,12 +1,12 @@ import { injectable } from 'inversify'; -import ApiService from './api.service'; +import { MAX_WATCHLIST_ITEMS_COUNT } from '../constants'; +import * as persist from '../utils/persist'; +import type { Favorite, SerializedFavorite } from '../../types/favorite'; +import type { PlaylistItem } from '../../types/playlist'; +import type { Customer } from '../../types/account'; -import * as persist from '#src/utils/persist'; -import type { Favorite, SerializedFavorite } from '#types/favorite'; -import type { PlaylistItem } from '#types/playlist'; -import { MAX_WATCHLIST_ITEMS_COUNT } from '#src/config'; -import type { Customer } from '#types/account'; +import ApiService from './api.service'; @injectable() export default class FavoritesService { diff --git a/src/services/genericEntitlement.service.ts b/packages/common/src/services/genericEntitlement.service.ts similarity index 86% rename from src/services/genericEntitlement.service.ts rename to packages/common/src/services/genericEntitlement.service.ts index d7e7ce495..6463b4397 100644 --- a/src/services/genericEntitlement.service.ts +++ b/packages/common/src/services/genericEntitlement.service.ts @@ -1,6 +1,7 @@ import { injectable } from 'inversify'; -import type { GetMediaParams } from '#types/media'; +import type { GetMediaParams } from '../../types/media'; +import type { GetTokenResponse } from '../../types/entitlement'; @injectable() export default class GenericEntitlementService { diff --git a/src/services/inplayer.account.service.ts b/packages/common/src/services/inplayer.account.service.ts similarity index 96% rename from src/services/inplayer.account.service.ts rename to packages/common/src/services/inplayer.account.service.ts index 7ffaeb7c1..b3238f75c 100644 --- a/src/services/inplayer.account.service.ts +++ b/packages/common/src/services/inplayer.account.service.ts @@ -1,11 +1,9 @@ -import InPlayer, { AccountData, Env, FavoritesData, UpdateAccountData, WatchHistory, type RegisterField } from '@inplayer-org/inplayer.js'; +import InPlayer, { AccountData, Env, FavoritesData, type RegisterField, UpdateAccountData, WatchHistory } from '@inplayer-org/inplayer.js'; import i18next from 'i18next'; import { injectable } from 'inversify'; -import AccountService from './account.service'; - -import { formatConsentsToRegisterFields } from '#src/utils/collection'; -import { getCommonResponseData, isCommonError } from '#src/utils/api'; +import { formatConsentsToRegisterFields } from '../utils/collection'; +import { getCommonResponseData, isCommonError } from '../utils/api'; import type { AuthData, Capture, @@ -14,6 +12,7 @@ import type { Consent, Customer, CustomerConsent, + CustomRegisterFieldVariant, DeleteAccount, ExportAccountData, ExternalData, @@ -22,6 +21,7 @@ import type { GetCustomerConsentsResponse, GetPublisherConsents, Login, + NotificationsData, Register, ResetPassword, SocialURLSData, @@ -30,13 +30,13 @@ import type { UpdateCustomerArgs, UpdateCustomerConsents, UpdatePersonalShelves, - CustomRegisterFieldVariant, - NotificationsData, -} from '#types/account'; -import type { Config } from '#types/Config'; -import type { InPlayerAuthData } from '#types/inplayer'; -import type { Favorite } from '#types/favorite'; -import type { WatchHistoryItem } from '#types/watchHistory'; +} from '../../types/account'; +import type { Config } from '../../types/config'; +import type { InPlayerAuthData } from '../../types/inplayer'; +import type { Favorite } from '../../types/favorite'; +import type { WatchHistoryItem } from '../../types/watchHistory'; + +import AccountService from './account.service'; enum InPlayerEnv { Development = 'development', diff --git a/src/services/inplayer.checkout.service.ts b/packages/common/src/services/inplayer.checkout.service.ts similarity index 98% rename from src/services/inplayer.checkout.service.ts rename to packages/common/src/services/inplayer.checkout.service.ts index d791f0dd7..6fa95edef 100644 --- a/src/services/inplayer.checkout.service.ts +++ b/packages/common/src/services/inplayer.checkout.service.ts @@ -1,8 +1,7 @@ import InPlayer, { AccessFee, MerchantPaymentMethod } from '@inplayer-org/inplayer.js'; import { injectable } from 'inversify'; -import CheckoutService from './checkout.service'; - +import { isSVODOffer } from '../utils/subscription'; import type { CardPaymentData, CreateOrder, @@ -19,8 +18,9 @@ import type { PaymentWithoutDetails, PaymentWithPayPal, UpdateOrder, -} from '#types/checkout'; -import { isSVODOffer } from '#src/utils/subscription'; +} from '../../types/checkout'; + +import CheckoutService from './checkout.service'; @injectable() export default class InplayerCheckoutService extends CheckoutService { diff --git a/src/services/inplayer.profile.service.ts b/packages/common/src/services/inplayer.profile.service.ts similarity index 91% rename from src/services/inplayer.profile.service.ts rename to packages/common/src/services/inplayer.profile.service.ts index 5aa5a06b7..d38e6feb1 100644 --- a/src/services/inplayer.profile.service.ts +++ b/packages/common/src/services/inplayer.profile.service.ts @@ -1,10 +1,10 @@ import InPlayer from '@inplayer-org/inplayer.js'; import { injectable } from 'inversify'; +import defaultAvatar from '@jwplayer/ott-web/src/assets/profiles/default_avatar.png'; -import ProfileService from './profile.service'; +import type { CreateProfile, DeleteProfile, EnterProfile, GetProfileDetails, ListProfiles, UpdateProfile } from '../../types/account'; -import type { ListProfiles, CreateProfile, UpdateProfile, EnterProfile, GetProfileDetails, DeleteProfile } from '#types/account'; -import defaultAvatar from '#src/assets/profiles/default_avatar.png'; +import ProfileService from './profile.service'; @injectable() export default class InplayerProfileService extends ProfileService { diff --git a/src/services/inplayer.subscription.service.ts b/packages/common/src/services/inplayer.subscription.service.ts similarity index 97% rename from src/services/inplayer.subscription.service.ts rename to packages/common/src/services/inplayer.subscription.service.ts index 15f97df8d..48d121bd0 100644 --- a/src/services/inplayer.subscription.service.ts +++ b/packages/common/src/services/inplayer.subscription.service.ts @@ -1,10 +1,10 @@ import i18next from 'i18next'; -import InPlayer, { PaymentHistory, Card, GetItemAccessV1, SubscriptionDetails as InplayerSubscription } from '@inplayer-org/inplayer.js'; +import InPlayer, { Card, GetItemAccessV1, PaymentHistory, SubscriptionDetails as InplayerSubscription } from '@inplayer-org/inplayer.js'; import { injectable } from 'inversify'; -import SubscriptionService from './subscription.service'; - +import { isCommonError } from '../utils/api'; import type { + ChangeSubscription, GetActivePayment, GetActiveSubscription, GetAllTransactions, @@ -13,10 +13,10 @@ import type { Transaction, UpdateCardDetails, UpdateSubscription, - ChangeSubscription, -} from '#types/subscription'; -import type { Config } from '#types/Config'; -import { isCommonError } from '#src/utils/api'; +} from '../../types/subscription'; +import type { Config } from '../../types/config'; + +import SubscriptionService from './subscription.service'; interface SubscriptionDetails extends InplayerSubscription { item_id?: number; diff --git a/src/services/jwpEntitlement.service.ts b/packages/common/src/services/jwpEntitlement.service.ts similarity index 100% rename from src/services/jwpEntitlement.service.ts rename to packages/common/src/services/jwpEntitlement.service.ts diff --git a/src/services/profile.service.ts b/packages/common/src/services/profile.service.ts similarity index 69% rename from src/services/profile.service.ts rename to packages/common/src/services/profile.service.ts index 609042bc6..e5fb23563 100644 --- a/src/services/profile.service.ts +++ b/packages/common/src/services/profile.service.ts @@ -1,4 +1,4 @@ -import type { ListProfiles, CreateProfile, UpdateProfile, EnterProfile, GetProfileDetails, DeleteProfile } from '#types/account'; +import type { CreateProfile, DeleteProfile, EnterProfile, GetProfileDetails, ListProfiles, UpdateProfile } from '../../types/account'; export default abstract class ProfileService { abstract listProfiles?: ListProfiles; diff --git a/src/services/settings.service.ts b/packages/common/src/services/settings.service.ts similarity index 95% rename from src/services/settings.service.ts rename to packages/common/src/services/settings.service.ts index 67a07738a..10d5beca4 100644 --- a/src/services/settings.service.ts +++ b/packages/common/src/services/settings.service.ts @@ -2,10 +2,10 @@ import { injectable } from 'inversify'; import ini from 'ini'; import { getI18n } from 'react-i18next'; -import type { Settings } from '#types/settings'; -import { CONFIG_FILE_STORAGE_KEY, CONFIG_QUERY_KEY, OTT_GLOBAL_PLAYER_ID } from '#src/config'; -import { logDev } from '#src/utils/common'; -import { AppError } from '#src/utils/error'; +import { CONFIG_FILE_STORAGE_KEY, CONFIG_QUERY_KEY, OTT_GLOBAL_PLAYER_ID } from '../constants'; +import { logDev } from '../utils/common'; +import { AppError } from '../utils/error'; +import type { Settings } from '../../types/settings'; // Use local storage so the override persists until cleared const storage = window.localStorage; diff --git a/src/services/subscription.service.ts b/packages/common/src/services/subscription.service.ts similarity index 95% rename from src/services/subscription.service.ts rename to packages/common/src/services/subscription.service.ts index 9f146e786..82d38a021 100644 --- a/src/services/subscription.service.ts +++ b/packages/common/src/services/subscription.service.ts @@ -1,15 +1,15 @@ import type { ChangeSubscription, FetchReceipt, - GetPaymentDetails, GetActivePayment, + GetActiveSubscription, + GetAllTransactions, + GetPaymentDetails, GetSubscriptions, GetTransactions, UpdateCardDetails, UpdateSubscription, - GetAllTransactions, - GetActiveSubscription, -} from '#types/subscription'; +} from '../../types/subscription'; export default abstract class SubscriptionService { abstract getActiveSubscription: GetActiveSubscription; diff --git a/src/services/watchhistory.service.ts b/packages/common/src/services/watchhistory.service.ts similarity index 96% rename from src/services/watchhistory.service.ts rename to packages/common/src/services/watchhistory.service.ts index ee34a21cd..be43a7596 100644 --- a/src/services/watchhistory.service.ts +++ b/packages/common/src/services/watchhistory.service.ts @@ -1,11 +1,11 @@ import { injectable } from 'inversify'; -import ApiService from './api.service'; +import * as persist from '../utils/persist'; +import type { PlaylistItem } from '../../types/playlist'; +import type { SerializedWatchHistoryItem, WatchHistoryItem } from '../../types/watchHistory'; +import type { Customer } from '../../types/account'; -import * as persist from '#src/utils/persist'; -import type { PlaylistItem } from '#types/playlist'; -import type { SerializedWatchHistoryItem, WatchHistoryItem } from '#types/watchHistory'; -import type { Customer } from '#types/account'; +import ApiService from './api.service'; @injectable() export default class WatchHistoryService { diff --git a/src/stores/AccountController.ts b/packages/common/src/stores/AccountController.ts similarity index 95% rename from src/stores/AccountController.ts rename to packages/common/src/stores/AccountController.ts index fdc503b89..c62596e1d 100644 --- a/src/stores/AccountController.ts +++ b/packages/common/src/stores/AccountController.ts @@ -1,12 +1,15 @@ import i18next from 'i18next'; -import { injectable, inject } from 'inversify'; - -import FavoritesController from './FavoritesController'; -import WatchHistoryController from './WatchHistoryController'; -import ProfileController from './ProfileController'; -import { useProfileStore } from './ProfileStore'; - -import { useConfigStore } from '#src/stores/ConfigStore'; +import { inject, injectable } from 'inversify'; + +import { queryClient } from '../queryClient'; +import { ACCESS_MODEL, DEFAULT_FEATURES } from '../constants'; +import { logDev } from '../utils/common'; +import * as persist from '../utils/persist'; +import type { IntegrationType } from '../../types/config'; +import CheckoutService from '../services/checkout.service'; +import AccountService, { type AccountServiceFeatures } from '../services/account.service'; +import SubscriptionService from '../services/subscription.service'; +import type { Offer } from '../../types/checkout'; import type { Capture, Customer, @@ -17,20 +20,17 @@ import type { GetCustomerConsentsResponse, GetPublisherConsentsResponse, SubscribeToNotificationsPayload, -} from '#types/account'; -import type { Offer } from '#types/checkout'; -import { useAccountStore } from '#src/stores/AccountStore'; -import { queryClient } from '#src/containers/QueryProvider/QueryProvider'; -import { logDev } from '#src/utils/common'; -import SubscriptionService from '#src/services/subscription.service'; -import AccountService, { type AccountServiceFeatures } from '#src/services/account.service'; -import CheckoutService from '#src/services/checkout.service'; -import { useFavoritesStore } from '#src/stores/FavoritesStore'; -import { useWatchHistoryStore } from '#src/stores/WatchHistoryStore'; -import * as persist from '#src/utils/persist'; -import { ACCESS_MODEL, DEFAULT_FEATURES } from '#src/config'; -import { assertFeature, assertModuleMethod, getNamedModule } from '#src/modules/container'; -import type { IntegrationType } from '#types/Config'; +} from '../../types/account'; +import { assertFeature, assertModuleMethod, getNamedModule } from '../modules/container'; + +import { useWatchHistoryStore } from './WatchHistoryStore'; +import { useFavoritesStore } from './FavoritesStore'; +import { useAccountStore } from './AccountStore'; +import { useConfigStore } from './ConfigStore'; +import { useProfileStore } from './ProfileStore'; +import ProfileController from './ProfileController'; +import WatchHistoryController from './WatchHistoryController'; +import FavoritesController from './FavoritesController'; const PERSIST_PROFILE = 'profile'; diff --git a/src/stores/AccountStore.ts b/packages/common/src/stores/AccountStore.ts similarity index 79% rename from src/stores/AccountStore.ts rename to packages/common/src/stores/AccountStore.ts index 91671afaa..f16a86513 100644 --- a/src/stores/AccountStore.ts +++ b/packages/common/src/stores/AccountStore.ts @@ -1,7 +1,8 @@ -import { createStore } from '#src/stores/utils'; -import type { Consent, Customer, CustomerConsent } from '#types/account'; -import type { Offer } from '#types/checkout'; -import type { PaymentDetail, Subscription, Transaction } from '#types/subscription'; +import type { Consent, Customer, CustomerConsent } from '../../types/account'; +import type { Offer } from '../../types/checkout'; +import type { PaymentDetail, Subscription, Transaction } from '../../types/subscription'; + +import { createStore } from './utils'; type AccountStore = { loading: boolean; diff --git a/src/stores/AppController.ts b/packages/common/src/stores/AppController.ts similarity index 90% rename from src/stores/AppController.ts rename to packages/common/src/stores/AppController.ts index 74cc8c15a..dc106dc45 100644 --- a/src/stores/AppController.ts +++ b/packages/common/src/stores/AppController.ts @@ -1,16 +1,16 @@ import merge from 'lodash.merge'; import { inject, injectable } from 'inversify'; +import { PersonalShelf } from '../constants'; +import SettingsService from '../services/settings.service'; +import ConfigService from '../services/config.service'; +import type { IntegrationType } from '../../types/config'; +import { getModule } from '../modules/container'; + import AccountController from './AccountController'; import WatchHistoryController from './WatchHistoryController'; import FavoritesController from './FavoritesController'; - -import type { IntegrationType } from '#types/Config'; -import { useConfigStore } from '#src/stores/ConfigStore'; -import ConfigService from '#src/services/config.service'; -import SettingsService from '#src/services/settings.service'; -import { PersonalShelf } from '#src/config'; -import { getModule } from '#src/modules/container'; +import { useConfigStore } from './ConfigStore'; @injectable() export default class AppController { diff --git a/src/stores/CheckoutController.ts b/packages/common/src/stores/CheckoutController.ts similarity index 94% rename from src/stores/CheckoutController.ts rename to packages/common/src/stores/CheckoutController.ts index 9dea09ea6..4d258efe6 100644 --- a/src/stores/CheckoutController.ts +++ b/packages/common/src/stores/CheckoutController.ts @@ -1,31 +1,31 @@ import { inject, injectable } from 'inversify'; import { getOverrideIP } from '../utils/common'; - -import { useAccountStore } from '#src/stores/AccountStore'; import type { AddAdyenPaymentDetailsResponse, AdyenPaymentSession, CardPaymentData, CreateOrderArgs, - FinalizeAdyenPaymentDetails, FinalizeAdyenPayment, + FinalizeAdyenPaymentDetailsResponse, + GetEntitlements, + GetOffers, InitialAdyenPayment, Offer, Order, PaymentMethod, PaymentWithPayPalResponse, - UpdateOrderPayload, SwitchOffer, - GetOffers, - GetEntitlements, -} from '#types/checkout'; -import { useCheckoutStore } from '#src/stores/CheckoutStore'; -import { useConfigStore } from '#src/stores/ConfigStore'; -import CheckoutService from '#src/services/checkout.service'; -import SubscriptionService from '#src/services/subscription.service'; -import { assertModuleMethod, getNamedModule } from '#src/modules/container'; -import type { IntegrationType } from '#types/Config'; + UpdateOrderPayload, +} from '../../types/checkout'; +import CheckoutService from '../services/checkout.service'; +import SubscriptionService from '../services/subscription.service'; +import type { IntegrationType } from '../../types/config'; +import { assertModuleMethod, getNamedModule } from '../modules/container'; + +import { useConfigStore } from './ConfigStore'; +import { useCheckoutStore } from './CheckoutStore'; +import { useAccountStore } from './AccountStore'; @injectable() export default class CheckoutController { @@ -250,8 +250,9 @@ export default class CheckoutController { if (!response.responseData.available.length) return; - // @ts-expect-error we have checked the presence of the method - const switchOffers = response.responseData.available.map((offer: SwitchOffer) => this.checkoutService.getOffer({ offerId: offer.toOfferId }, isSandbox)); + // create variable for `getOffer` to ensure it's typed in `Array#map` scope + const getOfferDelegate = this.checkoutService.getOffer; + const switchOffers = response.responseData.available.map((offer: SwitchOffer) => getOfferDelegate({ offerId: offer.toOfferId }, isSandbox)); const offers = await Promise.all(switchOffers); // Sort offers for proper ordering in "Choose Offer" modal when applicable @@ -351,7 +352,7 @@ export default class CheckoutController { return response.responseData; }; - finalizeAdyenPaymentDetails = async (details: unknown, paymentMethodId: number, paymentData?: string): Promise => { + finalizeAdyenPaymentDetails = async (details: unknown, paymentMethodId: number, paymentData?: string): Promise => { const { isSandbox, clientId: authProviderId } = useConfigStore.getState(); if (!authProviderId) throw new Error('auth provider is not configured'); diff --git a/src/stores/CheckoutStore.ts b/packages/common/src/stores/CheckoutStore.ts similarity index 85% rename from src/stores/CheckoutStore.ts rename to packages/common/src/stores/CheckoutStore.ts index aa532c1f5..273a56441 100644 --- a/src/stores/CheckoutStore.ts +++ b/packages/common/src/stores/CheckoutStore.ts @@ -1,6 +1,7 @@ -import type { Offer, Order, PaymentMethod } from '#types/checkout'; -import type { MediaOffer } from '#types/media'; -import { createStore } from '#src/stores/utils'; +import type { Offer, Order, PaymentMethod } from '../../types/checkout'; +import type { MediaOffer } from '../../types/media'; + +import { createStore } from './utils'; type CheckoutStore = { offer: Offer | null; diff --git a/src/stores/ConfigStore.ts b/packages/common/src/stores/ConfigStore.ts similarity index 82% rename from src/stores/ConfigStore.ts rename to packages/common/src/stores/ConfigStore.ts index 8877aad2f..4654f4d40 100644 --- a/src/stores/ConfigStore.ts +++ b/packages/common/src/stores/ConfigStore.ts @@ -1,8 +1,8 @@ -import { createStore } from './utils'; +import { ACCESS_MODEL, OTT_GLOBAL_PLAYER_ID } from '../constants'; +import type { AccessModel, Config, IntegrationType } from '../../types/config'; +import type { Settings } from '../../types/settings'; -import type { AccessModel, Config, IntegrationType } from '#types/Config'; -import type { Settings } from '#types/settings'; -import { ACCESS_MODEL, OTT_GLOBAL_PLAYER_ID } from '#src/config'; +import { createStore } from './utils'; type ConfigState = { loaded: boolean; diff --git a/src/stores/FavoritesController.ts b/packages/common/src/stores/FavoritesController.ts similarity index 85% rename from src/stores/FavoritesController.ts rename to packages/common/src/stores/FavoritesController.ts index ba27ba585..fc24bd67d 100644 --- a/src/stores/FavoritesController.ts +++ b/packages/common/src/stores/FavoritesController.ts @@ -1,16 +1,17 @@ import i18next from 'i18next'; import { inject, injectable } from 'inversify'; -import { useAccountStore } from '#src/stores/AccountStore'; -import { useFavoritesStore } from '#src/stores/FavoritesStore'; -import { useConfigStore } from '#src/stores/ConfigStore'; -import FavoritesService from '#src/services/favorites.service'; -import AccountService from '#src/services/account.service'; -import type { PlaylistItem } from '#types/playlist'; -import type { Favorite, SerializedFavorite } from '#types/favorite'; -import type { Customer } from '#types/account'; -import { getNamedModule } from '#src/modules/container'; -import type { IntegrationType } from '#types/Config'; +import FavoritesService from '../services/favorites.service'; +import AccountService from '../services/account.service'; +import type { PlaylistItem } from '../../types/playlist'; +import type { Favorite, SerializedFavorite } from '../../types/favorite'; +import type { Customer } from '../../types/account'; +import type { IntegrationType } from '../../types/config'; +import { getNamedModule } from '../modules/container'; + +import { useAccountStore } from './AccountStore'; +import { useFavoritesStore } from './FavoritesStore'; +import { useConfigStore } from './ConfigStore'; @injectable() export default class FavoritesController { diff --git a/src/stores/FavoritesStore.ts b/packages/common/src/stores/FavoritesStore.ts similarity index 84% rename from src/stores/FavoritesStore.ts rename to packages/common/src/stores/FavoritesStore.ts index d412e837f..48433060f 100644 --- a/src/stores/FavoritesStore.ts +++ b/packages/common/src/stores/FavoritesStore.ts @@ -1,8 +1,8 @@ -import { createStore } from './utils'; +import { PersonalShelf } from '../constants'; +import type { Favorite } from '../../types/favorite'; +import type { Playlist, PlaylistItem } from '../../types/playlist'; -import type { Favorite } from '#types/favorite'; -import { PersonalShelf } from '#src/config'; -import type { Playlist, PlaylistItem } from '#types/playlist'; +import { createStore } from './utils'; type FavoritesState = { favorites: Favorite[]; diff --git a/src/stores/ProfileController.ts b/packages/common/src/stores/ProfileController.ts similarity index 82% rename from src/stores/ProfileController.ts rename to packages/common/src/stores/ProfileController.ts index 880709f8e..a95dd1200 100644 --- a/src/stores/ProfileController.ts +++ b/packages/common/src/stores/ProfileController.ts @@ -2,15 +2,15 @@ import { inject, injectable } from 'inversify'; import type { ProfilesData } from '@inplayer-org/inplayer.js'; import * as yup from 'yup'; +import * as persist from '../utils/persist'; +import type { EnterProfilePayload, ProfileDetailsPayload, ProfilePayload } from '../../types/account'; +import ProfileService from '../services/profile.service'; +import type { IntegrationType } from '../../types/config'; +import { assertModuleMethod, getNamedModule } from '../modules/container'; + import { useProfileStore } from './ProfileStore'; import { useConfigStore } from './ConfigStore'; -import type { ProfilePayload, EnterProfilePayload, ProfileDetailsPayload } from '#types/account'; -import ProfileService from '#src/services/profile.service'; -import * as persist from '#src/utils/persist'; -import { assertModuleMethod, getNamedModule } from '#src/modules/container'; -import type { IntegrationType } from '#types/Config'; - const PERSIST_PROFILE = 'profile'; const profileSchema = yup.object().shape({ @@ -39,7 +39,7 @@ export default class ProfileController { listProfiles = async () => { assertModuleMethod(this.profileService?.listProfiles, 'listProfiles is not available in profile service'); - const res = await this.profileService.listProfiles(undefined, this.getSandbox()); + const res = await this.profileService?.listProfiles(undefined, this.getSandbox()); const { canManageProfiles } = useProfileStore.getState(); @@ -59,13 +59,13 @@ export default class ProfileController { updateProfile = async ({ id, name, adult, avatar_url, pin }: ProfilePayload) => { assertModuleMethod(this.profileService?.updateProfile, 'updateProfile is not available in profile service'); - return this.profileService.updateProfile({ id, name, adult, avatar_url, pin }, this.getSandbox()); + return this.profileService?.updateProfile({ id, name, adult, avatar_url, pin }, this.getSandbox()); }; enterProfile = async ({ id, pin }: EnterProfilePayload) => { assertModuleMethod(this.profileService?.enterProfile, 'enterProfile is not available in profile service'); - const response = await this.profileService.enterProfile({ id, pin }, this.getSandbox()); + const response = await this.profileService?.enterProfile({ id, pin }, this.getSandbox()); const profile = response?.responseData; @@ -79,13 +79,13 @@ export default class ProfileController { deleteProfile = async ({ id }: ProfileDetailsPayload) => { assertModuleMethod(this.profileService?.deleteProfile, 'deleteProfile is not available in profile service'); - return this.profileService.deleteProfile({ id }, this.getSandbox()); + return this.profileService?.deleteProfile({ id }, this.getSandbox()); }; getProfileDetails = async ({ id }: ProfileDetailsPayload) => { assertModuleMethod(this.profileService?.getProfileDetails, 'getProfileDetails is not available in profile service'); - return this.profileService.getProfileDetails({ id }, this.getSandbox()); + return this.profileService?.getProfileDetails({ id }, this.getSandbox()); }; persistProfile = ({ profile }: { profile: ProfilesData }) => { diff --git a/src/stores/ProfileStore.ts b/packages/common/src/stores/ProfileStore.ts similarity index 75% rename from src/stores/ProfileStore.ts rename to packages/common/src/stores/ProfileStore.ts index 0314ab4db..ad0e69e37 100644 --- a/src/stores/ProfileStore.ts +++ b/packages/common/src/stores/ProfileStore.ts @@ -1,6 +1,8 @@ -import { createStore } from '#src/stores/utils'; -import type { Profile } from '#types/account'; -import defaultAvatar from '#src/assets/profiles/default_avatar.png'; +import defaultAvatar from '@jwplayer/ott-web/src/assets/profiles/default_avatar.png'; + +import type { Profile } from '../../types/account'; + +import { createStore } from './utils'; type ProfileStore = { profile: Profile | null; diff --git a/src/stores/UIStore.ts b/packages/common/src/stores/UIStore.ts similarity index 100% rename from src/stores/UIStore.ts rename to packages/common/src/stores/UIStore.ts diff --git a/src/stores/WatchHistoryController.ts b/packages/common/src/stores/WatchHistoryController.ts similarity index 84% rename from src/stores/WatchHistoryController.ts rename to packages/common/src/stores/WatchHistoryController.ts index 2cec5b611..3a6269ee4 100644 --- a/src/stores/WatchHistoryController.ts +++ b/packages/common/src/stores/WatchHistoryController.ts @@ -1,15 +1,16 @@ import { inject, injectable } from 'inversify'; -import { useAccountStore } from '#src/stores/AccountStore'; -import { useConfigStore } from '#src/stores/ConfigStore'; -import { useWatchHistoryStore } from '#src/stores/WatchHistoryStore'; -import WatchHistoryService from '#src/services/watchhistory.service'; -import AccountService from '#src/services/account.service'; -import type { PlaylistItem } from '#types/playlist'; -import type { SerializedWatchHistoryItem, WatchHistoryItem } from '#types/watchHistory'; -import type { Customer } from '#types/account'; -import { getNamedModule } from '#src/modules/container'; -import type { IntegrationType } from '#types/Config'; +import WatchHistoryService from '../services/watchhistory.service'; +import AccountService from '../services/account.service'; +import type { PlaylistItem } from '../../types/playlist'; +import type { SerializedWatchHistoryItem, WatchHistoryItem } from '../../types/watchHistory'; +import type { Customer } from '../../types/account'; +import type { IntegrationType } from '../../types/config'; +import { getNamedModule } from '../modules/container'; + +import { useAccountStore } from './AccountStore'; +import { useConfigStore } from './ConfigStore'; +import { useWatchHistoryStore } from './WatchHistoryStore'; @injectable() export default class WatchHistoryController { diff --git a/src/stores/WatchHistoryStore.ts b/packages/common/src/stores/WatchHistoryStore.ts similarity index 89% rename from src/stores/WatchHistoryStore.ts rename to packages/common/src/stores/WatchHistoryStore.ts index 21f270e0e..45dabc323 100644 --- a/src/stores/WatchHistoryStore.ts +++ b/packages/common/src/stores/WatchHistoryStore.ts @@ -1,8 +1,8 @@ -import { createStore } from './utils'; +import { PersonalShelf, VideoProgressMinMax } from '../constants'; +import type { WatchHistoryItem } from '../../types/watchHistory'; +import type { Playlist, PlaylistItem } from '../../types/playlist'; -import { VideoProgressMinMax, PersonalShelf } from '#src/config'; -import type { WatchHistoryItem } from '#types/watchHistory'; -import type { Playlist, PlaylistItem } from '#types/playlist'; +import { createStore } from './utils'; type WatchHistoryState = { watchHistory: WatchHistoryItem[]; diff --git a/src/stores/utils.ts b/packages/common/src/stores/utils.ts similarity index 88% rename from src/stores/utils.ts rename to packages/common/src/stores/utils.ts index 84c99ce43..63b1b9dca 100644 --- a/src/stores/utils.ts +++ b/packages/common/src/stores/utils.ts @@ -2,7 +2,7 @@ import type { State, StateCreator } from 'zustand'; import create from 'zustand'; import { devtools, subscribeWithSelector } from 'zustand/middleware'; -import { IS_DEVELOPMENT_BUILD, IS_TEST_MODE } from '#src/utils/common'; +import { IS_DEVELOPMENT_BUILD, IS_TEST_MODE } from '../utils/common'; export const createStore = (name: string, storeFn: StateCreator) => { const store = subscribeWithSelector(storeFn); diff --git a/src/utils/api.ts b/packages/common/src/utils/api.ts similarity index 95% rename from src/utils/api.ts rename to packages/common/src/utils/api.ts index aa994fdc2..1b23ab939 100644 --- a/src/utils/api.ts +++ b/packages/common/src/utils/api.ts @@ -1,6 +1,6 @@ import type { CommonResponse } from '@inplayer-org/inplayer.js'; -import type { InPlayerError } from '#types/inplayer'; +import type { InPlayerError } from '../../types/inplayer'; export class ApiError extends Error { code: number; diff --git a/src/utils/broadcaster.test.ts b/packages/common/src/utils/broadcaster.test.ts similarity index 97% rename from src/utils/broadcaster.test.ts rename to packages/common/src/utils/broadcaster.test.ts index 6cc090da9..f501ebea7 100644 --- a/src/utils/broadcaster.test.ts +++ b/packages/common/src/utils/broadcaster.test.ts @@ -1,6 +1,6 @@ import { vitest } from 'vitest'; -import { Broadcaster } from '#src/utils/broadcaster'; +import { Broadcaster } from './broadcaster'; type TestEvent = { text: string; digit: number }; diff --git a/src/utils/broadcaster.ts b/packages/common/src/utils/broadcaster.ts similarity index 98% rename from src/utils/broadcaster.ts rename to packages/common/src/utils/broadcaster.ts index 51c8f8c1c..3faa34193 100644 --- a/src/utils/broadcaster.ts +++ b/packages/common/src/utils/broadcaster.ts @@ -1,4 +1,4 @@ -import { logDev } from '#src/utils/common'; +import { logDev } from './common'; type BroadcastEventHandler = (event: T) => void; diff --git a/src/utils/collection.ts b/packages/common/src/utils/collection.ts similarity index 93% rename from src/utils/collection.ts rename to packages/common/src/utils/collection.ts index 438aff68c..17e0c137e 100644 --- a/src/utils/collection.ts +++ b/packages/common/src/utils/collection.ts @@ -1,9 +1,10 @@ -import type { Consent, CustomerConsent } from '#types/account'; -import type { Config } from '#types/Config'; -import type { GenericFormValues } from '#types/form'; -import type { Playlist, PlaylistItem } from '#types/playlist'; -import type { PosterAspectRatio } from '#components/Card/Card'; -import { cardAspectRatios } from '#components/Card/Card'; +import type { PosterAspectRatio } from '@jwplayer/ott-web/src/components/Card/Card'; +import { cardAspectRatios } from '@jwplayer/ott-web/src/components/Card/Card'; + +import type { Consent, CustomerConsent } from '../../types/account'; +import type { Config } from '../../types/config'; +import type { GenericFormValues } from '../../types/form'; +import type { Playlist, PlaylistItem } from '../../types/playlist'; const getFiltersFromConfig = (config: Config, playlistId: string | undefined): string[] => { const menuItem = config.menu.find((item) => item.contentId === playlistId); diff --git a/src/utils/common.ts b/packages/common/src/utils/common.ts similarity index 98% rename from src/utils/common.ts rename to packages/common/src/utils/common.ts index b8a3b142a..8c2e34511 100644 --- a/src/utils/common.ts +++ b/packages/common/src/utils/common.ts @@ -1,4 +1,4 @@ -import { overrideIPCookieKey } from '#test/constants'; +import { overrideIPCookieKey } from '../constants'; export function debounce void>(callback: T, wait = 200) { let timeout: NodeJS.Timeout | null; diff --git a/src/utils/configSchema.ts b/packages/common/src/utils/configSchema.ts similarity index 96% rename from src/utils/configSchema.ts rename to packages/common/src/utils/configSchema.ts index 166fe314b..af2856a36 100644 --- a/src/utils/configSchema.ts +++ b/packages/common/src/utils/configSchema.ts @@ -1,6 +1,6 @@ import { array, boolean, mixed, number, object, SchemaOf, string, StringSchema } from 'yup'; -import type { Cleeng, JWP, Config, Content, Features, Menu, Styling } from '#types/Config'; +import type { Cleeng, Config, Content, Features, JWP, Menu, Styling } from '../../types/config'; const contentSchema: SchemaOf = object({ contentId: string().notRequired(), diff --git a/src/utils/datetime.ts b/packages/common/src/utils/datetime.ts similarity index 100% rename from src/utils/datetime.ts rename to packages/common/src/utils/datetime.ts diff --git a/src/utils/dom.ts b/packages/common/src/utils/dom.ts similarity index 98% rename from src/utils/dom.ts rename to packages/common/src/utils/dom.ts index 35a823f4f..0c35b20a3 100644 --- a/src/utils/dom.ts +++ b/packages/common/src/utils/dom.ts @@ -1,3 +1,4 @@ +// @TODO: move this util export const canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); let size: number; diff --git a/src/utils/domHelpers.ts b/packages/common/src/utils/domHelpers.ts similarity index 92% rename from src/utils/domHelpers.ts rename to packages/common/src/utils/domHelpers.ts index b3af15d6e..56ec8bc4f 100644 --- a/src/utils/domHelpers.ts +++ b/packages/common/src/utils/domHelpers.ts @@ -1,3 +1,4 @@ +// @TODO: move out of the common package (browser context) export const canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); let size: number; diff --git a/src/utils/entitlements.ts b/packages/common/src/utils/entitlements.ts similarity index 86% rename from src/utils/entitlements.ts rename to packages/common/src/utils/entitlements.ts index c66e9e8c2..980afdf24 100644 --- a/src/utils/entitlements.ts +++ b/packages/common/src/utils/entitlements.ts @@ -1,8 +1,9 @@ -import type { AccessModel } from '#types/Config'; -import type { MediaOffer } from '#types/media'; -import type { PlaylistItem } from '#types/playlist'; -import { isTruthyCustomParamValue, isFalsyCustomParamValue } from '#src/utils/common'; -import { ACCESS_MODEL } from '#src/config'; +import { ACCESS_MODEL } from '../constants'; +import type { AccessModel } from '../../types/config'; +import type { MediaOffer } from '../../types/media'; +import type { PlaylistItem } from '../../types/playlist'; + +import { isFalsyCustomParamValue, isTruthyCustomParamValue } from './common'; /** * The appearance of the lock icon, depending on the access model diff --git a/src/utils/epg.ts b/packages/common/src/utils/epg.ts similarity index 94% rename from src/utils/epg.ts rename to packages/common/src/utils/epg.ts index 89bde3401..304236c28 100644 --- a/src/utils/epg.ts +++ b/packages/common/src/utils/epg.ts @@ -1,6 +1,6 @@ import { isAfter, isFuture, isPast, subHours } from 'date-fns'; -import type { EpgChannel, EpgProgram } from '#types/epg'; +import type { EpgChannel, EpgProgram } from '../../types/epg'; /** * Returns true when the program is currently live e.g. the startTime is before now and the endTime is after now diff --git a/src/utils/error.ts b/packages/common/src/utils/error.ts similarity index 100% rename from src/utils/error.ts rename to packages/common/src/utils/error.ts diff --git a/src/utils/formatting.ts b/packages/common/src/utils/formatting.ts similarity index 98% rename from src/utils/formatting.ts rename to packages/common/src/utils/formatting.ts index c6ce4735a..05396fb82 100644 --- a/src/utils/formatting.ts +++ b/packages/common/src/utils/formatting.ts @@ -1,6 +1,6 @@ -import { getLegacySeriesPlaylistIdFromEpisodeTags, getSeriesPlaylistIdFromCustomParams } from './media'; +import type { Playlist, PlaylistItem } from '../../types/playlist'; -import type { Playlist, PlaylistItem } from '#types/playlist'; +import { getLegacySeriesPlaylistIdFromEpisodeTags, getSeriesPlaylistIdFromCustomParams } from './media'; export const formatDurationTag = (seconds: number): string | null => { if (!seconds) return null; diff --git a/src/utils/liveEvent.ts b/packages/common/src/utils/liveEvent.ts similarity index 96% rename from src/utils/liveEvent.ts rename to packages/common/src/utils/liveEvent.ts index b60bab6e5..215040e9a 100644 --- a/src/utils/liveEvent.ts +++ b/packages/common/src/utils/liveEvent.ts @@ -1,4 +1,4 @@ -import type { PlaylistItem } from '#types/playlist'; +import type { PlaylistItem } from '../../types/playlist'; export enum EventState { PRE_LIVE = 'PRE_LIVE', diff --git a/src/utils/location.ts b/packages/common/src/utils/location.ts similarity index 100% rename from src/utils/location.ts rename to packages/common/src/utils/location.ts diff --git a/src/utils/matchMedia.ts b/packages/common/src/utils/matchMedia.ts similarity index 100% rename from src/utils/matchMedia.ts rename to packages/common/src/utils/matchMedia.ts diff --git a/src/utils/media.ts b/packages/common/src/utils/media.ts similarity index 94% rename from src/utils/media.ts rename to packages/common/src/utils/media.ts index 96ccc3309..741e4b9af 100644 --- a/src/utils/media.ts +++ b/packages/common/src/utils/media.ts @@ -1,5 +1,5 @@ -import { CONTENT_TYPE } from '#src/config'; -import type { Playlist, PlaylistItem } from '#types/playlist'; +import { CONTENT_TYPE } from '../constants'; +import type { Playlist, PlaylistItem } from '../../types/playlist'; type RequiredProperties = T & Required>; diff --git a/src/utils/persist.ts b/packages/common/src/utils/persist.ts similarity index 100% rename from src/utils/persist.ts rename to packages/common/src/utils/persist.ts diff --git a/src/utils/promiseQueue.test.ts b/packages/common/src/utils/promiseQueue.test.ts similarity index 100% rename from src/utils/promiseQueue.test.ts rename to packages/common/src/utils/promiseQueue.test.ts diff --git a/src/utils/promiseQueue.ts b/packages/common/src/utils/promiseQueue.ts similarity index 100% rename from src/utils/promiseQueue.ts rename to packages/common/src/utils/promiseQueue.ts diff --git a/src/utils/series.ts b/packages/common/src/utils/series.ts similarity index 90% rename from src/utils/series.ts rename to packages/common/src/utils/series.ts index a3687aacd..2414a78c3 100644 --- a/src/utils/series.ts +++ b/packages/common/src/utils/series.ts @@ -1,4 +1,4 @@ -import type { EpisodeMetadata, Series } from '#types/series'; +import type { EpisodeMetadata, Series } from '../../types/series'; /** * Get an array of options for a season filter diff --git a/src/utils/structuredData.ts b/packages/common/src/utils/structuredData.ts similarity index 93% rename from src/utils/structuredData.ts rename to packages/common/src/utils/structuredData.ts index 08340adce..6072ec2b4 100644 --- a/src/utils/structuredData.ts +++ b/packages/common/src/utils/structuredData.ts @@ -1,9 +1,9 @@ +import type { PlaylistItem } from '../../types/playlist'; +import type { EpisodeMetadata, Series } from '../../types/series'; + import { mediaURL } from './formatting'; import { secondsToISO8601 } from './datetime'; -import type { PlaylistItem } from '#types/playlist'; -import type { EpisodeMetadata, Series } from '#types/series'; - export const generateMovieJSONLD = (item: PlaylistItem) => { const movieCanonical = `${window.location.origin}${mediaURL({ media: item })}`; diff --git a/src/utils/subscription.ts b/packages/common/src/utils/subscription.ts similarity index 67% rename from src/utils/subscription.ts rename to packages/common/src/utils/subscription.ts index 73f6d17c2..d87001355 100644 --- a/src/utils/subscription.ts +++ b/packages/common/src/utils/subscription.ts @@ -1,5 +1,6 @@ -import { formatPrice } from '#src/utils/formatting'; -import type { Offer, Order } from '#types/checkout'; +import type { Offer, Order } from '../../types/checkout'; + +import { formatPrice } from './formatting'; export const getOfferPrice = (offer: Offer) => formatPrice(offer.customerPriceInclTax, offer.customerCurrency, offer.customerCountry); diff --git a/src/utils/yupSchemaCreator.ts b/packages/common/src/utils/yupSchemaCreator.ts similarity index 100% rename from src/utils/yupSchemaCreator.ts rename to packages/common/src/utils/yupSchemaCreator.ts index 3430273d0..d1e322437 100644 --- a/src/utils/yupSchemaCreator.ts +++ b/packages/common/src/utils/yupSchemaCreator.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import * as yupRaw from 'yup'; import type { AnySchema } from 'yup'; +import * as yupRaw from 'yup'; import type Reference from 'yup/lib/Reference'; import type Lazy from 'yup/lib/Lazy'; diff --git a/packages/common/tsconfig.json b/packages/common/tsconfig.json new file mode 100644 index 000000000..6d006d97f --- /dev/null +++ b/packages/common/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../../tsconfig.vite.json", + "include": [ + "src", + "types" + ], + "compilerOptions": { + "noEmit": true, + "types": [ + "vi-fetch/matchers", + "vitest/globals" + ] + } +} diff --git a/types/account.d.ts b/packages/common/types/account.d.ts similarity index 75% rename from types/account.d.ts rename to packages/common/types/account.d.ts index f5bedb08d..c166eeaa0 100644 --- a/types/account.d.ts +++ b/packages/common/types/account.d.ts @@ -1,9 +1,8 @@ -import type { CommonResponse, ProfilesData } from '@inplayer-org/inplayer.js'; +import type { ProfilesData } from '@inplayer-org/inplayer.js'; import type { SerializedWatchHistoryItem } from './watchHistory'; import type { SerializedFavorite } from './favorite'; - -import type { Config } from '#types/Config'; +import type { Config } from './config'; export type AuthData = { jwt: string; @@ -166,7 +165,7 @@ export type ChangePasswordWithTokenPayload = { newPasswordConfirmation: string; }; -export type changePasswordWithOldPasswordPayload = { +export type ChangePasswordWithOldPasswordPayload = { oldPassword: string; newPassword: string; newPasswordConfirmation: string; @@ -218,7 +217,7 @@ export type UpdateCustomerArgs = { firstName?: string | undefined; lastName?: string | undefined; externalData?: ExternalData | undefined; - metadata?: Record; + metadata?: Record; fullName?: string; }; @@ -375,29 +374,27 @@ export type SocialURLs = { google: string; }; -type Login = PromiseRequest; -type Register = PromiseRequest; -type Login = PromiseRequest; -type Register = PromiseRequest; -type GetCustomer = EnvironmentServiceRequest; -type UpdateCustomer = EnvironmentServiceRequest; -type GetPublisherConsents = PromiseRequest; -type GetCustomerConsents = PromiseRequest; -type UpdateCustomerConsents = PromiseRequest; -type GetCaptureStatus = EnvironmentServiceRequest; -type UpdateCaptureAnswers = EnvironmentServiceRequest; -type ResetPassword = EnvironmentServiceRequest>; -type ChangePassword = EnvironmentServiceRequest>; -type ChangePasswordWithOldPassword = EnvironmentServiceRequest>; -type UpdatePersonalShelves = EnvironmentServiceRequest>; -type GetLocales = EmptyServiceRequest; -type ExportAccountData = EnvironmentServiceRequest; -type SocialURLSData = PromiseRequest; -type NotificationsData = PromiseRequest; -type DeleteAccount = EnvironmentServiceRequest; -type ListProfiles = EnvironmentServiceRequest; -type CreateProfile = EnvironmentServiceRequest; -type UpdateProfile = EnvironmentServiceRequest; -type EnterProfile = EnvironmentServiceRequest; -type GetProfileDetails = EnvironmentServiceRequest; -type DeleteProfile = EnvironmentServiceRequest; +export type Login = PromiseRequest; +export type Register = PromiseRequest; +export type GetCustomer = EnvironmentServiceRequest; +export type UpdateCustomer = EnvironmentServiceRequest; +export type GetPublisherConsents = PromiseRequest; +export type GetCustomerConsents = PromiseRequest; +export type UpdateCustomerConsents = PromiseRequest; +export type GetCaptureStatus = EnvironmentServiceRequest; +export type UpdateCaptureAnswers = EnvironmentServiceRequest; +export type ResetPassword = EnvironmentServiceRequest>; +export type ChangePassword = EnvironmentServiceRequest; +export type ChangePasswordWithOldPassword = EnvironmentServiceRequest; +export type UpdatePersonalShelves = EnvironmentServiceRequest>; +export type GetLocales = EmptyServiceRequest; +export type ExportAccountData = EnvironmentServiceRequest; +export type SocialURLSData = PromiseRequest; +export type NotificationsData = PromiseRequest; +export type DeleteAccount = EnvironmentServiceRequest; +export type ListProfiles = EnvironmentServiceRequest; +export type CreateProfile = EnvironmentServiceRequest; +export type UpdateProfile = EnvironmentServiceRequest; +export type EnterProfile = EnvironmentServiceRequest; +export type GetProfileDetails = EnvironmentServiceRequest; +export type DeleteProfile = EnvironmentServiceRequest; diff --git a/types/ad-schedule.d.ts b/packages/common/types/ad-schedule.d.ts similarity index 100% rename from types/ad-schedule.d.ts rename to packages/common/types/ad-schedule.d.ts diff --git a/types/adyen.d.ts b/packages/common/types/adyen.d.ts similarity index 100% rename from types/adyen.d.ts rename to packages/common/types/adyen.d.ts diff --git a/types/checkout.d.ts b/packages/common/types/checkout.d.ts similarity index 97% rename from types/checkout.d.ts rename to packages/common/types/checkout.d.ts index d734971ae..c8f7eaf9d 100644 --- a/types/checkout.d.ts +++ b/packages/common/types/checkout.d.ts @@ -1,4 +1,5 @@ -import type { PayloadWithIPOverride } from '#types/account'; +import type { PayloadWithIPOverride } from './account'; +import type { PaymentDetail } from './subscription'; export type Offer = { id: number | null; @@ -182,7 +183,7 @@ export type GetSubscriptionSwitchPayload = { }; export type GetSubscriptionSwitchResponse = { - id: id; + id: string; customerId: number; direction: 'downgrade' | 'upgrade'; algorithm: string; @@ -336,7 +337,7 @@ export type AdyenPaymentSession = { sessionData: string; }; -export type UpdatePaymentWithPayPalPayload = Omit & { paymentMethodId: number }; +export type UpdatePaymentWithPayPalPayload = Omit & { paymentMethodId: number }; export type DeletePaymentMethodPayload = { paymentDetailsId: number; @@ -348,7 +349,7 @@ export type DeletePaymentMethodResponse = { export type AddAdyenPaymentDetailsPayload = Omit & { paymentMethodId: number }; -export type AddAdyenPaymentDetailsResponse = Omit; +export type AddAdyenPaymentDetailsResponse = Omit | AdyenAction; export type FinalizeAdyenPaymentDetailsPayload = Omit & { paymentMethodId: number }; diff --git a/types/cleeng.d.ts b/packages/common/types/cleeng.d.ts similarity index 100% rename from types/cleeng.d.ts rename to packages/common/types/cleeng.d.ts diff --git a/types/Config.d.ts b/packages/common/types/config.d.ts similarity index 100% rename from types/Config.d.ts rename to packages/common/types/config.d.ts diff --git a/packages/common/types/entitlement.d.ts b/packages/common/types/entitlement.d.ts new file mode 100644 index 000000000..5b5803420 --- /dev/null +++ b/packages/common/types/entitlement.d.ts @@ -0,0 +1,6 @@ +export type GetTokenResponse = { + entitled: boolean; + token: string; +}; + +export type EntitlementType = 'media' | 'playlist' | 'library'; diff --git a/types/env.d.ts b/packages/common/types/env.d.ts similarity index 100% rename from types/env.d.ts rename to packages/common/types/env.d.ts diff --git a/types/epg.d.ts b/packages/common/types/epg.d.ts similarity index 100% rename from types/epg.d.ts rename to packages/common/types/epg.d.ts diff --git a/types/favorite.d.ts b/packages/common/types/favorite.d.ts similarity index 100% rename from types/favorite.d.ts rename to packages/common/types/favorite.d.ts diff --git a/types/form.d.ts b/packages/common/types/form.d.ts similarity index 100% rename from types/form.d.ts rename to packages/common/types/form.d.ts diff --git a/types/global.d.ts b/packages/common/types/global.d.ts similarity index 100% rename from types/global.d.ts rename to packages/common/types/global.d.ts diff --git a/types/i18next.d.ts b/packages/common/types/i18next.d.ts similarity index 100% rename from types/i18next.d.ts rename to packages/common/types/i18next.d.ts diff --git a/types/inplayer.d.ts b/packages/common/types/inplayer.d.ts similarity index 80% rename from types/inplayer.d.ts rename to packages/common/types/inplayer.d.ts index 3fa64e3ea..67d651e56 100644 --- a/types/inplayer.d.ts +++ b/packages/common/types/inplayer.d.ts @@ -1,5 +1,3 @@ -import type { PurchaseHistoryCollection } from '@inplayer-org/inplayer.js'; - export type InPlayerAuthData = { access_token: string; expires?: number; diff --git a/types/jwplayer.d.ts b/packages/common/types/jwplayer.d.ts similarity index 100% rename from types/jwplayer.d.ts rename to packages/common/types/jwplayer.d.ts diff --git a/types/jwpltx.d.ts b/packages/common/types/jwpltx.d.ts similarity index 100% rename from types/jwpltx.d.ts rename to packages/common/types/jwpltx.d.ts diff --git a/types/media.d.ts b/packages/common/types/media.d.ts similarity index 100% rename from types/media.d.ts rename to packages/common/types/media.d.ts diff --git a/types/pagination.d.ts b/packages/common/types/pagination.d.ts similarity index 100% rename from types/pagination.d.ts rename to packages/common/types/pagination.d.ts diff --git a/types/playlist.d.ts b/packages/common/types/playlist.d.ts similarity index 100% rename from types/playlist.d.ts rename to packages/common/types/playlist.d.ts diff --git a/types/screens.d.ts b/packages/common/types/screens.d.ts similarity index 100% rename from types/screens.d.ts rename to packages/common/types/screens.d.ts diff --git a/types/series.d.ts b/packages/common/types/series.d.ts similarity index 100% rename from types/series.d.ts rename to packages/common/types/series.d.ts diff --git a/types/service.d.ts b/packages/common/types/service.d.ts similarity index 100% rename from types/service.d.ts rename to packages/common/types/service.d.ts diff --git a/types/settings.d.ts b/packages/common/types/settings.d.ts similarity index 100% rename from types/settings.d.ts rename to packages/common/types/settings.d.ts diff --git a/types/static.d.ts b/packages/common/types/static.d.ts similarity index 100% rename from types/static.d.ts rename to packages/common/types/static.d.ts diff --git a/types/subscription.d.ts b/packages/common/types/subscription.d.ts similarity index 96% rename from types/subscription.d.ts rename to packages/common/types/subscription.d.ts index 8a6713063..36bbb3104 100644 --- a/types/subscription.d.ts +++ b/packages/common/types/subscription.d.ts @@ -1,4 +1,4 @@ -import type { DefaultCreditCardData, SetDefaultCard, ChangeSubscriptionPlanRequestBody, ChangeSubscriptionPlanResponse } from '@inplayer-org/inplayer.js'; +import type { ChangeSubscriptionPlanResponse, DefaultCreditCardData, SetDefaultCard } from '@inplayer-org/inplayer.js'; // Subscription types export type Subscription = { subscriptionId: number | string; diff --git a/types/watchHistory.d.ts b/packages/common/types/watchHistory.d.ts similarity index 100% rename from types/watchHistory.d.ts rename to packages/common/types/watchHistory.d.ts diff --git a/packages/hooks-react/package.json b/packages/hooks-react/package.json new file mode 100644 index 000000000..7d7edfe5c --- /dev/null +++ b/packages/hooks-react/package.json @@ -0,0 +1,4 @@ +{ + "name": "@jwplayer/ott-hooks-react", + "version": "4.30.0" +} diff --git a/packages/i18n/package.json b/packages/i18n/package.json new file mode 100644 index 000000000..4e20b74d3 --- /dev/null +++ b/packages/i18n/package.json @@ -0,0 +1,4 @@ +{ + "name": "@jwplayer/ott-i18n", + "version": "4.30.0" +} diff --git a/packages/theme/package.json b/packages/theme/package.json new file mode 100644 index 000000000..97a8e9ef0 --- /dev/null +++ b/packages/theme/package.json @@ -0,0 +1,4 @@ +{ + "name": "@jwplayer/ott-theme", + "version": "4.30.0" +} diff --git a/packages/ui-react/package.json b/packages/ui-react/package.json new file mode 100644 index 000000000..69b48fbc9 --- /dev/null +++ b/packages/ui-react/package.json @@ -0,0 +1,16 @@ +{ + "name": "@jwplayer/ott-ui-react", + "version": "4.30.0", + "main": "./src", + "peerDependencies": { + "@testing-library/jest-dom": "^5.16.5", + "@testing-library/react": "^14.0.0", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "vi-fetch": "^0.8.0", + "vitest": "^0.34.1" + }, + "devDependencies": { + "typescript-plugin-css-modules": "^5.0.1" + } +} diff --git a/packages/ui-react/tsconfig.json b/packages/ui-react/tsconfig.json new file mode 100644 index 000000000..a1bcd65eb --- /dev/null +++ b/packages/ui-react/tsconfig.json @@ -0,0 +1,28 @@ +{ + "extends": "../../web/tsconfig.json", + "include": [ + "src" + ], + "compilerOptions": { + "baseUrl": "./", + "noEmit": true, + "types": [ + "vi-fetch/matchers", + "vitest/globals", + "@testing-library/jest-dom" + ], + "plugins": [ + { + "name": "typescript-plugin-css-modules", + "options": { + "rendererOptions": { + "includePaths": ["./styles"] + }, + "postcssOptions": { + "useConfig": true + } + } + } + ] + } +} diff --git a/src/hooks/useLiveEvent.ts b/src/hooks/useLiveEvent.ts deleted file mode 100644 index 3d5ef1330..000000000 --- a/src/hooks/useLiveEvent.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { PlaylistItem } from '../../types/playlist'; -import { isLiveEvent, isPlayable } from '../utils/liveEvent'; - -export function useLiveEvent(media: PlaylistItem) { - return { - isLiveEvent: isLiveEvent(media), - isPlayable: isPlayable(media), - }; -} diff --git a/tsconfig.json b/tsconfig.json index 0c280aa72..1b48a6ef6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,49 +1,27 @@ { - "include": [ - "src", - "types", - "scripts", - "test", - "vite.config.ts", - "vitest.config.ts", - "vitest.setup.ts" - ], "compilerOptions": { "module": "esnext", "target": "esnext", "moduleResolution": "node", - "jsx": "preserve", - "baseUrl": "./", - /* paths - import rewriting/resolving */ - "paths": { - "#components/*": ["./src/components/*"], - "#src/*": ["./src/*"], - "#test/*": ["./test/*"], - "#types/*": ["./types/*"] - }, - /* noEmit - Vite builds (emits) files, not tsc. */ - "noEmit": true, - /* Additional Options */ + "sourceMap": true, "strict": true, + "declaration": true, + "declarationMap": true, + "noEmitOnError": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "resolveJsonModule": true, + "esModuleInterop": true, "allowSyntheticDefaultImports": true, - "importsNotUsedAsValues": "error", - // Ensure unused code is cleaned up - "noUnusedParameters": true, + "verbatimModuleSyntax": false, "noUnusedLocals": true, - // Fallthrough must be documented "noFallthroughCasesInSwitch": true, - "experimentalDecorators": true, - "emitDecoratorMetadata": true, - "types": [ - "vi-fetch/matchers", - "vitest/globals", - "@testing-library/jest-dom", - "@types/jwplayer", - "vite-plugin-pwa/client", - "reflect-metadata" - ] - } + "jsx": "preserve", + "noEmit": true, + "baseUrl": "./" + }, + "exclude": [ + "node_modules", + "dist" + ] } diff --git a/tsconfig.vite.json b/tsconfig.vite.json new file mode 100644 index 000000000..95ba8915e --- /dev/null +++ b/tsconfig.vite.json @@ -0,0 +1,33 @@ +{ + "compilerOptions": { + "module": "esnext", + "target": "esnext", + "moduleResolution": "node", + "jsx": "preserve", + "baseUrl": "./", + /* noEmit - Vite builds (emits) files, not tsc. */ + "noEmit": true, + /* Additional Options */ + "strict": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "importsNotUsedAsValues": "error", + // Ensure unused code is cleaned up + "noUnusedParameters": true, + "noUnusedLocals": true, + // Fallthrough must be documented + "noFallthroughCasesInSwitch": true, + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "types": [ + "vi-fetch/matchers", + "vitest/globals", + "@testing-library/jest-dom", + "@types/jwplayer", + "vite-plugin-pwa/client", + "reflect-metadata" + ] + } +} diff --git a/types/entitlement.d.ts b/types/entitlement.d.ts deleted file mode 100644 index d13dabfd2..000000000 --- a/types/entitlement.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -type GetTokenResponse = { - entitled: boolean; - token: string; -}; - -type EntitlementType = 'media' | 'playlist' | 'library'; diff --git a/.env b/web/.env similarity index 100% rename from .env rename to web/.env diff --git a/.env.jwdev b/web/.env.jwdev similarity index 100% rename from .env.jwdev rename to web/.env.jwdev diff --git a/index.html b/web/index.html similarity index 100% rename from index.html rename to web/index.html diff --git a/web/ini/.webapp.dev.ini b/web/ini/.webapp.dev.ini new file mode 100644 index 000000000..44a9d80e7 --- /dev/null +++ b/web/ini/.webapp.dev.ini @@ -0,0 +1,4 @@ +; This is a basic Blender demo +defaultConfigSource = 51mjz2tf +; When developing, switching between configs is useful for test and debug +UNSAFE_allowAnyConfigSource = true diff --git a/ini/templates/.webapp.prod.ini b/web/ini/.webapp.prod.ini similarity index 100% rename from ini/templates/.webapp.prod.ini rename to web/ini/.webapp.prod.ini diff --git a/ini/templates/.webapp.test.ini b/web/ini/.webapp.test.ini similarity index 100% rename from ini/templates/.webapp.test.ini rename to web/ini/.webapp.test.ini diff --git a/ini/templates/.webapp.demo.ini b/web/ini/templates/.webapp.demo.ini similarity index 100% rename from ini/templates/.webapp.demo.ini rename to web/ini/templates/.webapp.demo.ini diff --git a/ini/templates/.webapp.dev.ini b/web/ini/templates/.webapp.dev.ini similarity index 100% rename from ini/templates/.webapp.dev.ini rename to web/ini/templates/.webapp.dev.ini diff --git a/ini/templates/.webapp.jwdev.ini b/web/ini/templates/.webapp.jwdev.ini similarity index 100% rename from ini/templates/.webapp.jwdev.ini rename to web/ini/templates/.webapp.jwdev.ini diff --git a/ini/templates/.webapp.preview.ini b/web/ini/templates/.webapp.preview.ini similarity index 100% rename from ini/templates/.webapp.preview.ini rename to web/ini/templates/.webapp.preview.ini diff --git a/web/ini/templates/.webapp.prod.ini b/web/ini/templates/.webapp.prod.ini new file mode 100644 index 000000000..c9a913815 --- /dev/null +++ b/web/ini/templates/.webapp.prod.ini @@ -0,0 +1,15 @@ +; This is the app config that your application will load at startup +defaultConfigSource = ; Enter your 8 digit config ID (i.e. gnnuzabk) here (case sensitive) + +; This key ensures proper integration with the JW Platform. +; Please make sure to set it here unless you are setting it at build time with the APP_PLAYER_LICENSE_KEY env variable. +playerLicenseKey = ; Enter the 'License Key' from the 'Self-Hosted Web Player' section at https://dashboard.jwplayer.com/p/players + +;******************************************************************************************** +; If you want to support app configs other than the default with the app-config= query param +; add them individually one per line here. +; See .webapp.test.ini for an example. +;******************************************************************************************** +;additionalAllowedConfigSources[] = +;additionalAllowedConfigSources[] = +;additionalAllowedConfigSources[] = diff --git a/web/ini/templates/.webapp.test.ini b/web/ini/templates/.webapp.test.ini new file mode 100644 index 000000000..95f961195 --- /dev/null +++ b/web/ini/templates/.webapp.test.ini @@ -0,0 +1,9 @@ +defaultConfigSource = gnnuzabk +additionalAllowedConfigSources[] = kujzeu1b +additionalAllowedConfigSources[] = ata6ucb8 +additionalAllowedConfigSources[] = nvqkufhy +additionalAllowedConfigSources[] = 7weyqrua +additionalAllowedConfigSources[] = ozylzc5m +additionalAllowedConfigSources[] = a2kbjdv0 +additionalAllowedConfigSources[] = oqrsyxin +additionalAllowedConfigSources[] = 9qqwmnbx diff --git a/web/package.json b/web/package.json new file mode 100644 index 000000000..b5790f361 --- /dev/null +++ b/web/package.json @@ -0,0 +1,104 @@ +{ + "name": "@jwplayer/ott-web", + "version": "4.30.0", + "main": "index.js", + "repository": "https://github.com/jwplayer/ott-web-app.git", + "author": "JW Player", + "private": true, + "engines": { + "node": ">=18.13.0" + }, + "scripts": { + "start": "vite", + "start:test": "vite build --mode test && vite preview --port 8080", + "build": "vite build --mode ${MODE:=prod} && sh scripts/compressIni.sh build/public/.webapp.ini", + "test": "TZ=UTC LC_ALL=en_US.UTF-8 vitest run", + "test-watch": "TZ=UTC LC_ALL=en_US.UTF-8 vitest", + "test-coverage": "TZ=UTC LC_ALL=en_US.UTF-8 vitest run --coverage", + "test-commit": "TZ=UTC LC_ALL=en_US.UTF-8 vitest run --changed HEAD~1 --coverage", + "test-update": "TZ=UTC LC_ALL=en_US.UTF-8 vitest run --update", + "codecept:mobile": "cd test-e2e && rm -rf \"./output/mobile\" && codeceptjs run-workers --suites ${WORKER_COUNT:=8} --config ./codecept.mobile.js", + "codecept:desktop": "cd test-e2e && rm -rf \"./output/desktop\" && codeceptjs run-workers --suites ${WORKER_COUNT:=8} --config ./codecept.desktop.js", + "serve-report:mobile": "cd test-e2e && allure serve \"./output/mobile\"", + "serve-report:desktop": "cd test-e2e && allure serve \"./output/desktop\"", + "codecept-serve:mobile": "yarn codecept:mobile ; yarn serve-report:mobile", + "codecept-serve:desktop": "yarn codecept:desktop ; yarn serve-report:desktop", + "load-content-types": "npx ts-node ./scripts/content-types/load-content-types" + }, + "dependencies": { + "@adyen/adyen-web": "^5.42.1", + "@codeceptjs/allure-legacy": "^1.0.2", + "@inplayer-org/inplayer.js": "^3.13.24", + "classnames": "^2.3.1", + "date-fns": "^2.28.0", + "dompurify": "^2.3.8", + "i18next": "^22.4.15", + "i18next-browser-languagedetector": "^6.1.1", + "i18next-http-backend": "^2.2.0", + "ini": "^3.0.1", + "marked": "^4.1.1", + "payment": "^2.4.6", + "planby": "^0.3.0", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "react-helmet": "^6.1.0", + "react-i18next": "^12.2.2", + "react-infinite-scroller": "^1.2.6", + "react-query": "^3.39.0", + "react-router-dom": "6.14.2", + "wicg-inert": "^3.1.1", + "yup": "^0.32.9" + }, + "devDependencies": { + "@babel/core": "^7.22.11", + "@babel/plugin-proposal-decorators": "^7.22.10", + "@codeceptjs/configure": "^0.8.0", + "@testing-library/jest-dom": "^5.16.5", + "@testing-library/react": "^14.0.0", + "@types/dompurify": "^2.3.4", + "@types/ini": "^1.3.31", + "@types/jwplayer": "^8.2.13", + "@types/luxon": "^3.0.2", + "@types/marked": "^4.0.7", + "@types/node": "^17.0.23", + "@types/payment": "^2.1.4", + "@types/react": "^18.2.15", + "@types/react-dom": "18.2.7", + "@types/react-helmet": "^6.1.2", + "@types/react-infinite-scroller": "^1.2.3", + "@typescript-eslint/eslint-plugin": "^5.17.0", + "@typescript-eslint/parser": "^5.17.0", + "@vitejs/plugin-react": "^4.0.4", + "@vitest/coverage-v8": "^0.33.0", + "allure-commandline": "^2.17.2", + "babel-plugin-transform-typescript-metadata": "^0.3.2", + "codeceptjs": "3.5.5", + "jsdom": "^22.1.0", + "luxon": "^3.2.1", + "playwright": "^1.38.1", + "postcss": "^8.3.5", + "postcss-import": "^14.0.2", + "postcss-scss": "^4.0.4", + "prettier": "^2.8.8", + "react-app-polyfill": "^3.0.0", + "read": "^2.1.0", + "timezone-mock": "^1.3.4", + "vi-fetch": "^0.8.0", + "vite": "^4.4.8", + "vite-plugin-eslint": "^1.8.1", + "vite-plugin-html": "^3.2.0", + "vite-plugin-pwa": "^0.14.0", + "vite-plugin-static-copy": "^0.17.0", + "vite-plugin-stylelint": "^4.3.0", + "vitest": "^0.34.1", + "workbox-build": "^6.5.4", + "workbox-window": "^6.5.4" + }, + "peerDependencies": { + "react-router": "6.14.2" + }, + "optionalDependencies": { + "gh-pages": "^3.2.3", + "lighthouse": "^9.6.7" + } +} diff --git a/public/browserconfig.xml b/web/public/browserconfig.xml similarity index 100% rename from public/browserconfig.xml rename to web/public/browserconfig.xml diff --git a/public/favicon.ico b/web/public/favicon.ico similarity index 100% rename from public/favicon.ico rename to web/public/favicon.ico diff --git a/public/images/android-chrome-144x144.png b/web/public/images/android-chrome-144x144.png similarity index 100% rename from public/images/android-chrome-144x144.png rename to web/public/images/android-chrome-144x144.png diff --git a/public/images/apple-touch-icon.png b/web/public/images/apple-touch-icon.png similarity index 100% rename from public/images/apple-touch-icon.png rename to web/public/images/apple-touch-icon.png diff --git a/public/images/avatars/Alien.svg b/web/public/images/avatars/Alien.svg similarity index 100% rename from public/images/avatars/Alien.svg rename to web/public/images/avatars/Alien.svg diff --git a/public/images/avatars/Bear.svg b/web/public/images/avatars/Bear.svg similarity index 100% rename from public/images/avatars/Bear.svg rename to web/public/images/avatars/Bear.svg diff --git a/public/images/avatars/Brainy.svg b/web/public/images/avatars/Brainy.svg similarity index 100% rename from public/images/avatars/Brainy.svg rename to web/public/images/avatars/Brainy.svg diff --git a/public/images/avatars/Cooool.svg b/web/public/images/avatars/Cooool.svg similarity index 100% rename from public/images/avatars/Cooool.svg rename to web/public/images/avatars/Cooool.svg diff --git a/public/images/avatars/Dummy.svg b/web/public/images/avatars/Dummy.svg similarity index 100% rename from public/images/avatars/Dummy.svg rename to web/public/images/avatars/Dummy.svg diff --git a/public/images/avatars/Frog.svg b/web/public/images/avatars/Frog.svg similarity index 100% rename from public/images/avatars/Frog.svg rename to web/public/images/avatars/Frog.svg diff --git a/public/images/avatars/Goofball.svg b/web/public/images/avatars/Goofball.svg similarity index 100% rename from public/images/avatars/Goofball.svg rename to web/public/images/avatars/Goofball.svg diff --git a/public/images/avatars/Marilyn.svg b/web/public/images/avatars/Marilyn.svg similarity index 100% rename from public/images/avatars/Marilyn.svg rename to web/public/images/avatars/Marilyn.svg diff --git a/public/images/avatars/Smiley.svg b/web/public/images/avatars/Smiley.svg similarity index 100% rename from public/images/avatars/Smiley.svg rename to web/public/images/avatars/Smiley.svg diff --git a/public/images/avatars/ToughGuy.svg b/web/public/images/avatars/ToughGuy.svg similarity index 100% rename from public/images/avatars/ToughGuy.svg rename to web/public/images/avatars/ToughGuy.svg diff --git a/public/images/avatars/UhOh.svg b/web/public/images/avatars/UhOh.svg similarity index 100% rename from public/images/avatars/UhOh.svg rename to web/public/images/avatars/UhOh.svg diff --git a/public/images/avatars/Vibe.svg b/web/public/images/avatars/Vibe.svg similarity index 100% rename from public/images/avatars/Vibe.svg rename to web/public/images/avatars/Vibe.svg diff --git a/public/images/favicon-16x16.png b/web/public/images/favicon-16x16.png similarity index 100% rename from public/images/favicon-16x16.png rename to web/public/images/favicon-16x16.png diff --git a/public/images/favicon-32x32.png b/web/public/images/favicon-32x32.png similarity index 100% rename from public/images/favicon-32x32.png rename to web/public/images/favicon-32x32.png diff --git a/public/images/logo.png b/web/public/images/logo.png similarity index 100% rename from public/images/logo.png rename to web/public/images/logo.png diff --git a/public/images/logo.svg b/web/public/images/logo.svg similarity index 100% rename from public/images/logo.svg rename to web/public/images/logo.svg diff --git a/public/images/mstile-150x150.png b/web/public/images/mstile-150x150.png similarity index 100% rename from public/images/mstile-150x150.png rename to web/public/images/mstile-150x150.png diff --git a/public/images/payments/amex.svg b/web/public/images/payments/amex.svg similarity index 100% rename from public/images/payments/amex.svg rename to web/public/images/payments/amex.svg diff --git a/public/images/payments/diners.svg b/web/public/images/payments/diners.svg similarity index 100% rename from public/images/payments/diners.svg rename to web/public/images/payments/diners.svg diff --git a/public/images/payments/discover.svg b/web/public/images/payments/discover.svg similarity index 100% rename from public/images/payments/discover.svg rename to web/public/images/payments/discover.svg diff --git a/public/images/payments/hiper.svg b/web/public/images/payments/hiper.svg similarity index 100% rename from public/images/payments/hiper.svg rename to web/public/images/payments/hiper.svg diff --git a/public/images/payments/maestro.svg b/web/public/images/payments/maestro.svg similarity index 100% rename from public/images/payments/maestro.svg rename to web/public/images/payments/maestro.svg diff --git a/public/images/payments/mastercard.svg b/web/public/images/payments/mastercard.svg similarity index 100% rename from public/images/payments/mastercard.svg rename to web/public/images/payments/mastercard.svg diff --git a/public/images/payments/unionpay.svg b/web/public/images/payments/unionpay.svg similarity index 100% rename from public/images/payments/unionpay.svg rename to web/public/images/payments/unionpay.svg diff --git a/public/images/payments/visa.svg b/web/public/images/payments/visa.svg similarity index 100% rename from public/images/payments/visa.svg rename to web/public/images/payments/visa.svg diff --git a/public/images/safari-pinned-tab.svg b/web/public/images/safari-pinned-tab.svg similarity index 100% rename from public/images/safari-pinned-tab.svg rename to web/public/images/safari-pinned-tab.svg diff --git a/public/jwpltx.js b/web/public/jwpltx.js similarity index 100% rename from public/jwpltx.js rename to web/public/jwpltx.js diff --git a/public/locales/en/account.json b/web/public/locales/en/account.json similarity index 100% rename from public/locales/en/account.json rename to web/public/locales/en/account.json diff --git a/public/locales/en/common.json b/web/public/locales/en/common.json similarity index 100% rename from public/locales/en/common.json rename to web/public/locales/en/common.json diff --git a/public/locales/en/country.json b/web/public/locales/en/country.json similarity index 100% rename from public/locales/en/country.json rename to web/public/locales/en/country.json diff --git a/public/locales/en/demo.json b/web/public/locales/en/demo.json similarity index 100% rename from public/locales/en/demo.json rename to web/public/locales/en/demo.json diff --git a/public/locales/en/epg.json b/web/public/locales/en/epg.json similarity index 100% rename from public/locales/en/epg.json rename to web/public/locales/en/epg.json diff --git a/public/locales/en/error.json b/web/public/locales/en/error.json similarity index 100% rename from public/locales/en/error.json rename to web/public/locales/en/error.json diff --git a/public/locales/en/menu.json b/web/public/locales/en/menu.json similarity index 100% rename from public/locales/en/menu.json rename to web/public/locales/en/menu.json diff --git a/public/locales/en/search.json b/web/public/locales/en/search.json similarity index 100% rename from public/locales/en/search.json rename to web/public/locales/en/search.json diff --git a/public/locales/en/us_state.json b/web/public/locales/en/us_state.json similarity index 100% rename from public/locales/en/us_state.json rename to web/public/locales/en/us_state.json diff --git a/public/locales/en/user.json b/web/public/locales/en/user.json similarity index 100% rename from public/locales/en/user.json rename to web/public/locales/en/user.json diff --git a/public/locales/en/video.json b/web/public/locales/en/video.json similarity index 100% rename from public/locales/en/video.json rename to web/public/locales/en/video.json diff --git a/public/locales/es/account.json b/web/public/locales/es/account.json similarity index 100% rename from public/locales/es/account.json rename to web/public/locales/es/account.json diff --git a/public/locales/es/common.json b/web/public/locales/es/common.json similarity index 100% rename from public/locales/es/common.json rename to web/public/locales/es/common.json diff --git a/public/locales/es/country.json b/web/public/locales/es/country.json similarity index 100% rename from public/locales/es/country.json rename to web/public/locales/es/country.json diff --git a/public/locales/es/demo.json b/web/public/locales/es/demo.json similarity index 100% rename from public/locales/es/demo.json rename to web/public/locales/es/demo.json diff --git a/public/locales/es/epg.json b/web/public/locales/es/epg.json similarity index 100% rename from public/locales/es/epg.json rename to web/public/locales/es/epg.json diff --git a/public/locales/es/error.json b/web/public/locales/es/error.json similarity index 100% rename from public/locales/es/error.json rename to web/public/locales/es/error.json diff --git a/public/locales/es/menu.json b/web/public/locales/es/menu.json similarity index 100% rename from public/locales/es/menu.json rename to web/public/locales/es/menu.json diff --git a/public/locales/es/search.json b/web/public/locales/es/search.json similarity index 100% rename from public/locales/es/search.json rename to web/public/locales/es/search.json diff --git a/public/locales/es/us_state.json b/web/public/locales/es/us_state.json similarity index 100% rename from public/locales/es/us_state.json rename to web/public/locales/es/us_state.json diff --git a/public/locales/es/user.json b/web/public/locales/es/user.json similarity index 100% rename from public/locales/es/user.json rename to web/public/locales/es/user.json diff --git a/public/locales/es/video.json b/web/public/locales/es/video.json similarity index 100% rename from public/locales/es/video.json rename to web/public/locales/es/video.json diff --git a/public/manifest.json b/web/public/manifest.json similarity index 100% rename from public/manifest.json rename to web/public/manifest.json diff --git a/public/robots.txt b/web/public/robots.txt similarity index 100% rename from public/robots.txt rename to web/public/robots.txt diff --git a/scripts/build-tools/settings.ts b/web/scripts/build-tools/settings.ts similarity index 100% rename from scripts/build-tools/settings.ts rename to web/scripts/build-tools/settings.ts diff --git a/scripts/compressIni.sh b/web/scripts/compressIni.sh similarity index 100% rename from scripts/compressIni.sh rename to web/scripts/compressIni.sh diff --git a/scripts/waitOnConfig.js b/web/scripts/waitOnConfig.js similarity index 100% rename from scripts/waitOnConfig.js rename to web/scripts/waitOnConfig.js diff --git a/src/App.tsx b/web/src/App.tsx similarity index 73% rename from src/App.tsx rename to web/src/App.tsx index 6591ca415..086b43f61 100644 --- a/src/App.tsx +++ b/web/src/App.tsx @@ -1,14 +1,15 @@ import React, { useEffect, useState } from 'react'; import { BrowserRouter } from 'react-router-dom'; -import QueryProvider from '#src/containers/QueryProvider/QueryProvider'; -import initI18n from '#src/i18n/config'; -import Root from '#components/Root/Root'; -import { ErrorPageWithoutTranslation } from '#components/ErrorPage/ErrorPage'; -import LoadingOverlay from '#components/LoadingOverlay/LoadingOverlay'; - -import '#src/screenMapping'; -import '#src/styles/main.scss'; +import QueryProvider from './containers/QueryProvider/QueryProvider'; +import initI18n from './i18n/config'; +import Root from './components/Root/Root'; +import { ErrorPageWithoutTranslation } from './components/ErrorPage/ErrorPage'; +import LoadingOverlay from './components/LoadingOverlay/LoadingOverlay'; + +import './screenMapping'; +import './styles/main.scss'; + interface State { isLoading: boolean; error?: Error; diff --git a/src/assets/icons/facebook.svg b/web/src/assets/icons/facebook.svg similarity index 100% rename from src/assets/icons/facebook.svg rename to web/src/assets/icons/facebook.svg diff --git a/src/assets/icons/google.svg b/web/src/assets/icons/google.svg similarity index 100% rename from src/assets/icons/google.svg rename to web/src/assets/icons/google.svg diff --git a/src/assets/icons/twitter.svg b/web/src/assets/icons/twitter.svg similarity index 100% rename from src/assets/icons/twitter.svg rename to web/src/assets/icons/twitter.svg diff --git a/src/assets/profiles/default_avatar.png b/web/src/assets/profiles/default_avatar.png similarity index 100% rename from src/assets/profiles/default_avatar.png rename to web/src/assets/profiles/default_avatar.png diff --git a/src/components/Account/Account.module.scss b/web/src/components/Account/Account.module.scss similarity index 100% rename from src/components/Account/Account.module.scss rename to web/src/components/Account/Account.module.scss diff --git a/src/components/Account/Account.test.tsx b/web/src/components/Account/Account.test.tsx similarity index 66% rename from src/components/Account/Account.test.tsx rename to web/src/components/Account/Account.test.tsx index dff1f7a18..d6b6a9df5 100644 --- a/src/components/Account/Account.test.tsx +++ b/web/src/components/Account/Account.test.tsx @@ -1,14 +1,14 @@ import React from 'react'; +import type { Consent } from '@jwplayer/ott-common/types/account'; +import { useAccountStore } from '@jwplayer/ott-common/src/stores/AccountStore'; +import AccountController from '@jwplayer/ott-common/src/stores/AccountController'; -import Account from './Account'; +import customer from '../../../test/fixtures/customer.json'; +import { renderWithRouter } from '../../../test/testUtils'; -import customer from '#test/fixtures/customer.json'; -import { useAccountStore } from '#src/stores/AccountStore'; -import { renderWithRouter } from '#test/testUtils'; -import type { Consent } from '#types/account'; -import AccountController from '#src/stores/AccountController'; +import Account from './Account'; -vi.mock('#src/modules/container', () => ({ +vi.mock('@jwplayer/ott-common/src/modules/container', () => ({ getModule: (type: typeof AccountController) => { switch (type) { case AccountController: diff --git a/src/components/Account/Account.tsx b/web/src/components/Account/Account.tsx similarity index 91% rename from src/components/Account/Account.tsx rename to web/src/components/Account/Account.tsx index 5342090d0..12f112e31 100644 --- a/src/components/Account/Account.tsx +++ b/web/src/components/Account/Account.tsx @@ -4,28 +4,28 @@ import { useLocation, useNavigate } from 'react-router-dom'; import shallow from 'zustand/shallow'; import DOMPurify from 'dompurify'; import { useMutation } from 'react-query'; +import type { Consent } from '@jwplayer/ott-common/types/account'; +import { getModule } from '@jwplayer/ott-common/src/modules/container'; +import { useAccountStore } from '@jwplayer/ott-common/src/stores/AccountStore'; +import AccountController from '@jwplayer/ott-common/src/stores/AccountController'; +import { isTruthy, isTruthyCustomParamValue, logDev, testId } from '@jwplayer/ott-common/src/utils/common'; +import { formatConsents, formatConsentsFromValues, formatConsentsToRegisterFields, formatConsentValues } from '@jwplayer/ott-common/src/utils/collection'; +import { addQueryParam } from '@jwplayer/ott-common/src/utils/location'; -import styles from './Account.module.scss'; +import type { FormSectionContentArgs, FormSectionProps } from '../Form/FormSection'; +import Alert from '../Alert/Alert'; +import Visibility from '../../icons/Visibility'; +import VisibilityOff from '../../icons/VisibilityOff'; +import Button from '../Button/Button'; +import Form from '../Form/Form'; +import IconButton from '../IconButton/IconButton'; +import TextField from '../TextField/TextField'; +import Checkbox from '../Checkbox/Checkbox'; +import HelperText from '../HelperText/HelperText'; +import CustomRegisterField from '../CustomRegisterField/CustomRegisterField'; +import useToggle from '../../hooks/useToggle'; -import { isTruthyCustomParamValue, isTruthy, logDev, testId } from '#src/utils/common'; -import type { FormSectionContentArgs, FormSectionProps } from '#components/Form/FormSection'; -import type { Consent } from '#types/account'; -import Alert from '#components/Alert/Alert'; -import Visibility from '#src/icons/Visibility'; -import VisibilityOff from '#src/icons/VisibilityOff'; -import Button from '#components/Button/Button'; -import Form from '#components/Form/Form'; -import IconButton from '#components/IconButton/IconButton'; -import TextField from '#components/TextField/TextField'; -import Checkbox from '#components/Checkbox/Checkbox'; -import HelperText from '#components/HelperText/HelperText'; -import CustomRegisterField from '#components/CustomRegisterField/CustomRegisterField'; -import useToggle from '#src/hooks/useToggle'; -import { formatConsentsFromValues, formatConsents, formatConsentValues, formatConsentsToRegisterFields } from '#src/utils/collection'; -import { addQueryParam } from '#src/utils/location'; -import { useAccountStore } from '#src/stores/AccountStore'; -import AccountController from '#src/stores/AccountController'; -import { getModule } from '#src/modules/container'; +import styles from './Account.module.scss'; type Props = { panelClassName?: string; diff --git a/src/components/Account/__snapshots__/Account.test.tsx.snap b/web/src/components/Account/__snapshots__/Account.test.tsx.snap similarity index 100% rename from src/components/Account/__snapshots__/Account.test.tsx.snap rename to web/src/components/Account/__snapshots__/Account.test.tsx.snap diff --git a/src/components/Adyen/Adyen.module.scss b/web/src/components/Adyen/Adyen.module.scss similarity index 57% rename from src/components/Adyen/Adyen.module.scss rename to web/src/components/Adyen/Adyen.module.scss index 805f3fc11..fd99575ec 100644 --- a/src/components/Adyen/Adyen.module.scss +++ b/web/src/components/Adyen/Adyen.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .adyen { margin-bottom: 24px; diff --git a/src/components/Adyen/Adyen.tsx b/web/src/components/Adyen/Adyen.tsx similarity index 93% rename from src/components/Adyen/Adyen.tsx rename to web/src/components/Adyen/Adyen.tsx index d30230510..506fddc6e 100644 --- a/src/components/Adyen/Adyen.tsx +++ b/web/src/components/Adyen/Adyen.tsx @@ -4,10 +4,10 @@ import AdyenCheckout from '@adyen/adyen-web'; import type { CoreOptions } from '@adyen/adyen-web/dist/types/core/types'; import type { PaymentMethods } from '@adyen/adyen-web/dist/types/types'; -import styles from './Adyen.module.scss'; +import Button from '../Button/Button'; +import FormFeedback from '../FormFeedback/FormFeedback'; -import Button from '#components/Button/Button'; -import FormFeedback from '#components/FormFeedback/FormFeedback'; +import styles from './Adyen.module.scss'; import '@adyen/adyen-web/dist/adyen.css'; import './AdyenForm.scss'; diff --git a/src/components/Adyen/AdyenForm.scss b/web/src/components/Adyen/AdyenForm.scss similarity index 89% rename from src/components/Adyen/AdyenForm.scss rename to web/src/components/Adyen/AdyenForm.scss index bd5d1da2e..1be0cd971 100644 --- a/src/components/Adyen/AdyenForm.scss +++ b/web/src/components/Adyen/AdyenForm.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .adyen-checkout__card-input .adyen-checkout__card__form { .adyen-checkout__label__text { @@ -22,4 +22,4 @@ font-size: 16px; line-height: 18px; } -} \ No newline at end of file +} diff --git a/src/components/Alert/Alert.module.scss b/web/src/components/Alert/Alert.module.scss similarity index 79% rename from src/components/Alert/Alert.module.scss rename to web/src/components/Alert/Alert.module.scss index e957dd38a..b7802b505 100644 --- a/src/components/Alert/Alert.module.scss +++ b/web/src/components/Alert/Alert.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .title { margin-bottom: 24px; diff --git a/src/components/Alert/Alert.test.tsx b/web/src/components/Alert/Alert.test.tsx similarity index 100% rename from src/components/Alert/Alert.test.tsx rename to web/src/components/Alert/Alert.test.tsx diff --git a/src/components/Alert/Alert.tsx b/web/src/components/Alert/Alert.tsx similarity index 89% rename from src/components/Alert/Alert.tsx rename to web/src/components/Alert/Alert.tsx index b2c057962..00974094e 100644 --- a/src/components/Alert/Alert.tsx +++ b/web/src/components/Alert/Alert.tsx @@ -1,10 +1,10 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; -import styles from './Alert.module.scss'; +import Dialog from '../Dialog/Dialog'; +import Button from '../Button/Button'; -import Dialog from '#components/Dialog/Dialog'; -import Button from '#components/Button/Button'; +import styles from './Alert.module.scss'; type Props = { open: boolean; diff --git a/src/components/Alert/__snapshots__/Alert.test.tsx.snap b/web/src/components/Alert/__snapshots__/Alert.test.tsx.snap similarity index 100% rename from src/components/Alert/__snapshots__/Alert.test.tsx.snap rename to web/src/components/Alert/__snapshots__/Alert.test.tsx.snap diff --git a/src/components/Animation/Animation.tsx b/web/src/components/Animation/Animation.tsx similarity index 100% rename from src/components/Animation/Animation.tsx rename to web/src/components/Animation/Animation.tsx diff --git a/src/components/Animation/Fade/Fade.tsx b/web/src/components/Animation/Fade/Fade.tsx similarity index 93% rename from src/components/Animation/Fade/Fade.tsx rename to web/src/components/Animation/Fade/Fade.tsx index 6a5d22db7..c6e6b5bda 100644 --- a/src/components/Animation/Fade/Fade.tsx +++ b/web/src/components/Animation/Fade/Fade.tsx @@ -1,6 +1,6 @@ import React, { CSSProperties, ReactNode } from 'react'; -import Animation, { Status } from '#components/Animation/Animation'; +import Animation, { Status } from '../Animation'; type Props = { className?: string; diff --git a/src/components/Animation/Grow/Grow.tsx b/web/src/components/Animation/Grow/Grow.tsx similarity index 87% rename from src/components/Animation/Grow/Grow.tsx rename to web/src/components/Animation/Grow/Grow.tsx index 793c1c87b..042680713 100644 --- a/src/components/Animation/Grow/Grow.tsx +++ b/web/src/components/Animation/Grow/Grow.tsx @@ -1,6 +1,6 @@ -import React, { ReactNode, CSSProperties } from 'react'; +import React, { CSSProperties, ReactNode } from 'react'; -import Animation, { Status } from '#components/Animation/Animation'; +import Animation, { Status } from '../Animation'; type Props = { open?: boolean; diff --git a/src/components/Animation/Slide/Slide.tsx b/web/src/components/Animation/Slide/Slide.tsx similarity index 91% rename from src/components/Animation/Slide/Slide.tsx rename to web/src/components/Animation/Slide/Slide.tsx index 9c6fc8622..f7aaf79f1 100644 --- a/src/components/Animation/Slide/Slide.tsx +++ b/web/src/components/Animation/Slide/Slide.tsx @@ -1,6 +1,6 @@ -import React, { ReactNode, CSSProperties } from 'react'; +import React, { CSSProperties, ReactNode } from 'react'; -import Animation, { Status } from '#components/Animation/Animation'; +import Animation, { Status } from '../Animation'; type Props = { open?: boolean; diff --git a/src/components/BackButton/BackButton.module.scss b/web/src/components/BackButton/BackButton.module.scss similarity index 64% rename from src/components/BackButton/BackButton.module.scss rename to web/src/components/BackButton/BackButton.module.scss index 041025693..24dadb017 100644 --- a/src/components/BackButton/BackButton.module.scss +++ b/web/src/components/BackButton/BackButton.module.scss @@ -1,5 +1,5 @@ -@use '../../styles/variables'; -@use '../../styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .backButton { position: absolute; diff --git a/src/components/BackButton/BackButton.tsx b/web/src/components/BackButton/BackButton.tsx similarity index 100% rename from src/components/BackButton/BackButton.tsx rename to web/src/components/BackButton/BackButton.tsx diff --git a/src/components/Button/Button.module.scss b/web/src/components/Button/Button.module.scss similarity index 96% rename from src/components/Button/Button.module.scss rename to web/src/components/Button/Button.module.scss index db3068634..d3e818249 100644 --- a/src/components/Button/Button.module.scss +++ b/web/src/components/Button/Button.module.scss @@ -1,6 +1,6 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; -@use 'src/styles/mixins/responsive'; +@use '~/styles/variables'; +@use '~/styles/theme'; +@use '~/styles/mixins/responsive'; $small-button-height: 28px; $medium-button-height: 36px; diff --git a/src/components/Button/Button.test.tsx b/web/src/components/Button/Button.test.tsx similarity index 100% rename from src/components/Button/Button.test.tsx rename to web/src/components/Button/Button.test.tsx diff --git a/src/components/Button/Button.tsx b/web/src/components/Button/Button.tsx similarity index 97% rename from src/components/Button/Button.tsx rename to web/src/components/Button/Button.tsx index a199d3af7..25fac6a36 100644 --- a/src/components/Button/Button.tsx +++ b/web/src/components/Button/Button.tsx @@ -2,9 +2,9 @@ import React, { MouseEventHandler } from 'react'; import classNames from 'classnames'; import { NavLink } from 'react-router-dom'; -import styles from './Button.module.scss'; +import Spinner from '../Spinner/Spinner'; -import Spinner from '#components/Spinner/Spinner'; +import styles from './Button.module.scss'; type Color = 'default' | 'primary' | 'delete'; diff --git a/src/components/Button/__snapshots__/Button.test.tsx.snap b/web/src/components/Button/__snapshots__/Button.test.tsx.snap similarity index 100% rename from src/components/Button/__snapshots__/Button.test.tsx.snap rename to web/src/components/Button/__snapshots__/Button.test.tsx.snap diff --git a/src/components/CancelSubscriptionForm/CancelSubscriptionForm.module.scss b/web/src/components/CancelSubscriptionForm/CancelSubscriptionForm.module.scss similarity index 75% rename from src/components/CancelSubscriptionForm/CancelSubscriptionForm.module.scss rename to web/src/components/CancelSubscriptionForm/CancelSubscriptionForm.module.scss index a5e41db7f..e2bfaed15 100644 --- a/src/components/CancelSubscriptionForm/CancelSubscriptionForm.module.scss +++ b/web/src/components/CancelSubscriptionForm/CancelSubscriptionForm.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .title { margin-bottom: 8px; diff --git a/src/components/CancelSubscriptionForm/CancelSubscriptionForm.test.tsx b/web/src/components/CancelSubscriptionForm/CancelSubscriptionForm.test.tsx similarity index 100% rename from src/components/CancelSubscriptionForm/CancelSubscriptionForm.test.tsx rename to web/src/components/CancelSubscriptionForm/CancelSubscriptionForm.test.tsx diff --git a/src/components/CancelSubscriptionForm/CancelSubscriptionForm.tsx b/web/src/components/CancelSubscriptionForm/CancelSubscriptionForm.tsx similarity index 90% rename from src/components/CancelSubscriptionForm/CancelSubscriptionForm.tsx rename to web/src/components/CancelSubscriptionForm/CancelSubscriptionForm.tsx index 1b503128e..aae94d0a2 100644 --- a/src/components/CancelSubscriptionForm/CancelSubscriptionForm.tsx +++ b/web/src/components/CancelSubscriptionForm/CancelSubscriptionForm.tsx @@ -1,10 +1,10 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; -import styles from './CancelSubscriptionForm.module.scss'; +import Button from '../Button/Button'; +import FormFeedback from '../FormFeedback/FormFeedback'; -import Button from '#components/Button/Button'; -import FormFeedback from '#components/FormFeedback/FormFeedback'; +import styles from './CancelSubscriptionForm.module.scss'; type Props = { onConfirm: () => void; diff --git a/src/components/CancelSubscriptionForm/__snapshots__/CancelSubscriptionForm.test.tsx.snap b/web/src/components/CancelSubscriptionForm/__snapshots__/CancelSubscriptionForm.test.tsx.snap similarity index 100% rename from src/components/CancelSubscriptionForm/__snapshots__/CancelSubscriptionForm.test.tsx.snap rename to web/src/components/CancelSubscriptionForm/__snapshots__/CancelSubscriptionForm.test.tsx.snap diff --git a/src/components/Card/Card.module.scss b/web/src/components/Card/Card.module.scss similarity index 98% rename from src/components/Card/Card.module.scss rename to web/src/components/Card/Card.module.scss index afdd7fcd1..da48941d4 100644 --- a/src/components/Card/Card.module.scss +++ b/web/src/components/Card/Card.module.scss @@ -1,7 +1,7 @@ @use 'sass:math'; -@use 'src/styles/mixins/responsive'; -@use 'src/styles/theme'; -@use 'src/styles/variables'; +@use '~/styles/mixins/responsive'; +@use '~/styles/theme'; +@use '~/styles/variables'; .card { display: flex; diff --git a/src/components/Card/Card.test.tsx b/web/src/components/Card/Card.test.tsx similarity index 92% rename from src/components/Card/Card.test.tsx rename to web/src/components/Card/Card.test.tsx index ea646de7c..af2b58f28 100644 --- a/src/components/Card/Card.test.tsx +++ b/web/src/components/Card/Card.test.tsx @@ -1,10 +1,10 @@ import * as React from 'react'; import { fireEvent } from '@testing-library/react'; +import type { PlaylistItem } from '@jwplayer/ott-common/types/playlist'; -import Card from './Card'; +import { renderWithRouter } from '../../../test/testUtils'; -import type { PlaylistItem } from '#types/playlist'; -import { renderWithRouter } from '#test/testUtils'; +import Card from './Card'; const item = { title: 'aa', duration: 120 } as PlaylistItem; const itemWithImage = { title: 'This is a movie', duration: 120, cardImage: 'http://movie.jpg' } as PlaylistItem; diff --git a/src/components/Card/Card.tsx b/web/src/components/Card/Card.tsx similarity index 91% rename from src/components/Card/Card.tsx rename to web/src/components/Card/Card.tsx index 621112e2f..7d56d1f2e 100644 --- a/src/components/Card/Card.tsx +++ b/web/src/components/Card/Card.tsx @@ -2,16 +2,16 @@ import React, { memo, useState } from 'react'; import classNames from 'classnames'; import { useTranslation } from 'react-i18next'; import { Link } from 'react-router-dom'; +import type { PlaylistItem } from '@jwplayer/ott-common/types/playlist'; +import { formatDurationTag, formatLocalizedDateTime, formatSeriesMetaString } from '@jwplayer/ott-common/src/utils/formatting'; +import { isLiveChannel, isSeries } from '@jwplayer/ott-common/src/utils/media'; +import { MediaStatus } from '@jwplayer/ott-common/src/utils/liveEvent'; -import styles from './Card.module.scss'; +import Lock from '../../icons/Lock'; +import Image from '../Image/Image'; +import Today from '../../icons/Today'; -import { formatDurationTag, formatLocalizedDateTime, formatSeriesMetaString } from '#src/utils/formatting'; -import Lock from '#src/icons/Lock'; -import Image from '#components/Image/Image'; -import Today from '#src/icons/Today'; -import type { PlaylistItem } from '#types/playlist'; -import { isLiveChannel, isSeries } from '#src/utils/media'; -import { MediaStatus } from '#src/utils/liveEvent'; +import styles from './Card.module.scss'; export const cardAspectRatios = ['2:1', '16:9', '5:3', '4:3', '1:1', '9:13', '2:3', '9:16'] as const; diff --git a/src/components/Card/__snapshots__/Card.test.tsx.snap b/web/src/components/Card/__snapshots__/Card.test.tsx.snap similarity index 100% rename from src/components/Card/__snapshots__/Card.test.tsx.snap rename to web/src/components/Card/__snapshots__/Card.test.tsx.snap diff --git a/src/components/CardGrid/CardGrid.module.scss b/web/src/components/CardGrid/CardGrid.module.scss similarity index 100% rename from src/components/CardGrid/CardGrid.module.scss rename to web/src/components/CardGrid/CardGrid.module.scss diff --git a/src/components/CardGrid/CardGrid.test.tsx b/web/src/components/CardGrid/CardGrid.test.tsx similarity index 72% rename from src/components/CardGrid/CardGrid.test.tsx rename to web/src/components/CardGrid/CardGrid.test.tsx index 0e3f06a16..433d18628 100644 --- a/src/components/CardGrid/CardGrid.test.tsx +++ b/web/src/components/CardGrid/CardGrid.test.tsx @@ -1,10 +1,10 @@ import * as React from 'react'; +import type { Playlist, PlaylistItem } from '@jwplayer/ott-common/types/playlist'; -import CardGrid from './CardGrid'; +import playlistFixture from '../../../test/fixtures/playlist.json'; +import { renderWithRouter } from '../../../test/testUtils'; -import playlistFixture from '#test/fixtures/playlist.json'; -import { renderWithRouter } from '#test/testUtils'; -import type { Playlist, PlaylistItem } from '#types/playlist'; +import CardGrid from './CardGrid'; describe('', () => { it('renders and matches snapshot', () => { diff --git a/src/components/CardGrid/CardGrid.tsx b/web/src/components/CardGrid/CardGrid.tsx similarity index 85% rename from src/components/CardGrid/CardGrid.tsx rename to web/src/components/CardGrid/CardGrid.tsx index 643c5a151..11c92e165 100644 --- a/src/components/CardGrid/CardGrid.tsx +++ b/web/src/components/CardGrid/CardGrid.tsx @@ -1,16 +1,16 @@ import React, { useEffect, useState } from 'react'; import classNames from 'classnames'; import InfiniteScroll from 'react-infinite-scroller'; +import type { Playlist, PlaylistItem } from '@jwplayer/ott-common/types/playlist'; +import type { AccessModel } from '@jwplayer/ott-common/types/Config'; +import { isLocked } from '@jwplayer/ott-common/src/utils/entitlements'; +import { parseAspectRatio, parseTilesDelta } from '@jwplayer/ott-common/src/utils/collection'; -import styles from './CardGrid.module.scss'; +import useBreakpoint, { Breakpoint, Breakpoints } from '../../hooks/useBreakpoint'; +import Card from '../Card/Card'; +import InfiniteScrollLoader from '../InfiniteScrollLoader/InfiniteScrollLoader'; -import useBreakpoint, { Breakpoint, Breakpoints } from '#src/hooks/useBreakpoint'; -import { isLocked } from '#src/utils/entitlements'; -import Card from '#components/Card/Card'; -import type { AccessModel } from '#types/Config'; -import type { Playlist, PlaylistItem } from '#types/playlist'; -import { parseAspectRatio, parseTilesDelta } from '#src/utils/collection'; -import InfiniteScrollLoader from '#components/InfiniteScrollLoader/InfiniteScrollLoader'; +import styles from './CardGrid.module.scss'; const INITIAL_ROW_COUNT = 6; const LOAD_ROWS_COUNT = 4; diff --git a/src/components/CardGrid/__snapshots__/CardGrid.test.tsx.snap b/web/src/components/CardGrid/__snapshots__/CardGrid.test.tsx.snap similarity index 100% rename from src/components/CardGrid/__snapshots__/CardGrid.test.tsx.snap rename to web/src/components/CardGrid/__snapshots__/CardGrid.test.tsx.snap diff --git a/src/components/Checkbox/Checkbox.module.scss b/web/src/components/Checkbox/Checkbox.module.scss similarity index 97% rename from src/components/Checkbox/Checkbox.module.scss rename to web/src/components/Checkbox/Checkbox.module.scss index a8c346ae7..9961de639 100644 --- a/src/components/Checkbox/Checkbox.module.scss +++ b/web/src/components/Checkbox/Checkbox.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .checkbox { display: inline-block; diff --git a/src/components/Checkbox/Checkbox.test.tsx b/web/src/components/Checkbox/Checkbox.test.tsx similarity index 100% rename from src/components/Checkbox/Checkbox.test.tsx rename to web/src/components/Checkbox/Checkbox.test.tsx diff --git a/src/components/Checkbox/Checkbox.tsx b/web/src/components/Checkbox/Checkbox.tsx similarity index 92% rename from src/components/Checkbox/Checkbox.tsx rename to web/src/components/Checkbox/Checkbox.tsx index d8a5ca933..6f73f52b2 100644 --- a/src/components/Checkbox/Checkbox.tsx +++ b/web/src/components/Checkbox/Checkbox.tsx @@ -2,10 +2,10 @@ import React, { type ReactNode } from 'react'; import classNames from 'classnames'; import { useTranslation } from 'react-i18next'; -import styles from './Checkbox.module.scss'; +import HelperText from '../HelperText/HelperText'; +import useOpaqueId from '../../hooks/useOpaqueId'; -import HelperText from '#components/HelperText/HelperText'; -import useOpaqueId from '#src/hooks/useOpaqueId'; +import styles from './Checkbox.module.scss'; type Props = { label?: ReactNode; diff --git a/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap b/web/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap similarity index 100% rename from src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap rename to web/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap diff --git a/src/components/CheckoutForm/CheckoutForm.module.scss b/web/src/components/CheckoutForm/CheckoutForm.module.scss similarity index 98% rename from src/components/CheckoutForm/CheckoutForm.module.scss rename to web/src/components/CheckoutForm/CheckoutForm.module.scss index 12a478e1c..33b398cbe 100644 --- a/src/components/CheckoutForm/CheckoutForm.module.scss +++ b/web/src/components/CheckoutForm/CheckoutForm.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .backButton { position: absolute; diff --git a/src/components/CheckoutForm/CheckoutForm.test.tsx b/web/src/components/CheckoutForm/CheckoutForm.test.tsx similarity index 81% rename from src/components/CheckoutForm/CheckoutForm.test.tsx rename to web/src/components/CheckoutForm/CheckoutForm.test.tsx index 6b49ad592..8200a7fb7 100644 --- a/src/components/CheckoutForm/CheckoutForm.test.tsx +++ b/web/src/components/CheckoutForm/CheckoutForm.test.tsx @@ -1,11 +1,11 @@ import React from 'react'; import { render } from '@testing-library/react'; +import type { Offer, Order } from '@jwplayer/ott-common/types/checkout'; -import CheckoutForm from './CheckoutForm'; +import offer from '../../../test/fixtures/monthlyOffer.json'; +import order from '../../../test/fixtures/order.json'; -import offer from '#test/fixtures/monthlyOffer.json'; -import order from '#test/fixtures/order.json'; -import type { Offer, Order } from '#types/checkout'; +import CheckoutForm from './CheckoutForm'; describe('', () => { test('renders and matches snapshot', () => { diff --git a/src/components/CheckoutForm/CheckoutForm.tsx b/web/src/components/CheckoutForm/CheckoutForm.tsx similarity index 92% rename from src/components/CheckoutForm/CheckoutForm.tsx rename to web/src/components/CheckoutForm/CheckoutForm.tsx index 11c8d1a1a..103ce9723 100644 --- a/src/components/CheckoutForm/CheckoutForm.tsx +++ b/web/src/components/CheckoutForm/CheckoutForm.tsx @@ -1,20 +1,20 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; import classNames from 'classnames'; +import type { OfferType } from '@jwplayer/ott-common/types/account'; +import type { Offer, Order, PaymentMethod } from '@jwplayer/ott-common/types/checkout'; +import { formatPrice } from '@jwplayer/ott-common/src/utils/formatting'; -import styles from './CheckoutForm.module.scss'; +import Button from '../Button/Button'; +import IconButton from '../IconButton/IconButton'; +import FormFeedback from '../FormFeedback/FormFeedback'; +import Close from '../../icons/Close'; +import DialogBackButton from '../DialogBackButton/DialogBackButton'; +import PayPal from '../../icons/PayPal'; +import CreditCard from '../../icons/CreditCard'; +import LoadingOverlay from '../LoadingOverlay/LoadingOverlay'; -import Button from '#components/Button/Button'; -import type { Offer, Order, PaymentMethod } from '#types/checkout'; -import IconButton from '#components/IconButton/IconButton'; -import FormFeedback from '#components/FormFeedback/FormFeedback'; -import { formatPrice } from '#src/utils/formatting'; -import Close from '#src/icons/Close'; -import DialogBackButton from '#components/DialogBackButton/DialogBackButton'; -import PayPal from '#src/icons/PayPal'; -import CreditCard from '#src/icons/CreditCard'; -import LoadingOverlay from '#components/LoadingOverlay/LoadingOverlay'; -import type { OfferType } from '#types/account'; +import styles from './CheckoutForm.module.scss'; type Props = { paymentMethodId?: number; diff --git a/src/components/CheckoutForm/__snapshots__/CheckoutForm.test.tsx.snap b/web/src/components/CheckoutForm/__snapshots__/CheckoutForm.test.tsx.snap similarity index 100% rename from src/components/CheckoutForm/__snapshots__/CheckoutForm.test.tsx.snap rename to web/src/components/CheckoutForm/__snapshots__/CheckoutForm.test.tsx.snap diff --git a/src/components/ChooseOfferForm/ChooseOfferForm.module.scss b/web/src/components/ChooseOfferForm/ChooseOfferForm.module.scss similarity index 95% rename from src/components/ChooseOfferForm/ChooseOfferForm.module.scss rename to web/src/components/ChooseOfferForm/ChooseOfferForm.module.scss index 15266b3fc..b85b59fb2 100644 --- a/src/components/ChooseOfferForm/ChooseOfferForm.module.scss +++ b/web/src/components/ChooseOfferForm/ChooseOfferForm.module.scss @@ -1,6 +1,6 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; -@use 'src/styles/mixins/responsive'; +@use '~/styles/variables'; +@use '~/styles/theme'; +@use '~/styles/mixins/responsive'; .title { margin-bottom: 8px; diff --git a/src/components/ChooseOfferForm/ChooseOfferForm.test.tsx b/web/src/components/ChooseOfferForm/ChooseOfferForm.test.tsx similarity index 92% rename from src/components/ChooseOfferForm/ChooseOfferForm.test.tsx rename to web/src/components/ChooseOfferForm/ChooseOfferForm.test.tsx index ce7fbc471..a27285e5a 100644 --- a/src/components/ChooseOfferForm/ChooseOfferForm.test.tsx +++ b/web/src/components/ChooseOfferForm/ChooseOfferForm.test.tsx @@ -1,12 +1,12 @@ import React from 'react'; import { fireEvent, render } from '@testing-library/react'; +import type { Offer } from '@jwplayer/ott-common/types/checkout'; -import ChooseOfferForm from './ChooseOfferForm'; +import monthlyOffer from '../../../test/fixtures/monthlyOffer.json'; +import yearlyOffer from '../../../test/fixtures/yearlyOffer.json'; +import tvodOffer from '../../../test/fixtures/tvodOffer.json'; -import monthlyOffer from '#test/fixtures/monthlyOffer.json'; -import yearlyOffer from '#test/fixtures/yearlyOffer.json'; -import tvodOffer from '#test/fixtures/tvodOffer.json'; -import type { Offer } from '#types/checkout'; +import ChooseOfferForm from './ChooseOfferForm'; const svodOffers = [monthlyOffer, yearlyOffer] as Offer[]; const tvodOffers = [tvodOffer] as Offer[]; diff --git a/src/components/ChooseOfferForm/ChooseOfferForm.tsx b/web/src/components/ChooseOfferForm/ChooseOfferForm.tsx similarity index 88% rename from src/components/ChooseOfferForm/ChooseOfferForm.tsx rename to web/src/components/ChooseOfferForm/ChooseOfferForm.tsx index 8812257b4..d417e0d08 100644 --- a/src/components/ChooseOfferForm/ChooseOfferForm.tsx +++ b/web/src/components/ChooseOfferForm/ChooseOfferForm.tsx @@ -1,20 +1,20 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; import classNames from 'classnames'; +import type { ChooseOfferFormData, OfferType } from '@jwplayer/ott-common/types/account'; +import type { FormErrors } from '@jwplayer/ott-common/types/form'; +import type { Offer } from '@jwplayer/ott-common/types/checkout'; +import { useConfigStore } from '@jwplayer/ott-common/src/stores/ConfigStore'; +import { getOfferPrice, isSVODOffer } from '@jwplayer/ott-common/src/utils/subscription'; +import { testId } from '@jwplayer/ott-common/src/utils/common'; -import styles from './ChooseOfferForm.module.scss'; +import Button from '../Button/Button'; +import FormFeedback from '../FormFeedback/FormFeedback'; +import DialogBackButton from '../DialogBackButton/DialogBackButton'; +import LoadingOverlay from '../LoadingOverlay/LoadingOverlay'; +import CheckCircle from '../../icons/CheckCircle'; -import Button from '#components/Button/Button'; -import FormFeedback from '#components/FormFeedback/FormFeedback'; -import DialogBackButton from '#components/DialogBackButton/DialogBackButton'; -import LoadingOverlay from '#components/LoadingOverlay/LoadingOverlay'; -import CheckCircle from '#src/icons/CheckCircle'; -import type { Offer } from '#types/checkout'; -import { getOfferPrice, isSVODOffer } from '#src/utils/subscription'; -import type { FormErrors } from '#types/form'; -import { testId } from '#src/utils/common'; -import type { ChooseOfferFormData, OfferType } from '#types/account'; -import { useConfigStore } from '#src/stores/ConfigStore'; +import styles from './ChooseOfferForm.module.scss'; type Props = { values: ChooseOfferFormData; diff --git a/src/components/ChooseOfferForm/__snapshots__/ChooseOfferForm.test.tsx.snap b/web/src/components/ChooseOfferForm/__snapshots__/ChooseOfferForm.test.tsx.snap similarity index 100% rename from src/components/ChooseOfferForm/__snapshots__/ChooseOfferForm.test.tsx.snap rename to web/src/components/ChooseOfferForm/__snapshots__/ChooseOfferForm.test.tsx.snap diff --git a/src/components/CollapsibleText/CollapsibleText.module.scss b/web/src/components/CollapsibleText/CollapsibleText.module.scss similarity index 93% rename from src/components/CollapsibleText/CollapsibleText.module.scss rename to web/src/components/CollapsibleText/CollapsibleText.module.scss index 788aac76b..2243c8ec4 100644 --- a/src/components/CollapsibleText/CollapsibleText.module.scss +++ b/web/src/components/CollapsibleText/CollapsibleText.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .collapsibleText { position: relative; diff --git a/src/components/CollapsibleText/CollapsibleText.test.tsx b/web/src/components/CollapsibleText/CollapsibleText.test.tsx similarity index 100% rename from src/components/CollapsibleText/CollapsibleText.test.tsx rename to web/src/components/CollapsibleText/CollapsibleText.test.tsx diff --git a/src/components/CollapsibleText/CollapsibleText.tsx b/web/src/components/CollapsibleText/CollapsibleText.tsx similarity index 90% rename from src/components/CollapsibleText/CollapsibleText.tsx rename to web/src/components/CollapsibleText/CollapsibleText.tsx index df514584c..63b5da059 100644 --- a/src/components/CollapsibleText/CollapsibleText.tsx +++ b/web/src/components/CollapsibleText/CollapsibleText.tsx @@ -1,11 +1,11 @@ import classNames from 'classnames'; import React, { useEffect, useRef, useState } from 'react'; -import styles from './CollapsibleText.module.scss'; +import IconButton from '../IconButton/IconButton'; +import ChevronRight from '../../icons/ChevronRight'; +import useBreakpoint from '../../hooks/useBreakpoint'; -import IconButton from '#components/IconButton/IconButton'; -import ChevronRight from '#src/icons/ChevronRight'; -import useBreakpoint from '#src/hooks/useBreakpoint'; +import styles from './CollapsibleText.module.scss'; type Props = { text: string; diff --git a/src/components/CollapsibleText/__snapshots__/CollapsibleText.test.tsx.snap b/web/src/components/CollapsibleText/__snapshots__/CollapsibleText.test.tsx.snap similarity index 100% rename from src/components/CollapsibleText/__snapshots__/CollapsibleText.test.tsx.snap rename to web/src/components/CollapsibleText/__snapshots__/CollapsibleText.test.tsx.snap diff --git a/src/components/ConfirmationDialog/ConfirmationDialog.module.scss b/web/src/components/ConfirmationDialog/ConfirmationDialog.module.scss similarity index 79% rename from src/components/ConfirmationDialog/ConfirmationDialog.module.scss rename to web/src/components/ConfirmationDialog/ConfirmationDialog.module.scss index e957dd38a..b7802b505 100644 --- a/src/components/ConfirmationDialog/ConfirmationDialog.module.scss +++ b/web/src/components/ConfirmationDialog/ConfirmationDialog.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .title { margin-bottom: 24px; diff --git a/src/components/ConfirmationDialog/ConfirmationDialog.test.tsx b/web/src/components/ConfirmationDialog/ConfirmationDialog.test.tsx similarity index 100% rename from src/components/ConfirmationDialog/ConfirmationDialog.test.tsx rename to web/src/components/ConfirmationDialog/ConfirmationDialog.test.tsx diff --git a/src/components/ConfirmationDialog/ConfirmationDialog.tsx b/web/src/components/ConfirmationDialog/ConfirmationDialog.tsx similarity index 91% rename from src/components/ConfirmationDialog/ConfirmationDialog.tsx rename to web/src/components/ConfirmationDialog/ConfirmationDialog.tsx index b8f803c4c..2e46be8b4 100644 --- a/src/components/ConfirmationDialog/ConfirmationDialog.tsx +++ b/web/src/components/ConfirmationDialog/ConfirmationDialog.tsx @@ -1,10 +1,10 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; -import styles from './ConfirmationDialog.module.scss'; +import Dialog from '../Dialog/Dialog'; +import Button from '../Button/Button'; -import Dialog from '#components/Dialog/Dialog'; -import Button from '#components/Button/Button'; +import styles from './ConfirmationDialog.module.scss'; type Props = { open: boolean; diff --git a/src/components/ConfirmationDialog/__snapshots__/ConfirmationDialog.test.tsx.snap b/web/src/components/ConfirmationDialog/__snapshots__/ConfirmationDialog.test.tsx.snap similarity index 100% rename from src/components/ConfirmationDialog/__snapshots__/ConfirmationDialog.test.tsx.snap rename to web/src/components/ConfirmationDialog/__snapshots__/ConfirmationDialog.test.tsx.snap diff --git a/src/components/ConfirmationForm/ConfirmationForm.module.scss b/web/src/components/ConfirmationForm/ConfirmationForm.module.scss similarity index 88% rename from src/components/ConfirmationForm/ConfirmationForm.module.scss rename to web/src/components/ConfirmationForm/ConfirmationForm.module.scss index c3dff0d14..2a0d6fa9e 100644 --- a/src/components/ConfirmationForm/ConfirmationForm.module.scss +++ b/web/src/components/ConfirmationForm/ConfirmationForm.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .title { margin: 24px 0; font-weight: var(--body-font-weight-bold); diff --git a/src/components/ConfirmationForm/ConfirmationForm.test.tsx b/web/src/components/ConfirmationForm/ConfirmationForm.test.tsx similarity index 83% rename from src/components/ConfirmationForm/ConfirmationForm.test.tsx rename to web/src/components/ConfirmationForm/ConfirmationForm.test.tsx index dcce3faf2..80d5b94d3 100644 --- a/src/components/ConfirmationForm/ConfirmationForm.test.tsx +++ b/web/src/components/ConfirmationForm/ConfirmationForm.test.tsx @@ -1,8 +1,8 @@ import React from 'react'; -import ConfirmationForm from './ConfirmationForm'; +import { renderWithRouter } from '../../../test/testUtils'; -import { renderWithRouter } from '#test/testUtils'; +import ConfirmationForm from './ConfirmationForm'; describe('', () => { test('renders and matches snapshot', () => { diff --git a/src/components/ConfirmationForm/ConfirmationForm.tsx b/web/src/components/ConfirmationForm/ConfirmationForm.tsx similarity index 90% rename from src/components/ConfirmationForm/ConfirmationForm.tsx rename to web/src/components/ConfirmationForm/ConfirmationForm.tsx index be126c4aa..4c4c56b1f 100644 --- a/src/components/ConfirmationForm/ConfirmationForm.tsx +++ b/web/src/components/ConfirmationForm/ConfirmationForm.tsx @@ -1,11 +1,11 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; import { Link, useLocation } from 'react-router-dom'; +import { addQueryParam } from '@jwplayer/ott-common/src/utils/location'; -import styles from './ConfirmationForm.module.scss'; +import Button from '../Button/Button'; -import Button from '#components/Button/Button'; -import { addQueryParam } from '#src/utils/location'; +import styles from './ConfirmationForm.module.scss'; type Props = { email?: string; diff --git a/src/components/ConfirmationForm/__snapshots__/ConfirmationForm.test.tsx.snap b/web/src/components/ConfirmationForm/__snapshots__/ConfirmationForm.test.tsx.snap similarity index 100% rename from src/components/ConfirmationForm/__snapshots__/ConfirmationForm.test.tsx.snap rename to web/src/components/ConfirmationForm/__snapshots__/ConfirmationForm.test.tsx.snap diff --git a/src/components/CreditCardCVCField/CreditCardCVCField.test.tsx b/web/src/components/CreditCardCVCField/CreditCardCVCField.test.tsx similarity index 100% rename from src/components/CreditCardCVCField/CreditCardCVCField.test.tsx rename to web/src/components/CreditCardCVCField/CreditCardCVCField.test.tsx diff --git a/src/components/CreditCardCVCField/CreditCardCVCField.tsx b/web/src/components/CreditCardCVCField/CreditCardCVCField.tsx similarity index 100% rename from src/components/CreditCardCVCField/CreditCardCVCField.tsx rename to web/src/components/CreditCardCVCField/CreditCardCVCField.tsx diff --git a/src/components/CreditCardCVCField/__snapshots__/CreditCardCVCField.test.tsx.snap b/web/src/components/CreditCardCVCField/__snapshots__/CreditCardCVCField.test.tsx.snap similarity index 100% rename from src/components/CreditCardCVCField/__snapshots__/CreditCardCVCField.test.tsx.snap rename to web/src/components/CreditCardCVCField/__snapshots__/CreditCardCVCField.test.tsx.snap diff --git a/src/components/CreditCardExpiryField/CreditCardExpiryField.test.tsx b/web/src/components/CreditCardExpiryField/CreditCardExpiryField.test.tsx similarity index 100% rename from src/components/CreditCardExpiryField/CreditCardExpiryField.test.tsx rename to web/src/components/CreditCardExpiryField/CreditCardExpiryField.test.tsx diff --git a/src/components/CreditCardExpiryField/CreditCardExpiryField.tsx b/web/src/components/CreditCardExpiryField/CreditCardExpiryField.tsx similarity index 100% rename from src/components/CreditCardExpiryField/CreditCardExpiryField.tsx rename to web/src/components/CreditCardExpiryField/CreditCardExpiryField.tsx diff --git a/src/components/CreditCardExpiryField/__snapshots__/CreditCardExpiryField.test.tsx.snap b/web/src/components/CreditCardExpiryField/__snapshots__/CreditCardExpiryField.test.tsx.snap similarity index 100% rename from src/components/CreditCardExpiryField/__snapshots__/CreditCardExpiryField.test.tsx.snap rename to web/src/components/CreditCardExpiryField/__snapshots__/CreditCardExpiryField.test.tsx.snap diff --git a/src/components/CreditCardNumberField/CreditCardNumberField.module.scss b/web/src/components/CreditCardNumberField/CreditCardNumberField.module.scss similarity index 100% rename from src/components/CreditCardNumberField/CreditCardNumberField.module.scss rename to web/src/components/CreditCardNumberField/CreditCardNumberField.module.scss diff --git a/src/components/CreditCardNumberField/CreditCardNumberField.test.tsx b/web/src/components/CreditCardNumberField/CreditCardNumberField.test.tsx similarity index 100% rename from src/components/CreditCardNumberField/CreditCardNumberField.test.tsx rename to web/src/components/CreditCardNumberField/CreditCardNumberField.test.tsx diff --git a/src/components/CreditCardNumberField/CreditCardNumberField.tsx b/web/src/components/CreditCardNumberField/CreditCardNumberField.tsx similarity index 100% rename from src/components/CreditCardNumberField/CreditCardNumberField.tsx rename to web/src/components/CreditCardNumberField/CreditCardNumberField.tsx diff --git a/src/components/CreditCardNumberField/__snapshots__/CreditCardNumberField.test.tsx.snap b/web/src/components/CreditCardNumberField/__snapshots__/CreditCardNumberField.test.tsx.snap similarity index 100% rename from src/components/CreditCardNumberField/__snapshots__/CreditCardNumberField.test.tsx.snap rename to web/src/components/CreditCardNumberField/__snapshots__/CreditCardNumberField.test.tsx.snap diff --git a/src/components/CustomRegisterField/CustomRegisterField.test.tsx b/web/src/components/CustomRegisterField/CustomRegisterField.test.tsx similarity index 97% rename from src/components/CustomRegisterField/CustomRegisterField.test.tsx rename to web/src/components/CustomRegisterField/CustomRegisterField.test.tsx index 65bc78fc5..6e878a496 100644 --- a/src/components/CustomRegisterField/CustomRegisterField.test.tsx +++ b/web/src/components/CustomRegisterField/CustomRegisterField.test.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { render } from '@testing-library/react'; -import { CustomRegisterField } from './CustomRegisterField'; +import CustomRegisterField from './CustomRegisterField'; describe('', () => { test('renders and matches snapshot ', () => { diff --git a/src/components/CustomRegisterField/CustomRegisterField.tsx b/web/src/components/CustomRegisterField/CustomRegisterField.tsx similarity index 73% rename from src/components/CustomRegisterField/CustomRegisterField.tsx rename to web/src/components/CustomRegisterField/CustomRegisterField.tsx index d9e27461a..51a4f94c0 100644 --- a/src/components/CustomRegisterField/CustomRegisterField.tsx +++ b/web/src/components/CustomRegisterField/CustomRegisterField.tsx @@ -1,16 +1,16 @@ -import { type FC, type ChangeEventHandler, type ReactNode, useMemo } from 'react'; +import { type ChangeEventHandler, type FC, type ReactNode, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import type { RegisterFieldOptions } from '@inplayer-org/inplayer.js'; +import type { CustomRegisterFieldVariant } from '@jwplayer/ott-common/types/account'; +import { isTruthyCustomParamValue, testId } from '@jwplayer/ott-common/src/utils/common'; -import type { CustomRegisterFieldVariant } from '#types/account'; -import { isTruthyCustomParamValue, testId } from '#src/utils/common'; -import Checkbox from '#components/Checkbox/Checkbox'; -import TextField from '#components/TextField/TextField'; -import Radio from '#components/Radio/Radio'; -import Dropdown from '#components/Dropdown/Dropdown'; -import DateField from '#components/DateField/DateField'; +import Checkbox from '../Checkbox/Checkbox'; +import TextField from '../TextField/TextField'; +import Radio from '../Radio/Radio'; +import Dropdown from '../Dropdown/Dropdown'; +import DateField from '../DateField/DateField'; -type Props = { +export type CustomRegisterFieldCommonProps = { type?: CustomRegisterFieldVariant; name: string; value: string | boolean; @@ -25,9 +25,7 @@ type Props = { options: RegisterFieldOptions; }>; -export type CustomRegisterFieldCommonProps = Props; - -export const CustomRegisterField: FC = ({ type, value = '', options, ...props }) => { +const CustomRegisterField: FC = ({ type, value = '', options, ...props }) => { const { t, i18n } = useTranslation(); const optionsList = useMemo(() => { diff --git a/src/components/CustomRegisterField/__snapshots__/CustomRegisterField.test.tsx.snap b/web/src/components/CustomRegisterField/__snapshots__/CustomRegisterField.test.tsx.snap similarity index 100% rename from src/components/CustomRegisterField/__snapshots__/CustomRegisterField.test.tsx.snap rename to web/src/components/CustomRegisterField/__snapshots__/CustomRegisterField.test.tsx.snap diff --git a/src/components/DateField/DateField.module.scss b/web/src/components/DateField/DateField.module.scss similarity index 96% rename from src/components/DateField/DateField.module.scss rename to web/src/components/DateField/DateField.module.scss index b38188006..9ac3241ca 100644 --- a/src/components/DateField/DateField.module.scss +++ b/web/src/components/DateField/DateField.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .dateField { width: 100%; diff --git a/src/components/DateField/DateField.tsx b/web/src/components/DateField/DateField.tsx similarity index 97% rename from src/components/DateField/DateField.tsx rename to web/src/components/DateField/DateField.tsx index 227f92cfd..d7432a2b0 100644 --- a/src/components/DateField/DateField.tsx +++ b/web/src/components/DateField/DateField.tsx @@ -1,11 +1,11 @@ -import React, { useState, type ReactNode, useRef } from 'react'; +import React, { type ReactNode, useRef, useState } from 'react'; import classNames from 'classnames'; import { useTranslation } from 'react-i18next'; -import styles from './DateField.module.scss'; +import HelperText from '../HelperText/HelperText'; +import useOpaqueId from '../../hooks/useOpaqueId'; -import HelperText from '#components/HelperText/HelperText'; -import useOpaqueId from '#src/hooks/useOpaqueId'; +import styles from './DateField.module.scss'; type Props = { className?: string; diff --git a/src/components/DeleteAccountModal/DeleteAccountModal.module.scss b/web/src/components/DeleteAccountModal/DeleteAccountModal.module.scss similarity index 97% rename from src/components/DeleteAccountModal/DeleteAccountModal.module.scss rename to web/src/components/DeleteAccountModal/DeleteAccountModal.module.scss index 2ceafb3ae..2d9284564 100644 --- a/src/components/DeleteAccountModal/DeleteAccountModal.module.scss +++ b/web/src/components/DeleteAccountModal/DeleteAccountModal.module.scss @@ -1,4 +1,4 @@ -@use 'src/styles/variables'; +@use '~/styles/variables'; .formContainer { display: flex; diff --git a/src/components/DeleteAccountModal/DeleteAccountModal.tsx b/web/src/components/DeleteAccountModal/DeleteAccountModal.tsx similarity index 89% rename from src/components/DeleteAccountModal/DeleteAccountModal.tsx rename to web/src/components/DeleteAccountModal/DeleteAccountModal.tsx index 378e18ca6..cf24402c8 100644 --- a/src/components/DeleteAccountModal/DeleteAccountModal.tsx +++ b/web/src/components/DeleteAccountModal/DeleteAccountModal.tsx @@ -1,21 +1,20 @@ import { useTranslation } from 'react-i18next'; -import { type SchemaOf, object, string } from 'yup'; -import { useNavigate, useLocation } from 'react-router'; +import { object, type SchemaOf, string } from 'yup'; +import { useLocation, useNavigate } from 'react-router'; import { useCallback, useEffect, useState } from 'react'; import { useMutation } from 'react-query'; +import type { DeleteAccountFormData } from '@jwplayer/ott-common/types/account'; +import { getModule } from '@jwplayer/ott-common/src/modules/container'; +import AccountController from '@jwplayer/ott-common/src/stores/AccountController'; +import { addQueryParam, removeQueryParam } from '@jwplayer/ott-common/src/utils/location'; import PasswordField from '../PasswordField/PasswordField'; import Button from '../Button/Button'; +import useForm from '../../hooks/useForm'; +import Alert from '../Alert/Alert'; import styles from './DeleteAccountModal.module.scss'; -import type { DeleteAccountFormData } from '#types/account'; -import useForm from '#src/hooks/useForm'; -import { addQueryParam, removeQueryParam } from '#src/utils/location'; -import Alert from '#components/Alert/Alert'; -import AccountController from '#src/stores/AccountController'; -import { getModule } from '#src/modules/container'; - const DeleteAccountModal = () => { const accountController = getModule(AccountController); diff --git a/src/components/DeleteAccountPasswordWarning/DeleteAccountPasswordWarning.module.scss b/web/src/components/DeleteAccountPasswordWarning/DeleteAccountPasswordWarning.module.scss similarity index 96% rename from src/components/DeleteAccountPasswordWarning/DeleteAccountPasswordWarning.module.scss rename to web/src/components/DeleteAccountPasswordWarning/DeleteAccountPasswordWarning.module.scss index 6be500615..8aec05be9 100644 --- a/src/components/DeleteAccountPasswordWarning/DeleteAccountPasswordWarning.module.scss +++ b/web/src/components/DeleteAccountPasswordWarning/DeleteAccountPasswordWarning.module.scss @@ -1,4 +1,4 @@ -@use 'src/styles/variables'; +@use '~/styles/variables'; .formFeedback { margin-bottom: -24px; @@ -51,4 +51,4 @@ .button { margin: auto; -} \ No newline at end of file +} diff --git a/src/components/DeleteAccountPasswordWarning/DeleteAccountPasswordWarning.tsx b/web/src/components/DeleteAccountPasswordWarning/DeleteAccountPasswordWarning.tsx similarity index 81% rename from src/components/DeleteAccountPasswordWarning/DeleteAccountPasswordWarning.tsx rename to web/src/components/DeleteAccountPasswordWarning/DeleteAccountPasswordWarning.tsx index 6ae54afb0..33b4f86e6 100644 --- a/src/components/DeleteAccountPasswordWarning/DeleteAccountPasswordWarning.tsx +++ b/web/src/components/DeleteAccountPasswordWarning/DeleteAccountPasswordWarning.tsx @@ -1,17 +1,16 @@ import { useTranslation } from 'react-i18next'; -import { useNavigate, useLocation } from 'react-router'; +import { useLocation, useNavigate } from 'react-router'; import { useCallback, useState } from 'react'; +import { getModule } from '@jwplayer/ott-common/src/modules/container'; +import { useAccountStore } from '@jwplayer/ott-common/src/stores/AccountStore'; +import AccountController from '@jwplayer/ott-common/src/stores/AccountController'; +import { addQueryParam, removeQueryParam } from '@jwplayer/ott-common/src/utils/location'; import Button from '../Button/Button'; +import FormFeedback from '../FormFeedback/FormFeedback'; import styles from './DeleteAccountPasswordWarning.module.scss'; -import { addQueryParam, removeQueryParam } from '#src/utils/location'; -import { useAccountStore } from '#src/stores/AccountStore'; -import AccountController from '#src/stores/AccountController'; -import FormFeedback from '#components/FormFeedback/FormFeedback'; -import { getModule } from '#src/modules/container'; - const DeleteAccountPasswordWarning = () => { const accountController = getModule(AccountController); diff --git a/src/components/DemoConfigDialog/DemoConfigDialog.module.scss b/web/src/components/DemoConfigDialog/DemoConfigDialog.module.scss similarity index 94% rename from src/components/DemoConfigDialog/DemoConfigDialog.module.scss rename to web/src/components/DemoConfigDialog/DemoConfigDialog.module.scss index c6a7346c1..db02af6d7 100644 --- a/src/components/DemoConfigDialog/DemoConfigDialog.module.scss +++ b/web/src/components/DemoConfigDialog/DemoConfigDialog.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .controls { margin-top: variables.$base-spacing; diff --git a/src/components/DemoConfigDialog/DemoConfigDialog.test.tsx b/web/src/components/DemoConfigDialog/DemoConfigDialog.test.tsx similarity index 87% rename from src/components/DemoConfigDialog/DemoConfigDialog.test.tsx rename to web/src/components/DemoConfigDialog/DemoConfigDialog.test.tsx index b803ec5ed..c23822f9c 100644 --- a/src/components/DemoConfigDialog/DemoConfigDialog.test.tsx +++ b/web/src/components/DemoConfigDialog/DemoConfigDialog.test.tsx @@ -1,7 +1,8 @@ import React from 'react'; -import { renderWithRouter } from '#test/testUtils'; -import DemoConfigDialog from '#components/DemoConfigDialog/DemoConfigDialog'; +import { renderWithRouter } from '../../../test/testUtils'; + +import DemoConfigDialog from './DemoConfigDialog'; describe('', () => { test('renders and matches snapshot', () => { diff --git a/src/components/DemoConfigDialog/DemoConfigDialog.tsx b/web/src/components/DemoConfigDialog/DemoConfigDialog.tsx similarity index 92% rename from src/components/DemoConfigDialog/DemoConfigDialog.tsx rename to web/src/components/DemoConfigDialog/DemoConfigDialog.tsx index 166cfcf0d..548b21bc3 100644 --- a/src/components/DemoConfigDialog/DemoConfigDialog.tsx +++ b/web/src/components/DemoConfigDialog/DemoConfigDialog.tsx @@ -2,18 +2,18 @@ import React, { ChangeEventHandler, MouseEventHandler, useEffect, useState } fro import { useTranslation } from 'react-i18next'; import { NavigateFunction, useNavigate } from 'react-router'; import { Helmet } from 'react-helmet'; +import { addQueryParams } from '@jwplayer/ott-common/src/utils/formatting'; +import { CONFIG_QUERY_KEY } from '@jwplayer/ott-common/src/constants'; -import styles from './DemoConfigDialog.module.scss'; +import ErrorPage from '../ErrorPage/ErrorPage'; +import TextField from '../TextField/TextField'; +import Button from '../Button/Button'; +import ConfirmationDialog from '../ConfirmationDialog/ConfirmationDialog'; +import LoadingOverlay from '../LoadingOverlay/LoadingOverlay'; +import DevStackTrace from '../DevStackTrace/DevStackTrace'; +import type { BootstrapData } from '../../hooks/useBootstrapApp'; -import ErrorPage from '#components/ErrorPage/ErrorPage'; -import TextField from '#components/TextField/TextField'; -import Button from '#components/Button/Button'; -import ConfirmationDialog from '#components/ConfirmationDialog/ConfirmationDialog'; -import LoadingOverlay from '#components/LoadingOverlay/LoadingOverlay'; -import DevStackTrace from '#components/DevStackTrace/DevStackTrace'; -import { addQueryParams } from '#src/utils/formatting'; -import { CONFIG_QUERY_KEY } from '#src/config'; -import type { BootstrapData } from '#src/hooks/useBootstrapApp'; +import styles from './DemoConfigDialog.module.scss'; const regex = /^[a-z,\d]{0,8}$/g; const DEMO_CONFIG = '225tvq1i'; diff --git a/src/components/DemoConfigDialog/__snapshots__/DemoConfigDialog.test.tsx.snap b/web/src/components/DemoConfigDialog/__snapshots__/DemoConfigDialog.test.tsx.snap similarity index 100% rename from src/components/DemoConfigDialog/__snapshots__/DemoConfigDialog.test.tsx.snap rename to web/src/components/DemoConfigDialog/__snapshots__/DemoConfigDialog.test.tsx.snap diff --git a/src/components/DetectOutsideClick/DetectOutsideClick.tsx b/web/src/components/DetectOutsideClick/DetectOutsideClick.tsx similarity index 100% rename from src/components/DetectOutsideClick/DetectOutsideClick.tsx rename to web/src/components/DetectOutsideClick/DetectOutsideClick.tsx diff --git a/src/components/DevConfigSelector/DevConfigSelector.module.scss b/web/src/components/DevConfigSelector/DevConfigSelector.module.scss similarity index 100% rename from src/components/DevConfigSelector/DevConfigSelector.module.scss rename to web/src/components/DevConfigSelector/DevConfigSelector.module.scss diff --git a/src/components/DevConfigSelector/DevConfigSelector.tsx b/web/src/components/DevConfigSelector/DevConfigSelector.tsx similarity index 79% rename from src/components/DevConfigSelector/DevConfigSelector.tsx rename to web/src/components/DevConfigSelector/DevConfigSelector.tsx index 215731dd0..972dc2562 100644 --- a/src/components/DevConfigSelector/DevConfigSelector.tsx +++ b/web/src/components/DevConfigSelector/DevConfigSelector.tsx @@ -1,11 +1,11 @@ import { ChangeEvent, useCallback } from 'react'; +import { addQueryParams } from '@jwplayer/ott-common/src/utils/formatting'; +import { CONFIG_QUERY_KEY } from '@jwplayer/ott-common/src/constants'; -import styles from './DevConfigSelector.module.scss'; +import Dropdown from '../Dropdown/Dropdown'; +import { jwDevEnvConfigs, testConfigs } from '../../../test/constants'; -import Dropdown from '#components/Dropdown/Dropdown'; -import { jwDevEnvConfigs, testConfigs } from '#test/constants'; -import { addQueryParams } from '#src/utils/formatting'; -import { CONFIG_QUERY_KEY } from '#src/config'; +import styles from './DevConfigSelector.module.scss'; interface Props { selectedConfig: string | undefined; diff --git a/src/components/DevStackTrace/DevStackTrace.module.scss b/web/src/components/DevStackTrace/DevStackTrace.module.scss similarity index 100% rename from src/components/DevStackTrace/DevStackTrace.module.scss rename to web/src/components/DevStackTrace/DevStackTrace.module.scss diff --git a/src/components/DevStackTrace/DevStackTrace.tsx b/web/src/components/DevStackTrace/DevStackTrace.tsx similarity index 100% rename from src/components/DevStackTrace/DevStackTrace.tsx rename to web/src/components/DevStackTrace/DevStackTrace.tsx diff --git a/src/components/Dialog/Dialog.module.scss b/web/src/components/Dialog/Dialog.module.scss similarity index 87% rename from src/components/Dialog/Dialog.module.scss rename to web/src/components/Dialog/Dialog.module.scss index 218861ac1..395dcd8ee 100644 --- a/src/components/Dialog/Dialog.module.scss +++ b/web/src/components/Dialog/Dialog.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .dialog { width: 100vw; diff --git a/src/components/Dialog/Dialog.test.tsx b/web/src/components/Dialog/Dialog.test.tsx similarity index 100% rename from src/components/Dialog/Dialog.test.tsx rename to web/src/components/Dialog/Dialog.test.tsx diff --git a/src/components/Dialog/Dialog.tsx b/web/src/components/Dialog/Dialog.tsx similarity index 76% rename from src/components/Dialog/Dialog.tsx rename to web/src/components/Dialog/Dialog.tsx index 5cd30eeb2..91c8fd32c 100644 --- a/src/components/Dialog/Dialog.tsx +++ b/web/src/components/Dialog/Dialog.tsx @@ -1,11 +1,11 @@ import React from 'react'; import classNames from 'classnames'; -import styles from './Dialog.module.scss'; +import Modal from '../Modal/Modal'; +import Slide from '../Animation/Slide/Slide'; +import ModalCloseButton from '../ModalCloseButton/ModalCloseButton'; -import Modal from '#components/Modal/Modal'; -import Slide from '#components/Animation/Slide/Slide'; -import ModalCloseButton from '#components/ModalCloseButton/ModalCloseButton'; +import styles from './Dialog.module.scss'; type Props = { open: boolean; diff --git a/src/components/Dialog/__snapshots__/Dialog.test.tsx.snap b/web/src/components/Dialog/__snapshots__/Dialog.test.tsx.snap similarity index 100% rename from src/components/Dialog/__snapshots__/Dialog.test.tsx.snap rename to web/src/components/Dialog/__snapshots__/Dialog.test.tsx.snap diff --git a/src/components/DialogBackButton/DialogBackButton.module.scss b/web/src/components/DialogBackButton/DialogBackButton.module.scss similarity index 65% rename from src/components/DialogBackButton/DialogBackButton.module.scss rename to web/src/components/DialogBackButton/DialogBackButton.module.scss index 0a0c26d44..b6a8908b5 100644 --- a/src/components/DialogBackButton/DialogBackButton.module.scss +++ b/web/src/components/DialogBackButton/DialogBackButton.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .dialogBackButton { position: absolute; diff --git a/src/components/DialogBackButton/DialogBackButton.test.tsx b/web/src/components/DialogBackButton/DialogBackButton.test.tsx similarity index 100% rename from src/components/DialogBackButton/DialogBackButton.test.tsx rename to web/src/components/DialogBackButton/DialogBackButton.test.tsx diff --git a/src/components/DialogBackButton/DialogBackButton.tsx b/web/src/components/DialogBackButton/DialogBackButton.tsx similarity index 78% rename from src/components/DialogBackButton/DialogBackButton.tsx rename to web/src/components/DialogBackButton/DialogBackButton.tsx index 88975ab94..72e76c2fc 100644 --- a/src/components/DialogBackButton/DialogBackButton.tsx +++ b/web/src/components/DialogBackButton/DialogBackButton.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import styles from './DialogBackButton.module.scss'; +import IconButton from '../IconButton/IconButton'; +import ArrowLeft from '../../icons/ArrowLeft'; -import IconButton from '#components/IconButton/IconButton'; -import ArrowLeft from '#src/icons/ArrowLeft'; +import styles from './DialogBackButton.module.scss'; type Props = { onClick?: () => void; diff --git a/src/components/DialogBackButton/__snapshots__/DialogBackButton.test.tsx.snap b/web/src/components/DialogBackButton/__snapshots__/DialogBackButton.test.tsx.snap similarity index 100% rename from src/components/DialogBackButton/__snapshots__/DialogBackButton.test.tsx.snap rename to web/src/components/DialogBackButton/__snapshots__/DialogBackButton.test.tsx.snap diff --git a/src/components/Dropdown/Dropdown.module.scss b/web/src/components/Dropdown/Dropdown.module.scss similarity index 96% rename from src/components/Dropdown/Dropdown.module.scss rename to web/src/components/Dropdown/Dropdown.module.scss index 6afbf09a7..038e5ce6a 100644 --- a/src/components/Dropdown/Dropdown.module.scss +++ b/web/src/components/Dropdown/Dropdown.module.scss @@ -1,6 +1,6 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; -@use 'src/styles/mixins/responsive'; +@use '~/styles/variables'; +@use '~/styles/theme'; +@use '~/styles/mixins/responsive'; $select-border: variables.$gray-lighter; $select-arrow: variables.$white; diff --git a/src/components/Dropdown/Dropdown.test.tsx b/web/src/components/Dropdown/Dropdown.test.tsx similarity index 99% rename from src/components/Dropdown/Dropdown.test.tsx rename to web/src/components/Dropdown/Dropdown.test.tsx index 224657843..bb9999388 100644 --- a/src/components/Dropdown/Dropdown.test.tsx +++ b/web/src/components/Dropdown/Dropdown.test.tsx @@ -2,6 +2,7 @@ import * as React from 'react'; import { render } from '@testing-library/react'; import Dropdown from './Dropdown'; + const options = ['x', 'y', 'z']; describe('', () => { it('renders dropdown', () => { diff --git a/src/components/Dropdown/Dropdown.tsx b/web/src/components/Dropdown/Dropdown.tsx similarity index 95% rename from src/components/Dropdown/Dropdown.tsx rename to web/src/components/Dropdown/Dropdown.tsx index 476f0e89d..c0f9f51b6 100644 --- a/src/components/Dropdown/Dropdown.tsx +++ b/web/src/components/Dropdown/Dropdown.tsx @@ -2,10 +2,10 @@ import React, { type ReactNode } from 'react'; import classNames from 'classnames'; import { useTranslation } from 'react-i18next'; -import styles from './Dropdown.module.scss'; +import HelperText from '../HelperText/HelperText'; +import useOpaqueId from '../../hooks/useOpaqueId'; -import HelperText from '#components/HelperText/HelperText'; -import useOpaqueId from '#src/hooks/useOpaqueId'; +import styles from './Dropdown.module.scss'; type Props = { name: string; diff --git a/src/components/EditCardPaymentForm/EditCardPaymentForm.module.scss b/web/src/components/EditCardPaymentForm/EditCardPaymentForm.module.scss similarity index 100% rename from src/components/EditCardPaymentForm/EditCardPaymentForm.module.scss rename to web/src/components/EditCardPaymentForm/EditCardPaymentForm.module.scss diff --git a/src/components/EditCardPaymentForm/EditCardPaymentForm.tsx b/web/src/components/EditCardPaymentForm/EditCardPaymentForm.tsx similarity index 94% rename from src/components/EditCardPaymentForm/EditCardPaymentForm.tsx rename to web/src/components/EditCardPaymentForm/EditCardPaymentForm.tsx index 960145f80..ad78ebea0 100644 --- a/src/components/EditCardPaymentForm/EditCardPaymentForm.tsx +++ b/web/src/components/EditCardPaymentForm/EditCardPaymentForm.tsx @@ -4,20 +4,19 @@ import Payment from 'payment'; import { object, string } from 'yup'; import { useMutation } from 'react-query'; import shallow from 'zustand/shallow'; +import { getModule } from '@jwplayer/ott-common/src/modules/container'; +import { useAccountStore } from '@jwplayer/ott-common/src/stores/AccountStore'; +import AccountController from '@jwplayer/ott-common/src/stores/AccountController'; import Button from '../Button/Button'; import CreditCardCVCField from '../CreditCardCVCField/CreditCardCVCField'; import CreditCardExpiryField from '../CreditCardExpiryField/CreditCardExpiryField'; import CreditCardNumberField from '../CreditCardNumberField/CreditCardNumberField'; import TextField from '../TextField/TextField'; +import useForm from '../../hooks/useForm'; import styles from './EditCardPaymentForm.module.scss'; -import useForm from '#src/hooks/useForm'; -import { useAccountStore } from '#src/stores/AccountStore'; -import AccountController from '#src/stores/AccountController'; -import { getModule } from '#src/modules/container'; - type Props = { onCancel: () => void; setUpdatingCardDetails: (e: boolean) => void; diff --git a/src/components/EditForm/EditCardDetailsForm.module.scss b/web/src/components/EditForm/EditCardDetailsForm.module.scss similarity index 71% rename from src/components/EditForm/EditCardDetailsForm.module.scss rename to web/src/components/EditForm/EditCardDetailsForm.module.scss index 2736c1bb8..716cb840c 100644 --- a/src/components/EditForm/EditCardDetailsForm.module.scss +++ b/web/src/components/EditForm/EditCardDetailsForm.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .title { margin-bottom: 24px; diff --git a/src/components/EditForm/EditCardDetailsForm.tsx b/web/src/components/EditForm/EditCardDetailsForm.tsx similarity index 92% rename from src/components/EditForm/EditCardDetailsForm.tsx rename to web/src/components/EditForm/EditCardDetailsForm.tsx index 081572c72..6e173c36d 100644 --- a/src/components/EditForm/EditCardDetailsForm.tsx +++ b/web/src/components/EditForm/EditCardDetailsForm.tsx @@ -2,11 +2,10 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; import Button from '../Button/Button'; +import LoadingOverlay from '../LoadingOverlay/LoadingOverlay'; import styles from './EditCardDetailsForm.module.scss'; -import LoadingOverlay from '#components/LoadingOverlay/LoadingOverlay'; - type Props = { renderPaymentMethod?: () => JSX.Element | null; submitting: boolean; diff --git a/src/components/EditPasswordForm/EditPasswordForm.module.scss b/web/src/components/EditPasswordForm/EditPasswordForm.module.scss similarity index 89% rename from src/components/EditPasswordForm/EditPasswordForm.module.scss rename to web/src/components/EditPasswordForm/EditPasswordForm.module.scss index dbaeebe35..9f09e0006 100644 --- a/src/components/EditPasswordForm/EditPasswordForm.module.scss +++ b/web/src/components/EditPasswordForm/EditPasswordForm.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .title { margin: 24px 0; @@ -36,4 +36,4 @@ color: rgb(129, 175, 254); cursor: pointer; -} \ No newline at end of file +} diff --git a/src/components/EditPasswordForm/EditPasswordForm.test.tsx b/web/src/components/EditPasswordForm/EditPasswordForm.test.tsx similarity index 100% rename from src/components/EditPasswordForm/EditPasswordForm.test.tsx rename to web/src/components/EditPasswordForm/EditPasswordForm.test.tsx diff --git a/src/components/EditPasswordForm/EditPasswordForm.tsx b/web/src/components/EditPasswordForm/EditPasswordForm.tsx similarity index 90% rename from src/components/EditPasswordForm/EditPasswordForm.tsx rename to web/src/components/EditPasswordForm/EditPasswordForm.tsx index ba4d894a0..fe9ba652f 100644 --- a/src/components/EditPasswordForm/EditPasswordForm.tsx +++ b/web/src/components/EditPasswordForm/EditPasswordForm.tsx @@ -1,18 +1,17 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; +import type { EditPasswordFormData } from '@jwplayer/ott-common/types/account'; +import type { FormErrors } from '@jwplayer/ott-common/types/form'; +import { testId } from '@jwplayer/ott-common/src/utils/common'; import PasswordField from '../PasswordField/PasswordField'; import TextField from '../TextField/TextField'; +import Button from '../Button/Button'; +import FormFeedback from '../FormFeedback/FormFeedback'; +import LoadingOverlay from '../LoadingOverlay/LoadingOverlay'; import styles from './EditPasswordForm.module.scss'; -import Button from '#components/Button/Button'; -import FormFeedback from '#components/FormFeedback/FormFeedback'; -import LoadingOverlay from '#components/LoadingOverlay/LoadingOverlay'; -import { testId } from '#src/utils/common'; -import type { EditPasswordFormData } from '#types/account'; -import type { FormErrors } from '#types/form'; - type Props = { onSubmit: React.FormEventHandler; onChange: React.ChangeEventHandler; diff --git a/src/components/EditPasswordForm/__snapshots__/EditPasswordForm.test.tsx.snap b/web/src/components/EditPasswordForm/__snapshots__/EditPasswordForm.test.tsx.snap similarity index 100% rename from src/components/EditPasswordForm/__snapshots__/EditPasswordForm.test.tsx.snap rename to web/src/components/EditPasswordForm/__snapshots__/EditPasswordForm.test.tsx.snap diff --git a/src/components/Epg/Epg.module.scss b/web/src/components/Epg/Epg.module.scss similarity index 95% rename from src/components/Epg/Epg.module.scss rename to web/src/components/Epg/Epg.module.scss index 1c3d87a07..5420ab710 100644 --- a/src/components/Epg/Epg.module.scss +++ b/web/src/components/Epg/Epg.module.scss @@ -1,6 +1,6 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; -@use 'src/styles/mixins/responsive'; +@use '~/styles/variables'; +@use '~/styles/theme'; +@use '~/styles/mixins/responsive'; $base-z-index: variables.$epg-z-index; $cover-z-index: $base-z-index + 1; diff --git a/src/components/Epg/Epg.tsx b/web/src/components/Epg/Epg.tsx similarity index 83% rename from src/components/Epg/Epg.tsx rename to web/src/components/Epg/Epg.tsx index 9b776e3c8..d9fa95bc7 100644 --- a/src/components/Epg/Epg.tsx +++ b/web/src/components/Epg/Epg.tsx @@ -2,21 +2,21 @@ import { Epg as EpgContainer, Layout } from 'planby'; import React, { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { isBefore, subHours } from 'date-fns'; +import type { EpgChannel, EpgProgram } from '@jwplayer/ott-common/types/epg'; +import type { Config } from '@jwplayer/ott-common/types/Config'; -import styles from './Epg.module.scss'; +import IconButton from '../IconButton/IconButton'; +import Button from '../Button/Button'; +import EpgChannelItem from '../EpgChannel/EpgChannelItem'; +import EpgProgramItem from '../EpgProgramItem/EpgProgramItem'; +import EpgTimeline from '../EpgTimeline/EpgTimeline'; +import Spinner from '../Spinner/Spinner'; +import ChevronRight from '../../icons/ChevronRight'; +import ChevronLeft from '../../icons/ChevronLeft'; +import usePlanByEpg from '../../hooks/usePlanByEpg'; +import useBreakpoint, { Breakpoint } from '../../hooks/useBreakpoint'; -import type { Config } from '#types/Config'; -import type { EpgProgram, EpgChannel } from '#types/epg'; -import IconButton from '#components/IconButton/IconButton'; -import Button from '#components/Button/Button'; -import EpgChannelItem from '#components/EpgChannel/EpgChannelItem'; -import EpgProgramItem from '#components/EpgProgramItem/EpgProgramItem'; -import EpgTimeline from '#components/EpgTimeline/EpgTimeline'; -import Spinner from '#components/Spinner/Spinner'; -import ChevronRight from '#src/icons/ChevronRight'; -import ChevronLeft from '#src/icons/ChevronLeft'; -import usePlanByEpg from '#src/hooks/usePlanByEpg'; -import useBreakpoint, { Breakpoint } from '#src/hooks/useBreakpoint'; +import styles from './Epg.module.scss'; type Props = { channels: EpgChannel[]; diff --git a/src/components/EpgChannel/EpgChannelItem.module.scss b/web/src/components/EpgChannel/EpgChannelItem.module.scss similarity index 87% rename from src/components/EpgChannel/EpgChannelItem.module.scss rename to web/src/components/EpgChannel/EpgChannelItem.module.scss index 1105805fe..1417fa3c3 100644 --- a/src/components/EpgChannel/EpgChannelItem.module.scss +++ b/web/src/components/EpgChannel/EpgChannelItem.module.scss @@ -1,6 +1,6 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; -@use 'src/styles/mixins/responsive'; +@use '~/styles/variables'; +@use '~/styles/theme'; +@use '~/styles/mixins/responsive'; .epgChannelBox { position: absolute; diff --git a/src/components/EpgChannel/EpgChannelItem.tsx b/web/src/components/EpgChannel/EpgChannelItem.tsx similarity index 91% rename from src/components/EpgChannel/EpgChannelItem.tsx rename to web/src/components/EpgChannel/EpgChannelItem.tsx index a2a7c606c..99f5f349d 100644 --- a/src/components/EpgChannel/EpgChannelItem.tsx +++ b/web/src/components/EpgChannel/EpgChannelItem.tsx @@ -1,11 +1,11 @@ import React from 'react'; import type { Channel } from 'planby'; import classNames from 'classnames'; +import { testId } from '@jwplayer/ott-common/src/utils/common'; -import styles from './EpgChannelItem.module.scss'; +import Image from '../Image/Image'; -import Image from '#components/Image/Image'; -import { testId } from '#src/utils/common'; +import styles from './EpgChannelItem.module.scss'; type Props = { channel: Channel; diff --git a/src/components/EpgProgramItem/EpgProgramItem.module.scss b/web/src/components/EpgProgramItem/EpgProgramItem.module.scss similarity index 96% rename from src/components/EpgProgramItem/EpgProgramItem.module.scss rename to web/src/components/EpgProgramItem/EpgProgramItem.module.scss index 4d3c69e40..e47fa0445 100644 --- a/src/components/EpgProgramItem/EpgProgramItem.module.scss +++ b/web/src/components/EpgProgramItem/EpgProgramItem.module.scss @@ -1,6 +1,6 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; -@use 'src/styles/mixins/responsive'; +@use '~/styles/variables'; +@use '~/styles/theme'; +@use '~/styles/mixins/responsive'; .epgProgramBox { position: absolute; diff --git a/src/components/EpgProgramItem/EpgProgramItem.tsx b/web/src/components/EpgProgramItem/EpgProgramItem.tsx similarity index 96% rename from src/components/EpgProgramItem/EpgProgramItem.tsx rename to web/src/components/EpgProgramItem/EpgProgramItem.tsx index 28efc53d9..9e55ab3f2 100644 --- a/src/components/EpgProgramItem/EpgProgramItem.tsx +++ b/web/src/components/EpgProgramItem/EpgProgramItem.tsx @@ -2,11 +2,10 @@ import React from 'react'; import { Program, useProgram } from 'planby'; import classNames from 'classnames'; import { useTranslation } from 'react-i18next'; +import { testId } from '@jwplayer/ott-common/src/utils/common'; import styles from './EpgProgramItem.module.scss'; -import { testId } from '#src/utils/common'; - type Props = { program: Program; onClick?: (program: Program) => void; diff --git a/src/components/EpgTimeline/EpgTimeline.module.scss b/web/src/components/EpgTimeline/EpgTimeline.module.scss similarity index 92% rename from src/components/EpgTimeline/EpgTimeline.module.scss rename to web/src/components/EpgTimeline/EpgTimeline.module.scss index ca2e5073e..4c62e7f60 100644 --- a/src/components/EpgTimeline/EpgTimeline.module.scss +++ b/web/src/components/EpgTimeline/EpgTimeline.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .timelineBox { position: relative; diff --git a/src/components/EpgTimeline/EpgTimeline.tsx b/web/src/components/EpgTimeline/EpgTimeline.tsx similarity index 100% rename from src/components/EpgTimeline/EpgTimeline.tsx rename to web/src/components/EpgTimeline/EpgTimeline.tsx diff --git a/src/components/ErrorPage/ErrorPage.module.scss b/web/src/components/ErrorPage/ErrorPage.module.scss similarity index 90% rename from src/components/ErrorPage/ErrorPage.module.scss rename to web/src/components/ErrorPage/ErrorPage.module.scss index e902f7ce1..0be1142da 100644 --- a/src/components/ErrorPage/ErrorPage.module.scss +++ b/web/src/components/ErrorPage/ErrorPage.module.scss @@ -1,6 +1,6 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; -@use 'src/styles/mixins/responsive'; +@use '~/styles/variables'; +@use '~/styles/theme'; +@use '~/styles/mixins/responsive'; .errorPage { display: flex; diff --git a/src/components/ErrorPage/ErrorPage.test.tsx b/web/src/components/ErrorPage/ErrorPage.test.tsx similarity index 100% rename from src/components/ErrorPage/ErrorPage.test.tsx rename to web/src/components/ErrorPage/ErrorPage.test.tsx diff --git a/src/components/ErrorPage/ErrorPage.tsx b/web/src/components/ErrorPage/ErrorPage.tsx similarity index 91% rename from src/components/ErrorPage/ErrorPage.tsx rename to web/src/components/ErrorPage/ErrorPage.tsx index b7bb166b4..9bc4d65cf 100644 --- a/src/components/ErrorPage/ErrorPage.tsx +++ b/web/src/components/ErrorPage/ErrorPage.tsx @@ -1,11 +1,11 @@ import React, { ReactNode } from 'react'; import { useTranslation } from 'react-i18next'; +import { useConfigStore } from '@jwplayer/ott-common/src/stores/ConfigStore'; +import { IS_DEMO_MODE, IS_DEVELOPMENT_BUILD, IS_PREVIEW_MODE } from '@jwplayer/ott-common/src/utils/common'; -import styles from './ErrorPage.module.scss'; +import DevStackTrace from '../DevStackTrace/DevStackTrace'; -import { IS_DEMO_MODE, IS_DEVELOPMENT_BUILD, IS_PREVIEW_MODE } from '#src/utils/common'; -import DevStackTrace from '#components/DevStackTrace/DevStackTrace'; -import { useConfigStore } from '#src/stores/ConfigStore'; +import styles from './ErrorPage.module.scss'; interface Props { disableFallbackTranslation?: boolean; diff --git a/src/components/ErrorPage/__snapshots__/ErrorPage.test.tsx.snap b/web/src/components/ErrorPage/__snapshots__/ErrorPage.test.tsx.snap similarity index 100% rename from src/components/ErrorPage/__snapshots__/ErrorPage.test.tsx.snap rename to web/src/components/ErrorPage/__snapshots__/ErrorPage.test.tsx.snap diff --git a/src/components/Favorites/Favorites.module.scss b/web/src/components/Favorites/Favorites.module.scss similarity index 81% rename from src/components/Favorites/Favorites.module.scss rename to web/src/components/Favorites/Favorites.module.scss index 2ef860218..d00c1c4dc 100644 --- a/src/components/Favorites/Favorites.module.scss +++ b/web/src/components/Favorites/Favorites.module.scss @@ -1,6 +1,6 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; -@use 'src/styles/mixins/responsive'; +@use '~/styles/variables'; +@use '~/styles/theme'; +@use '~/styles/mixins/responsive'; .header { display: flex; diff --git a/src/components/Favorites/Favorites.test.tsx b/web/src/components/Favorites/Favorites.test.tsx similarity index 71% rename from src/components/Favorites/Favorites.test.tsx rename to web/src/components/Favorites/Favorites.test.tsx index 8eabfd715..69e859d83 100644 --- a/src/components/Favorites/Favorites.test.tsx +++ b/web/src/components/Favorites/Favorites.test.tsx @@ -1,13 +1,13 @@ import React from 'react'; +import ApiService from '@jwplayer/ott-common/src/services/api.service'; +import { PersonalShelf } from '@jwplayer/ott-common/src/constants'; -import Favorites from './Favorites'; +import PlaylistContainer from '../../containers/PlaylistContainer/PlaylistContainer'; +import { renderWithRouter } from '../../../test/testUtils'; -import { PersonalShelf } from '#src/config'; -import PlaylistContainer from '#src/containers/PlaylistContainer/PlaylistContainer'; -import { renderWithRouter } from '#test/testUtils'; -import ApiService from '#src/services/api.service'; +import Favorites from './Favorites'; -vi.mock('#src/modules/container', () => ({ +vi.mock('@jwplayer/ott-common/src/modules/container', () => ({ getModule: (type: typeof ApiService) => { switch (type) { case ApiService: diff --git a/src/components/Favorites/Favorites.tsx b/web/src/components/Favorites/Favorites.tsx similarity index 76% rename from src/components/Favorites/Favorites.tsx rename to web/src/components/Favorites/Favorites.tsx index 85f3e2df5..fee2a2524 100644 --- a/src/components/Favorites/Favorites.tsx +++ b/web/src/components/Favorites/Favorites.tsx @@ -1,16 +1,16 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; +import type { AccessModel } from '@jwplayer/ott-common/types/Config'; +import type { Playlist, PlaylistItem } from '@jwplayer/ott-common/types/playlist'; +import { mediaURL } from '@jwplayer/ott-common/src/utils/formatting'; -import styles from './Favorites.module.scss'; +import Button from '../Button/Button'; +import CardGrid from '../CardGrid/CardGrid'; +import LoadingOverlay from '../LoadingOverlay/LoadingOverlay'; +import ErrorPage from '../ErrorPage/ErrorPage'; +import { Breakpoint, Breakpoints } from '../../hooks/useBreakpoint'; -import Button from '#components/Button/Button'; -import CardGrid from '#components/CardGrid/CardGrid'; -import LoadingOverlay from '#components/LoadingOverlay/LoadingOverlay'; -import ErrorPage from '#components/ErrorPage/ErrorPage'; -import { Breakpoint, Breakpoints } from '#src/hooks/useBreakpoint'; -import type { AccessModel } from '#types/Config'; -import type { Playlist, PlaylistItem } from '#types/playlist'; -import { mediaURL } from '#src/utils/formatting'; +import styles from './Favorites.module.scss'; type Props = { playlist: Playlist; diff --git a/src/components/Favorites/__snapshots__/Favorites.test.tsx.snap b/web/src/components/Favorites/__snapshots__/Favorites.test.tsx.snap similarity index 100% rename from src/components/Favorites/__snapshots__/Favorites.test.tsx.snap rename to web/src/components/Favorites/__snapshots__/Favorites.test.tsx.snap diff --git a/src/components/Filter/Filter.module.scss b/web/src/components/Filter/Filter.module.scss similarity index 69% rename from src/components/Filter/Filter.module.scss rename to web/src/components/Filter/Filter.module.scss index d0d00ee15..f69ff3750 100644 --- a/src/components/Filter/Filter.module.scss +++ b/web/src/components/Filter/Filter.module.scss @@ -1,6 +1,6 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; -@use 'src/styles/mixins/responsive'; +@use '~/styles/variables'; +@use '~/styles/theme'; +@use '~/styles/mixins/responsive'; .filterRow { display: flex; diff --git a/src/components/Filter/Filter.test.tsx b/web/src/components/Filter/Filter.test.tsx similarity index 100% rename from src/components/Filter/Filter.test.tsx rename to web/src/components/Filter/Filter.test.tsx diff --git a/src/components/Filter/Filter.tsx b/web/src/components/Filter/Filter.tsx similarity index 89% rename from src/components/Filter/Filter.tsx rename to web/src/components/Filter/Filter.tsx index 8fa2d53e7..ca2e48971 100644 --- a/src/components/Filter/Filter.tsx +++ b/web/src/components/Filter/Filter.tsx @@ -1,11 +1,11 @@ -import React, { Fragment, FC } from 'react'; +import React, { FC, Fragment } from 'react'; import { useTranslation } from 'react-i18next'; -import styles from './Filter.module.scss'; +import Dropdown from '../Dropdown/Dropdown'; +import Button from '../Button/Button'; +import useBreakpoint, { Breakpoint } from '../../hooks/useBreakpoint'; -import Dropdown from '#components/Dropdown/Dropdown'; -import Button from '#components/Button/Button'; -import useBreakpoint, { Breakpoint } from '#src/hooks/useBreakpoint'; +import styles from './Filter.module.scss'; type FilterOption = | { diff --git a/src/components/Filter/__snapshots__/Filter.test.tsx.snap b/web/src/components/Filter/__snapshots__/Filter.test.tsx.snap similarity index 100% rename from src/components/Filter/__snapshots__/Filter.test.tsx.snap rename to web/src/components/Filter/__snapshots__/Filter.test.tsx.snap diff --git a/src/components/FinalizePayment/FinalizePayment.module.scss b/web/src/components/FinalizePayment/FinalizePayment.module.scss similarity index 100% rename from src/components/FinalizePayment/FinalizePayment.module.scss rename to web/src/components/FinalizePayment/FinalizePayment.module.scss diff --git a/src/components/FinalizePayment/FinalizePayment.tsx b/web/src/components/FinalizePayment/FinalizePayment.tsx similarity index 78% rename from src/components/FinalizePayment/FinalizePayment.tsx rename to web/src/components/FinalizePayment/FinalizePayment.tsx index 0bb86c527..77eb205fa 100644 --- a/src/components/FinalizePayment/FinalizePayment.tsx +++ b/web/src/components/FinalizePayment/FinalizePayment.tsx @@ -2,18 +2,18 @@ import React, { useEffect, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useLocation, useNavigate } from 'react-router'; import { useSearchParams } from 'react-router-dom'; +import { getModule } from '@jwplayer/ott-common/src/modules/container'; +import { useConfigStore } from '@jwplayer/ott-common/src/stores/ConfigStore'; +import AccountController from '@jwplayer/ott-common/src/stores/AccountController'; +import CheckoutController from '@jwplayer/ott-common/src/stores/CheckoutController'; +import { addQueryParam, removeQueryParam, replaceQueryParam } from '@jwplayer/ott-common/src/utils/location'; +import { ACCESS_MODEL } from '@jwplayer/ott-common/src/constants'; -import styles from './FinalizePayment.module.scss'; +import Button from '../Button/Button'; +import Spinner from '../Spinner/Spinner'; +import useEventCallback from '../../hooks/useEventCallback'; -import Button from '#components/Button/Button'; -import Spinner from '#components/Spinner/Spinner'; -import useEventCallback from '#src/hooks/useEventCallback'; -import { useConfigStore } from '#src/stores/ConfigStore'; -import { replaceQueryParam, removeQueryParam, addQueryParam } from '#src/utils/location'; -import AccountController from '#src/stores/AccountController'; -import CheckoutController from '#src/stores/CheckoutController'; -import { ACCESS_MODEL } from '#src/config'; -import { getModule } from '#src/modules/container'; +import styles from './FinalizePayment.module.scss'; const FinalizePayment = () => { const accountController = getModule(AccountController); diff --git a/src/components/ForgotPasswordForm/ForgotPasswordForm.module.scss b/web/src/components/ForgotPasswordForm/ForgotPasswordForm.module.scss similarity index 76% rename from src/components/ForgotPasswordForm/ForgotPasswordForm.module.scss rename to web/src/components/ForgotPasswordForm/ForgotPasswordForm.module.scss index 711096e1f..f72ac6917 100644 --- a/src/components/ForgotPasswordForm/ForgotPasswordForm.module.scss +++ b/web/src/components/ForgotPasswordForm/ForgotPasswordForm.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .title { margin: 24px 0; diff --git a/src/components/ForgotPasswordForm/ForgotPasswordForm.test.tsx b/web/src/components/ForgotPasswordForm/ForgotPasswordForm.test.tsx similarity index 100% rename from src/components/ForgotPasswordForm/ForgotPasswordForm.test.tsx rename to web/src/components/ForgotPasswordForm/ForgotPasswordForm.test.tsx diff --git a/src/components/ForgotPasswordForm/ForgotPasswordForm.tsx b/web/src/components/ForgotPasswordForm/ForgotPasswordForm.tsx similarity index 80% rename from src/components/ForgotPasswordForm/ForgotPasswordForm.tsx rename to web/src/components/ForgotPasswordForm/ForgotPasswordForm.tsx index 297758bd8..eb10d81dd 100644 --- a/src/components/ForgotPasswordForm/ForgotPasswordForm.tsx +++ b/web/src/components/ForgotPasswordForm/ForgotPasswordForm.tsx @@ -1,14 +1,14 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; +import type { ForgotPasswordFormData } from '@jwplayer/ott-common/types/account'; +import type { FormErrors } from '@jwplayer/ott-common/types/form'; +import { testId } from '@jwplayer/ott-common/src/utils/common'; -import styles from './ForgotPasswordForm.module.scss'; +import Button from '../Button/Button'; +import TextField from '../TextField/TextField'; +import FormFeedback from '../FormFeedback/FormFeedback'; -import Button from '#components/Button/Button'; -import TextField from '#components/TextField/TextField'; -import type { FormErrors } from '#types/form'; -import type { ForgotPasswordFormData } from '#types/account'; -import FormFeedback from '#components/FormFeedback/FormFeedback'; -import { testId } from '#src/utils/common'; +import styles from './ForgotPasswordForm.module.scss'; type Props = { onSubmit: React.FormEventHandler; diff --git a/src/components/ForgotPasswordForm/__snapshots__/ForgotPasswordForm.test.tsx.snap b/web/src/components/ForgotPasswordForm/__snapshots__/ForgotPasswordForm.test.tsx.snap similarity index 100% rename from src/components/ForgotPasswordForm/__snapshots__/ForgotPasswordForm.test.tsx.snap rename to web/src/components/ForgotPasswordForm/__snapshots__/ForgotPasswordForm.test.tsx.snap diff --git a/src/components/Form/Form.module.scss b/web/src/components/Form/Form.module.scss similarity index 75% rename from src/components/Form/Form.module.scss rename to web/src/components/Form/Form.module.scss index e651f732b..b4b92d992 100644 --- a/src/components/Form/Form.module.scss +++ b/web/src/components/Form/Form.module.scss @@ -1,6 +1,6 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; -@use 'src/styles/mixins/responsive'; +@use '~/styles/variables'; +@use '~/styles/theme'; +@use '~/styles/mixins/responsive'; .flexBox { display: flex; diff --git a/src/components/Form/Form.test.tsx b/web/src/components/Form/Form.test.tsx similarity index 100% rename from src/components/Form/Form.test.tsx rename to web/src/components/Form/Form.test.tsx diff --git a/src/components/Form/Form.tsx b/web/src/components/Form/Form.tsx similarity index 96% rename from src/components/Form/Form.tsx rename to web/src/components/Form/Form.tsx index 903026ee6..3140ccab6 100644 --- a/src/components/Form/Form.tsx +++ b/web/src/components/Form/Form.tsx @@ -1,10 +1,9 @@ import React, { createContext, SetStateAction, useCallback, useEffect, useState } from 'react'; +import type { GenericFormValues } from '@jwplayer/ott-common/types/form'; import type { FormSectionProps } from './FormSection'; import { FormSection } from './FormSection'; -import type { GenericFormValues } from '#types/form'; - interface Props { initialValues: TData; isLoading?: boolean; diff --git a/src/components/Form/FormSection.tsx b/web/src/components/Form/FormSection.tsx similarity index 95% rename from src/components/Form/FormSection.tsx rename to web/src/components/Form/FormSection.tsx index 1fdf3bbdd..cf04a3ddc 100644 --- a/src/components/Form/FormSection.tsx +++ b/web/src/components/Form/FormSection.tsx @@ -1,12 +1,12 @@ import React, { ReactElement, ReactNode, useCallback, useContext } from 'react'; +import type { GenericFormValues } from '@jwplayer/ott-common/types/form'; -import { FormContext } from './Form'; -import styles from './Form.module.scss'; +import Button from '../Button/Button'; +import LoadingOverlay from '../LoadingOverlay/LoadingOverlay'; +import useOpaqueId from '../../hooks/useOpaqueId'; -import Button from '#components/Button/Button'; -import LoadingOverlay from '#components/LoadingOverlay/LoadingOverlay'; -import useOpaqueId from '#src/hooks/useOpaqueId'; -import type { GenericFormValues } from '#types/form'; +import styles from './Form.module.scss'; +import { FormContext } from './Form'; export interface FormSectionContentArgs { values: T; diff --git a/src/components/Form/__snapshots__/Form.test.tsx.snap b/web/src/components/Form/__snapshots__/Form.test.tsx.snap similarity index 100% rename from src/components/Form/__snapshots__/Form.test.tsx.snap rename to web/src/components/Form/__snapshots__/Form.test.tsx.snap diff --git a/src/components/FormFeedback/FormFeedback.module.scss b/web/src/components/FormFeedback/FormFeedback.module.scss similarity index 91% rename from src/components/FormFeedback/FormFeedback.module.scss rename to web/src/components/FormFeedback/FormFeedback.module.scss index cdab3a135..20c2c746c 100644 --- a/src/components/FormFeedback/FormFeedback.module.scss +++ b/web/src/components/FormFeedback/FormFeedback.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .formFeedback { margin-bottom: 24px; diff --git a/src/components/FormFeedback/FormFeedback.test.tsx b/web/src/components/FormFeedback/FormFeedback.test.tsx similarity index 100% rename from src/components/FormFeedback/FormFeedback.test.tsx rename to web/src/components/FormFeedback/FormFeedback.test.tsx diff --git a/src/components/FormFeedback/FormFeedback.tsx b/web/src/components/FormFeedback/FormFeedback.tsx similarity index 100% rename from src/components/FormFeedback/FormFeedback.tsx rename to web/src/components/FormFeedback/FormFeedback.tsx diff --git a/src/components/FormFeedback/__snapshots__/FormFeedback.test.tsx.snap b/web/src/components/FormFeedback/__snapshots__/FormFeedback.test.tsx.snap similarity index 100% rename from src/components/FormFeedback/__snapshots__/FormFeedback.test.tsx.snap rename to web/src/components/FormFeedback/__snapshots__/FormFeedback.test.tsx.snap diff --git a/src/components/Header/Header.module.scss b/web/src/components/Header/Header.module.scss similarity index 95% rename from src/components/Header/Header.module.scss rename to web/src/components/Header/Header.module.scss index 1f657d030..a915f5d41 100644 --- a/src/components/Header/Header.module.scss +++ b/web/src/components/Header/Header.module.scss @@ -1,7 +1,7 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; -@use 'src/styles/mixins/responsive'; -@use 'src/styles/mixins/utils'; +@use '~/styles/variables'; +@use '~/styles/theme'; +@use '~/styles/mixins/responsive'; +@use '~/styles/mixins/utils'; // // Header diff --git a/src/components/Header/Header.test.tsx b/web/src/components/Header/Header.test.tsx similarity index 87% rename from src/components/Header/Header.test.tsx rename to web/src/components/Header/Header.test.tsx index 6888a5a93..0b9a4ee64 100644 --- a/src/components/Header/Header.test.tsx +++ b/web/src/components/Header/Header.test.tsx @@ -1,16 +1,16 @@ import React from 'react'; import { render } from '@testing-library/react'; +import AccountController from '@jwplayer/ott-common/src/stores/AccountController'; -import Header from './Header'; +import Button from '../Button/Button'; -import Button from '#components/Button/Button'; -import AccountController from '#src/stores/AccountController'; +import Header from './Header'; vi.mock('react-router-dom', () => ({ NavLink: () => 'a', })); -vi.mock('#src/modules/container', () => ({ +vi.mock('@jwplayer/ott-common/src/modules/container', () => ({ getModule: (type: typeof AccountController) => { switch (type) { case AccountController: diff --git a/src/components/Header/Header.tsx b/web/src/components/Header/Header.tsx similarity index 86% rename from src/components/Header/Header.tsx rename to web/src/components/Header/Header.tsx index 8a5830906..a22a77243 100644 --- a/src/components/Header/Header.tsx +++ b/web/src/components/Header/Header.tsx @@ -1,26 +1,26 @@ import React, { ReactFragment, useState } from 'react'; import classNames from 'classnames'; import { useTranslation } from 'react-i18next'; +import type { Profile } from '@jwplayer/ott-common/types/account'; -import styles from './Header.module.scss'; +import SearchBar, { Props as SearchBarProps } from '../SearchBar/SearchBar'; +import Logo from '../Logo/Logo'; +import Menu from '../../icons/Menu'; +import SearchIcon from '../../icons/Search'; +import CloseIcon from '../../icons/Close'; +import Button from '../Button/Button'; +import Popover from '../Popover/Popover'; +import UserMenu from '../UserMenu/UserMenu'; +import useBreakpoint, { Breakpoint } from '../../hooks/useBreakpoint'; +import IconButton from '../IconButton/IconButton'; +import Language from '../../icons/Language'; +import LanguageMenu from '../LanguageMenu/LanguageMenu'; +import type { LanguageDefinition } from '../../i18n/config'; +import Panel from '../Panel/Panel'; +import ProfileCircle from '../../icons/ProfileCircle'; +import AccountCircle from '../../icons/AccountCircle'; -import SearchBar, { Props as SearchBarProps } from '#components/SearchBar/SearchBar'; -import Logo from '#components/Logo/Logo'; -import Menu from '#src/icons/Menu'; -import SearchIcon from '#src/icons/Search'; -import CloseIcon from '#src/icons/Close'; -import Button from '#components/Button/Button'; -import Popover from '#components/Popover/Popover'; -import UserMenu from '#components/UserMenu/UserMenu'; -import useBreakpoint, { Breakpoint } from '#src/hooks/useBreakpoint'; -import IconButton from '#components/IconButton/IconButton'; -import Language from '#src/icons/Language'; -import LanguageMenu from '#components/LanguageMenu/LanguageMenu'; -import type { LanguageDefinition } from '#src/i18n/config'; -import Panel from '#components/Panel/Panel'; -import type { Profile } from '#types/account'; -import ProfileCircle from '#src/icons/ProfileCircle'; -import AccountCircle from '#src/icons/AccountCircle'; +import styles from './Header.module.scss'; type TypeHeader = 'static' | 'fixed'; diff --git a/src/components/Header/__snapshots__/Header.test.tsx.snap b/web/src/components/Header/__snapshots__/Header.test.tsx.snap similarity index 100% rename from src/components/Header/__snapshots__/Header.test.tsx.snap rename to web/src/components/Header/__snapshots__/Header.test.tsx.snap diff --git a/src/components/HelperText/HelperText.module.scss b/web/src/components/HelperText/HelperText.module.scss similarity index 71% rename from src/components/HelperText/HelperText.module.scss rename to web/src/components/HelperText/HelperText.module.scss index 5d76603bd..a5e4434f3 100644 --- a/src/components/HelperText/HelperText.module.scss +++ b/web/src/components/HelperText/HelperText.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .helperText { margin-top: 4px; diff --git a/src/components/HelperText/HelperText.test.tsx b/web/src/components/HelperText/HelperText.test.tsx similarity index 100% rename from src/components/HelperText/HelperText.test.tsx rename to web/src/components/HelperText/HelperText.test.tsx diff --git a/src/components/HelperText/HelperText.tsx b/web/src/components/HelperText/HelperText.tsx similarity index 100% rename from src/components/HelperText/HelperText.tsx rename to web/src/components/HelperText/HelperText.tsx diff --git a/src/components/HelperText/__snapshots__/HelperText.test.tsx.snap b/web/src/components/HelperText/__snapshots__/HelperText.test.tsx.snap similarity index 100% rename from src/components/HelperText/__snapshots__/HelperText.test.tsx.snap rename to web/src/components/HelperText/__snapshots__/HelperText.test.tsx.snap diff --git a/src/components/Hero/Hero.module.scss b/web/src/components/Hero/Hero.module.scss similarity index 87% rename from src/components/Hero/Hero.module.scss rename to web/src/components/Hero/Hero.module.scss index de1b52859..842d89303 100644 --- a/src/components/Hero/Hero.module.scss +++ b/web/src/components/Hero/Hero.module.scss @@ -1,7 +1,7 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; -@use 'src/styles/mixins/responsive'; -@use 'src/styles/mixins/typography'; +@use '~/styles/variables'; +@use '~/styles/theme'; +@use '~/styles/mixins/responsive'; +@use '~/styles/mixins/typography'; .hero { height: 40vh; diff --git a/src/components/Hero/Hero.tsx b/web/src/components/Hero/Hero.tsx similarity index 91% rename from src/components/Hero/Hero.tsx rename to web/src/components/Hero/Hero.tsx index 766cc66bc..7f7d43a96 100644 --- a/src/components/Hero/Hero.tsx +++ b/web/src/components/Hero/Hero.tsx @@ -1,8 +1,8 @@ import React from 'react'; -import styles from './Hero.module.scss'; +import Image from '../Image/Image'; -import Image from '#components/Image/Image'; +import styles from './Hero.module.scss'; type Props = { title: string; diff --git a/src/components/IconButton/IconButton.module.scss b/web/src/components/IconButton/IconButton.module.scss similarity index 85% rename from src/components/IconButton/IconButton.module.scss rename to web/src/components/IconButton/IconButton.module.scss index 48c8bb6bc..225c1ee6a 100644 --- a/src/components/IconButton/IconButton.module.scss +++ b/web/src/components/IconButton/IconButton.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .iconButton { display: inline-flex; diff --git a/src/components/IconButton/IconButton.test.tsx b/web/src/components/IconButton/IconButton.test.tsx similarity index 90% rename from src/components/IconButton/IconButton.test.tsx rename to web/src/components/IconButton/IconButton.test.tsx index c26f3921b..c5d8c9598 100644 --- a/src/components/IconButton/IconButton.test.tsx +++ b/web/src/components/IconButton/IconButton.test.tsx @@ -1,9 +1,9 @@ import React from 'react'; import { render } from '@testing-library/react'; -import IconButton from './IconButton'; +import Close from '../../icons/Close'; -import Close from '#src/icons/Close'; +import IconButton from './IconButton'; describe('', () => { test('renders and matches snapshot', () => { diff --git a/src/components/IconButton/IconButton.tsx b/web/src/components/IconButton/IconButton.tsx similarity index 100% rename from src/components/IconButton/IconButton.tsx rename to web/src/components/IconButton/IconButton.tsx diff --git a/src/components/IconButton/__snapshots__/IconButton.test.tsx.snap b/web/src/components/IconButton/__snapshots__/IconButton.test.tsx.snap similarity index 100% rename from src/components/IconButton/__snapshots__/IconButton.test.tsx.snap rename to web/src/components/IconButton/__snapshots__/IconButton.test.tsx.snap diff --git a/src/components/Image/Image.module.scss b/web/src/components/Image/Image.module.scss similarity index 100% rename from src/components/Image/Image.module.scss rename to web/src/components/Image/Image.module.scss diff --git a/src/components/Image/Image.test.tsx b/web/src/components/Image/Image.test.tsx similarity index 100% rename from src/components/Image/Image.test.tsx rename to web/src/components/Image/Image.test.tsx diff --git a/src/components/Image/Image.tsx b/web/src/components/Image/Image.tsx similarity index 89% rename from src/components/Image/Image.tsx rename to web/src/components/Image/Image.tsx index 4155ea610..1eda72d09 100644 --- a/src/components/Image/Image.tsx +++ b/web/src/components/Image/Image.tsx @@ -1,10 +1,9 @@ import React from 'react'; import classNames from 'classnames'; +import { addQueryParams } from '@jwplayer/ott-common/src/utils/formatting'; import styles from './Image.module.scss'; -import { addQueryParams } from '#src/utils/formatting'; - type Props = { className?: string; image?: string; diff --git a/src/components/InfiniteScrollLoader/InfiniteScrollLoader.module.scss b/web/src/components/InfiniteScrollLoader/InfiniteScrollLoader.module.scss similarity index 100% rename from src/components/InfiniteScrollLoader/InfiniteScrollLoader.module.scss rename to web/src/components/InfiniteScrollLoader/InfiniteScrollLoader.module.scss diff --git a/src/components/InfiniteScrollLoader/InfiniteScrollLoader.tsx b/web/src/components/InfiniteScrollLoader/InfiniteScrollLoader.tsx similarity index 83% rename from src/components/InfiniteScrollLoader/InfiniteScrollLoader.tsx rename to web/src/components/InfiniteScrollLoader/InfiniteScrollLoader.tsx index bb1570407..bc980ddf4 100644 --- a/src/components/InfiniteScrollLoader/InfiniteScrollLoader.tsx +++ b/web/src/components/InfiniteScrollLoader/InfiniteScrollLoader.tsx @@ -1,8 +1,8 @@ import React from 'react'; -import styles from './InfiniteScrollLoader.module.scss'; +import Spinner from '../Spinner/Spinner'; -import Spinner from '#components/Spinner/Spinner'; +import styles from './InfiniteScrollLoader.module.scss'; const InfiniteScrollLoader = () => { return ( diff --git a/src/components/LanguageMenu/LanguageMenu.module.scss b/web/src/components/LanguageMenu/LanguageMenu.module.scss similarity index 86% rename from src/components/LanguageMenu/LanguageMenu.module.scss rename to web/src/components/LanguageMenu/LanguageMenu.module.scss index f189604b8..573c554ca 100644 --- a/src/components/LanguageMenu/LanguageMenu.module.scss +++ b/web/src/components/LanguageMenu/LanguageMenu.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .menuItems { margin: 0; diff --git a/src/components/LanguageMenu/LanguageMenu.test.tsx b/web/src/components/LanguageMenu/LanguageMenu.test.tsx similarity index 95% rename from src/components/LanguageMenu/LanguageMenu.test.tsx rename to web/src/components/LanguageMenu/LanguageMenu.test.tsx index 1b3a1dc34..e6f0ac16c 100644 --- a/src/components/LanguageMenu/LanguageMenu.test.tsx +++ b/web/src/components/LanguageMenu/LanguageMenu.test.tsx @@ -1,9 +1,9 @@ import React from 'react'; import { fireEvent } from '@testing-library/react'; -import LanguageMenu from './LanguageMenu'; +import { renderWithRouter } from '../../../test/testUtils'; -import { renderWithRouter } from '#test/testUtils'; +import LanguageMenu from './LanguageMenu'; const languages = [ { diff --git a/src/components/LanguageMenu/LanguageMenu.tsx b/web/src/components/LanguageMenu/LanguageMenu.tsx similarity index 87% rename from src/components/LanguageMenu/LanguageMenu.tsx rename to web/src/components/LanguageMenu/LanguageMenu.tsx index 2d732a79c..f1cb2f2f7 100644 --- a/src/components/LanguageMenu/LanguageMenu.tsx +++ b/web/src/components/LanguageMenu/LanguageMenu.tsx @@ -1,10 +1,10 @@ import React from 'react'; import classNames from 'classnames'; -import styles from './LanguageMenu.module.scss'; +import Link from '../Link/Link'; +import type { LanguageDefinition } from '../../i18n/config'; -import Link from '#components/Link/Link'; -import type { LanguageDefinition } from '#src/i18n/config'; +import styles from './LanguageMenu.module.scss'; type Props = { onClick?: (code: string) => void; diff --git a/src/components/LanguageMenu/__snapshots__/LanguageMenu.test.tsx.snap b/web/src/components/LanguageMenu/__snapshots__/LanguageMenu.test.tsx.snap similarity index 100% rename from src/components/LanguageMenu/__snapshots__/LanguageMenu.test.tsx.snap rename to web/src/components/LanguageMenu/__snapshots__/LanguageMenu.test.tsx.snap diff --git a/src/components/LanguageMenu/__snapshots__/UserMenu.test.tsx.snap b/web/src/components/LanguageMenu/__snapshots__/UserMenu.test.tsx.snap similarity index 100% rename from src/components/LanguageMenu/__snapshots__/UserMenu.test.tsx.snap rename to web/src/components/LanguageMenu/__snapshots__/UserMenu.test.tsx.snap diff --git a/src/components/Link/Link.module.scss b/web/src/components/Link/Link.module.scss similarity index 82% rename from src/components/Link/Link.module.scss rename to web/src/components/Link/Link.module.scss index ab8bf2f4f..59b126c9e 100644 --- a/src/components/Link/Link.module.scss +++ b/web/src/components/Link/Link.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .link { display: inline-block; diff --git a/src/components/Link/Link.test.tsx b/web/src/components/Link/Link.test.tsx similarity index 100% rename from src/components/Link/Link.test.tsx rename to web/src/components/Link/Link.test.tsx diff --git a/src/components/Link/Link.tsx b/web/src/components/Link/Link.tsx similarity index 100% rename from src/components/Link/Link.tsx rename to web/src/components/Link/Link.tsx diff --git a/src/components/Link/__snapshots__/Link.test.tsx.snap b/web/src/components/Link/__snapshots__/Link.test.tsx.snap similarity index 100% rename from src/components/Link/__snapshots__/Link.test.tsx.snap rename to web/src/components/Link/__snapshots__/Link.test.tsx.snap diff --git a/src/components/LoadingOverlay/LoadingOverlay.module.scss b/web/src/components/LoadingOverlay/LoadingOverlay.module.scss similarity index 92% rename from src/components/LoadingOverlay/LoadingOverlay.module.scss rename to web/src/components/LoadingOverlay/LoadingOverlay.module.scss index 9c62d0550..886097640 100644 --- a/src/components/LoadingOverlay/LoadingOverlay.module.scss +++ b/web/src/components/LoadingOverlay/LoadingOverlay.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .loadingOverlay { display: flex; diff --git a/src/components/LoadingOverlay/LoadingOverlay.tsx b/web/src/components/LoadingOverlay/LoadingOverlay.tsx similarity index 93% rename from src/components/LoadingOverlay/LoadingOverlay.tsx rename to web/src/components/LoadingOverlay/LoadingOverlay.tsx index ed2d309cd..606c05ec6 100644 --- a/src/components/LoadingOverlay/LoadingOverlay.tsx +++ b/web/src/components/LoadingOverlay/LoadingOverlay.tsx @@ -1,9 +1,9 @@ import React from 'react'; import classNames from 'classnames'; -import styles from './LoadingOverlay.module.scss'; +import Spinner from '../Spinner/Spinner'; -import Spinner from '#components/Spinner/Spinner'; +import styles from './LoadingOverlay.module.scss'; type Props = { transparentBackground?: boolean; diff --git a/src/components/LoginForm/LoginForm.module.scss b/web/src/components/LoginForm/LoginForm.module.scss similarity index 81% rename from src/components/LoginForm/LoginForm.module.scss rename to web/src/components/LoginForm/LoginForm.module.scss index 0b9335f6e..ea0334db2 100644 --- a/src/components/LoginForm/LoginForm.module.scss +++ b/web/src/components/LoginForm/LoginForm.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .title { margin-bottom: 24px; diff --git a/src/components/LoginForm/LoginForm.test.tsx b/web/src/components/LoginForm/LoginForm.test.tsx similarity index 93% rename from src/components/LoginForm/LoginForm.test.tsx rename to web/src/components/LoginForm/LoginForm.test.tsx index fdbe93188..644fa288a 100644 --- a/src/components/LoginForm/LoginForm.test.tsx +++ b/web/src/components/LoginForm/LoginForm.test.tsx @@ -1,12 +1,12 @@ import React from 'react'; -import { fireEvent, act, render } from '@testing-library/react'; +import { act, fireEvent, render } from '@testing-library/react'; +import AccountController from '@jwplayer/ott-common/src/stores/AccountController'; -import LoginForm from './LoginForm'; +import { createWrapper, waitForWithFakeTimers } from '../../../test/testUtils'; -import { createWrapper, waitForWithFakeTimers } from '#test/testUtils'; -import AccountController from '#src/stores/AccountController'; +import LoginForm from './LoginForm'; -vi.mock('#src/modules/container', () => ({ +vi.mock('@jwplayer/ott-common/src/modules/container', () => ({ getModule: (type: typeof AccountController) => { switch (type) { case AccountController: diff --git a/src/components/LoginForm/LoginForm.tsx b/web/src/components/LoginForm/LoginForm.tsx similarity index 79% rename from src/components/LoginForm/LoginForm.tsx rename to web/src/components/LoginForm/LoginForm.tsx index fbc27e1c3..93d94ce28 100644 --- a/src/components/LoginForm/LoginForm.tsx +++ b/web/src/components/LoginForm/LoginForm.tsx @@ -1,23 +1,23 @@ import React from 'react'; import { useLocation } from 'react-router'; import { useTranslation } from 'react-i18next'; +import type { FormErrors } from '@jwplayer/ott-common/types/form'; +import type { LoginFormData } from '@jwplayer/ott-common/types/account'; +import { testId } from '@jwplayer/ott-common/src/utils/common'; +import { addQueryParam } from '@jwplayer/ott-common/src/utils/location'; -import styles from './LoginForm.module.scss'; +import useToggle from '../../hooks/useToggle'; +import TextField from '../TextField/TextField'; +import Button from '../Button/Button'; +import Link from '../Link/Link'; +import IconButton from '../IconButton/IconButton'; +import Visibility from '../../icons/Visibility'; +import VisibilityOff from '../../icons/VisibilityOff'; +import FormFeedback from '../FormFeedback/FormFeedback'; +import LoadingOverlay from '../LoadingOverlay/LoadingOverlay'; +import SocialButtonsList from '../SocialButtonsList/SocialButtonsList'; -import useToggle from '#src/hooks/useToggle'; -import TextField from '#components/TextField/TextField'; -import Button from '#components/Button/Button'; -import Link from '#components/Link/Link'; -import IconButton from '#components/IconButton/IconButton'; -import Visibility from '#src/icons/Visibility'; -import VisibilityOff from '#src/icons/VisibilityOff'; -import FormFeedback from '#components/FormFeedback/FormFeedback'; -import LoadingOverlay from '#components/LoadingOverlay/LoadingOverlay'; -import SocialButtonsList from '#components/SocialButtonsList/SocialButtonsList'; -import { testId } from '#src/utils/common'; -import { addQueryParam } from '#src/utils/location'; -import type { FormErrors } from '#types/form'; -import type { LoginFormData } from '#types/account'; +import styles from './LoginForm.module.scss'; type Props = { onSubmit: React.FormEventHandler; diff --git a/src/components/LoginForm/__snapshots__/LoginForm.test.tsx.snap b/web/src/components/LoginForm/__snapshots__/LoginForm.test.tsx.snap similarity index 100% rename from src/components/LoginForm/__snapshots__/LoginForm.test.tsx.snap rename to web/src/components/LoginForm/__snapshots__/LoginForm.test.tsx.snap diff --git a/src/components/Logo/Logo.module.scss b/web/src/components/Logo/Logo.module.scss similarity index 78% rename from src/components/Logo/Logo.module.scss rename to web/src/components/Logo/Logo.module.scss index 4c99793d2..6c9c476f8 100644 --- a/src/components/Logo/Logo.module.scss +++ b/web/src/components/Logo/Logo.module.scss @@ -1,6 +1,6 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; -@use 'src/styles/mixins/responsive'; +@use '~/styles/variables'; +@use '~/styles/theme'; +@use '~/styles/mixins/responsive'; // // Logo diff --git a/src/components/Logo/Logo.test.tsx b/web/src/components/Logo/Logo.test.tsx similarity index 93% rename from src/components/Logo/Logo.test.tsx rename to web/src/components/Logo/Logo.test.tsx index dfaa629d6..51a5f5b59 100644 --- a/src/components/Logo/Logo.test.tsx +++ b/web/src/components/Logo/Logo.test.tsx @@ -1,9 +1,9 @@ import React from 'react'; import { fireEvent } from '@testing-library/react'; -import Logo from './Logo'; +import { renderWithRouter } from '../../../test/testUtils'; -import { renderWithRouter } from '#test/testUtils'; +import Logo from './Logo'; describe('', () => { it('renders and matches snapshot', () => { diff --git a/src/components/Logo/Logo.tsx b/web/src/components/Logo/Logo.tsx similarity index 100% rename from src/components/Logo/Logo.tsx rename to web/src/components/Logo/Logo.tsx diff --git a/src/components/Logo/__snapshots__/Logo.test.tsx.snap b/web/src/components/Logo/__snapshots__/Logo.test.tsx.snap similarity index 100% rename from src/components/Logo/__snapshots__/Logo.test.tsx.snap rename to web/src/components/Logo/__snapshots__/Logo.test.tsx.snap diff --git a/src/components/MarkdownComponent/MarkdownComponent.module.scss b/web/src/components/MarkdownComponent/MarkdownComponent.module.scss similarity index 94% rename from src/components/MarkdownComponent/MarkdownComponent.module.scss rename to web/src/components/MarkdownComponent/MarkdownComponent.module.scss index 41eabd15c..9560ab6d9 100644 --- a/src/components/MarkdownComponent/MarkdownComponent.module.scss +++ b/web/src/components/MarkdownComponent/MarkdownComponent.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .markdown { h1, diff --git a/src/components/MarkdownComponent/MarkdownComponent.test.tsx b/web/src/components/MarkdownComponent/MarkdownComponent.test.tsx similarity index 100% rename from src/components/MarkdownComponent/MarkdownComponent.test.tsx rename to web/src/components/MarkdownComponent/MarkdownComponent.test.tsx diff --git a/src/components/MarkdownComponent/MarkdownComponent.tsx b/web/src/components/MarkdownComponent/MarkdownComponent.tsx similarity index 100% rename from src/components/MarkdownComponent/MarkdownComponent.tsx rename to web/src/components/MarkdownComponent/MarkdownComponent.tsx diff --git a/src/components/MarkdownComponent/__snapshots__/MarkdownComponent.test.tsx.snap b/web/src/components/MarkdownComponent/__snapshots__/MarkdownComponent.test.tsx.snap similarity index 100% rename from src/components/MarkdownComponent/__snapshots__/MarkdownComponent.test.tsx.snap rename to web/src/components/MarkdownComponent/__snapshots__/MarkdownComponent.test.tsx.snap diff --git a/src/components/MenuButton/MenuButton.module.scss b/web/src/components/MenuButton/MenuButton.module.scss similarity index 90% rename from src/components/MenuButton/MenuButton.module.scss rename to web/src/components/MenuButton/MenuButton.module.scss index 40adff838..f63ce6b81 100644 --- a/src/components/MenuButton/MenuButton.module.scss +++ b/web/src/components/MenuButton/MenuButton.module.scss @@ -1,7 +1,7 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; -@use 'src/styles/mixins/responsive'; -@use 'src/styles/mixins/utils'; +@use '~/styles/variables'; +@use '~/styles/theme'; +@use '~/styles/mixins/responsive'; +@use '~/styles/mixins/utils'; // // Navigation Button diff --git a/src/components/MenuButton/MenuButton.test.tsx b/web/src/components/MenuButton/MenuButton.test.tsx similarity index 100% rename from src/components/MenuButton/MenuButton.test.tsx rename to web/src/components/MenuButton/MenuButton.test.tsx diff --git a/src/components/MenuButton/MenuButton.tsx b/web/src/components/MenuButton/MenuButton.tsx similarity index 100% rename from src/components/MenuButton/MenuButton.tsx rename to web/src/components/MenuButton/MenuButton.tsx diff --git a/src/components/MenuButton/__snapshots__/MenuButton.test.tsx.snap b/web/src/components/MenuButton/__snapshots__/MenuButton.test.tsx.snap similarity index 100% rename from src/components/MenuButton/__snapshots__/MenuButton.test.tsx.snap rename to web/src/components/MenuButton/__snapshots__/MenuButton.test.tsx.snap diff --git a/src/components/Modal/Modal.module.scss b/web/src/components/Modal/Modal.module.scss similarity index 80% rename from src/components/Modal/Modal.module.scss rename to web/src/components/Modal/Modal.module.scss index a02c2b07d..1de213e44 100644 --- a/src/components/Modal/Modal.module.scss +++ b/web/src/components/Modal/Modal.module.scss @@ -1,6 +1,6 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; -@use 'src/styles/mixins/responsive'; +@use '~/styles/variables'; +@use '~/styles/theme'; +@use '~/styles/mixins/responsive'; .modal { position: fixed; diff --git a/src/components/Modal/Modal.test.tsx b/web/src/components/Modal/Modal.test.tsx similarity index 100% rename from src/components/Modal/Modal.test.tsx rename to web/src/components/Modal/Modal.test.tsx diff --git a/src/components/Modal/Modal.tsx b/web/src/components/Modal/Modal.tsx similarity index 93% rename from src/components/Modal/Modal.tsx rename to web/src/components/Modal/Modal.tsx index e068e9187..82cd3f0db 100644 --- a/src/components/Modal/Modal.tsx +++ b/web/src/components/Modal/Modal.tsx @@ -1,12 +1,12 @@ import React, { useEffect, useRef, useState } from 'react'; import ReactDOM from 'react-dom'; +import scrollbarSize from '@jwplayer/ott-common/src/utils/dom'; +import { testId } from '@jwplayer/ott-common/src/utils/common'; -import styles from './Modal.module.scss'; +import Fade from '../Animation/Fade/Fade'; +import Grow from '../Animation/Grow/Grow'; -import scrollbarSize from '#src/utils/dom'; -import Fade from '#components/Animation/Fade/Fade'; -import Grow from '#components/Animation/Grow/Grow'; -import { testId } from '#src/utils/common'; +import styles from './Modal.module.scss'; type Props = { children?: React.ReactNode; diff --git a/src/components/Modal/__snapshots__/Modal.test.tsx.snap b/web/src/components/Modal/__snapshots__/Modal.test.tsx.snap similarity index 100% rename from src/components/Modal/__snapshots__/Modal.test.tsx.snap rename to web/src/components/Modal/__snapshots__/Modal.test.tsx.snap diff --git a/src/components/ModalCloseButton/ModalCloseButton.module.scss b/web/src/components/ModalCloseButton/ModalCloseButton.module.scss similarity index 85% rename from src/components/ModalCloseButton/ModalCloseButton.module.scss rename to web/src/components/ModalCloseButton/ModalCloseButton.module.scss index 343141224..dbb044ae2 100644 --- a/src/components/ModalCloseButton/ModalCloseButton.module.scss +++ b/web/src/components/ModalCloseButton/ModalCloseButton.module.scss @@ -1,6 +1,6 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; -@use 'src/styles/mixins/responsive'; +@use '~/styles/variables'; +@use '~/styles/theme'; +@use '~/styles/mixins/responsive'; .modalCloseButton { position: absolute; diff --git a/src/components/ModalCloseButton/ModalCloseButton.test.tsx b/web/src/components/ModalCloseButton/ModalCloseButton.test.tsx similarity index 100% rename from src/components/ModalCloseButton/ModalCloseButton.test.tsx rename to web/src/components/ModalCloseButton/ModalCloseButton.test.tsx diff --git a/src/components/ModalCloseButton/ModalCloseButton.tsx b/web/src/components/ModalCloseButton/ModalCloseButton.tsx similarity index 85% rename from src/components/ModalCloseButton/ModalCloseButton.tsx rename to web/src/components/ModalCloseButton/ModalCloseButton.tsx index 716af28b6..665eb5ef3 100644 --- a/src/components/ModalCloseButton/ModalCloseButton.tsx +++ b/web/src/components/ModalCloseButton/ModalCloseButton.tsx @@ -2,10 +2,10 @@ import React from 'react'; import classNames from 'classnames'; import { useTranslation } from 'react-i18next'; -import styles from './ModalCloseButton.module.scss'; +import Close from '../../icons/Close'; +import IconButton from '../IconButton/IconButton'; -import Close from '#src/icons/Close'; -import IconButton from '#components/IconButton/IconButton'; +import styles from './ModalCloseButton.module.scss'; type Props = { onClick?: () => void; diff --git a/src/components/ModalCloseButton/__snapshots__/ModalCloseButton.test.tsx.snap b/web/src/components/ModalCloseButton/__snapshots__/ModalCloseButton.test.tsx.snap similarity index 100% rename from src/components/ModalCloseButton/__snapshots__/ModalCloseButton.test.tsx.snap rename to web/src/components/ModalCloseButton/__snapshots__/ModalCloseButton.test.tsx.snap diff --git a/src/components/NoPaymentRequired/NoPaymentRequired.module.scss b/web/src/components/NoPaymentRequired/NoPaymentRequired.module.scss similarity index 70% rename from src/components/NoPaymentRequired/NoPaymentRequired.module.scss rename to web/src/components/NoPaymentRequired/NoPaymentRequired.module.scss index 9fd557170..02feb2f9b 100644 --- a/src/components/NoPaymentRequired/NoPaymentRequired.module.scss +++ b/web/src/components/NoPaymentRequired/NoPaymentRequired.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .noPaymentRequired { p { diff --git a/src/components/NoPaymentRequired/NoPaymentRequired.test.tsx b/web/src/components/NoPaymentRequired/NoPaymentRequired.test.tsx similarity index 100% rename from src/components/NoPaymentRequired/NoPaymentRequired.test.tsx rename to web/src/components/NoPaymentRequired/NoPaymentRequired.test.tsx diff --git a/src/components/NoPaymentRequired/NoPaymentRequired.tsx b/web/src/components/NoPaymentRequired/NoPaymentRequired.tsx similarity index 85% rename from src/components/NoPaymentRequired/NoPaymentRequired.tsx rename to web/src/components/NoPaymentRequired/NoPaymentRequired.tsx index 4452cf073..be6686422 100644 --- a/src/components/NoPaymentRequired/NoPaymentRequired.tsx +++ b/web/src/components/NoPaymentRequired/NoPaymentRequired.tsx @@ -1,10 +1,10 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; -import styles from './NoPaymentRequired.module.scss'; +import Button from '../Button/Button'; +import FormFeedback from '../FormFeedback/FormFeedback'; -import Button from '#components/Button/Button'; -import FormFeedback from '#components/FormFeedback/FormFeedback'; +import styles from './NoPaymentRequired.module.scss'; type Props = { onSubmit?: () => void; diff --git a/src/components/NoPaymentRequired/__snapshots__/NoPaymentRequired.test.tsx.snap b/web/src/components/NoPaymentRequired/__snapshots__/NoPaymentRequired.test.tsx.snap similarity index 100% rename from src/components/NoPaymentRequired/__snapshots__/NoPaymentRequired.test.tsx.snap rename to web/src/components/NoPaymentRequired/__snapshots__/NoPaymentRequired.test.tsx.snap diff --git a/src/components/OfferSwitch/OfferSwitch.module.scss b/web/src/components/OfferSwitch/OfferSwitch.module.scss similarity index 94% rename from src/components/OfferSwitch/OfferSwitch.module.scss rename to web/src/components/OfferSwitch/OfferSwitch.module.scss index f55259025..434fc81c7 100644 --- a/src/components/OfferSwitch/OfferSwitch.module.scss +++ b/web/src/components/OfferSwitch/OfferSwitch.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .offerSwitchContainer { display: flex; diff --git a/src/components/OfferSwitch/OfferSwitch.tsx b/web/src/components/OfferSwitch/OfferSwitch.tsx similarity index 91% rename from src/components/OfferSwitch/OfferSwitch.tsx rename to web/src/components/OfferSwitch/OfferSwitch.tsx index ecca4ead0..bdf09586a 100644 --- a/src/components/OfferSwitch/OfferSwitch.tsx +++ b/web/src/components/OfferSwitch/OfferSwitch.tsx @@ -1,11 +1,11 @@ import classNames from 'classnames'; import { useTranslation } from 'react-i18next'; +import type { Offer } from '@jwplayer/ott-common/types/checkout'; +import { formatLocalizedDate, formatPrice } from '@jwplayer/ott-common/src/utils/formatting'; -import styles from './OfferSwitch.module.scss'; +import Checkbox from '../Checkbox/Checkbox'; -import type { Offer } from '#types/checkout'; -import Checkbox from '#components/Checkbox/Checkbox'; -import { formatLocalizedDate, formatPrice } from '#src/utils/formatting'; +import styles from './OfferSwitch.module.scss'; type OfferSwitchProps = { isCurrentOffer: boolean; diff --git a/src/components/Panel/Panel.module.scss b/web/src/components/Panel/Panel.module.scss similarity index 82% rename from src/components/Panel/Panel.module.scss rename to web/src/components/Panel/Panel.module.scss index 7552a7638..02594dfe0 100644 --- a/src/components/Panel/Panel.module.scss +++ b/web/src/components/Panel/Panel.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .panel { width: 100%; diff --git a/src/components/Panel/Panel.tsx b/web/src/components/Panel/Panel.tsx similarity index 100% rename from src/components/Panel/Panel.tsx rename to web/src/components/Panel/Panel.tsx diff --git a/src/components/PasswordField/PasswordField.test.tsx b/web/src/components/PasswordField/PasswordField.test.tsx similarity index 100% rename from src/components/PasswordField/PasswordField.test.tsx rename to web/src/components/PasswordField/PasswordField.test.tsx diff --git a/src/components/PasswordField/PasswordField.tsx b/web/src/components/PasswordField/PasswordField.tsx similarity index 90% rename from src/components/PasswordField/PasswordField.tsx rename to web/src/components/PasswordField/PasswordField.tsx index 8907fe307..4f800d52b 100644 --- a/src/components/PasswordField/PasswordField.tsx +++ b/web/src/components/PasswordField/PasswordField.tsx @@ -4,10 +4,9 @@ import { useTranslation } from 'react-i18next'; import TextField from '../TextField/TextField'; import PasswordStrength from '../PasswordStrength/PasswordStrength'; import IconButton from '../IconButton/IconButton'; - -import useToggle from '#src/hooks/useToggle'; -import Visibility from '#src/icons/Visibility'; -import VisibilityOff from '#src/icons/VisibilityOff'; +import useToggle from '../../hooks/useToggle'; +import Visibility from '../../icons/Visibility'; +import VisibilityOff from '../../icons/VisibilityOff'; type Props = { onChange?: React.ChangeEventHandler; diff --git a/src/components/PasswordField/__snapshots__/PasswordField.test.tsx.snap b/web/src/components/PasswordField/__snapshots__/PasswordField.test.tsx.snap similarity index 100% rename from src/components/PasswordField/__snapshots__/PasswordField.test.tsx.snap rename to web/src/components/PasswordField/__snapshots__/PasswordField.test.tsx.snap diff --git a/src/components/PasswordStrength/PasswordStrength.module.scss b/web/src/components/PasswordStrength/PasswordStrength.module.scss similarity index 94% rename from src/components/PasswordStrength/PasswordStrength.module.scss rename to web/src/components/PasswordStrength/PasswordStrength.module.scss index e64207289..a7deb98ad 100644 --- a/src/components/PasswordStrength/PasswordStrength.module.scss +++ b/web/src/components/PasswordStrength/PasswordStrength.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; @mixin strength($strength, $width, $color) { &[data-strength="#{$strength}"] { diff --git a/src/components/PasswordStrength/PasswordStrength.test.tsx b/web/src/components/PasswordStrength/PasswordStrength.test.tsx similarity index 100% rename from src/components/PasswordStrength/PasswordStrength.test.tsx rename to web/src/components/PasswordStrength/PasswordStrength.test.tsx diff --git a/src/components/PasswordStrength/PasswordStrength.tsx b/web/src/components/PasswordStrength/PasswordStrength.tsx similarity index 100% rename from src/components/PasswordStrength/PasswordStrength.tsx rename to web/src/components/PasswordStrength/PasswordStrength.tsx diff --git a/src/components/PasswordStrength/__snapshots__/PasswordStrength.test.tsx.snap b/web/src/components/PasswordStrength/__snapshots__/PasswordStrength.test.tsx.snap similarity index 100% rename from src/components/PasswordStrength/__snapshots__/PasswordStrength.test.tsx.snap rename to web/src/components/PasswordStrength/__snapshots__/PasswordStrength.test.tsx.snap diff --git a/src/components/PayPal/PayPal.module.scss b/web/src/components/PayPal/PayPal.module.scss similarity index 68% rename from src/components/PayPal/PayPal.module.scss rename to web/src/components/PayPal/PayPal.module.scss index 49d6fc585..d05714ee9 100644 --- a/src/components/PayPal/PayPal.module.scss +++ b/web/src/components/PayPal/PayPal.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .payPal { p { diff --git a/src/components/PayPal/PayPal.test.tsx b/web/src/components/PayPal/PayPal.test.tsx similarity index 100% rename from src/components/PayPal/PayPal.test.tsx rename to web/src/components/PayPal/PayPal.test.tsx diff --git a/src/components/PayPal/PayPal.tsx b/web/src/components/PayPal/PayPal.tsx similarity index 84% rename from src/components/PayPal/PayPal.tsx rename to web/src/components/PayPal/PayPal.tsx index 89eddf961..ee88d4036 100644 --- a/src/components/PayPal/PayPal.tsx +++ b/web/src/components/PayPal/PayPal.tsx @@ -1,10 +1,10 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; -import styles from './PayPal.module.scss'; +import Button from '../Button/Button'; +import FormFeedback from '../FormFeedback/FormFeedback'; -import Button from '#components/Button/Button'; -import FormFeedback from '#components/FormFeedback/FormFeedback'; +import styles from './PayPal.module.scss'; type Props = { onSubmit?: () => void; diff --git a/src/components/PayPal/__snapshots__/PayPal.test.tsx.snap b/web/src/components/PayPal/__snapshots__/PayPal.test.tsx.snap similarity index 100% rename from src/components/PayPal/__snapshots__/PayPal.test.tsx.snap rename to web/src/components/PayPal/__snapshots__/PayPal.test.tsx.snap diff --git a/src/components/Payment/Payment.module.scss b/web/src/components/Payment/Payment.module.scss similarity index 94% rename from src/components/Payment/Payment.module.scss rename to web/src/components/Payment/Payment.module.scss index 478de3494..14e44bdfa 100644 --- a/src/components/Payment/Payment.module.scss +++ b/web/src/components/Payment/Payment.module.scss @@ -1,6 +1,6 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; -@use 'src/styles/mixins/responsive'; +@use '~/styles/variables'; +@use '~/styles/theme'; +@use '~/styles/mixins/responsive'; .infoBox { display: flex; diff --git a/src/components/Payment/Payment.test.tsx b/web/src/components/Payment/Payment.test.tsx similarity index 69% rename from src/components/Payment/Payment.test.tsx rename to web/src/components/Payment/Payment.test.tsx index 511a85c7f..f26e675df 100644 --- a/src/components/Payment/Payment.test.tsx +++ b/web/src/components/Payment/Payment.test.tsx @@ -1,14 +1,14 @@ import React from 'react'; +import type { Customer } from '@jwplayer/ott-common/types/account'; +import type { PaymentDetail, Subscription, Transaction } from '@jwplayer/ott-common/types/subscription'; -import Payment from './Payment'; +import customer from '../../../test/fixtures/customer.json'; +import transactions from '../../../test/fixtures/transactions.json'; +import paymentDetail from '../../../test/fixtures/paymentDetail.json'; +import subscription from '../../../test/fixtures/subscription.json'; +import { renderWithRouter } from '../../../test/testUtils'; -import customer from '#test/fixtures/customer.json'; -import transactions from '#test/fixtures/transactions.json'; -import paymentDetail from '#test/fixtures/paymentDetail.json'; -import subscription from '#test/fixtures/subscription.json'; -import type { Customer } from '#types/account'; -import type { PaymentDetail, Subscription, Transaction } from '#types/subscription'; -import { renderWithRouter } from '#test/testUtils'; +import Payment from './Payment'; describe('', () => { test('renders and matches snapshot', () => { diff --git a/src/components/Payment/Payment.tsx b/web/src/components/Payment/Payment.tsx similarity index 94% rename from src/components/Payment/Payment.tsx rename to web/src/components/Payment/Payment.tsx index a81e5b29b..0a89286f4 100644 --- a/src/components/Payment/Payment.tsx +++ b/web/src/components/Payment/Payment.tsx @@ -1,27 +1,26 @@ import React, { useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useLocation, useNavigate } from 'react-router-dom'; +import type { AccessModel } from '@jwplayer/ott-common/types/Config'; +import type { Customer } from '@jwplayer/ott-common/types/account'; +import type { Offer } from '@jwplayer/ott-common/types/checkout'; +import type { PaymentDetail, Subscription, Transaction } from '@jwplayer/ott-common/types/subscription'; +import { formatLocalizedDate, formatPrice } from '@jwplayer/ott-common/src/utils/formatting'; +import { addQueryParam } from '@jwplayer/ott-common/src/utils/location'; +import { ACCESS_MODEL } from '@jwplayer/ott-common/src/constants'; import useBreakpoint, { Breakpoint } from '../../hooks/useBreakpoint'; import ExternalLink from '../../icons/ExternalLink'; import IconButton from '../IconButton/IconButton'; +import Alert from '../Alert/Alert'; +import Button from '../Button/Button'; +import LoadingOverlay from '../LoadingOverlay/LoadingOverlay'; +import OfferSwitch from '../OfferSwitch/OfferSwitch'; +import TextField from '../TextField/TextField'; +import PayPal from '../../icons/PayPal'; import styles from './Payment.module.scss'; -import Alert from '#components/Alert/Alert'; -import Button from '#components/Button/Button'; -import LoadingOverlay from '#components/LoadingOverlay/LoadingOverlay'; -import OfferSwitch from '#components/OfferSwitch/OfferSwitch'; -import TextField from '#components/TextField/TextField'; -import PayPal from '#src/icons/PayPal'; -import { formatLocalizedDate, formatPrice } from '#src/utils/formatting'; -import { addQueryParam } from '#src/utils/location'; -import type { AccessModel } from '#types/Config'; -import type { Customer } from '#types/account'; -import type { Offer } from '#types/checkout'; -import type { PaymentDetail, Subscription, Transaction } from '#types/subscription'; -import { ACCESS_MODEL } from '#src/config'; - const VISIBLE_TRANSACTIONS = 4; type Props = { diff --git a/src/components/Payment/__snapshots__/Payment.test.tsx.snap b/web/src/components/Payment/__snapshots__/Payment.test.tsx.snap similarity index 100% rename from src/components/Payment/__snapshots__/Payment.test.tsx.snap rename to web/src/components/Payment/__snapshots__/Payment.test.tsx.snap diff --git a/src/components/PaymentFailed/PaymentFailed.module.scss b/web/src/components/PaymentFailed/PaymentFailed.module.scss similarity index 66% rename from src/components/PaymentFailed/PaymentFailed.module.scss rename to web/src/components/PaymentFailed/PaymentFailed.module.scss index 9785ac180..3593036cf 100644 --- a/src/components/PaymentFailed/PaymentFailed.module.scss +++ b/web/src/components/PaymentFailed/PaymentFailed.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .title { font-weight: var(--body-font-weight-bold); diff --git a/src/components/PaymentFailed/PaymentFailed.test.tsx b/web/src/components/PaymentFailed/PaymentFailed.test.tsx similarity index 100% rename from src/components/PaymentFailed/PaymentFailed.test.tsx rename to web/src/components/PaymentFailed/PaymentFailed.test.tsx diff --git a/src/components/PaymentFailed/PaymentFailed.tsx b/web/src/components/PaymentFailed/PaymentFailed.tsx similarity index 94% rename from src/components/PaymentFailed/PaymentFailed.tsx rename to web/src/components/PaymentFailed/PaymentFailed.tsx index 0f7941567..cebfd7e29 100644 --- a/src/components/PaymentFailed/PaymentFailed.tsx +++ b/web/src/components/PaymentFailed/PaymentFailed.tsx @@ -1,9 +1,9 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; -import styles from './PaymentFailed.module.scss'; +import Button from '../Button/Button'; -import Button from '#components/Button/Button'; +import styles from './PaymentFailed.module.scss'; type Props = { type: 'error' | 'cancelled'; diff --git a/src/components/PaymentFailed/__snapshots__/PaymentFailed.test.tsx.snap b/web/src/components/PaymentFailed/__snapshots__/PaymentFailed.test.tsx.snap similarity index 100% rename from src/components/PaymentFailed/__snapshots__/PaymentFailed.test.tsx.snap rename to web/src/components/PaymentFailed/__snapshots__/PaymentFailed.test.tsx.snap diff --git a/src/components/PaymentForm/PaymentForm.module.scss b/web/src/components/PaymentForm/PaymentForm.module.scss similarity index 100% rename from src/components/PaymentForm/PaymentForm.module.scss rename to web/src/components/PaymentForm/PaymentForm.module.scss diff --git a/src/components/PaymentForm/PaymentForm.tsx b/web/src/components/PaymentForm/PaymentForm.tsx similarity index 93% rename from src/components/PaymentForm/PaymentForm.tsx rename to web/src/components/PaymentForm/PaymentForm.tsx index 4e4f88860..914f982a5 100644 --- a/src/components/PaymentForm/PaymentForm.tsx +++ b/web/src/components/PaymentForm/PaymentForm.tsx @@ -2,20 +2,19 @@ import { useEffect } from 'react'; import { useTranslation } from 'react-i18next'; import Payment from 'payment'; import { object, string } from 'yup'; +import { getModule } from '@jwplayer/ott-common/src/modules/container'; +import CheckoutController from '@jwplayer/ott-common/src/stores/CheckoutController'; import Button from '../Button/Button'; import CreditCardCVCField from '../CreditCardCVCField/CreditCardCVCField'; import CreditCardExpiryField from '../CreditCardExpiryField/CreditCardExpiryField'; import CreditCardNumberField from '../CreditCardNumberField/CreditCardNumberField'; import TextField from '../TextField/TextField'; +import useForm from '../../hooks/useForm'; +import useCheckAccess from '../../hooks/useCheckAccess'; import styles from './PaymentForm.module.scss'; -import useForm from '#src/hooks/useForm'; -import useCheckAccess from '#src/hooks/useCheckAccess'; -import CheckoutController from '#src/stores/CheckoutController'; -import { getModule } from '#src/modules/container'; - type Props = { couponCode?: string; setUpdatingOrder: (value: boolean) => void; diff --git a/src/components/PaymentMethodForm/PaymentMethodForm.module.scss b/web/src/components/PaymentMethodForm/PaymentMethodForm.module.scss similarity index 92% rename from src/components/PaymentMethodForm/PaymentMethodForm.module.scss rename to web/src/components/PaymentMethodForm/PaymentMethodForm.module.scss index 65c26dc47..614561d39 100644 --- a/src/components/PaymentMethodForm/PaymentMethodForm.module.scss +++ b/web/src/components/PaymentMethodForm/PaymentMethodForm.module.scss @@ -1,6 +1,6 @@ -@use '../../styles/variables'; -@use '../../styles/theme'; -@use '../../styles/mixins/responsive'; +@use '~/styles/variables'; +@use '~/styles/theme'; +@use '~/styles/mixins/responsive'; .title { diff --git a/src/components/PaymentMethodForm/PaymentMethodForm.tsx b/web/src/components/PaymentMethodForm/PaymentMethodForm.tsx similarity index 91% rename from src/components/PaymentMethodForm/PaymentMethodForm.tsx rename to web/src/components/PaymentMethodForm/PaymentMethodForm.tsx index 917aca8ce..78823b4a1 100644 --- a/src/components/PaymentMethodForm/PaymentMethodForm.tsx +++ b/web/src/components/PaymentMethodForm/PaymentMethodForm.tsx @@ -1,13 +1,13 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; +import type { PaymentMethod } from '@jwplayer/ott-common/types/checkout'; -import styles from './PaymentMethodForm.module.scss'; +import CreditCard from '../../icons/CreditCard'; +import PayPal from '../../icons/PayPal'; +import Button from '../Button/Button'; +import LoadingOverlay from '../LoadingOverlay/LoadingOverlay'; -import CreditCard from '#src/icons/CreditCard'; -import PayPal from '#src/icons/PayPal'; -import Button from '#components/Button/Button'; -import LoadingOverlay from '#components/LoadingOverlay/LoadingOverlay'; -import type { PaymentMethod } from '#types/checkout'; +import styles from './PaymentMethodForm.module.scss'; type Props = { paymentMethodId?: number; diff --git a/src/components/PersonalDetailsForm/PersonalDetailsForm.module.scss b/web/src/components/PersonalDetailsForm/PersonalDetailsForm.module.scss similarity index 73% rename from src/components/PersonalDetailsForm/PersonalDetailsForm.module.scss rename to web/src/components/PersonalDetailsForm/PersonalDetailsForm.module.scss index 372376b57..42d62ad56 100644 --- a/src/components/PersonalDetailsForm/PersonalDetailsForm.module.scss +++ b/web/src/components/PersonalDetailsForm/PersonalDetailsForm.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .title { margin-bottom: 24px; diff --git a/src/components/PersonalDetailsForm/PersonalDetailsForm.test.tsx b/web/src/components/PersonalDetailsForm/PersonalDetailsForm.test.tsx similarity index 97% rename from src/components/PersonalDetailsForm/PersonalDetailsForm.test.tsx rename to web/src/components/PersonalDetailsForm/PersonalDetailsForm.test.tsx index c72522a4d..5d339ff12 100644 --- a/src/components/PersonalDetailsForm/PersonalDetailsForm.test.tsx +++ b/web/src/components/PersonalDetailsForm/PersonalDetailsForm.test.tsx @@ -1,6 +1,6 @@ import { render } from '@testing-library/react'; -import PersonalDetailsForm from '#components/PersonalDetailsForm/PersonalDetailsForm'; +import PersonalDetailsForm from './PersonalDetailsForm'; const noop = () => { /**/ diff --git a/src/components/PersonalDetailsForm/PersonalDetailsForm.tsx b/web/src/components/PersonalDetailsForm/PersonalDetailsForm.tsx similarity index 91% rename from src/components/PersonalDetailsForm/PersonalDetailsForm.tsx rename to web/src/components/PersonalDetailsForm/PersonalDetailsForm.tsx index d62f010d7..5f6deb253 100644 --- a/src/components/PersonalDetailsForm/PersonalDetailsForm.tsx +++ b/web/src/components/PersonalDetailsForm/PersonalDetailsForm.tsx @@ -1,19 +1,19 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; +import type { FormErrors } from '@jwplayer/ott-common/types/form'; +import type { CleengCaptureField, CleengCaptureQuestionField, PersonalDetailsFormData } from '@jwplayer/ott-common/types/account'; +import { testId } from '@jwplayer/ott-common/src/utils/common'; -import styles from './PersonalDetailsForm.module.scss'; +import TextField from '../TextField/TextField'; +import Button from '../Button/Button'; +import Dropdown from '../Dropdown/Dropdown'; +import Checkbox from '../Checkbox/Checkbox'; +import Radio from '../Radio/Radio'; +import DateField from '../DateField/DateField'; +import LoadingOverlay from '../LoadingOverlay/LoadingOverlay'; +import FormFeedback from '../FormFeedback/FormFeedback'; -import TextField from '#components/TextField/TextField'; -import Button from '#components/Button/Button'; -import Dropdown from '#components/Dropdown/Dropdown'; -import Checkbox from '#components/Checkbox/Checkbox'; -import Radio from '#components/Radio/Radio'; -import DateField from '#components/DateField/DateField'; -import LoadingOverlay from '#components/LoadingOverlay/LoadingOverlay'; -import FormFeedback from '#components/FormFeedback/FormFeedback'; -import { testId } from '#src/utils/common'; -import type { FormErrors } from '#types/form'; -import type { PersonalDetailsFormData, CleengCaptureField, CleengCaptureQuestionField } from '#types/account'; +import styles from './PersonalDetailsForm.module.scss'; type Props = { onSubmit: React.FormEventHandler; diff --git a/src/components/PersonalDetailsForm/__snapshots__/PersonalDetailsForm.test.tsx.snap b/web/src/components/PersonalDetailsForm/__snapshots__/PersonalDetailsForm.test.tsx.snap similarity index 100% rename from src/components/PersonalDetailsForm/__snapshots__/PersonalDetailsForm.test.tsx.snap rename to web/src/components/PersonalDetailsForm/__snapshots__/PersonalDetailsForm.test.tsx.snap diff --git a/src/components/Player/Player.module.scss b/web/src/components/Player/Player.module.scss similarity index 100% rename from src/components/Player/Player.module.scss rename to web/src/components/Player/Player.module.scss diff --git a/src/components/Player/Player.test.tsx b/web/src/components/Player/Player.test.tsx similarity index 84% rename from src/components/Player/Player.test.tsx rename to web/src/components/Player/Player.test.tsx index 477201469..98f02fa61 100644 --- a/src/components/Player/Player.test.tsx +++ b/web/src/components/Player/Player.test.tsx @@ -1,9 +1,9 @@ import React from 'react'; +import type { PlaylistItem } from '@jwplayer/ott-common/types/playlist'; -import Player from './Player'; +import { renderWithRouter } from '../../../test/testUtils'; -import type { PlaylistItem } from '#types/playlist'; -import { renderWithRouter } from '#test/testUtils'; +import Player from './Player'; describe('', () => { test('renders and matches snapshot', () => { diff --git a/src/components/Player/Player.tsx b/web/src/components/Player/Player.tsx similarity index 91% rename from src/components/Player/Player.tsx rename to web/src/components/Player/Player.tsx index 249c4000a..81f93a962 100644 --- a/src/components/Player/Player.tsx +++ b/web/src/components/Player/Player.tsx @@ -1,16 +1,16 @@ import React, { useCallback, useEffect, useRef, useState } from 'react'; +import type { AdSchedule } from '@jwplayer/ott-common/types/ad-schedule'; +import type { PlaylistItem } from '@jwplayer/ott-common/types/playlist'; +import type { JWPlayer } from '@jwplayer/ott-common/types/jwplayer'; +import { useConfigStore } from '@jwplayer/ott-common/src/stores/ConfigStore'; +import { addScript } from '@jwplayer/ott-common/src/utils/dom'; +import { deepCopy } from '@jwplayer/ott-common/src/utils/collection'; +import { logDev, testId } from '@jwplayer/ott-common/src/utils/common'; -import styles from './Player.module.scss'; +import useEventCallback from '../../hooks/useEventCallback'; +import useOttAnalytics from '../../hooks/useOttAnalytics'; -import { addScript } from '#src/utils/dom'; -import { deepCopy } from '#src/utils/collection'; -import type { JWPlayer } from '#types/jwplayer'; -import type { PlaylistItem } from '#types/playlist'; -import useEventCallback from '#src/hooks/useEventCallback'; -import useOttAnalytics from '#src/hooks/useOttAnalytics'; -import { logDev, testId } from '#src/utils/common'; -import { useConfigStore } from '#src/stores/ConfigStore'; -import type { AdSchedule } from '#types/ad-schedule'; +import styles from './Player.module.scss'; type Props = { feedId?: string; @@ -139,7 +139,7 @@ const Player: React.FC = ({ return; } - const currentItem = playerRef.current?.getPlaylistItem() as PlaylistItem | null; + const currentItem = playerRef.current?.getPlaylistItem() as unknown as PlaylistItem | null; // We already loaded this item if (currentItem && currentItem.mediaid === item.mediaid) { diff --git a/src/components/Player/__snapshots__/Player.test.tsx.snap b/web/src/components/Player/__snapshots__/Player.test.tsx.snap similarity index 100% rename from src/components/Player/__snapshots__/Player.test.tsx.snap rename to web/src/components/Player/__snapshots__/Player.test.tsx.snap diff --git a/src/components/Popover/Popover.module.scss b/web/src/components/Popover/Popover.module.scss similarity index 80% rename from src/components/Popover/Popover.module.scss rename to web/src/components/Popover/Popover.module.scss index e787b17e5..6d08797ec 100644 --- a/src/components/Popover/Popover.module.scss +++ b/web/src/components/Popover/Popover.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .popover { position: absolute; diff --git a/src/components/Popover/Popover.test.tsx b/web/src/components/Popover/Popover.test.tsx similarity index 78% rename from src/components/Popover/Popover.test.tsx rename to web/src/components/Popover/Popover.test.tsx index e24551785..230d8e729 100644 --- a/src/components/Popover/Popover.test.tsx +++ b/web/src/components/Popover/Popover.test.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import Popover from './Popover'; +import { renderWithRouter } from '../../../test/testUtils'; +import MenuButton from '../MenuButton/MenuButton'; -import { renderWithRouter } from '#test/testUtils'; -import MenuButton from '#components/MenuButton/MenuButton'; +import Popover from './Popover'; describe('', () => { test('renders and matches snapshot', () => { diff --git a/src/components/Popover/Popover.tsx b/web/src/components/Popover/Popover.tsx similarity index 80% rename from src/components/Popover/Popover.tsx rename to web/src/components/Popover/Popover.tsx index cd424d104..174f0024e 100644 --- a/src/components/Popover/Popover.tsx +++ b/web/src/components/Popover/Popover.tsx @@ -1,10 +1,10 @@ import React, { ReactNode } from 'react'; import classNames from 'classnames'; -import styles from './Popover.module.scss'; +import DetectOutsideClick from '../DetectOutsideClick/DetectOutsideClick'; +import Slide from '../Animation/Slide/Slide'; -import DetectOutsideClick from '#components/DetectOutsideClick/DetectOutsideClick'; -import Slide from '#components/Animation/Slide/Slide'; +import styles from './Popover.module.scss'; type Props = { children: ReactNode; diff --git a/src/components/Popover/__snapshots__/Popover.test.tsx.snap b/web/src/components/Popover/__snapshots__/Popover.test.tsx.snap similarity index 100% rename from src/components/Popover/__snapshots__/Popover.test.tsx.snap rename to web/src/components/Popover/__snapshots__/Popover.test.tsx.snap diff --git a/src/components/ProfileBox/AddNewProfile.tsx b/web/src/components/ProfileBox/AddNewProfile.tsx similarity index 95% rename from src/components/ProfileBox/AddNewProfile.tsx rename to web/src/components/ProfileBox/AddNewProfile.tsx index 9692d4bf3..dd9683827 100644 --- a/src/components/ProfileBox/AddNewProfile.tsx +++ b/web/src/components/ProfileBox/AddNewProfile.tsx @@ -2,9 +2,9 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; import classNames from 'classnames'; -import styles from './ProfileBox.module.scss'; +import Plus from '../../icons/Plus'; -import Plus from '#src/icons/Plus'; +import styles from './ProfileBox.module.scss'; type Props = { onClick: () => void; diff --git a/src/components/ProfileBox/ProfileBox.module.scss b/web/src/components/ProfileBox/ProfileBox.module.scss similarity index 99% rename from src/components/ProfileBox/ProfileBox.module.scss rename to web/src/components/ProfileBox/ProfileBox.module.scss index 3a5493e92..940d4ee8c 100644 --- a/src/components/ProfileBox/ProfileBox.module.scss +++ b/web/src/components/ProfileBox/ProfileBox.module.scss @@ -1,4 +1,4 @@ -@use 'src/styles/variables'; +@use '~/styles/variables'; $avatar-border-radius: 50%; diff --git a/src/components/ProfileBox/ProfileBox.tsx b/web/src/components/ProfileBox/ProfileBox.tsx similarity index 90% rename from src/components/ProfileBox/ProfileBox.tsx rename to web/src/components/ProfileBox/ProfileBox.tsx index 00934e27d..0df9c4151 100644 --- a/src/components/ProfileBox/ProfileBox.tsx +++ b/web/src/components/ProfileBox/ProfileBox.tsx @@ -2,11 +2,11 @@ import React from 'react'; import classNames from 'classnames'; import { useTranslation } from 'react-i18next'; -import styles from './ProfileBox.module.scss'; +import Edit from '../../icons/Edit'; +import Check from '../../icons/Check'; +import IconButton from '../IconButton/IconButton'; -import Edit from '#src/icons/Edit'; -import Check from '#src/icons/Check'; -import IconButton from '#components/IconButton/IconButton'; +import styles from './ProfileBox.module.scss'; type Props = { name?: string; diff --git a/src/components/Radio/Radio.module.scss b/web/src/components/Radio/Radio.module.scss similarity index 95% rename from src/components/Radio/Radio.module.scss rename to web/src/components/Radio/Radio.module.scss index 2b008dc30..184d59c60 100644 --- a/src/components/Radio/Radio.module.scss +++ b/web/src/components/Radio/Radio.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .header { margin-bottom: 8px; diff --git a/src/components/Radio/Radio.test.tsx b/web/src/components/Radio/Radio.test.tsx similarity index 100% rename from src/components/Radio/Radio.test.tsx rename to web/src/components/Radio/Radio.test.tsx diff --git a/src/components/Radio/Radio.tsx b/web/src/components/Radio/Radio.tsx similarity index 92% rename from src/components/Radio/Radio.tsx rename to web/src/components/Radio/Radio.tsx index a6bfe6d0c..e33b5ff8b 100644 --- a/src/components/Radio/Radio.tsx +++ b/web/src/components/Radio/Radio.tsx @@ -1,10 +1,10 @@ import React, { type ReactNode } from 'react'; import { useTranslation } from 'react-i18next'; -import styles from './Radio.module.scss'; +import HelperText from '../HelperText/HelperText'; +import useOpaqueId from '../../hooks/useOpaqueId'; -import HelperText from '#components/HelperText/HelperText'; -import useOpaqueId from '#src/hooks/useOpaqueId'; +import styles from './Radio.module.scss'; type Props = { name: string; diff --git a/src/components/Radio/__snapshots__/Radio.test.tsx.snap b/web/src/components/Radio/__snapshots__/Radio.test.tsx.snap similarity index 100% rename from src/components/Radio/__snapshots__/Radio.test.tsx.snap rename to web/src/components/Radio/__snapshots__/Radio.test.tsx.snap diff --git a/src/components/RegistrationForm/RegistrationForm.module.scss b/web/src/components/RegistrationForm/RegistrationForm.module.scss similarity index 90% rename from src/components/RegistrationForm/RegistrationForm.module.scss rename to web/src/components/RegistrationForm/RegistrationForm.module.scss index f3e36a728..5d7e1cece 100644 --- a/src/components/RegistrationForm/RegistrationForm.module.scss +++ b/web/src/components/RegistrationForm/RegistrationForm.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .title { margin-bottom: 24px; diff --git a/src/components/RegistrationForm/RegistrationForm.test.tsx b/web/src/components/RegistrationForm/RegistrationForm.test.tsx similarity index 91% rename from src/components/RegistrationForm/RegistrationForm.test.tsx rename to web/src/components/RegistrationForm/RegistrationForm.test.tsx index 616986275..ef94b6946 100644 --- a/src/components/RegistrationForm/RegistrationForm.test.tsx +++ b/web/src/components/RegistrationForm/RegistrationForm.test.tsx @@ -1,8 +1,8 @@ import React from 'react'; -import RegistrationForm from './RegistrationForm'; +import { renderWithRouter } from '../../../test/testUtils'; -import { renderWithRouter } from '#test/testUtils'; +import RegistrationForm from './RegistrationForm'; describe('', () => { test('renders and matches snapshot', () => { diff --git a/src/components/RegistrationForm/RegistrationForm.tsx b/web/src/components/RegistrationForm/RegistrationForm.tsx similarity index 82% rename from src/components/RegistrationForm/RegistrationForm.tsx rename to web/src/components/RegistrationForm/RegistrationForm.tsx index 94f731244..74028592f 100644 --- a/src/components/RegistrationForm/RegistrationForm.tsx +++ b/web/src/components/RegistrationForm/RegistrationForm.tsx @@ -1,25 +1,25 @@ -import React, { type ChangeEventHandler, useRef, useEffect } from 'react'; +import React, { type ChangeEventHandler, useEffect, useRef } from 'react'; import { useLocation } from 'react-router'; import { useTranslation } from 'react-i18next'; import DOMPurify from 'dompurify'; +import type { FormErrors } from '@jwplayer/ott-common/types/form'; +import type { Consent, RegistrationFormData } from '@jwplayer/ott-common/types/account'; +import { testId } from '@jwplayer/ott-common/src/utils/common'; +import { addQueryParam } from '@jwplayer/ott-common/src/utils/location'; -import styles from './RegistrationForm.module.scss'; +import TextField from '../TextField/TextField'; +import Button from '../Button/Button'; +import IconButton from '../IconButton/IconButton'; +import Visibility from '../../icons/Visibility'; +import VisibilityOff from '../../icons/VisibilityOff'; +import PasswordStrength from '../PasswordStrength/PasswordStrength'; +import CustomRegisterField from '../CustomRegisterField/CustomRegisterField'; +import FormFeedback from '../FormFeedback/FormFeedback'; +import LoadingOverlay from '../LoadingOverlay/LoadingOverlay'; +import Link from '../Link/Link'; +import useToggle from '../../hooks/useToggle'; -import TextField from '#components/TextField/TextField'; -import Button from '#components/Button/Button'; -import IconButton from '#components/IconButton/IconButton'; -import Visibility from '#src/icons/Visibility'; -import VisibilityOff from '#src/icons/VisibilityOff'; -import PasswordStrength from '#components/PasswordStrength/PasswordStrength'; -import CustomRegisterField from '#components/CustomRegisterField/CustomRegisterField'; -import FormFeedback from '#components/FormFeedback/FormFeedback'; -import LoadingOverlay from '#components/LoadingOverlay/LoadingOverlay'; -import Link from '#components/Link/Link'; -import { testId } from '#src/utils/common'; -import useToggle from '#src/hooks/useToggle'; -import { addQueryParam } from '#src/utils/location'; -import type { FormErrors } from '#types/form'; -import type { RegistrationFormData, Consent } from '#types/account'; +import styles from './RegistrationForm.module.scss'; type Props = { onSubmit: React.FormEventHandler; diff --git a/src/components/RegistrationForm/__snapshots__/RegistrationForm.test.tsx.snap b/web/src/components/RegistrationForm/__snapshots__/RegistrationForm.test.tsx.snap similarity index 100% rename from src/components/RegistrationForm/__snapshots__/RegistrationForm.test.tsx.snap rename to web/src/components/RegistrationForm/__snapshots__/RegistrationForm.test.tsx.snap diff --git a/src/components/RenewSubscriptionForm/RenewSubscriptionForm.module.scss b/web/src/components/RenewSubscriptionForm/RenewSubscriptionForm.module.scss similarity index 93% rename from src/components/RenewSubscriptionForm/RenewSubscriptionForm.module.scss rename to web/src/components/RenewSubscriptionForm/RenewSubscriptionForm.module.scss index e693e29af..27d4ba539 100644 --- a/src/components/RenewSubscriptionForm/RenewSubscriptionForm.module.scss +++ b/web/src/components/RenewSubscriptionForm/RenewSubscriptionForm.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .title { margin-bottom: 16px; diff --git a/src/components/RenewSubscriptionForm/RenewSubscriptionForm.test.tsx b/web/src/components/RenewSubscriptionForm/RenewSubscriptionForm.test.tsx similarity index 66% rename from src/components/RenewSubscriptionForm/RenewSubscriptionForm.test.tsx rename to web/src/components/RenewSubscriptionForm/RenewSubscriptionForm.test.tsx index 700b69a59..8a5309bb5 100644 --- a/src/components/RenewSubscriptionForm/RenewSubscriptionForm.test.tsx +++ b/web/src/components/RenewSubscriptionForm/RenewSubscriptionForm.test.tsx @@ -1,12 +1,12 @@ import React from 'react'; import { render } from '@testing-library/react'; +import type { Subscription } from '@jwplayer/ott-common/types/subscription'; +import type { Customer } from '@jwplayer/ott-common/types/account'; -import RenewSubscriptionForm from './RenewSubscriptionForm'; +import customer from '../../../test/fixtures/customer.json'; +import subscription from '../../../test/fixtures/subscription.json'; -import customer from '#test/fixtures/customer.json'; -import subscription from '#test/fixtures/subscription.json'; -import type { Subscription } from '#types/subscription'; -import type { Customer } from '#types/account'; +import RenewSubscriptionForm from './RenewSubscriptionForm'; describe('', () => { test('renders and matches snapshot', () => { diff --git a/src/components/RenewSubscriptionForm/RenewSubscriptionForm.tsx b/web/src/components/RenewSubscriptionForm/RenewSubscriptionForm.tsx similarity index 83% rename from src/components/RenewSubscriptionForm/RenewSubscriptionForm.tsx rename to web/src/components/RenewSubscriptionForm/RenewSubscriptionForm.tsx index db04ae630..a2b6c8eb8 100644 --- a/src/components/RenewSubscriptionForm/RenewSubscriptionForm.tsx +++ b/web/src/components/RenewSubscriptionForm/RenewSubscriptionForm.tsx @@ -1,13 +1,13 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; +import type { Customer } from '@jwplayer/ott-common/types/account'; +import type { Subscription } from '@jwplayer/ott-common/types/subscription'; +import { formatLocalizedDate, formatPrice } from '@jwplayer/ott-common/src/utils/formatting'; -import styles from './RenewSubscriptionForm.module.scss'; +import Button from '../Button/Button'; +import FormFeedback from '../FormFeedback/FormFeedback'; -import Button from '#components/Button/Button'; -import { formatLocalizedDate, formatPrice } from '#src/utils/formatting'; -import FormFeedback from '#components/FormFeedback/FormFeedback'; -import type { Customer } from '#types/account'; -import type { Subscription } from '#types/subscription'; +import styles from './RenewSubscriptionForm.module.scss'; type Props = { subscription: Subscription; diff --git a/src/components/RenewSubscriptionForm/__snapshots__/RenewSubscriptionForm.test.tsx.snap b/web/src/components/RenewSubscriptionForm/__snapshots__/RenewSubscriptionForm.test.tsx.snap similarity index 100% rename from src/components/RenewSubscriptionForm/__snapshots__/RenewSubscriptionForm.test.tsx.snap rename to web/src/components/RenewSubscriptionForm/__snapshots__/RenewSubscriptionForm.test.tsx.snap diff --git a/src/components/ResetPasswordForm/ResetPasswordForm.module.scss b/web/src/components/ResetPasswordForm/ResetPasswordForm.module.scss similarity index 77% rename from src/components/ResetPasswordForm/ResetPasswordForm.module.scss rename to web/src/components/ResetPasswordForm/ResetPasswordForm.module.scss index e20456738..fe0cba4de 100644 --- a/src/components/ResetPasswordForm/ResetPasswordForm.module.scss +++ b/web/src/components/ResetPasswordForm/ResetPasswordForm.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .title { margin: 24px 0; diff --git a/src/components/ResetPasswordForm/ResetPasswordForm.test.tsx b/web/src/components/ResetPasswordForm/ResetPasswordForm.test.tsx similarity index 100% rename from src/components/ResetPasswordForm/ResetPasswordForm.test.tsx rename to web/src/components/ResetPasswordForm/ResetPasswordForm.test.tsx diff --git a/src/components/ResetPasswordForm/ResetPasswordForm.tsx b/web/src/components/ResetPasswordForm/ResetPasswordForm.tsx similarity index 94% rename from src/components/ResetPasswordForm/ResetPasswordForm.tsx rename to web/src/components/ResetPasswordForm/ResetPasswordForm.tsx index ef36b83ba..5414f56e3 100644 --- a/src/components/ResetPasswordForm/ResetPasswordForm.tsx +++ b/web/src/components/ResetPasswordForm/ResetPasswordForm.tsx @@ -1,9 +1,9 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; -import styles from './ResetPasswordForm.module.scss'; +import Button from '../Button/Button'; -import Button from '#components/Button/Button'; +import styles from './ResetPasswordForm.module.scss'; type Props = { onCancel: () => void; diff --git a/src/components/ResetPasswordForm/__snapshots__/ResetPasswordForm.test.tsx.snap b/web/src/components/ResetPasswordForm/__snapshots__/ResetPasswordForm.test.tsx.snap similarity index 100% rename from src/components/ResetPasswordForm/__snapshots__/ResetPasswordForm.test.tsx.snap rename to web/src/components/ResetPasswordForm/__snapshots__/ResetPasswordForm.test.tsx.snap diff --git a/src/components/Root/Root.tsx b/web/src/components/Root/Root.tsx similarity index 78% rename from src/components/Root/Root.tsx rename to web/src/components/Root/Root.tsx index 11cf0abbe..9b937c75d 100644 --- a/src/components/Root/Root.tsx +++ b/web/src/components/Root/Root.tsx @@ -1,14 +1,14 @@ import React, { FC, useEffect, useState } from 'react'; - -import ErrorPage from '#components/ErrorPage/ErrorPage'; -import AccountModal from '#src/containers/AccountModal/AccountModal'; -import { IS_DEMO_MODE, IS_DEVELOPMENT_BUILD, IS_PREVIEW_MODE, IS_PROD_MODE } from '#src/utils/common'; -import DemoConfigDialog from '#components/DemoConfigDialog/DemoConfigDialog'; -import DevConfigSelector from '#components/DevConfigSelector/DevConfigSelector'; -import AppRoutes from '#src/containers/AppRoutes/AppRoutes'; -import registerCustomScreens from '#src/screenMapping'; -import LoadingOverlay from '#components/LoadingOverlay/LoadingOverlay'; -import { useBootstrapApp, type BootstrapData } from '#src/hooks/useBootstrapApp'; +import { IS_DEMO_MODE, IS_DEVELOPMENT_BUILD, IS_PREVIEW_MODE, IS_PROD_MODE } from '@jwplayer/ott-common/src/utils/common'; + +import ErrorPage from '../ErrorPage/ErrorPage'; +import AccountModal from '../../containers/AccountModal/AccountModal'; +import DemoConfigDialog from '../DemoConfigDialog/DemoConfigDialog'; +import DevConfigSelector from '../DevConfigSelector/DevConfigSelector'; +import AppRoutes from '../../containers/AppRoutes/AppRoutes'; +import registerCustomScreens from '../../screenMapping'; +import LoadingOverlay from '../LoadingOverlay/LoadingOverlay'; +import { type BootstrapData, useBootstrapApp } from '../../hooks/useBootstrapApp'; const IS_DEMO_OR_PREVIEW = IS_DEMO_MODE || IS_PREVIEW_MODE; diff --git a/src/components/RootErrorPage/RootErrorPage.tsx b/web/src/components/RootErrorPage/RootErrorPage.tsx similarity index 80% rename from src/components/RootErrorPage/RootErrorPage.tsx rename to web/src/components/RootErrorPage/RootErrorPage.tsx index 15ae140ef..8dfe60d25 100644 --- a/src/components/RootErrorPage/RootErrorPage.tsx +++ b/web/src/components/RootErrorPage/RootErrorPage.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { useRouteError } from 'react-router'; -import ErrorPage from '#components/ErrorPage/ErrorPage'; +import ErrorPage from '../ErrorPage/ErrorPage'; const RootErrorPage: React.FC = () => { const error = useRouteError() as Error; diff --git a/src/components/SearchBar/SearchBar.module.scss b/web/src/components/SearchBar/SearchBar.module.scss similarity index 93% rename from src/components/SearchBar/SearchBar.module.scss rename to web/src/components/SearchBar/SearchBar.module.scss index ef7c5381c..3ea8cdcbd 100644 --- a/src/components/SearchBar/SearchBar.module.scss +++ b/web/src/components/SearchBar/SearchBar.module.scss @@ -1,5 +1,5 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; +@use '~/styles/variables'; +@use '~/styles/theme'; .searchBar { position: relative; diff --git a/src/components/SearchBar/SearchBar.test.tsx b/web/src/components/SearchBar/SearchBar.test.tsx similarity index 95% rename from src/components/SearchBar/SearchBar.test.tsx rename to web/src/components/SearchBar/SearchBar.test.tsx index cb5a41908..fc745da2c 100644 --- a/src/components/SearchBar/SearchBar.test.tsx +++ b/web/src/components/SearchBar/SearchBar.test.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { render, fireEvent } from '@testing-library/react'; +import { fireEvent, render } from '@testing-library/react'; import SearchBar from './SearchBar'; diff --git a/src/components/SearchBar/SearchBar.tsx b/web/src/components/SearchBar/SearchBar.tsx similarity index 88% rename from src/components/SearchBar/SearchBar.tsx rename to web/src/components/SearchBar/SearchBar.tsx index 4d6eb03a7..40a0c1166 100644 --- a/src/components/SearchBar/SearchBar.tsx +++ b/web/src/components/SearchBar/SearchBar.tsx @@ -1,11 +1,11 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; -import styles from './SearchBar.module.scss'; +import IconButton from '../IconButton/IconButton'; +import SearchIcon from '../../icons/Search'; +import CancelIcon from '../../icons/Cancel'; -import IconButton from '#components/IconButton/IconButton'; -import SearchIcon from '#src/icons/Search'; -import CancelIcon from '#src/icons/Cancel'; +import styles from './SearchBar.module.scss'; export type Props = { query?: string; diff --git a/src/components/SearchBar/__snapshots__/SearchBar.test.tsx.snap b/web/src/components/SearchBar/__snapshots__/SearchBar.test.tsx.snap similarity index 100% rename from src/components/SearchBar/__snapshots__/SearchBar.test.tsx.snap rename to web/src/components/SearchBar/__snapshots__/SearchBar.test.tsx.snap diff --git a/src/components/ShareButton/ShareButton.test.tsx b/web/src/components/ShareButton/ShareButton.test.tsx similarity index 100% rename from src/components/ShareButton/ShareButton.test.tsx rename to web/src/components/ShareButton/ShareButton.test.tsx diff --git a/src/components/ShareButton/ShareButton.tsx b/web/src/components/ShareButton/ShareButton.tsx similarity index 78% rename from src/components/ShareButton/ShareButton.tsx rename to web/src/components/ShareButton/ShareButton.tsx index 6a4f46d62..98fec3bed 100644 --- a/src/components/ShareButton/ShareButton.tsx +++ b/web/src/components/ShareButton/ShareButton.tsx @@ -1,11 +1,11 @@ import React, { useState } from 'react'; import { useTranslation } from 'react-i18next'; +import { copyToClipboard } from '@jwplayer/ott-common/src/utils/dom'; -import { copyToClipboard } from '#src/utils/dom'; -import Check from '#src/icons/Check'; -import Share from '#src/icons/Share'; -import useBreakpoint, { Breakpoint } from '#src/hooks/useBreakpoint'; -import Button from '#components/Button/Button'; +import Check from '../../icons/Check'; +import Share from '../../icons/Share'; +import useBreakpoint, { Breakpoint } from '../../hooks/useBreakpoint'; +import Button from '../Button/Button'; type Props = { title: string; diff --git a/src/components/ShareButton/__snapshots__/ShareButton.test.tsx.snap b/web/src/components/ShareButton/__snapshots__/ShareButton.test.tsx.snap similarity index 100% rename from src/components/ShareButton/__snapshots__/ShareButton.test.tsx.snap rename to web/src/components/ShareButton/__snapshots__/ShareButton.test.tsx.snap diff --git a/src/components/Shelf/Shelf.module.scss b/web/src/components/Shelf/Shelf.module.scss similarity index 100% rename from src/components/Shelf/Shelf.module.scss rename to web/src/components/Shelf/Shelf.module.scss diff --git a/src/components/Shelf/Shelf.test.tsx b/web/src/components/Shelf/Shelf.test.tsx similarity index 95% rename from src/components/Shelf/Shelf.test.tsx rename to web/src/components/Shelf/Shelf.test.tsx index 43fa0e73b..ff5b84d4c 100644 --- a/src/components/Shelf/Shelf.test.tsx +++ b/web/src/components/Shelf/Shelf.test.tsx @@ -1,7 +1,8 @@ import React from 'react'; -import Shelf from '#components/Shelf/Shelf'; -import { renderWithRouter } from '#test/testUtils'; +import { renderWithRouter } from '../../../test/testUtils'; + +import Shelf from './Shelf'; const playlist = { playlist: [ diff --git a/src/components/Shelf/Shelf.tsx b/web/src/components/Shelf/Shelf.tsx similarity index 87% rename from src/components/Shelf/Shelf.tsx rename to web/src/components/Shelf/Shelf.tsx index 0097f9ecd..f9f8106aa 100644 --- a/src/components/Shelf/Shelf.tsx +++ b/web/src/components/Shelf/Shelf.tsx @@ -1,19 +1,19 @@ import React, { useCallback, useState } from 'react'; import classNames from 'classnames'; import { useTranslation } from 'react-i18next'; +import type { Playlist, PlaylistItem } from '@jwplayer/ott-common/types/playlist'; +import type { AccessModel, ContentType } from '@jwplayer/ott-common/types/Config'; +import { isLocked } from '@jwplayer/ott-common/src/utils/entitlements'; +import { mediaURL } from '@jwplayer/ott-common/src/utils/formatting'; +import { PersonalShelf } from '@jwplayer/ott-common/src/constants'; -import styles from './Shelf.module.scss'; +import useBreakpoint, { Breakpoint, Breakpoints } from '../../hooks/useBreakpoint'; +import ChevronLeft from '../../icons/ChevronLeft'; +import ChevronRight from '../../icons/ChevronRight'; +import TileDock from '../TileDock/TileDock'; +import Card, { type PosterAspectRatio } from '../Card/Card'; -import useBreakpoint, { Breakpoint, Breakpoints } from '#src/hooks/useBreakpoint'; -import ChevronLeft from '#src/icons/ChevronLeft'; -import ChevronRight from '#src/icons/ChevronRight'; -import type { AccessModel, ContentType } from '#types/Config'; -import { isLocked } from '#src/utils/entitlements'; -import TileDock from '#components/TileDock/TileDock'; -import Card, { type PosterAspectRatio } from '#components/Card/Card'; -import type { Playlist, PlaylistItem } from '#types/playlist'; -import { mediaURL } from '#src/utils/formatting'; -import { PersonalShelf } from '#src/config'; +import styles from './Shelf.module.scss'; export const tileBreakpoints: Breakpoints = { [Breakpoint.xs]: 1, diff --git a/src/components/Shelf/__snapshots__/Shelf.test.tsx.snap b/web/src/components/Shelf/__snapshots__/Shelf.test.tsx.snap similarity index 100% rename from src/components/Shelf/__snapshots__/Shelf.test.tsx.snap rename to web/src/components/Shelf/__snapshots__/Shelf.test.tsx.snap diff --git a/src/components/Sidebar/Sidebar.module.scss b/web/src/components/Sidebar/Sidebar.module.scss similarity index 92% rename from src/components/Sidebar/Sidebar.module.scss rename to web/src/components/Sidebar/Sidebar.module.scss index c1b2f6f2d..933e58d98 100644 --- a/src/components/Sidebar/Sidebar.module.scss +++ b/web/src/components/Sidebar/Sidebar.module.scss @@ -1,6 +1,6 @@ -@use 'src/styles/variables'; -@use 'src/styles/theme'; -@use 'src/styles/mixins/responsive'; +@use '~/styles/variables'; +@use '~/styles/theme'; +@use '~/styles/mixins/responsive'; // // jwSidebarBackdrop diff --git a/src/components/Sidebar/Sidebar.test.tsx b/web/src/components/Sidebar/Sidebar.test.tsx similarity index 79% rename from src/components/Sidebar/Sidebar.test.tsx rename to web/src/components/Sidebar/Sidebar.test.tsx index ad94255c4..5d7b4f8c8 100644 --- a/src/components/Sidebar/Sidebar.test.tsx +++ b/web/src/components/Sidebar/Sidebar.test.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import Sidebar from './Sidebar'; +import { renderWithRouter } from '../../../test/testUtils'; +import Button from '../Button/Button'; -import { renderWithRouter } from '#test/testUtils'; -import Button from '#components/Button/Button'; +import Sidebar from './Sidebar'; describe('', () => { const playlistMenuItems = [ - -
+
-

+

account.email

@@ -101,14 +107,17 @@ exports[` > renders and matches snapshot 1`] = `
- -
+
-

+

account.security

@@ -128,14 +137,17 @@ exports[` > renders and matches snapshot 1`] = `
- -
+
-

+

account.terms_and_tracking

@@ -146,14 +158,17 @@ exports[` > renders and matches snapshot 1`] = `
-
-
+
-

+

account.other_registration_details

@@ -173,13 +188,13 @@ exports[` > renders and matches snapshot 1`] = ` class="_row_531f07" > @@ -190,6 +205,6 @@ exports[` > renders and matches snapshot 1`] = `
-
+
`; diff --git a/packages/ui-react/src/components/CreditCardCVCField/__snapshots__/CreditCardCVCField.test.tsx.snap b/packages/ui-react/src/components/CreditCardCVCField/__snapshots__/CreditCardCVCField.test.tsx.snap index c59cfacb3..97e945f11 100644 --- a/packages/ui-react/src/components/CreditCardCVCField/__snapshots__/CreditCardCVCField.test.tsx.snap +++ b/packages/ui-react/src/components/CreditCardCVCField/__snapshots__/CreditCardCVCField.test.tsx.snap @@ -7,7 +7,7 @@ exports[` > renders and matches snapshot 1`] = ` > @@ -17,7 +17,7 @@ exports[` > renders and matches snapshot 1`] = ` > renders and matches snapshot 1`] = ` > @@ -16,7 +16,7 @@ exports[` > renders and matches snapshot 1`] = ` > > renders and matches snapshot 1`] = ` > @@ -16,7 +16,7 @@ exports[` > renders and matches snapshot 1`] = ` > > renders and matches snapshot 1`] = ` > @@ -73,7 +73,7 @@ exports[` > renders and matches snapshot 1`] = ` > ({ ); return ( -
+
-

{label}

+

{label}

{isBusy && isEditing && } {content && ( @@ -183,6 +183,6 @@ export function FormSection({ )}
)} -
+ ); } diff --git a/packages/ui-react/src/components/Form/__snapshots__/Form.test.tsx.snap b/packages/ui-react/src/components/Form/__snapshots__/Form.test.tsx.snap index 66ebd97e4..aa5227432 100644 --- a/packages/ui-react/src/components/Form/__snapshots__/Form.test.tsx.snap +++ b/packages/ui-react/src/components/Form/__snapshots__/Form.test.tsx.snap @@ -2,9 +2,13 @@ exports[` > renders Form 1`] = `
-
+
-

+

Edit This

@@ -29,6 +33,6 @@ exports[` > renders Form 1`] = `
-
+ `; diff --git a/packages/ui-react/src/components/Payment/Payment.tsx b/packages/ui-react/src/components/Payment/Payment.tsx index 2d988b996..1ee6aff0c 100644 --- a/packages/ui-react/src/components/Payment/Payment.tsx +++ b/packages/ui-react/src/components/Payment/Payment.tsx @@ -10,6 +10,7 @@ import { ACCESS_MODEL } from '@jwp/ott-common/src/constants'; import ExternalLink from '@jwp/ott-theme/assets/icons/external_link.svg?react'; import PayPal from '@jwp/ott-theme/assets/icons/paypal.svg?react'; import useBreakpoint, { Breakpoint } from '@jwp/ott-ui-react/src/hooks/useBreakpoint'; +import useOpaqueId from '@jwp/ott-hooks-react/src/useOpaqueId'; import IconButton from '../IconButton/IconButton'; import Alert from '../Alert/Alert'; @@ -84,6 +85,9 @@ const Payment = ({ isUpgradeOffer, setIsUpgradeOffer, }: Props): JSX.Element => { + const subscriptionDetailsId = useOpaqueId('subscription-details'); + const paymentMethodId = useOpaqueId('payment-method'); + const billingHistoryId = useOpaqueId('billing-history'); const { t, i18n } = useTranslation(['user', 'account']); const hiddenTransactionsCount = transactions ? transactions?.length - VISIBLE_TRANSACTIONS : 0; const hasMoreTransactions = hiddenTransactionsCount > 0; @@ -169,9 +173,9 @@ const Payment = ({ />

{t('nav.payments')}

{accessModel === ACCESS_MODEL.SVOD && ( -
+
-

{isChangingOffer ? t('user:payment.change_plan') : t('user:payment.subscription_details')}

+

{isChangingOffer ? t('user:payment.change_plan') : t('user:payment.subscription_details')}

{activeSubscription ? ( @@ -269,11 +273,11 @@ const Payment = ({
)} - + )} -
+
-

{t('user:payment.payment_method')}

+

{t('user:payment.payment_method')}

{activePaymentDetail ? ( activePaymentDetail.paymentMethod === 'paypal' ? ( @@ -306,10 +310,10 @@ const Payment = ({ {canUpdatePaymentMethod && (
-
+ +
-

{t('user:payment.billing_history')}

+

{t('user:payment.billing_history')}

{transactions?.length ? ( @@ -353,7 +357,7 @@ const Payment = ({

{!isLoading && t('user:payment.no_transactions')}

)} - + {isLoading && } ); diff --git a/packages/ui-react/src/components/Payment/__snapshots__/Payment.test.tsx.snap b/packages/ui-react/src/components/Payment/__snapshots__/Payment.test.tsx.snap index 2ebf19efe..dfcba11ba 100644 --- a/packages/ui-react/src/components/Payment/__snapshots__/Payment.test.tsx.snap +++ b/packages/ui-react/src/components/Payment/__snapshots__/Payment.test.tsx.snap @@ -7,9 +7,13 @@ exports[` > renders and matches snapshot 1`] = ` > nav.payments -
+
-

+

user:payment.payment_method

@@ -65,10 +69,14 @@ exports[` > renders and matches snapshot 1`] = `
- -
+ +
-

+

user:payment.billing_history

@@ -150,6 +158,6 @@ exports[` > renders and matches snapshot 1`] = `
- + `; diff --git a/packages/ui-react/src/components/PersonalDetailsForm/__snapshots__/PersonalDetailsForm.test.tsx.snap b/packages/ui-react/src/components/PersonalDetailsForm/__snapshots__/PersonalDetailsForm.test.tsx.snap index 84e309a07..aae29ec1b 100644 --- a/packages/ui-react/src/components/PersonalDetailsForm/__snapshots__/PersonalDetailsForm.test.tsx.snap +++ b/packages/ui-react/src/components/PersonalDetailsForm/__snapshots__/PersonalDetailsForm.test.tsx.snap @@ -21,7 +21,7 @@ exports[` > Renders with errors 1`] = ` > @@ -30,7 +30,7 @@ exports[` > Renders with errors 1`] = ` > > Renders with errors 1`] = ` > @@ -58,7 +58,7 @@ exports[` > Renders with errors 1`] = ` > > Renders with errors 1`] = ` >