orionplace-nuxt 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +711 -24
- package/bin/orionplace-nuxt.mjs +39 -11
- package/package.json +26 -6
- package/runtime/api.mjs +4 -1
- package/runtime/domain.mjs +4 -2
- package/runtime/marketplace.mjs +287 -211
- package/src/asset-loading-plugin.mjs +10 -0
- package/src/module.mjs +44 -14
- package/src/project-readme.mjs +507 -35
- package/src/setup.mjs +100 -51
- package/src/update.mjs +36 -0
- package/src/validation.mjs +6 -0
- package/templates/.vscode/settings.json +5 -0
- package/templates/app/app.vue +48 -0
- package/templates/app/assets/css/orionplace-tokens.css +21 -0
- package/templates/app/assets/css/orionplace.css +28 -0
- package/templates/app/components/orionplace/account/AccountActivity.README.md +31 -0
- package/templates/app/components/orionplace/account/AccountActivity.vue +61 -0
- package/templates/app/components/orionplace/account/AccountPromocodes.README.md +50 -0
- package/templates/app/components/orionplace/account/AccountPromocodes.vue +267 -0
- package/templates/app/components/orionplace/account/AccountSection.README.md +31 -0
- package/templates/app/components/orionplace/account/AccountSection.vue +132 -0
- package/templates/app/components/orionplace/account/ProfileAvatar.vue +139 -0
- package/templates/app/components/orionplace/account/ProfileDeleteAccount.vue +161 -0
- package/templates/app/components/orionplace/account/ProfileDetailsForm.vue +172 -0
- package/templates/app/components/orionplace/account/ProfileEmailSettings.vue +269 -0
- package/templates/app/components/orionplace/account/ProfilePasswordForm.vue +201 -0
- package/templates/app/components/orionplace/account/ProfileSignIn.vue +446 -0
- package/templates/app/components/orionplace/account/SignInHistory.README.md +27 -0
- package/templates/app/components/orionplace/account/SignInHistory.vue +218 -0
- package/templates/app/components/orionplace/account/StorefrontLogout.README.md +15 -0
- package/templates/app/components/orionplace/account/StorefrontLogout.vue +109 -0
- package/templates/app/components/orionplace/account/StorefrontProfile.README.md +145 -0
- package/templates/app/components/orionplace/account/StorefrontProfile.vue +168 -0
- package/templates/app/components/orionplace/account/account.css +1047 -0
- package/templates/app/components/orionplace/account/profile.css +696 -0
- package/templates/app/components/orionplace/address/AddressForm.README.md +67 -0
- package/templates/app/components/orionplace/address/AddressForm.vue +537 -0
- package/templates/app/components/orionplace/address/StorefrontAddresses.README.md +44 -0
- package/templates/app/components/orionplace/address/StorefrontAddresses.vue +438 -0
- package/templates/app/components/orionplace/banners/MainBanner.vue +171 -0
- package/templates/app/components/orionplace/banners/examples/BannerExample.vue +6 -0
- package/templates/app/components/orionplace/blog/BlogArticle.README.md +44 -0
- package/templates/app/components/orionplace/blog/BlogArticle.vue +829 -0
- package/templates/app/components/orionplace/blog/BlogCommentForm.README.md +28 -0
- package/templates/app/components/orionplace/blog/BlogCommentForm.vue +129 -0
- package/templates/app/components/orionplace/blog/BlogComments.README.md +36 -0
- package/templates/app/components/orionplace/blog/BlogComments.vue +373 -0
- package/templates/app/components/orionplace/blog/BlogPostCard.vue +307 -0
- package/templates/app/components/orionplace/blog/BlogPostGroup.vue +108 -0
- package/templates/app/components/orionplace/blog/StorefrontJournal.README.md +42 -0
- package/templates/app/components/orionplace/blog/StorefrontJournal.vue +669 -0
- package/templates/app/components/orionplace/branding/BrandLogos.vue +25 -0
- package/templates/app/components/orionplace/branding/examples/BrandLogosExample.vue +6 -0
- package/templates/app/components/orionplace/cart/CartCheckoutDetails.README.md +81 -0
- package/templates/app/components/orionplace/cart/CartCheckoutDetails.vue +367 -0
- package/templates/app/components/orionplace/cart/CartDeliverySelector.README.md +95 -0
- package/templates/app/components/orionplace/cart/CartDeliverySelector.vue +724 -0
- package/templates/app/components/orionplace/cart/CartItemOptions.README.md +98 -0
- package/templates/app/components/orionplace/cart/CartItemOptions.vue +693 -0
- package/templates/app/components/orionplace/cart/CartLineItem.README.md +70 -0
- package/templates/app/components/orionplace/cart/CartLineItem.vue +271 -0
- package/templates/app/components/orionplace/cart/CartPreview.README.md +43 -0
- package/templates/app/components/orionplace/cart/CartPreview.vue +263 -0
- package/templates/app/components/orionplace/cart/DeliveryMap.README.md +48 -0
- package/templates/app/components/orionplace/cart/DeliveryMap.vue +155 -0
- package/templates/app/components/orionplace/cart/StorefrontCart.README.md +89 -0
- package/templates/app/components/orionplace/cart/StorefrontCart.vue +689 -0
- package/templates/app/components/orionplace/catalog/CatalogHeader.vue +681 -0
- package/templates/app/components/orionplace/catalog/CatalogRepresentative.vue +59 -0
- package/templates/app/components/orionplace/catalog/StorefrontCatalog.README.md +35 -0
- package/templates/app/components/orionplace/catalog/StorefrontCatalog.vue +179 -0
- package/templates/app/components/orionplace/catalog/examples/CatalogHeaderExample.vue +6 -0
- package/templates/app/components/orionplace/categories/CategoryGroup.vue +125 -0
- package/templates/app/components/orionplace/categories/StorefrontCategory.README.md +60 -0
- package/templates/app/components/orionplace/categories/StorefrontCategory.vue +277 -0
- package/templates/app/components/orionplace/categories/examples/CategoryGroupExample.vue +7 -0
- package/templates/app/components/orionplace/contact/AboutPage.README.md +23 -0
- package/templates/app/components/orionplace/contact/AboutPage.vue +409 -0
- package/templates/app/components/orionplace/contact/ContactForm.README.md +29 -0
- package/templates/app/components/orionplace/contact/ContactForm.vue +289 -0
- package/templates/app/components/orionplace/contact/EmailUnsubscribe.README.md +27 -0
- package/templates/app/components/orionplace/contact/EmailUnsubscribe.vue +95 -0
- package/templates/app/components/orionplace/contact/StorefrontContact.README.md +18 -0
- package/templates/app/components/orionplace/contact/StorefrontContact.vue +89 -0
- package/templates/app/components/orionplace/contact/examples/ContactExample.vue +6 -0
- package/templates/app/components/orionplace/currencies/MainCurrencySwitcher.vue +80 -0
- package/templates/app/components/orionplace/currencies/examples/CurrencyExample.vue +6 -0
- package/templates/app/components/orionplace/events/EventEnrollmentDialog.README.md +58 -0
- package/templates/app/components/orionplace/events/EventEnrollmentDialog.vue +294 -0
- package/templates/app/components/orionplace/events/EventsBlock.vue +138 -0
- package/templates/app/components/orionplace/events/examples/EventsExample.vue +6 -0
- package/templates/app/components/orionplace/locale/MainLanguageSwitcher.vue +506 -0
- package/templates/app/components/orionplace/locale/examples/LocaleExample.vue +6 -0
- package/templates/app/components/orionplace/manufacturers/ManufacturerIndex.README.md +36 -0
- package/templates/app/components/orionplace/manufacturers/ManufacturerIndex.vue +495 -0
- package/templates/app/components/orionplace/manufacturers/StorefrontManufacturers.README.md +30 -0
- package/templates/app/components/orionplace/manufacturers/StorefrontManufacturers.vue +263 -0
- package/templates/app/components/orionplace/orders/OrderDetails.README.md +39 -0
- package/templates/app/components/orionplace/orders/OrderDetails.vue +1074 -0
- package/templates/app/components/orionplace/orders/OrderPaymentForm.README.md +59 -0
- package/templates/app/components/orionplace/orders/OrderPaymentForm.vue +73 -0
- package/templates/app/components/orionplace/orders/StorefrontOrders.README.md +39 -0
- package/templates/app/components/orionplace/orders/StorefrontOrders.vue +869 -0
- package/templates/app/components/orionplace/orders/orders.css +612 -0
- package/templates/app/components/orionplace/payments/PaymentPanel.README.md +76 -0
- package/templates/app/components/orionplace/payments/PaymentPanel.vue +108 -0
- package/templates/app/components/orionplace/products/HoverImageViewer.vue +190 -0
- package/templates/app/components/orionplace/products/ProductCard.README.md +63 -0
- package/templates/app/components/orionplace/products/ProductCard.vue +897 -0
- package/templates/app/components/orionplace/products/ProductCardActions.README.md +33 -0
- package/templates/app/components/orionplace/products/ProductCardActions.vue +412 -0
- package/templates/app/components/orionplace/products/ProductCardBadges.vue +83 -0
- package/templates/app/components/orionplace/products/ProductCardDescription.vue +46 -0
- package/templates/app/components/orionplace/products/ProductCardFavorite.vue +99 -0
- package/templates/app/components/orionplace/products/ProductCardPrice.vue +66 -0
- package/templates/app/components/orionplace/products/ProductCardRating.vue +65 -0
- package/templates/app/components/orionplace/products/ProductCardSeller.vue +66 -0
- package/templates/app/components/orionplace/products/ProductCardStockNotice.vue +43 -0
- package/templates/app/components/orionplace/products/ProductCardTitle.vue +46 -0
- package/templates/app/components/orionplace/products/ProductCardVariants.vue +388 -0
- package/templates/app/components/orionplace/products/ProductGroup.vue +257 -0
- package/templates/app/components/orionplace/products/ProductPreorderDialog.README.md +22 -0
- package/templates/app/components/orionplace/products/ProductPreorderDialog.vue +471 -0
- package/templates/app/components/orionplace/products/ProductReviewForm.README.md +39 -0
- package/templates/app/components/orionplace/products/ProductReviewForm.vue +312 -0
- package/templates/app/components/orionplace/products/ProductReviewGallery.README.md +28 -0
- package/templates/app/components/orionplace/products/ProductReviewGallery.vue +141 -0
- package/templates/app/components/orionplace/products/ProductReviewImageViewer.README.md +51 -0
- package/templates/app/components/orionplace/products/ProductReviewImageViewer.vue +351 -0
- package/templates/app/components/orionplace/products/ProductReviews.README.md +70 -0
- package/templates/app/components/orionplace/products/ProductReviews.vue +1025 -0
- package/templates/app/components/orionplace/products/ProductSecondaryVariantModal.vue +460 -0
- package/templates/app/components/orionplace/products/ProductSpecificationsDialog.README.md +65 -0
- package/templates/app/components/orionplace/products/ProductSpecificationsDialog.vue +174 -0
- package/templates/app/components/orionplace/products/StorefrontProduct.README.md +52 -0
- package/templates/app/components/orionplace/products/StorefrontProduct.vue +1466 -0
- package/templates/app/components/orionplace/products/StorefrontWishlist.README.md +33 -0
- package/templates/app/components/orionplace/products/StorefrontWishlist.vue +290 -0
- package/templates/app/components/orionplace/products/examples/FeaturedExample.vue +6 -0
- package/templates/app/components/orionplace/products/examples/FeaturedHoverImageViewerExample.vue +14 -0
- package/templates/app/components/orionplace/products/examples/FeaturedProductCardActionsExample.vue +14 -0
- package/templates/app/components/orionplace/products/examples/FeaturedProductCardBadgesExample.vue +14 -0
- package/templates/app/components/orionplace/products/examples/FeaturedProductCardDescriptionExample.vue +14 -0
- package/templates/app/components/orionplace/products/examples/FeaturedProductCardExample.vue +14 -0
- package/templates/app/components/orionplace/products/examples/FeaturedProductCardFavoriteExample.vue +14 -0
- package/templates/app/components/orionplace/products/examples/FeaturedProductCardPriceExample.vue +14 -0
- package/templates/app/components/orionplace/products/examples/FeaturedProductCardRatingExample.vue +14 -0
- package/templates/app/components/orionplace/products/examples/FeaturedProductCardSellerExample.vue +14 -0
- package/templates/app/components/orionplace/products/examples/FeaturedProductCardStockNoticeExample.vue +14 -0
- package/templates/app/components/orionplace/products/examples/FeaturedProductCardTitleExample.vue +14 -0
- package/templates/app/components/orionplace/products/examples/FeaturedProductCardVariantsExample.vue +14 -0
- package/templates/app/components/orionplace/products/examples/ProductsExample.vue +6 -0
- package/templates/app/components/orionplace/products/examples/ProductsHoverImageViewerExample.vue +13 -0
- package/templates/app/components/orionplace/products/examples/ProductsProductCardActionsExample.vue +13 -0
- package/templates/app/components/orionplace/products/examples/ProductsProductCardBadgesExample.vue +13 -0
- package/templates/app/components/orionplace/products/examples/ProductsProductCardDescriptionExample.vue +13 -0
- package/templates/app/components/orionplace/products/examples/ProductsProductCardExample.vue +13 -0
- package/templates/app/components/orionplace/products/examples/ProductsProductCardFavoriteExample.vue +13 -0
- package/templates/app/components/orionplace/products/examples/ProductsProductCardPriceExample.vue +13 -0
- package/templates/app/components/orionplace/products/examples/ProductsProductCardRatingExample.vue +13 -0
- package/templates/app/components/orionplace/products/examples/ProductsProductCardSellerExample.vue +13 -0
- package/templates/app/components/orionplace/products/examples/ProductsProductCardStockNoticeExample.vue +13 -0
- package/templates/app/components/orionplace/products/examples/ProductsProductCardTitleExample.vue +13 -0
- package/templates/app/components/orionplace/products/examples/ProductsProductCardVariantsExample.vue +13 -0
- package/templates/app/components/orionplace/promo/PromoProducts.README.md +45 -0
- package/templates/app/components/orionplace/promo/PromoProducts.vue +287 -0
- package/templates/app/components/orionplace/search/MainSearch.vue +342 -0
- package/templates/app/components/orionplace/search/ProductSearchResults.README.md +81 -0
- package/templates/app/components/orionplace/search/ProductSearchResults.vue +458 -0
- package/templates/app/components/orionplace/search/SearchFilters.vue +546 -0
- package/templates/app/components/orionplace/search/examples/MainSearchExample.vue +6 -0
- package/templates/app/components/orionplace/sellers/SellerFilters.README.md +32 -0
- package/templates/app/components/orionplace/sellers/SellerFilters.vue +317 -0
- package/templates/app/components/orionplace/sellers/SellerPhotoGallery.README.md +45 -0
- package/templates/app/components/orionplace/sellers/SellerPhotoGallery.vue +406 -0
- package/templates/app/components/orionplace/sellers/SellerSummary.README.md +33 -0
- package/templates/app/components/orionplace/sellers/SellerSummary.vue +162 -0
- package/templates/app/components/orionplace/sellers/StorefrontSellers.README.md +73 -0
- package/templates/app/components/orionplace/sellers/StorefrontSellers.vue +300 -0
- package/templates/app/components/orionplace/shared/OrionplaceAvatar.README.md +30 -0
- package/templates/app/components/orionplace/shared/OrionplaceAvatar.vue +83 -0
- package/templates/app/components/orionplace/shared/OrionplaceBreadcrumbs.README.md +65 -0
- package/templates/app/components/orionplace/shared/OrionplaceBreadcrumbs.vue +118 -0
- package/templates/app/components/orionplace/shared/OrionplaceEmptyState.README.md +38 -0
- package/templates/app/components/orionplace/shared/OrionplaceEmptyState.vue +143 -0
- package/templates/app/components/orionplace/shared/OrionplaceImage.vue +84 -0
- package/templates/app/components/orionplace/shared/OrionplaceInfoHint.README.md +32 -0
- package/templates/app/components/orionplace/shared/OrionplaceInfoHint.vue +158 -0
- package/templates/app/components/orionplace/shared/OrionplacePasswordInput.README.md +30 -0
- package/templates/app/components/orionplace/shared/OrionplacePasswordInput.vue +197 -0
- package/templates/app/components/orionplace/shared/OrionplaceSearchSelect.README.md +38 -0
- package/templates/app/components/orionplace/shared/OrionplaceSearchSelect.vue +411 -0
- package/templates/app/components/orionplace/shared/OrionplaceSelect.README.md +31 -0
- package/templates/app/components/orionplace/shared/OrionplaceSelect.vue +525 -0
- package/templates/app/components/orionplace/shared/StorefrontErrorPage.README.md +55 -0
- package/templates/app/components/orionplace/shared/StorefrontErrorPage.vue +151 -0
- package/templates/app/components/orionplace/shared/StorefrontPagination.README.md +45 -0
- package/templates/app/components/orionplace/shared/StorefrontPagination.vue +101 -0
- package/templates/app/components/orionplace/shared/dialogs.css +36 -0
- package/templates/app/components/orionplace/shared/features.css +364 -0
- package/templates/app/components/orionplace/social/SocialLinks.vue +72 -0
- package/templates/app/components/orionplace/social/examples/SocialLinksExample.vue +6 -0
- package/templates/app/components/orionplace/storefront/StorefrontAccount.README.md +47 -0
- package/templates/app/components/orionplace/storefront/StorefrontAccount.vue +332 -0
- package/templates/app/components/orionplace/storefront/StorefrontCartButton.vue +68 -0
- package/templates/app/components/orionplace/storefront/StorefrontFooter.README.md +26 -0
- package/templates/app/components/orionplace/storefront/StorefrontFooter.vue +222 -0
- package/templates/app/components/orionplace/storefront/StorefrontHeader.README.md +93 -0
- package/templates/app/components/orionplace/storefront/StorefrontHeader.vue +509 -0
- package/templates/app/components/orionplace/storefront/StorefrontHome.README.md +79 -0
- package/templates/app/components/orionplace/storefront/StorefrontHome.vue +315 -0
- package/templates/app/components/orionplace/storefront/StorefrontWishlistButton.vue +105 -0
- package/templates/app/components/orionplace/storefront/examples/StorefrontAccountExample.vue +7 -0
- package/templates/app/components/orionplace/stores/StorefrontStores.README.md +41 -0
- package/templates/app/components/orionplace/stores/StorefrontStores.vue +345 -0
- package/templates/app/components/orionplace/subscriptions/StorefrontSubscriptions.README.md +151 -0
- package/templates/app/components/orionplace/subscriptions/StorefrontSubscriptions.vue +851 -0
- package/templates/app/components/orionplace/subscriptions/StorefrontTariff.README.md +38 -0
- package/templates/app/components/orionplace/subscriptions/StorefrontTariff.vue +535 -0
- package/templates/app/components/orionplace/subscriptions/StorefrontTariffs.README.md +36 -0
- package/templates/app/components/orionplace/subscriptions/StorefrontTariffs.vue +395 -0
- package/templates/app/components/orionplace/subscriptions/SubscriptionCancelDialog.README.md +39 -0
- package/templates/app/components/orionplace/subscriptions/SubscriptionCancelDialog.vue +292 -0
- package/templates/app/components/orionplace/subscriptions/SubscriptionChangeDialog.README.md +85 -0
- package/templates/app/components/orionplace/subscriptions/SubscriptionChangeDialog.vue +874 -0
- package/templates/app/components/orionplace/subscriptions/SubscriptionExtendDialog.README.md +53 -0
- package/templates/app/components/orionplace/subscriptions/SubscriptionExtendDialog.vue +536 -0
- package/templates/app/components/orionplace/subscriptions/SubscriptionPlanSummary.README.md +101 -0
- package/templates/app/components/orionplace/subscriptions/SubscriptionPlanSummary.vue +286 -0
- package/templates/app/components/orionplace/subscriptions/SubscriptionRemoteDetails.README.md +138 -0
- package/templates/app/components/orionplace/subscriptions/SubscriptionRemoteDetails.vue +134 -0
- package/templates/app/components/orionplace/subscriptions/SubscriptionRenewalDialog.README.md +85 -0
- package/templates/app/components/orionplace/subscriptions/SubscriptionRenewalDialog.vue +364 -0
- package/templates/app/components/orionplace/support/StorefrontSupport.README.md +39 -0
- package/templates/app/components/orionplace/support/StorefrontSupport.vue +484 -0
- package/templates/app/components/orionplace/support/TicketConversation.README.md +38 -0
- package/templates/app/components/orionplace/support/TicketConversation.vue +524 -0
- package/templates/app/components/orionplace/support/TicketImage.README.md +27 -0
- package/templates/app/components/orionplace/support/TicketImage.vue +186 -0
- package/templates/app/components/orionplace/support/TicketItemCard.README.md +59 -0
- package/templates/app/components/orionplace/support/TicketItemCard.vue +177 -0
- package/templates/app/components/orionplace/support/TicketMessageForm.README.md +35 -0
- package/templates/app/components/orionplace/support/TicketMessageForm.vue +258 -0
- package/templates/app/components/orionplace/support/TicketSubscriptionCard.README.md +40 -0
- package/templates/app/components/orionplace/support/TicketSubscriptionCard.vue +154 -0
- package/templates/app/components/orionplace/tariffs/TariffCard.README.md +12 -0
- package/templates/app/components/orionplace/tariffs/TariffCard.vue +241 -0
- package/templates/app/components/orionplace/tariffs/TariffCardDescription.README.md +12 -0
- package/templates/app/components/orionplace/tariffs/TariffCardDescription.vue +97 -0
- package/templates/app/components/orionplace/tariffs/TariffCardFeatures.README.md +14 -0
- package/templates/app/components/orionplace/tariffs/TariffCardFeatures.vue +172 -0
- package/templates/app/components/orionplace/tariffs/TariffCardImage.README.md +12 -0
- package/templates/app/components/orionplace/tariffs/TariffCardImage.vue +33 -0
- package/templates/app/components/orionplace/tariffs/TariffCardPrices.README.md +12 -0
- package/templates/app/components/orionplace/tariffs/TariffCardPrices.vue +280 -0
- package/templates/app/components/orionplace/tariffs/TariffCardTitle.README.md +12 -0
- package/templates/app/components/orionplace/tariffs/TariffCardTitle.vue +30 -0
- package/templates/app/components/orionplace/tariffs/TariffCards.README.md +12 -0
- package/templates/app/components/orionplace/tariffs/TariffCards.vue +94 -0
- package/templates/app/components/orionplace/tariffs/TariffSubscriptionModal.README.md +31 -0
- package/templates/app/components/orionplace/tariffs/TariffSubscriptionModal.vue +411 -0
- package/templates/app/components/orionplace/tariffs/examples/TariffCardDescriptionExample.vue +13 -0
- package/templates/app/components/orionplace/tariffs/examples/TariffCardExample.vue +13 -0
- package/templates/app/components/orionplace/tariffs/examples/TariffCardFeaturesExample.vue +14 -0
- package/templates/app/components/orionplace/tariffs/examples/TariffCardImageExample.vue +13 -0
- package/templates/app/components/orionplace/tariffs/examples/TariffCardPricesExample.vue +13 -0
- package/templates/app/components/orionplace/tariffs/examples/TariffCardTitleExample.vue +13 -0
- package/templates/app/components/orionplace/tariffs/examples/TariffCardsExample.vue +6 -0
- package/templates/app/components/orionplace/theme/OrionplaceThemeProvider.vue +38 -0
- package/templates/app/components/orionplace/units/UnitSwitcher.vue +71 -0
- package/templates/app/components/orionplace/units/examples/LengthExample.vue +6 -0
- package/templates/app/components/orionplace/units/examples/WeightExample.vue +6 -0
- package/templates/app/components/orionplace/wallet/StorefrontWallet.README.md +117 -0
- package/templates/app/components/orionplace/wallet/StorefrontWallet.vue +863 -0
- package/templates/app/components/orionplace/wallet/WalletBalance.vue +47 -0
- package/templates/app/components/orionplace/wallet/WalletTopUpForm.README.md +32 -0
- package/templates/app/components/orionplace/wallet/WalletTopUpForm.vue +224 -0
- package/templates/app/components/orionplace/wallet/examples/WalletExample.vue +6 -0
- package/templates/app/composables/useOrionplaceActionMenu.ts +126 -0
- package/templates/app/composables/useOrionplaceAddressEditor.ts +343 -0
- package/templates/app/composables/useOrionplaceAddresses.ts +75 -0
- package/templates/app/composables/useOrionplaceApi.ts +174 -0
- package/templates/app/composables/useOrionplaceAppLoad.ts +74 -0
- package/templates/app/composables/useOrionplaceBlogComments.ts +325 -0
- package/templates/app/composables/useOrionplaceBlogReading.ts +270 -0
- package/templates/app/composables/useOrionplaceCart.ts +226 -0
- package/templates/app/composables/useOrionplaceCartPreview.ts +142 -0
- package/templates/app/composables/useOrionplaceCategoryLink.ts +24 -0
- package/templates/app/composables/useOrionplaceCategoryProducts.ts +16 -0
- package/templates/app/composables/useOrionplaceFeature.ts +100 -0
- package/templates/app/composables/useOrionplaceFeaturedProducts.ts +14 -0
- package/templates/app/composables/useOrionplaceGeolocation.ts +28 -0
- package/templates/app/composables/useOrionplaceHomeProducts.ts +90 -0
- package/templates/app/composables/useOrionplaceManufacturerIndex.ts +83 -0
- package/templates/app/composables/useOrionplaceMap.ts +240 -0
- package/templates/app/composables/useOrionplaceMediaFormat.ts +24 -0
- package/templates/app/composables/useOrionplaceMissingPage.ts +67 -0
- package/templates/app/composables/useOrionplaceOrders.ts +185 -0
- package/templates/app/composables/useOrionplacePageSeo.ts +38 -0
- package/templates/app/composables/useOrionplaceProductActions.ts +116 -0
- package/templates/app/composables/useOrionplaceProductLink.ts +24 -0
- package/templates/app/composables/useOrionplaceProductSearch.ts +259 -0
- package/templates/app/composables/useOrionplaceProductVariants.ts +176 -0
- package/templates/app/composables/useOrionplaceProfile.ts +309 -0
- package/templates/app/composables/useOrionplaceProgress.ts +89 -0
- package/templates/app/composables/useOrionplaceReviews.ts +242 -0
- package/templates/app/composables/useOrionplaceSearchHistory.ts +23 -0
- package/templates/app/composables/useOrionplaceSearchScopeNames.ts +99 -0
- package/templates/app/composables/useOrionplaceServerData.ts +72 -0
- package/templates/app/composables/useOrionplaceSignIn.ts +66 -0
- package/templates/app/composables/useOrionplaceStableHeight.ts +69 -0
- package/templates/app/composables/useOrionplaceStorefront.ts +29 -0
- package/templates/app/composables/useOrionplaceSubscriptions.ts +217 -0
- package/templates/app/composables/useOrionplaceTheme.ts +27 -0
- package/templates/app/composables/useOrionplaceTicketSubject.ts +180 -0
- package/templates/app/composables/useOrionplaceTickets.ts +335 -0
- package/templates/app/composables/useOrionplaceWallet.ts +166 -0
- package/templates/app/error.vue +108 -0
- package/templates/app/interfaces/orionplace/accounts/IContact.ts +21 -0
- package/templates/app/interfaces/orionplace/accounts/IEmailNotificationLocale.ts +17 -0
- package/templates/app/interfaces/orionplace/accounts/IEmailVerification.ts +59 -0
- package/templates/app/interfaces/orionplace/accounts/IProfileActions.ts +38 -0
- package/templates/app/interfaces/orionplace/accounts/IProfileData.ts +123 -0
- package/templates/app/interfaces/orionplace/accounts/IProfileMedia.ts +17 -0
- package/templates/app/interfaces/orionplace/accounts/IStorefrontProfile.ts +54 -0
- package/templates/app/interfaces/orionplace/address/IAddressCitySuggestion.ts +19 -0
- package/templates/app/interfaces/orionplace/address/IAddressEditor.ts +9 -0
- package/templates/app/interfaces/orionplace/address/IAddressLocationSuggestion.ts +22 -0
- package/templates/app/interfaces/orionplace/address/IAddressRegionSearch.ts +30 -0
- package/templates/app/interfaces/orionplace/address/IAddressSuggestion.ts +20 -0
- package/templates/app/interfaces/orionplace/address/IUserAddress.ts +87 -0
- package/templates/app/interfaces/orionplace/apiBase/TMethod.ts +1 -0
- package/templates/app/interfaces/orionplace/appBase/IAppLoad.ts +16 -0
- package/templates/app/interfaces/orionplace/appBase/IAppLoadCommon.ts +45 -0
- package/templates/app/interfaces/orionplace/appBase/IApploadUserProfile.ts +13 -0
- package/templates/app/interfaces/orionplace/appBase/IForm.ts +21 -0
- package/templates/app/interfaces/orionplace/appBase/ISEO.ts +21 -0
- package/templates/app/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonBanner.ts +11 -0
- package/templates/app/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonContact.ts +8 -0
- package/templates/app/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonCurrency.ts +15 -0
- package/templates/app/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonEvents.ts +18 -0
- package/templates/app/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonLocale.ts +14 -0
- package/templates/app/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonLogos.ts +6 -0
- package/templates/app/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonPath.ts +22 -0
- package/templates/app/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonSEO.ts +26 -0
- package/templates/app/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonSocial.ts +15 -0
- package/templates/app/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonTariff.ts +7 -0
- package/templates/app/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonUnit.ts +12 -0
- package/templates/app/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonVariables.ts +8 -0
- package/templates/app/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonVisualSettings.ts +11 -0
- package/templates/app/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonWalletValue.ts +3 -0
- package/templates/app/interfaces/orionplace/blog/IBlogApi.ts +247 -0
- package/templates/app/interfaces/orionplace/blog/IBlogPostPreview.ts +30 -0
- package/templates/app/interfaces/orionplace/cart/ICartActions.ts +67 -0
- package/templates/app/interfaces/orionplace/cart/ICartData.ts +382 -0
- package/templates/app/interfaces/orionplace/cart/ICartDeliveryActions.ts +68 -0
- package/templates/app/interfaces/orionplace/cart/ICartModal.ts +22 -0
- package/templates/app/interfaces/orionplace/cart/IDeliveryMap.ts +29 -0
- package/templates/app/interfaces/orionplace/catalog/ICatalogDirectory.ts +75 -0
- package/templates/app/interfaces/orionplace/category/ICategory.ts +41 -0
- package/templates/app/interfaces/orionplace/domains/IDomain.ts +13 -0
- package/templates/app/interfaces/orionplace/forms/ICustomerSubfilter.ts +19 -0
- package/templates/app/interfaces/orionplace/index.ts +57 -0
- package/templates/app/interfaces/orionplace/marketing/IPromoActions.ts +51 -0
- package/templates/app/interfaces/orionplace/orders/IOrderActions.ts +99 -0
- package/templates/app/interfaces/orionplace/orders/IOrderHistory.ts +259 -0
- package/templates/app/interfaces/orionplace/orders/IProductPreorder.ts +31 -0
- package/templates/app/interfaces/orionplace/payments/IInvoice.ts +147 -0
- package/templates/app/interfaces/orionplace/products/IProduct.ts +262 -0
- package/templates/app/interfaces/orionplace/products/IProductFeedbackApi.ts +218 -0
- package/templates/app/interfaces/orionplace/products/IProductSearchApi.ts +146 -0
- package/templates/app/interfaces/orionplace/products/IProductSearchFacets.ts +35 -0
- package/templates/app/interfaces/orionplace/products/IProductSecondaryVariantRequest.ts +15 -0
- package/templates/app/interfaces/orionplace/products/IProductSpecification.ts +14 -0
- package/templates/app/interfaces/orionplace/products/IWishlist.ts +22 -0
- package/templates/app/interfaces/orionplace/sellers/ISellerDirectory.ts +70 -0
- package/templates/app/interfaces/orionplace/shared/IBreadcrumb.ts +10 -0
- package/templates/app/interfaces/orionplace/shared/IGeoCoordinates.ts +4 -0
- package/templates/app/interfaces/orionplace/shared/IStorefrontControls.ts +13 -0
- package/templates/app/interfaces/orionplace/shared/ITransformValue.ts +3 -0
- package/templates/app/interfaces/orionplace/state.ts +4 -0
- package/templates/app/interfaces/orionplace/stores/IStoreDirectory.ts +63 -0
- package/templates/app/interfaces/orionplace/subscribeOptions/ISubscribeOption.ts +9 -0
- package/templates/app/interfaces/orionplace/subscribeTariff/ISubscribeTariff.ts +56 -0
- package/templates/app/interfaces/orionplace/subscribeTariff/ITariffSelection.ts +11 -0
- package/templates/app/interfaces/orionplace/subscribes/ISubscribe.ts +28 -0
- package/templates/app/interfaces/orionplace/subscribes/ISubscriptionApi.ts +125 -0
- package/templates/app/interfaces/orionplace/tickets/ICustomerTicketApi.ts +223 -0
- package/templates/app/interfaces/orionplace/transport.ts +34 -0
- package/templates/app/layouts/default.vue +376 -0
- package/templates/app/middleware/00.orionplace.global.ts +27 -0
- package/templates/app/middleware/01.orionplace-sellers.global.ts +15 -0
- package/templates/app/middleware/orionplace-account.ts +40 -0
- package/templates/app/pages/activity.vue +19 -0
- package/templates/app/pages/addresses.vue +23 -0
- package/templates/app/pages/browse.vue +246 -0
- package/templates/app/pages/cart.vue +20 -0
- package/templates/app/pages/catalog.vue +17 -0
- package/templates/app/pages/category/[id].vue +142 -0
- package/templates/app/pages/contact.vue +17 -0
- package/templates/app/pages/featured.vue +144 -0
- package/templates/app/pages/index.vue +194 -0
- package/templates/app/pages/journal/[id].vue +128 -0
- package/templates/app/pages/journal/index.vue +67 -0
- package/templates/app/pages/logout.vue +71 -0
- package/templates/app/pages/manufacturers.vue +33 -0
- package/templates/app/pages/orders.vue +40 -0
- package/templates/app/pages/product/[id].vue +126 -0
- package/templates/app/pages/profile.vue +118 -0
- package/templates/app/pages/promo/[id].vue +67 -0
- package/templates/app/pages/promocodes.vue +21 -0
- package/templates/app/pages/sellers.vue +203 -0
- package/templates/app/pages/stores.vue +36 -0
- package/templates/app/pages/subscriptions.vue +21 -0
- package/templates/app/pages/tariffs/[slug]/[id].vue +126 -0
- package/templates/app/pages/tariffs/index.vue +50 -0
- package/templates/app/pages/tickets.vue +56 -0
- package/templates/app/pages/unsubscribe.vue +32 -0
- package/templates/app/pages/wallet.vue +23 -0
- package/templates/app/pages/wishlist.vue +48 -0
- package/templates/app/stores/orionplace.ts +493 -0
- package/templates/app/stores/orionplaceBrowse.ts +79 -0
- package/templates/app/stores/orionplaceCatalog.ts +121 -0
- package/templates/app/stores/orionplaceDomainAccess.ts +55 -0
- package/templates/app/stores/orionplaceProducts.ts +249 -0
- package/templates/app/stores/orionplaceSelections.ts +132 -0
- package/templates/app/themes/orionplace.ts +108 -0
- package/templates/app/utils/orionplace/accountLabels.ts +22 -0
- package/templates/app/utils/orionplace/activityLabels.ts +65 -0
- package/templates/app/utils/orionplace/activityPresentation.ts +16 -0
- package/templates/app/utils/orionplace/addressChanges.ts +26 -0
- package/templates/app/utils/orionplace/addressRegions.ts +17 -0
- package/templates/app/utils/orionplace/api.ts +333 -0
- package/templates/app/utils/orionplace/blogArticleHtml.ts +318 -0
- package/templates/app/utils/orionplace/blogComments.ts +133 -0
- package/templates/app/utils/orionplace/blogLabels.ts +111 -0
- package/templates/app/utils/orionplace/blogLayout.ts +95 -0
- package/templates/app/utils/orionplace/breadcrumbLabels.ts +11 -0
- package/templates/app/utils/orionplace/browseLabels.ts +98 -0
- package/templates/app/utils/orionplace/cartAddress.ts +94 -0
- package/templates/app/utils/orionplace/cartLabels.ts +261 -0
- package/templates/app/utils/orionplace/cartOptions.ts +143 -0
- package/templates/app/utils/orionplace/cartPreview.ts +108 -0
- package/templates/app/utils/orionplace/cartPromo.ts +150 -0
- package/templates/app/utils/orionplace/cartShipment.ts +74 -0
- package/templates/app/utils/orionplace/cartSnapshot.ts +20 -0
- package/templates/app/utils/orionplace/catalog.ts +106 -0
- package/templates/app/utils/orionplace/category.ts +52 -0
- package/templates/app/utils/orionplace/categoryLabels.ts +31 -0
- package/templates/app/utils/orionplace/contactLabels.ts +102 -0
- package/templates/app/utils/orionplace/currency.ts +128 -0
- package/templates/app/utils/orionplace/deliveryMap.ts +89 -0
- package/templates/app/utils/orionplace/directoryLabels.ts +131 -0
- package/templates/app/utils/orionplace/emptyStateArt.ts +231 -0
- package/templates/app/utils/orionplace/errorPageLabels.ts +80 -0
- package/templates/app/utils/orionplace/featureData.ts +25 -0
- package/templates/app/utils/orionplace/featureLabels.ts +271 -0
- package/templates/app/utils/orionplace/featuredLabels.ts +28 -0
- package/templates/app/utils/orionplace/files.ts +71 -0
- package/templates/app/utils/orionplace/footerLabels.ts +35 -0
- package/templates/app/utils/orionplace/guestSession.ts +50 -0
- package/templates/app/utils/orionplace/headerLabels.ts +68 -0
- package/templates/app/utils/orionplace/homeContent.ts +129 -0
- package/templates/app/utils/orionplace/homeLabels.ts +52 -0
- package/templates/app/utils/orionplace/htmlText.ts +59 -0
- package/templates/app/utils/orionplace/links.ts +14 -0
- package/templates/app/utils/orionplace/manufacturerIndex.ts +91 -0
- package/templates/app/utils/orionplace/modalWindow.ts +109 -0
- package/templates/app/utils/orionplace/nativeApp.ts +361 -0
- package/templates/app/utils/orionplace/notice.ts +22 -0
- package/templates/app/utils/orionplace/orderLabels.ts +309 -0
- package/templates/app/utils/orionplace/orderPresentation.ts +586 -0
- package/templates/app/utils/orionplace/pageSeo.ts +274 -0
- package/templates/app/utils/orionplace/paginationScroll.ts +131 -0
- package/templates/app/utils/orionplace/phone.ts +22 -0
- package/templates/app/utils/orionplace/presentation.ts +72 -0
- package/templates/app/utils/orionplace/productActionLabels.ts +60 -0
- package/templates/app/utils/orionplace/productActions.ts +547 -0
- package/templates/app/utils/orionplace/productAvailability.ts +36 -0
- package/templates/app/utils/orionplace/productGallery.ts +72 -0
- package/templates/app/utils/orionplace/productLabels.ts +82 -0
- package/templates/app/utils/orionplace/productManufacturer.ts +30 -0
- package/templates/app/utils/orionplace/productPage.ts +46 -0
- package/templates/app/utils/orionplace/productPhotos.ts +67 -0
- package/templates/app/utils/orionplace/productSearchScope.ts +237 -0
- package/templates/app/utils/orionplace/productSeller.ts +51 -0
- package/templates/app/utils/orionplace/profile.ts +136 -0
- package/templates/app/utils/orionplace/profileLabels.ts +151 -0
- package/templates/app/utils/orionplace/promoLabels.ts +75 -0
- package/templates/app/utils/orionplace/promoPresentation.ts +381 -0
- package/templates/app/utils/orionplace/reviewLabels.ts +172 -0
- package/templates/app/utils/orionplace/reviewScope.ts +41 -0
- package/templates/app/utils/orionplace/richText.ts +13 -0
- package/templates/app/utils/orionplace/searchFilters.ts +99 -0
- package/templates/app/utils/orionplace/searchHistory.ts +144 -0
- package/templates/app/utils/orionplace/sellerDirectory.ts +134 -0
- package/templates/app/utils/orionplace/seo.ts +52 -0
- package/templates/app/utils/orionplace/serverCookies.ts +88 -0
- package/templates/app/utils/orionplace/sessionLabels.ts +27 -0
- package/templates/app/utils/orionplace/signInReturn.ts +89 -0
- package/templates/app/utils/orionplace/storeDirectory.ts +50 -0
- package/templates/app/utils/orionplace/subscriptionChanges.ts +167 -0
- package/templates/app/utils/orionplace/subscriptionLabels.ts +67 -0
- package/templates/app/utils/orionplace/subscriptionManageLabels.ts +307 -0
- package/templates/app/utils/orionplace/subscriptionPlans.ts +162 -0
- package/templates/app/utils/orionplace/subscriptionRemote.ts +110 -0
- package/templates/app/utils/orionplace/subscriptionUsage.ts +82 -0
- package/templates/app/utils/orionplace/tariffLabels.ts +130 -0
- package/templates/app/utils/orionplace/tariffPage.ts +77 -0
- package/templates/app/utils/orionplace/tariffVariables.ts +165 -0
- package/templates/app/utils/orionplace/tariffs.ts +284 -0
- package/templates/app/utils/orionplace/ticketItems.ts +87 -0
- package/templates/app/utils/orionplace/ticketLabels.ts +335 -0
- package/templates/app/utils/orionplace/ticketLocation.ts +79 -0
- package/templates/app/utils/orionplace/walletTransaction.ts +135 -0
- package/templates/app/utils/orionplaceAppLoad.ts +73 -0
- package/templates/orionplace/COMPONENT-DOWNLOAD.md +40 -0
- package/templates/orionplace/COMPONENTS.md +1983 -0
- package/templates/orionplace/THEMES.md +94 -0
|
@@ -0,0 +1,1466 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
computed,
|
|
4
|
+
nextTick,
|
|
5
|
+
onBeforeUnmount,
|
|
6
|
+
onMounted,
|
|
7
|
+
ref,
|
|
8
|
+
watch,
|
|
9
|
+
} from 'vue';
|
|
10
|
+
import { NuxtLink } from '#components';
|
|
11
|
+
import { useOrionplaceStore } from '@/stores/orionplace';
|
|
12
|
+
import { useOrionplaceProductsStore } from '@/stores/orionplaceProducts';
|
|
13
|
+
import { useOrionplaceCatalogStore } from '@/stores/orionplaceCatalog';
|
|
14
|
+
import { useOrionplaceSelectionsStore } from '@/stores/orionplaceSelections';
|
|
15
|
+
import {
|
|
16
|
+
useOrionplaceFeatureApi,
|
|
17
|
+
useOrionplaceTask,
|
|
18
|
+
} from '@/composables/useOrionplaceFeature';
|
|
19
|
+
import { useOrionplaceProductActions } from '@/composables/useOrionplaceProductActions';
|
|
20
|
+
import { useOrionplaceProductVariants } from '@/composables/useOrionplaceProductVariants';
|
|
21
|
+
import { reviewLabels } from '@/utils/orionplace/reviewLabels';
|
|
22
|
+
import { featureLabels } from '@/utils/orionplace/featureLabels';
|
|
23
|
+
import { productLabels } from '@/utils/orionplace/productLabels';
|
|
24
|
+
import { productActionLabels } from '@/utils/orionplace/productActionLabels';
|
|
25
|
+
import { categoryLabels } from '@/utils/orionplace/categoryLabels';
|
|
26
|
+
import { categoryTrail } from '@/utils/orionplace/category';
|
|
27
|
+
import {
|
|
28
|
+
getAvailableNestedValueFromObject,
|
|
29
|
+
getAvailableValueFromObject,
|
|
30
|
+
} from '@/utils/orionplace/presentation';
|
|
31
|
+
import { safeArticleHtml } from '@/utils/orionplace/richText';
|
|
32
|
+
import { htmlTextParagraphs } from '@/utils/orionplace/htmlText';
|
|
33
|
+
import {
|
|
34
|
+
thumbnailKeyTarget,
|
|
35
|
+
thumbnailRailEdges,
|
|
36
|
+
thumbnailScrollTarget,
|
|
37
|
+
} from '@/utils/orionplace/productGallery';
|
|
38
|
+
import type { IThumbnailRailMetrics } from '@/utils/orionplace/productGallery';
|
|
39
|
+
import { productPhotoAfterSwipe } from '@/utils/orionplace/productPhotos';
|
|
40
|
+
import { productManufacturer } from '@/utils/orionplace/productManufacturer';
|
|
41
|
+
import { requestProductPage } from '@/utils/orionplace/productPage';
|
|
42
|
+
import type { IAppLoadCommonUnit } from '@/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonUnit';
|
|
43
|
+
import type { IBreadcrumb } from '@/interfaces/orionplace/shared/IBreadcrumb';
|
|
44
|
+
import type { ITransformValue } from '@/interfaces/orionplace/shared/ITransformValue';
|
|
45
|
+
import type {
|
|
46
|
+
IProduct,
|
|
47
|
+
IProductAttribute,
|
|
48
|
+
IProductAttributeName,
|
|
49
|
+
IProductSeller,
|
|
50
|
+
} from '@/interfaces/orionplace/products/IProduct';
|
|
51
|
+
import { EProductStatus } from '@/interfaces/orionplace/products/IProduct';
|
|
52
|
+
import type {
|
|
53
|
+
IProductSpecificationGroup,
|
|
54
|
+
IProductSpecificationRow,
|
|
55
|
+
} from '@/interfaces/orionplace/products/IProductSpecification';
|
|
56
|
+
import ProductCard from '@/components/orionplace/products/ProductCard.vue';
|
|
57
|
+
import ProductReviews from '@/components/orionplace/products/ProductReviews.vue';
|
|
58
|
+
import ProductPreorderDialog from '@/components/orionplace/products/ProductPreorderDialog.vue';
|
|
59
|
+
import ProductSpecificationsDialog from '@/components/orionplace/products/ProductSpecificationsDialog.vue';
|
|
60
|
+
import ProductReviewImageViewer from '@/components/orionplace/products/ProductReviewImageViewer.vue';
|
|
61
|
+
import OrionplaceBreadcrumbs from '@/components/orionplace/shared/OrionplaceBreadcrumbs.vue';
|
|
62
|
+
import OrionplaceImage from '@/components/orionplace/shared/OrionplaceImage.vue';
|
|
63
|
+
import OrionplaceAvatar from '@/components/orionplace/shared/OrionplaceAvatar.vue';
|
|
64
|
+
import '@/components/orionplace/shared/features.css';
|
|
65
|
+
import OrionplaceEmptyState from '@/components/orionplace/shared/OrionplaceEmptyState.vue';
|
|
66
|
+
|
|
67
|
+
const props = withDefaults(
|
|
68
|
+
defineProps<{
|
|
69
|
+
productId: number;
|
|
70
|
+
preloaded?: boolean;
|
|
71
|
+
previewKey?: string;
|
|
72
|
+
}>(),
|
|
73
|
+
{ preloaded: false, previewKey: '' },
|
|
74
|
+
);
|
|
75
|
+
const emit = defineEmits<{
|
|
76
|
+
loaded: [product: IProduct];
|
|
77
|
+
missing: [];
|
|
78
|
+
seller: [seller: IProductSeller];
|
|
79
|
+
}>();
|
|
80
|
+
const store = useOrionplaceStore();
|
|
81
|
+
const productStore = useOrionplaceProductsStore();
|
|
82
|
+
const catalogStore = useOrionplaceCatalogStore();
|
|
83
|
+
const selectionStore = useOrionplaceSelectionsStore();
|
|
84
|
+
const api = useOrionplaceFeatureApi();
|
|
85
|
+
const task = useOrionplaceTask();
|
|
86
|
+
const actions = useOrionplaceProductActions({ api });
|
|
87
|
+
const variants = useOrionplaceProductVariants({ api });
|
|
88
|
+
const labels = computed(() => reviewLabels(selectionStore.localeCode));
|
|
89
|
+
const common = computed(() => featureLabels(selectionStore.localeCode));
|
|
90
|
+
const cardLabels = computed(() => productLabels(selectionStore.localeCode));
|
|
91
|
+
const actionLabels = computed(() =>
|
|
92
|
+
productActionLabels(selectionStore.localeCode),
|
|
93
|
+
);
|
|
94
|
+
const categoryNames = computed(() =>
|
|
95
|
+
categoryLabels(selectionStore.localeCode),
|
|
96
|
+
);
|
|
97
|
+
const currentId = ref(props.productId);
|
|
98
|
+
// The page loaded this product during the server render and put it in
|
|
99
|
+
// the store: the browser shows it without another request.
|
|
100
|
+
const confirmed = ref(
|
|
101
|
+
props.preloaded && Boolean(productStore.getProduct(props.productId)),
|
|
102
|
+
);
|
|
103
|
+
const settled = ref(confirmed.value);
|
|
104
|
+
const image = ref(0);
|
|
105
|
+
const product = computed(() =>
|
|
106
|
+
confirmed.value ? productStore.getProduct(currentId.value) : undefined,
|
|
107
|
+
);
|
|
108
|
+
const title = computed(
|
|
109
|
+
() =>
|
|
110
|
+
getAvailableNestedValueFromObject(
|
|
111
|
+
product.value?.locale,
|
|
112
|
+
selectionStore.localeCode,
|
|
113
|
+
'product_name',
|
|
114
|
+
) || labels.value.product,
|
|
115
|
+
);
|
|
116
|
+
// The path above the product comes from `main_category`: the category the
|
|
117
|
+
// seller marked as the product's place in the catalog. Its ancestors are
|
|
118
|
+
// read from the catalog tree that Application Load already delivered, so
|
|
119
|
+
// the trail needs no request. A category outside that tree, for example a
|
|
120
|
+
// category that is not public, leaves the trail at the storefront home
|
|
121
|
+
// page and the product itself.
|
|
122
|
+
const categoryPath = computed(() => {
|
|
123
|
+
const category = product.value?.main_category;
|
|
124
|
+
|
|
125
|
+
return typeof category === 'number'
|
|
126
|
+
? categoryTrail(catalogStore.catalog, category)
|
|
127
|
+
: [];
|
|
128
|
+
});
|
|
129
|
+
const breadcrumbs = computed<IBreadcrumb[]>(() => [
|
|
130
|
+
{
|
|
131
|
+
id: 'catalog',
|
|
132
|
+
label: categoryNames.value.catalog,
|
|
133
|
+
to: {
|
|
134
|
+
path: '/catalog',
|
|
135
|
+
query: { locale: selectionStore.localeCode },
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
...categoryPath.value.map((category) => ({
|
|
139
|
+
id: category.id,
|
|
140
|
+
label:
|
|
141
|
+
getAvailableNestedValueFromObject(
|
|
142
|
+
category.locale,
|
|
143
|
+
selectionStore.localeCode,
|
|
144
|
+
'cg_name',
|
|
145
|
+
) || `${categoryNames.value.category} ${category.id}`,
|
|
146
|
+
to: {
|
|
147
|
+
path: `/category/${category.id}`,
|
|
148
|
+
query: { locale: selectionStore.localeCode },
|
|
149
|
+
},
|
|
150
|
+
})),
|
|
151
|
+
{ id: `product-${currentId.value}`, label: title.value },
|
|
152
|
+
]);
|
|
153
|
+
const descriptionSource = computed(
|
|
154
|
+
() =>
|
|
155
|
+
getAvailableNestedValueFromObject(
|
|
156
|
+
product.value?.locale,
|
|
157
|
+
selectionStore.localeCode,
|
|
158
|
+
'product_description',
|
|
159
|
+
) || '',
|
|
160
|
+
);
|
|
161
|
+
const description = computed(() => safeArticleHtml(descriptionSource.value));
|
|
162
|
+
// The server render and hydration show the description as plain
|
|
163
|
+
// paragraphs; the sanitized HTML replaces them once mounted.
|
|
164
|
+
const mounted = ref(false);
|
|
165
|
+
const descriptionText = computed(() =>
|
|
166
|
+
htmlTextParagraphs(descriptionSource.value),
|
|
167
|
+
);
|
|
168
|
+
const hasDescription = computed(() =>
|
|
169
|
+
mounted.value
|
|
170
|
+
? Boolean(description.value)
|
|
171
|
+
: descriptionText.value.length > 0,
|
|
172
|
+
);
|
|
173
|
+
const photos = computed(() => {
|
|
174
|
+
const images = product.value?.images;
|
|
175
|
+
return images?.full?.length ? images.full : (images?.small ?? []);
|
|
176
|
+
});
|
|
177
|
+
// The first request in the browser shows a placeholder with the page
|
|
178
|
+
// layout; a later retry after an error shows it again. A product loaded
|
|
179
|
+
// during the server render is shown at once.
|
|
180
|
+
const showSkeleton = computed(
|
|
181
|
+
() =>
|
|
182
|
+
!product.value &&
|
|
183
|
+
!task.state.error &&
|
|
184
|
+
(!settled.value || Boolean(task.state.pending)),
|
|
185
|
+
);
|
|
186
|
+
const actionMessage = computed(() => {
|
|
187
|
+
const error = actions.error.value;
|
|
188
|
+
if (error) {
|
|
189
|
+
return (
|
|
190
|
+
error.message ||
|
|
191
|
+
actionLabels.value[error.kind as keyof typeof actionLabels.value] ||
|
|
192
|
+
actionLabels.value.failed
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
return actions.success.value ? actionLabels.value.saved : '';
|
|
196
|
+
});
|
|
197
|
+
const previewStatus = computed(() => {
|
|
198
|
+
if (!props.previewKey || !product.value) {
|
|
199
|
+
return '';
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
const status = product.value.status.status;
|
|
203
|
+
if (status === EProductStatus.PUBLISHED_AS_OPTION) {
|
|
204
|
+
return cardLabels.value.previewOption;
|
|
205
|
+
}
|
|
206
|
+
if (
|
|
207
|
+
status !== EProductStatus.PUBLISHED &&
|
|
208
|
+
status !== EProductStatus.LOW_STOCK &&
|
|
209
|
+
status !== EProductStatus.LOW_SALE_STOCK
|
|
210
|
+
) {
|
|
211
|
+
return cardLabels.value.previewUnpublished;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
return '';
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
const reviewStat = computed(() => {
|
|
218
|
+
const stat = product.value?.feedback_stat;
|
|
219
|
+
const count = Number(stat?.c_feedbacks ?? 0);
|
|
220
|
+
const average = Number(stat?.avg_raiting ?? 0);
|
|
221
|
+
|
|
222
|
+
if (!count || !Number.isFinite(average)) {
|
|
223
|
+
return undefined;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
return { count, average: Math.round(average * 10) / 10 };
|
|
227
|
+
});
|
|
228
|
+
const reviewCaption = computed(() =>
|
|
229
|
+
pluralWord(reviewStat.value?.count ?? 0, cardLabels.value.reviews),
|
|
230
|
+
);
|
|
231
|
+
const summaryLabel = computed(() => {
|
|
232
|
+
const stat = reviewStat.value;
|
|
233
|
+
const rating = `${stat?.average} ${labels.value.ofFive}`;
|
|
234
|
+
const count = `${stat?.count} ${reviewCaption.value}`;
|
|
235
|
+
|
|
236
|
+
return `${labels.value.showReviews}: ${rating}, ${count}`;
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
const seller = computed(() =>
|
|
240
|
+
store.init?.visual_settings?.single_seller_mode
|
|
241
|
+
? undefined
|
|
242
|
+
: product.value?.seller,
|
|
243
|
+
);
|
|
244
|
+
const sellerHref = computed(() => {
|
|
245
|
+
const query = new URLSearchParams({
|
|
246
|
+
locale: selectionStore.localeCode,
|
|
247
|
+
seller: String(seller.value?.id ?? ''),
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
return `/sellers?${query}`;
|
|
251
|
+
});
|
|
252
|
+
const sellerRating = computed(() => Number(seller.value?.raiting ?? 0));
|
|
253
|
+
|
|
254
|
+
const manufacturer = computed(() =>
|
|
255
|
+
productManufacturer(product.value, selectionStore.localeCode),
|
|
256
|
+
);
|
|
257
|
+
|
|
258
|
+
// The arrow buttons overlay both ends of the thumbnail rail; a revealed
|
|
259
|
+
// thumbnail keeps this many pixels clear of them.
|
|
260
|
+
const railInset = 40;
|
|
261
|
+
const rail = ref<HTMLElement>();
|
|
262
|
+
const railEdges = ref({ back: false, forward: false });
|
|
263
|
+
let railObserver: ResizeObserver | undefined;
|
|
264
|
+
|
|
265
|
+
// A long description is shortened in the purchase column until More.
|
|
266
|
+
const descriptionBody = ref<HTMLElement>();
|
|
267
|
+
const descriptionOpen = ref(false);
|
|
268
|
+
const descriptionLong = ref(false);
|
|
269
|
+
let descriptionObserver: ResizeObserver | undefined;
|
|
270
|
+
|
|
271
|
+
// The characteristics keep a fixed height in the purchase column, so the
|
|
272
|
+
// price and the purchase controls stay where the reader expects them. A
|
|
273
|
+
// list that does not fit that height fades out at its lower edge and the
|
|
274
|
+
// control below it opens every characteristic in a dialog.
|
|
275
|
+
const specificationsBody = ref<HTMLElement>();
|
|
276
|
+
const specificationsLong = ref(false);
|
|
277
|
+
const specificationsOpen = ref(false);
|
|
278
|
+
let specificationsObserver: ResizeObserver | undefined;
|
|
279
|
+
|
|
280
|
+
const returns = computed(() => {
|
|
281
|
+
const refunds = product.value?.refunds;
|
|
282
|
+
|
|
283
|
+
if (!refunds || product.value?.is_digital) {
|
|
284
|
+
return [];
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
return [
|
|
288
|
+
{
|
|
289
|
+
key: 'regular',
|
|
290
|
+
label: labels.value.returnRegular,
|
|
291
|
+
days: refunds.customer_max_refund_days,
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
key: 'defect',
|
|
295
|
+
label: labels.value.returnDefect,
|
|
296
|
+
days: refunds.max_refund_days_with_defect,
|
|
297
|
+
},
|
|
298
|
+
]
|
|
299
|
+
.filter((entry) => entry.days > 0)
|
|
300
|
+
.map((entry) => ({
|
|
301
|
+
...entry,
|
|
302
|
+
value: `${labels.value.within} ${entry.days} ${pluralWord(
|
|
303
|
+
entry.days,
|
|
304
|
+
labels.value.days,
|
|
305
|
+
)}`,
|
|
306
|
+
}));
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
const generalRows = computed(() => {
|
|
310
|
+
const value = product.value;
|
|
311
|
+
const rows: IProductSpecificationRow[] = [];
|
|
312
|
+
|
|
313
|
+
if (!value) {
|
|
314
|
+
return rows;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
if (manufacturer.value) {
|
|
318
|
+
rows.push({
|
|
319
|
+
key: 'manufacturer',
|
|
320
|
+
label: labels.value.manufacturer,
|
|
321
|
+
value: manufacturer.value.name,
|
|
322
|
+
to: manufacturer.value.to,
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
const weight = measurement(
|
|
327
|
+
value.weight_dict,
|
|
328
|
+
selectionStore.weights,
|
|
329
|
+
selectionStore.weightId,
|
|
330
|
+
);
|
|
331
|
+
const dimensions = [
|
|
332
|
+
value.length_dict?.length,
|
|
333
|
+
value.length_dict?.width,
|
|
334
|
+
value.length_dict?.height,
|
|
335
|
+
].map((entry) =>
|
|
336
|
+
measurement(entry, selectionStore.lengths, selectionStore.lengthId),
|
|
337
|
+
);
|
|
338
|
+
|
|
339
|
+
if (weight) {
|
|
340
|
+
rows.push({
|
|
341
|
+
key: 'weight',
|
|
342
|
+
label: labels.value.weight,
|
|
343
|
+
value: `${weight.amount} ${weight.unit}`,
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
if (dimensions.every(Boolean)) {
|
|
348
|
+
const unit = dimensions[0]!.unit;
|
|
349
|
+
const amounts = dimensions.map((entry) => entry!.amount).join(' × ');
|
|
350
|
+
rows.push({
|
|
351
|
+
key: 'dimensions',
|
|
352
|
+
label: labels.value.dimensions,
|
|
353
|
+
value: `${amounts} ${unit}`,
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
if (value.is_digital) {
|
|
358
|
+
rows.push({
|
|
359
|
+
key: 'type',
|
|
360
|
+
label: labels.value.type,
|
|
361
|
+
value: labels.value.digital,
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
return rows;
|
|
366
|
+
});
|
|
367
|
+
|
|
368
|
+
const specifications = computed<IProductSpecificationGroup[]>(() => {
|
|
369
|
+
const groups: IProductSpecificationGroup[] = [];
|
|
370
|
+
|
|
371
|
+
if (generalRows.value.length) {
|
|
372
|
+
groups.push({ key: 'general', title: '', rows: generalRows.value });
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
for (const attribute of attributeList(product.value?.attributes)) {
|
|
376
|
+
const rows = attribute.names
|
|
377
|
+
.map((name) => attributeRow(name))
|
|
378
|
+
.filter((row): row is IProductSpecificationRow => Boolean(row));
|
|
379
|
+
|
|
380
|
+
if (rows.length) {
|
|
381
|
+
groups.push({
|
|
382
|
+
key: `attribute-${attribute.id}`,
|
|
383
|
+
title:
|
|
384
|
+
getAvailableValueFromObject(
|
|
385
|
+
attribute.locales,
|
|
386
|
+
selectionStore.localeCode,
|
|
387
|
+
) ?? '',
|
|
388
|
+
rows,
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
return groups;
|
|
394
|
+
});
|
|
395
|
+
|
|
396
|
+
function pluralWord(count: number, forms: string[]) {
|
|
397
|
+
let rule: string;
|
|
398
|
+
|
|
399
|
+
try {
|
|
400
|
+
rule = new Intl.PluralRules(selectionStore.localeCode).select(count);
|
|
401
|
+
} catch {
|
|
402
|
+
// Backend locale codes are not always valid BCP 47 tags.
|
|
403
|
+
rule = new Intl.PluralRules('en').select(count);
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
if (rule === 'one') {
|
|
407
|
+
return forms[0];
|
|
408
|
+
}
|
|
409
|
+
if (rule === 'few' && forms.length > 2) {
|
|
410
|
+
return forms[1];
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
return forms[forms.length - 1];
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
function formatNumber(value: number) {
|
|
417
|
+
try {
|
|
418
|
+
return new Intl.NumberFormat(selectionStore.localeCode, {
|
|
419
|
+
maximumFractionDigits: 2,
|
|
420
|
+
}).format(value);
|
|
421
|
+
} catch {
|
|
422
|
+
return String(value);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
// Values arrive converted for every unit; the selected unit is shown.
|
|
427
|
+
function measurement(
|
|
428
|
+
values: Record<string, ITransformValue> | undefined,
|
|
429
|
+
units: Record<string, IAppLoadCommonUnit>,
|
|
430
|
+
selectedId: string,
|
|
431
|
+
) {
|
|
432
|
+
const unitId = values?.[selectedId]
|
|
433
|
+
? selectedId
|
|
434
|
+
: Object.keys(values ?? {})[0];
|
|
435
|
+
const amount = unitId ? values?.[unitId]?.transform_value : undefined;
|
|
436
|
+
|
|
437
|
+
if (!unitId || !amount || amount <= 0) {
|
|
438
|
+
return undefined;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
const unit = units[unitId];
|
|
442
|
+
const label =
|
|
443
|
+
getAvailableNestedValueFromObject(
|
|
444
|
+
unit?.locales,
|
|
445
|
+
selectionStore.localeCode,
|
|
446
|
+
'unit',
|
|
447
|
+
) ||
|
|
448
|
+
unit?.unit ||
|
|
449
|
+
'';
|
|
450
|
+
|
|
451
|
+
return { amount: formatNumber(amount), unit: label };
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
function attributeList(value: IProduct['attributes']): IProductAttribute[] {
|
|
455
|
+
if (!value) {
|
|
456
|
+
return [];
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
return Array.isArray(value) ? value : Object.values(value);
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
function attributeRow(
|
|
463
|
+
name: IProductAttributeName,
|
|
464
|
+
): IProductSpecificationRow | undefined {
|
|
465
|
+
const localized = getAvailableValueFromObject(
|
|
466
|
+
name.locale,
|
|
467
|
+
selectionStore.localeCode,
|
|
468
|
+
false,
|
|
469
|
+
);
|
|
470
|
+
const values =
|
|
471
|
+
localized && Object.keys(localized).length
|
|
472
|
+
? localized
|
|
473
|
+
: Object.values(name.locale ?? {}).find(
|
|
474
|
+
(entry) => entry && Object.keys(entry).length,
|
|
475
|
+
);
|
|
476
|
+
const entry = values ? Object.entries(values)[0] : undefined;
|
|
477
|
+
|
|
478
|
+
if (!entry) {
|
|
479
|
+
return undefined;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
return { key: `name-${name.id}`, label: entry[0], value: entry[1] };
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
// A tap on the main photo opens it full screen; the page keeps the photo
|
|
486
|
+
// chosen there.
|
|
487
|
+
const viewerOpen = ref(false);
|
|
488
|
+
const viewerPhotos = computed(() =>
|
|
489
|
+
photos.value.map((photo, id) => ({ id, image: photo })),
|
|
490
|
+
);
|
|
491
|
+
|
|
492
|
+
function openViewerKey(event: KeyboardEvent) {
|
|
493
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
494
|
+
event.preventDefault();
|
|
495
|
+
viewerOpen.value = true;
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
function showImage(index: number) {
|
|
500
|
+
const count = photos.value.length;
|
|
501
|
+
image.value = (index + count) % count;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
let swipeStart: { x: number; y: number } | undefined;
|
|
505
|
+
|
|
506
|
+
// A sideways swipe on a touch screen steps to the next or previous photo,
|
|
507
|
+
// as on the product cards.
|
|
508
|
+
function startSwipe(event: TouchEvent) {
|
|
509
|
+
const touch = event.touches[0];
|
|
510
|
+
swipeStart =
|
|
511
|
+
touch && event.touches.length === 1
|
|
512
|
+
? { x: touch.clientX, y: touch.clientY }
|
|
513
|
+
: undefined;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
function endSwipe(event: TouchEvent) {
|
|
517
|
+
const touch = event.changedTouches[0];
|
|
518
|
+
const start = swipeStart;
|
|
519
|
+
|
|
520
|
+
swipeStart = undefined;
|
|
521
|
+
if (!start || !touch) {
|
|
522
|
+
return;
|
|
523
|
+
}
|
|
524
|
+
showImage(
|
|
525
|
+
productPhotoAfterSwipe(
|
|
526
|
+
image.value,
|
|
527
|
+
photos.value.length,
|
|
528
|
+
touch.clientX - start.x,
|
|
529
|
+
touch.clientY - start.y,
|
|
530
|
+
),
|
|
531
|
+
);
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
// The rail is a column beside the main image on wide containers and a row
|
|
535
|
+
// below it on narrow ones; CSS decides, so the direction is read from it.
|
|
536
|
+
function railIsVertical(element: HTMLElement) {
|
|
537
|
+
return getComputedStyle(element).flexDirection === 'column';
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
function railMetrics(element: HTMLElement): IThumbnailRailMetrics {
|
|
541
|
+
if (railIsVertical(element)) {
|
|
542
|
+
return {
|
|
543
|
+
position: element.scrollTop,
|
|
544
|
+
size: element.scrollHeight,
|
|
545
|
+
viewport: element.clientHeight,
|
|
546
|
+
};
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
return {
|
|
550
|
+
position: element.scrollLeft,
|
|
551
|
+
size: element.scrollWidth,
|
|
552
|
+
viewport: element.clientWidth,
|
|
553
|
+
};
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
function updateRail() {
|
|
557
|
+
const element = rail.value;
|
|
558
|
+
|
|
559
|
+
railEdges.value = element
|
|
560
|
+
? thumbnailRailEdges(railMetrics(element))
|
|
561
|
+
: { back: false, forward: false };
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
function scrollRail(element: HTMLElement, position: number) {
|
|
565
|
+
const reduced = window.matchMedia(
|
|
566
|
+
'(prefers-reduced-motion: reduce)',
|
|
567
|
+
).matches;
|
|
568
|
+
const behavior = reduced ? 'auto' : 'smooth';
|
|
569
|
+
|
|
570
|
+
if (railIsVertical(element)) {
|
|
571
|
+
element.scrollTo({ top: position, behavior });
|
|
572
|
+
} else {
|
|
573
|
+
element.scrollTo({ left: position, behavior });
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
// Each arrow press moves the rail by one thumbnail and the gap after it.
|
|
578
|
+
function stepRail(direction: 1 | -1) {
|
|
579
|
+
const element = rail.value;
|
|
580
|
+
const thumbnail = element?.firstElementChild;
|
|
581
|
+
|
|
582
|
+
if (!element || !(thumbnail instanceof HTMLElement)) {
|
|
583
|
+
return;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
const style = getComputedStyle(element);
|
|
587
|
+
const step = railIsVertical(element)
|
|
588
|
+
? thumbnail.offsetHeight + parseFloat(style.rowGap || '0')
|
|
589
|
+
: thumbnail.offsetWidth + parseFloat(style.columnGap || '0');
|
|
590
|
+
|
|
591
|
+
scrollRail(element, railMetrics(element).position + direction * step);
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
function revealThumbnail(index: number) {
|
|
595
|
+
const element = rail.value;
|
|
596
|
+
const thumbnail = element?.children[index];
|
|
597
|
+
|
|
598
|
+
if (!element || !(thumbnail instanceof HTMLElement)) {
|
|
599
|
+
return;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
const bounds = railIsVertical(element)
|
|
603
|
+
? { start: thumbnail.offsetTop, length: thumbnail.offsetHeight }
|
|
604
|
+
: { start: thumbnail.offsetLeft, length: thumbnail.offsetWidth };
|
|
605
|
+
const target = thumbnailScrollTarget(
|
|
606
|
+
bounds,
|
|
607
|
+
railMetrics(element),
|
|
608
|
+
railInset,
|
|
609
|
+
);
|
|
610
|
+
|
|
611
|
+
if (target !== undefined) {
|
|
612
|
+
scrollRail(element, target);
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
// Only the shortened text is measured: an opened description keeps Less.
|
|
617
|
+
function measureDescription() {
|
|
618
|
+
const element = descriptionBody.value;
|
|
619
|
+
|
|
620
|
+
if (element && !descriptionOpen.value) {
|
|
621
|
+
descriptionLong.value = element.scrollHeight > element.clientHeight + 1;
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
// The characteristics that do not fit the reserved height are the ones the
|
|
626
|
+
// dialog exists for: a list that fits keeps every row on the page.
|
|
627
|
+
function measureSpecifications() {
|
|
628
|
+
const element = specificationsBody.value;
|
|
629
|
+
|
|
630
|
+
if (element) {
|
|
631
|
+
specificationsLong.value =
|
|
632
|
+
element.scrollHeight > element.clientHeight + 1;
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
// Arrow keys, Home and End move between thumbnails, which form one tab stop.
|
|
637
|
+
function thumbnailKeydown(event: KeyboardEvent, index: number) {
|
|
638
|
+
const target = thumbnailKeyTarget(event.key, index, photos.value.length);
|
|
639
|
+
|
|
640
|
+
if (target === undefined) {
|
|
641
|
+
return;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
event.preventDefault();
|
|
645
|
+
image.value = target;
|
|
646
|
+
|
|
647
|
+
const button = rail.value?.children[target];
|
|
648
|
+
if (button instanceof HTMLElement) {
|
|
649
|
+
button.focus({ preventScroll: true });
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
function showReviews() {
|
|
654
|
+
document
|
|
655
|
+
.getElementById('product-reviews')
|
|
656
|
+
?.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
function openSeller() {
|
|
660
|
+
if (seller.value) {
|
|
661
|
+
emit('seller', seller.value);
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
async function load() {
|
|
666
|
+
await task.run('load', async (signal) => {
|
|
667
|
+
const { product: found, sellers } = await requestProductPage(
|
|
668
|
+
api,
|
|
669
|
+
props.productId,
|
|
670
|
+
props.previewKey,
|
|
671
|
+
signal,
|
|
672
|
+
);
|
|
673
|
+
confirmed.value = Boolean(found);
|
|
674
|
+
if (found) {
|
|
675
|
+
productStore.setProduct(found, 'products', sellers);
|
|
676
|
+
} else {
|
|
677
|
+
// products_search returns an empty list for an unknown or hidden ID.
|
|
678
|
+
emit('missing');
|
|
679
|
+
}
|
|
680
|
+
});
|
|
681
|
+
settled.value = true;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
async function selectVariant(
|
|
685
|
+
selection: Parameters<typeof variants.select>[0],
|
|
686
|
+
) {
|
|
687
|
+
await variants.select(selection);
|
|
688
|
+
const target = selection.variant.reload_product;
|
|
689
|
+
if (target && productStore.getProduct(target)) {
|
|
690
|
+
currentId.value = target;
|
|
691
|
+
image.value = 0;
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
function selectSecondary(selection: { variant: { product: IProduct } }) {
|
|
695
|
+
currentId.value = selection.variant.product.id;
|
|
696
|
+
image.value = 0;
|
|
697
|
+
}
|
|
698
|
+
onMounted(() => {
|
|
699
|
+
mounted.value = true;
|
|
700
|
+
if (!confirmed.value) {
|
|
701
|
+
void load();
|
|
702
|
+
}
|
|
703
|
+
});
|
|
704
|
+
onBeforeUnmount(() => {
|
|
705
|
+
railObserver?.disconnect();
|
|
706
|
+
descriptionObserver?.disconnect();
|
|
707
|
+
specificationsObserver?.disconnect();
|
|
708
|
+
});
|
|
709
|
+
|
|
710
|
+
// The rail appears after the product loads and is replaced on variant
|
|
711
|
+
// changes; its size changes when the layout switches between column and row.
|
|
712
|
+
watch(rail, (element) => {
|
|
713
|
+
railObserver?.disconnect();
|
|
714
|
+
railObserver = undefined;
|
|
715
|
+
|
|
716
|
+
if (element) {
|
|
717
|
+
railObserver = new ResizeObserver(updateRail);
|
|
718
|
+
railObserver.observe(element);
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
updateRail();
|
|
722
|
+
});
|
|
723
|
+
watch(descriptionBody, (element) => {
|
|
724
|
+
descriptionObserver?.disconnect();
|
|
725
|
+
descriptionObserver = undefined;
|
|
726
|
+
|
|
727
|
+
if (element) {
|
|
728
|
+
descriptionObserver = new ResizeObserver(measureDescription);
|
|
729
|
+
descriptionObserver.observe(element);
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
measureDescription();
|
|
733
|
+
});
|
|
734
|
+
watch(description, async () => {
|
|
735
|
+
descriptionOpen.value = false;
|
|
736
|
+
descriptionLong.value = false;
|
|
737
|
+
await nextTick();
|
|
738
|
+
measureDescription();
|
|
739
|
+
});
|
|
740
|
+
watch(specificationsBody, (element) => {
|
|
741
|
+
specificationsObserver?.disconnect();
|
|
742
|
+
specificationsObserver = undefined;
|
|
743
|
+
|
|
744
|
+
if (element) {
|
|
745
|
+
specificationsObserver = new ResizeObserver(measureSpecifications);
|
|
746
|
+
specificationsObserver.observe(element);
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
measureSpecifications();
|
|
750
|
+
});
|
|
751
|
+
// Another variant, another language or another unit replaces the rows, so
|
|
752
|
+
// the list is measured again. A product without characteristics has
|
|
753
|
+
// nothing left to show in the dialog.
|
|
754
|
+
watch(specifications, async (groups) => {
|
|
755
|
+
specificationsLong.value = false;
|
|
756
|
+
|
|
757
|
+
if (!groups.length) {
|
|
758
|
+
specificationsOpen.value = false;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
await nextTick();
|
|
762
|
+
measureSpecifications();
|
|
763
|
+
});
|
|
764
|
+
watch(image, async (index) => {
|
|
765
|
+
await nextTick();
|
|
766
|
+
revealThumbnail(index);
|
|
767
|
+
});
|
|
768
|
+
// Another variant's photos start from the first thumbnail.
|
|
769
|
+
watch(photos, async () => {
|
|
770
|
+
await nextTick();
|
|
771
|
+
|
|
772
|
+
if (rail.value) {
|
|
773
|
+
rail.value.scrollTop = 0;
|
|
774
|
+
rail.value.scrollLeft = 0;
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
updateRail();
|
|
778
|
+
});
|
|
779
|
+
watch(product, (value) => {
|
|
780
|
+
if (value) {
|
|
781
|
+
emit('loaded', value);
|
|
782
|
+
}
|
|
783
|
+
});
|
|
784
|
+
</script>
|
|
785
|
+
|
|
786
|
+
<template>
|
|
787
|
+
<section
|
|
788
|
+
class="op-feature @container/product font-orionplace"
|
|
789
|
+
data-feature-part="StorefrontProduct"
|
|
790
|
+
:aria-busy="showSkeleton || undefined"
|
|
791
|
+
>
|
|
792
|
+
<div
|
|
793
|
+
v-if="task.state.error"
|
|
794
|
+
class="op-notice op-notice-error"
|
|
795
|
+
role="alert"
|
|
796
|
+
>
|
|
797
|
+
{{ task.state.error }}
|
|
798
|
+
<button
|
|
799
|
+
class="op-feature-button"
|
|
800
|
+
type="button"
|
|
801
|
+
:disabled="Boolean(task.state.pending)"
|
|
802
|
+
@click="load"
|
|
803
|
+
>
|
|
804
|
+
{{ common.retry }}
|
|
805
|
+
</button>
|
|
806
|
+
</div>
|
|
807
|
+
<p
|
|
808
|
+
class="op-feature-loading"
|
|
809
|
+
v-if="task.state.pending || showSkeleton"
|
|
810
|
+
role="status"
|
|
811
|
+
>
|
|
812
|
+
<span class="sr-only">{{ common.loading }}</span>
|
|
813
|
+
</p>
|
|
814
|
+
<OrionplaceBreadcrumbs
|
|
815
|
+
v-if="product || showSkeleton"
|
|
816
|
+
class="mb-6"
|
|
817
|
+
:items="breadcrumbs"
|
|
818
|
+
:loading="!product"
|
|
819
|
+
/>
|
|
820
|
+
<template v-if="product">
|
|
821
|
+
<div
|
|
822
|
+
class="grid items-start gap-8 @min-[960px]/product:grid-cols-[minmax(0,7fr)_minmax(0,5fr)] @min-[960px]/product:items-stretch @min-[960px]/product:gap-x-12 @min-[1200px]/product:gap-x-20"
|
|
823
|
+
>
|
|
824
|
+
<section
|
|
825
|
+
v-if="photos.length"
|
|
826
|
+
class="grid min-w-0 gap-3 @min-[560px]/product:grid-cols-[72px_minmax(0,1fr)] @min-[560px]/product:gap-4 @min-[960px]/product:col-start-1 @min-[960px]/product:row-start-1"
|
|
827
|
+
:aria-label="labels.gallery"
|
|
828
|
+
data-product-gallery
|
|
829
|
+
>
|
|
830
|
+
<div
|
|
831
|
+
class="relative min-w-0 @min-[560px]/product:col-start-2 @min-[560px]/product:row-start-1 @min-[960px]/product:min-h-96"
|
|
832
|
+
:class="{ 'touch-pan-y': photos.length > 1 }"
|
|
833
|
+
data-product-main-image
|
|
834
|
+
@touchstart.passive="startSwipe"
|
|
835
|
+
@touchend="endSwipe"
|
|
836
|
+
>
|
|
837
|
+
<OrionplaceImage
|
|
838
|
+
:src="photos[image]"
|
|
839
|
+
:alt="title"
|
|
840
|
+
:width="800"
|
|
841
|
+
:height="1000"
|
|
842
|
+
loading="eager"
|
|
843
|
+
role="button"
|
|
844
|
+
tabindex="0"
|
|
845
|
+
:aria-label="labels.openProductPhoto"
|
|
846
|
+
data-product-photo-open
|
|
847
|
+
@click="viewerOpen = true"
|
|
848
|
+
@keydown="openViewerKey"
|
|
849
|
+
class="
|
|
850
|
+
box-border aspect-square h-auto max-h-[70vh] w-full
|
|
851
|
+
cursor-zoom-in outline-none
|
|
852
|
+
focus-visible:outline-1 focus-visible:outline-solid
|
|
853
|
+
focus-visible:outline-orionplace-text
|
|
854
|
+
bg-orionplace-surface object-contain
|
|
855
|
+
@min-[560px]/product:aspect-[4/5]
|
|
856
|
+
@min-[960px]/product:absolute @min-[960px]/product:inset-0
|
|
857
|
+
@min-[960px]/product:m-auto @min-[960px]/product:aspect-auto
|
|
858
|
+
@min-[960px]/product:h-full
|
|
859
|
+
@min-[960px]/product:max-h-[calc(100vh-12rem)]
|
|
860
|
+
"
|
|
861
|
+
/>
|
|
862
|
+
<template v-if="photos.length > 1">
|
|
863
|
+
<button
|
|
864
|
+
type="button"
|
|
865
|
+
class="absolute left-2 top-1/2 -translate-y-1/2 grid h-10 w-10 place-items-center rounded-full p-0 cursor-pointer border border-solid border-orionplace-border bg-orionplace-surface/90 text-orionplace-text outline-none transition-colors motion-reduce:transition-none hover:border-orionplace-text focus-visible:border-orionplace-text"
|
|
866
|
+
:aria-label="labels.previousImage"
|
|
867
|
+
data-product-image-previous
|
|
868
|
+
@click="showImage(image - 1)"
|
|
869
|
+
>
|
|
870
|
+
<svg
|
|
871
|
+
viewBox="0 0 24 24"
|
|
872
|
+
class="h-4 w-4"
|
|
873
|
+
fill="none"
|
|
874
|
+
stroke="currentColor"
|
|
875
|
+
stroke-width="1.5"
|
|
876
|
+
aria-hidden="true"
|
|
877
|
+
>
|
|
878
|
+
<path d="m15 5-7 7 7 7" />
|
|
879
|
+
</svg>
|
|
880
|
+
</button>
|
|
881
|
+
<button
|
|
882
|
+
type="button"
|
|
883
|
+
class="absolute right-2 top-1/2 -translate-y-1/2 grid h-10 w-10 place-items-center rounded-full p-0 cursor-pointer border border-solid border-orionplace-border bg-orionplace-surface/90 text-orionplace-text outline-none transition-colors motion-reduce:transition-none hover:border-orionplace-text focus-visible:border-orionplace-text"
|
|
884
|
+
:aria-label="labels.nextImage"
|
|
885
|
+
data-product-image-next
|
|
886
|
+
@click="showImage(image + 1)"
|
|
887
|
+
>
|
|
888
|
+
<svg
|
|
889
|
+
viewBox="0 0 24 24"
|
|
890
|
+
class="h-4 w-4"
|
|
891
|
+
fill="none"
|
|
892
|
+
stroke="currentColor"
|
|
893
|
+
stroke-width="1.5"
|
|
894
|
+
aria-hidden="true"
|
|
895
|
+
>
|
|
896
|
+
<path d="m9 5 7 7-7 7" />
|
|
897
|
+
</svg>
|
|
898
|
+
</button>
|
|
899
|
+
</template>
|
|
900
|
+
</div>
|
|
901
|
+
<div
|
|
902
|
+
v-if="photos.length > 1"
|
|
903
|
+
class="relative min-w-0 @min-[560px]/product:col-start-1 @min-[560px]/product:row-start-1 @min-[560px]/product:h-0 @min-[560px]/product:min-h-full"
|
|
904
|
+
data-product-thumbnail-rail
|
|
905
|
+
>
|
|
906
|
+
<div
|
|
907
|
+
ref="rail"
|
|
908
|
+
class="product-thumbnails relative flex h-full min-w-0 gap-2 overflow-x-auto overflow-y-hidden overscroll-contain @min-[560px]/product:flex-col @min-[560px]/product:overflow-x-hidden @min-[560px]/product:overflow-y-auto"
|
|
909
|
+
data-product-thumbnails
|
|
910
|
+
@scroll.passive="updateRail"
|
|
911
|
+
>
|
|
912
|
+
<button
|
|
913
|
+
v-for="(photo, index) in photos"
|
|
914
|
+
:key="photo"
|
|
915
|
+
type="button"
|
|
916
|
+
class="box-border h-[70px] w-14 shrink-0 p-1 @min-[560px]/product:h-[90px] @min-[560px]/product:w-[72px] cursor-pointer border border-solid bg-orionplace-surface outline-none transition-[opacity,border-color] motion-reduce:transition-none hover:opacity-100 focus-visible:border-2 focus-visible:border-orionplace-text"
|
|
917
|
+
:class="
|
|
918
|
+
index === image
|
|
919
|
+
? 'border-orionplace-text opacity-100'
|
|
920
|
+
: 'border-transparent opacity-75'
|
|
921
|
+
"
|
|
922
|
+
:aria-label="`${labels.gallery} ${index + 1}`"
|
|
923
|
+
:aria-pressed="index === image"
|
|
924
|
+
:tabindex="index === image ? 0 : -1"
|
|
925
|
+
:data-product-thumbnail="index"
|
|
926
|
+
@click="image = index"
|
|
927
|
+
@keydown="thumbnailKeydown($event, index)"
|
|
928
|
+
>
|
|
929
|
+
<OrionplaceImage
|
|
930
|
+
:src="photo"
|
|
931
|
+
alt=""
|
|
932
|
+
class="h-full w-full object-contain"
|
|
933
|
+
/>
|
|
934
|
+
</button>
|
|
935
|
+
</div>
|
|
936
|
+
<button
|
|
937
|
+
type="button"
|
|
938
|
+
class="group absolute left-0 top-0 bottom-0 grid w-10 place-items-center p-0 @min-[560px]/product:right-0 @min-[560px]/product:bottom-auto @min-[560px]/product:h-10 @min-[560px]/product:w-auto cursor-pointer border-0 outline-none bg-linear-to-r from-orionplace-surface from-40% to-transparent @min-[560px]/product:bg-linear-to-b transition-opacity motion-reduce:transition-none disabled:pointer-events-none disabled:opacity-0"
|
|
939
|
+
:aria-label="labels.thumbnailsBack"
|
|
940
|
+
:disabled="!railEdges.back"
|
|
941
|
+
data-product-thumbnails-previous
|
|
942
|
+
@click="stepRail(-1)"
|
|
943
|
+
>
|
|
944
|
+
<span
|
|
945
|
+
class="grid h-7 w-7 place-items-center rounded-full border border-solid border-orionplace-border bg-orionplace-surface text-orionplace-text transition-colors motion-reduce:transition-none group-hover:border-orionplace-text group-focus-visible:border-orionplace-text"
|
|
946
|
+
>
|
|
947
|
+
<svg
|
|
948
|
+
viewBox="0 0 24 24"
|
|
949
|
+
class="h-3.5 w-3.5 @min-[560px]/product:rotate-90"
|
|
950
|
+
fill="none"
|
|
951
|
+
stroke="currentColor"
|
|
952
|
+
stroke-width="1.5"
|
|
953
|
+
aria-hidden="true"
|
|
954
|
+
>
|
|
955
|
+
<path d="m15 5-7 7 7 7" />
|
|
956
|
+
</svg>
|
|
957
|
+
</span>
|
|
958
|
+
</button>
|
|
959
|
+
<button
|
|
960
|
+
type="button"
|
|
961
|
+
class="group absolute right-0 top-0 bottom-0 grid w-10 place-items-center p-0 @min-[560px]/product:left-0 @min-[560px]/product:top-auto @min-[560px]/product:h-10 @min-[560px]/product:w-auto cursor-pointer border-0 outline-none bg-linear-to-l from-orionplace-surface from-40% to-transparent @min-[560px]/product:bg-linear-to-t transition-opacity motion-reduce:transition-none disabled:pointer-events-none disabled:opacity-0"
|
|
962
|
+
:aria-label="labels.thumbnailsForward"
|
|
963
|
+
:disabled="!railEdges.forward"
|
|
964
|
+
data-product-thumbnails-next
|
|
965
|
+
@click="stepRail(1)"
|
|
966
|
+
>
|
|
967
|
+
<span
|
|
968
|
+
class="grid h-7 w-7 place-items-center rounded-full border border-solid border-orionplace-border bg-orionplace-surface text-orionplace-text transition-colors motion-reduce:transition-none group-hover:border-orionplace-text group-focus-visible:border-orionplace-text"
|
|
969
|
+
>
|
|
970
|
+
<svg
|
|
971
|
+
viewBox="0 0 24 24"
|
|
972
|
+
class="h-3.5 w-3.5 @min-[560px]/product:rotate-90"
|
|
973
|
+
fill="none"
|
|
974
|
+
stroke="currentColor"
|
|
975
|
+
stroke-width="1.5"
|
|
976
|
+
aria-hidden="true"
|
|
977
|
+
>
|
|
978
|
+
<path d="m9 5 7 7-7 7" />
|
|
979
|
+
</svg>
|
|
980
|
+
</span>
|
|
981
|
+
</button>
|
|
982
|
+
</div>
|
|
983
|
+
</section>
|
|
984
|
+
|
|
985
|
+
<div
|
|
986
|
+
class="grid min-w-0 content-start gap-6 @min-[960px]/product:col-start-2 @min-[960px]/product:row-start-1"
|
|
987
|
+
data-product-summary
|
|
988
|
+
>
|
|
989
|
+
<header class="grid min-w-0 gap-3">
|
|
990
|
+
<h1
|
|
991
|
+
class="m-0 break-words text-2xl font-medium leading-tight text-orionplace-text @min-[560px]/product:text-[28px]"
|
|
992
|
+
>
|
|
993
|
+
{{ title }}
|
|
994
|
+
</h1>
|
|
995
|
+
<a
|
|
996
|
+
v-if="reviewStat"
|
|
997
|
+
href="#product-reviews"
|
|
998
|
+
class="inline-flex items-center gap-2 justify-self-start text-xs text-orionplace-muted no-underline tabular-nums outline-none transition-colors motion-reduce:transition-none hover:text-orionplace-text focus-visible:text-orionplace-text"
|
|
999
|
+
:aria-label="summaryLabel"
|
|
1000
|
+
data-product-review-summary
|
|
1001
|
+
@click.prevent="showReviews"
|
|
1002
|
+
>
|
|
1003
|
+
<span
|
|
1004
|
+
class="inline-flex text-sm tracking-[0.06em]"
|
|
1005
|
+
aria-hidden="true"
|
|
1006
|
+
>
|
|
1007
|
+
<span
|
|
1008
|
+
v-for="star in 5"
|
|
1009
|
+
:key="star"
|
|
1010
|
+
:class="
|
|
1011
|
+
star <= Math.round(reviewStat.average)
|
|
1012
|
+
? 'text-orionplace-text'
|
|
1013
|
+
: 'text-orionplace-border'
|
|
1014
|
+
"
|
|
1015
|
+
>
|
|
1016
|
+
★
|
|
1017
|
+
</span>
|
|
1018
|
+
</span>
|
|
1019
|
+
<span class="text-orionplace-text">
|
|
1020
|
+
{{ reviewStat.average }}
|
|
1021
|
+
</span>
|
|
1022
|
+
<span>· {{ reviewStat.count }} {{ reviewCaption }}</span>
|
|
1023
|
+
</a>
|
|
1024
|
+
</header>
|
|
1025
|
+
|
|
1026
|
+
<p
|
|
1027
|
+
v-if="previewStatus"
|
|
1028
|
+
class="op-notice op-notice-attention"
|
|
1029
|
+
role="status"
|
|
1030
|
+
data-product-preview-status
|
|
1031
|
+
>
|
|
1032
|
+
{{ previewStatus }}
|
|
1033
|
+
</p>
|
|
1034
|
+
|
|
1035
|
+
<ProductCard
|
|
1036
|
+
:product-id="currentId"
|
|
1037
|
+
details
|
|
1038
|
+
:actions-disabled="
|
|
1039
|
+
actions.pending.value || actions.needsRefresh.value
|
|
1040
|
+
"
|
|
1041
|
+
@select-seller="emit('seller', $event)"
|
|
1042
|
+
@add="actions.run('add', $event)"
|
|
1043
|
+
@remove="actions.run('remove', $event)"
|
|
1044
|
+
@toggle-favorite="actions.run('toggleFavorite', $event)"
|
|
1045
|
+
@subscribe="actions.run('subscribe', $event)"
|
|
1046
|
+
@unsubscribe="actions.run('unsubscribe', $event)"
|
|
1047
|
+
@preorder="actions.openPreorder"
|
|
1048
|
+
@request-secondary-variants="variants.requestSecondary"
|
|
1049
|
+
@select-variant="selectVariant"
|
|
1050
|
+
@select-secondary-variant="selectSecondary"
|
|
1051
|
+
>
|
|
1052
|
+
<template #afterPrice>
|
|
1053
|
+
<div
|
|
1054
|
+
v-if="hasDescription || specifications.length"
|
|
1055
|
+
class="grid gap-6 py-1"
|
|
1056
|
+
data-product-information
|
|
1057
|
+
>
|
|
1058
|
+
<section
|
|
1059
|
+
v-if="hasDescription"
|
|
1060
|
+
class="grid gap-3"
|
|
1061
|
+
data-product-description
|
|
1062
|
+
>
|
|
1063
|
+
<h2
|
|
1064
|
+
class="m-0 text-xs font-medium uppercase tracking-[0.08em] text-orionplace-text"
|
|
1065
|
+
>
|
|
1066
|
+
{{ labels.description }}
|
|
1067
|
+
</h2>
|
|
1068
|
+
<div
|
|
1069
|
+
v-if="mounted"
|
|
1070
|
+
id="product-description-text"
|
|
1071
|
+
ref="descriptionBody"
|
|
1072
|
+
class="product-description text-sm text-orionplace-text"
|
|
1073
|
+
:class="{
|
|
1074
|
+
'product-description-short': !descriptionOpen,
|
|
1075
|
+
'product-description-fade':
|
|
1076
|
+
!descriptionOpen && descriptionLong,
|
|
1077
|
+
}"
|
|
1078
|
+
v-html="description"
|
|
1079
|
+
/>
|
|
1080
|
+
<div
|
|
1081
|
+
v-else
|
|
1082
|
+
id="product-description-text"
|
|
1083
|
+
ref="descriptionBody"
|
|
1084
|
+
class="product-description text-sm text-orionplace-text"
|
|
1085
|
+
:class="{
|
|
1086
|
+
'product-description-short': !descriptionOpen,
|
|
1087
|
+
'product-description-fade':
|
|
1088
|
+
!descriptionOpen && descriptionLong,
|
|
1089
|
+
}"
|
|
1090
|
+
>
|
|
1091
|
+
<p
|
|
1092
|
+
v-for="(paragraph, index) in descriptionText"
|
|
1093
|
+
:key="index"
|
|
1094
|
+
>
|
|
1095
|
+
{{ paragraph }}
|
|
1096
|
+
</p>
|
|
1097
|
+
</div>
|
|
1098
|
+
<button
|
|
1099
|
+
v-if="descriptionLong"
|
|
1100
|
+
type="button"
|
|
1101
|
+
class="justify-self-start p-0 cursor-pointer border-0 bg-transparent text-xs uppercase tracking-[0.08em] text-orionplace-text outline-none transition-colors motion-reduce:transition-none hover:text-orionplace-muted focus-visible:text-orionplace-muted"
|
|
1102
|
+
aria-controls="product-description-text"
|
|
1103
|
+
:aria-expanded="descriptionOpen"
|
|
1104
|
+
data-product-description-toggle
|
|
1105
|
+
@click="descriptionOpen = !descriptionOpen"
|
|
1106
|
+
>
|
|
1107
|
+
{{ descriptionOpen ? labels.less : labels.more }}
|
|
1108
|
+
</button>
|
|
1109
|
+
</section>
|
|
1110
|
+
<section
|
|
1111
|
+
v-if="specifications.length"
|
|
1112
|
+
class="grid gap-3"
|
|
1113
|
+
data-product-specifications
|
|
1114
|
+
>
|
|
1115
|
+
<h2
|
|
1116
|
+
class="m-0 text-xs font-medium uppercase tracking-[0.08em] text-orionplace-text"
|
|
1117
|
+
>
|
|
1118
|
+
{{ labels.characteristics }}
|
|
1119
|
+
</h2>
|
|
1120
|
+
<div
|
|
1121
|
+
id="product-specifications-list"
|
|
1122
|
+
ref="specificationsBody"
|
|
1123
|
+
class="product-specifications grid gap-4"
|
|
1124
|
+
:class="{
|
|
1125
|
+
'product-specifications-fade': specificationsLong,
|
|
1126
|
+
}"
|
|
1127
|
+
>
|
|
1128
|
+
<div
|
|
1129
|
+
v-for="group in specifications"
|
|
1130
|
+
:key="group.key"
|
|
1131
|
+
class="grid gap-1"
|
|
1132
|
+
>
|
|
1133
|
+
<h3
|
|
1134
|
+
v-if="group.title"
|
|
1135
|
+
class="m-0 text-sm font-normal text-orionplace-muted"
|
|
1136
|
+
>
|
|
1137
|
+
{{ group.title }}
|
|
1138
|
+
</h3>
|
|
1139
|
+
<dl class="m-0 grid">
|
|
1140
|
+
<div
|
|
1141
|
+
v-for="row in group.rows"
|
|
1142
|
+
:key="row.key"
|
|
1143
|
+
class="grid grid-cols-[minmax(0,2fr)_minmax(0,3fr)] gap-4 py-2.5 text-sm border-0 border-b border-solid border-orionplace-border"
|
|
1144
|
+
>
|
|
1145
|
+
<dt class="break-words text-orionplace-muted">
|
|
1146
|
+
{{ row.label }}
|
|
1147
|
+
</dt>
|
|
1148
|
+
<dd
|
|
1149
|
+
class="m-0 whitespace-pre-line break-words text-orionplace-text"
|
|
1150
|
+
>
|
|
1151
|
+
<NuxtLink
|
|
1152
|
+
v-if="row.to"
|
|
1153
|
+
class="op-feature-link"
|
|
1154
|
+
:to="row.to"
|
|
1155
|
+
>
|
|
1156
|
+
{{ row.value }}
|
|
1157
|
+
</NuxtLink>
|
|
1158
|
+
<template v-else>{{ row.value }}</template>
|
|
1159
|
+
</dd>
|
|
1160
|
+
</div>
|
|
1161
|
+
</dl>
|
|
1162
|
+
</div>
|
|
1163
|
+
</div>
|
|
1164
|
+
<button
|
|
1165
|
+
v-if="specificationsLong"
|
|
1166
|
+
type="button"
|
|
1167
|
+
class="justify-self-start p-0 cursor-pointer border-0 bg-transparent text-xs uppercase tracking-[0.08em] text-orionplace-text outline-none transition-colors motion-reduce:transition-none hover:text-orionplace-muted focus-visible:text-orionplace-muted"
|
|
1168
|
+
aria-haspopup="dialog"
|
|
1169
|
+
data-product-specifications-toggle
|
|
1170
|
+
@click="specificationsOpen = true"
|
|
1171
|
+
>
|
|
1172
|
+
{{ labels.allCharacteristics }}
|
|
1173
|
+
</button>
|
|
1174
|
+
</section>
|
|
1175
|
+
</div>
|
|
1176
|
+
</template>
|
|
1177
|
+
</ProductCard>
|
|
1178
|
+
<p
|
|
1179
|
+
v-if="variants.error.value"
|
|
1180
|
+
role="alert"
|
|
1181
|
+
class="op-notice op-notice-error"
|
|
1182
|
+
>
|
|
1183
|
+
{{ common.failed }}
|
|
1184
|
+
</p>
|
|
1185
|
+
<!-- While the preorder window is open, it shows its own messages. -->
|
|
1186
|
+
<div
|
|
1187
|
+
v-if="actionMessage && actions.preorder.value === undefined"
|
|
1188
|
+
:role="actions.error.value ? 'alert' : 'status'"
|
|
1189
|
+
class="op-notice"
|
|
1190
|
+
:class="
|
|
1191
|
+
actions.error.value ? 'op-notice-error' : 'op-notice-success'
|
|
1192
|
+
"
|
|
1193
|
+
>
|
|
1194
|
+
{{ actionMessage }}
|
|
1195
|
+
<button
|
|
1196
|
+
class="op-feature-button"
|
|
1197
|
+
v-if="actions.needsRefresh.value"
|
|
1198
|
+
type="button"
|
|
1199
|
+
:disabled="actions.pending.value"
|
|
1200
|
+
@click="actions.retryRefresh()"
|
|
1201
|
+
>
|
|
1202
|
+
{{ actionLabels.retry }}
|
|
1203
|
+
</button>
|
|
1204
|
+
<NuxtLink
|
|
1205
|
+
v-if="actions.error.value?.kind === 'email'"
|
|
1206
|
+
class="op-feature-link op-feature-button"
|
|
1207
|
+
:to="{
|
|
1208
|
+
path: '/profile',
|
|
1209
|
+
query: { locale: selectionStore.localeCode },
|
|
1210
|
+
}"
|
|
1211
|
+
>
|
|
1212
|
+
{{ common.navigation.profile }}
|
|
1213
|
+
</NuxtLink>
|
|
1214
|
+
</div>
|
|
1215
|
+
|
|
1216
|
+
<section
|
|
1217
|
+
v-if="returns.length"
|
|
1218
|
+
class="grid gap-3 pt-5 border-0 border-t border-solid border-orionplace-border"
|
|
1219
|
+
data-product-returns
|
|
1220
|
+
>
|
|
1221
|
+
<h2
|
|
1222
|
+
class="m-0 text-xs font-medium uppercase tracking-[0.08em] text-orionplace-text"
|
|
1223
|
+
>
|
|
1224
|
+
{{ labels.returns }}
|
|
1225
|
+
</h2>
|
|
1226
|
+
<dl class="m-0 grid gap-2 text-sm">
|
|
1227
|
+
<div
|
|
1228
|
+
v-for="entry in returns"
|
|
1229
|
+
:key="entry.key"
|
|
1230
|
+
class="flex flex-wrap items-baseline justify-between gap-x-4"
|
|
1231
|
+
>
|
|
1232
|
+
<dt class="text-orionplace-muted">{{ entry.label }}</dt>
|
|
1233
|
+
<dd class="m-0 text-orionplace-text tabular-nums">
|
|
1234
|
+
{{ entry.value }}
|
|
1235
|
+
</dd>
|
|
1236
|
+
</div>
|
|
1237
|
+
</dl>
|
|
1238
|
+
</section>
|
|
1239
|
+
|
|
1240
|
+
<div
|
|
1241
|
+
v-if="manufacturer || seller"
|
|
1242
|
+
class="grid gap-3"
|
|
1243
|
+
>
|
|
1244
|
+
<NuxtLink
|
|
1245
|
+
v-if="manufacturer"
|
|
1246
|
+
:to="manufacturer.to"
|
|
1247
|
+
class="flex min-w-0 items-center gap-3 p-4 border border-solid border-orionplace-border text-orionplace-text no-underline outline-none transition-colors motion-reduce:transition-none hover:border-orionplace-text focus-visible:border-orionplace-text"
|
|
1248
|
+
:aria-label="`${labels.manufacturerHint}: ${manufacturer.name}`"
|
|
1249
|
+
data-product-manufacturer
|
|
1250
|
+
>
|
|
1251
|
+
<OrionplaceImage
|
|
1252
|
+
v-if="manufacturer.logo"
|
|
1253
|
+
:src="manufacturer.logo"
|
|
1254
|
+
alt=""
|
|
1255
|
+
class="h-10 w-16 shrink-0 bg-orionplace-surface object-contain"
|
|
1256
|
+
data-product-manufacturer-logo
|
|
1257
|
+
/>
|
|
1258
|
+
<OrionplaceAvatar
|
|
1259
|
+
v-else
|
|
1260
|
+
:name="manufacturer.name"
|
|
1261
|
+
/>
|
|
1262
|
+
<span class="grid min-w-0 flex-1 gap-0.5">
|
|
1263
|
+
<span
|
|
1264
|
+
class="text-[11px] leading-4 uppercase tracking-[0.08em] text-orionplace-muted"
|
|
1265
|
+
>
|
|
1266
|
+
{{ labels.manufacturer }}
|
|
1267
|
+
</span>
|
|
1268
|
+
<span class="min-w-0 truncate text-sm">
|
|
1269
|
+
{{ manufacturer.name }}
|
|
1270
|
+
</span>
|
|
1271
|
+
</span>
|
|
1272
|
+
<svg
|
|
1273
|
+
viewBox="0 0 24 24"
|
|
1274
|
+
class="h-4 w-4 shrink-0"
|
|
1275
|
+
fill="none"
|
|
1276
|
+
stroke="currentColor"
|
|
1277
|
+
stroke-width="1.5"
|
|
1278
|
+
aria-hidden="true"
|
|
1279
|
+
>
|
|
1280
|
+
<path d="m9 5 7 7-7 7" />
|
|
1281
|
+
</svg>
|
|
1282
|
+
</NuxtLink>
|
|
1283
|
+
|
|
1284
|
+
<a
|
|
1285
|
+
v-if="seller"
|
|
1286
|
+
:href="sellerHref"
|
|
1287
|
+
class="flex min-w-0 items-center gap-3 p-4 border border-solid border-orionplace-border text-orionplace-text no-underline outline-none transition-colors motion-reduce:transition-none hover:border-orionplace-text focus-visible:border-orionplace-text"
|
|
1288
|
+
:aria-label="`${labels.sellerHint}: ${seller.name}`"
|
|
1289
|
+
data-product-seller-link
|
|
1290
|
+
@click.prevent="openSeller"
|
|
1291
|
+
>
|
|
1292
|
+
<OrionplaceAvatar
|
|
1293
|
+
:src="seller.avatar"
|
|
1294
|
+
:name="seller.name"
|
|
1295
|
+
/>
|
|
1296
|
+
<span class="grid min-w-0 flex-1 gap-0.5">
|
|
1297
|
+
<span
|
|
1298
|
+
class="text-[11px] leading-4 uppercase tracking-[0.08em] text-orionplace-muted"
|
|
1299
|
+
>
|
|
1300
|
+
{{ labels.seller }}
|
|
1301
|
+
</span>
|
|
1302
|
+
<span class="flex min-w-0 items-center gap-2 text-sm">
|
|
1303
|
+
<span class="min-w-0 truncate">{{ seller.name }}</span>
|
|
1304
|
+
<span
|
|
1305
|
+
v-if="sellerRating > 0"
|
|
1306
|
+
class="shrink-0 text-xs text-orionplace-muted tabular-nums"
|
|
1307
|
+
>
|
|
1308
|
+
★ {{ seller.raiting }}
|
|
1309
|
+
</span>
|
|
1310
|
+
</span>
|
|
1311
|
+
</span>
|
|
1312
|
+
<svg
|
|
1313
|
+
viewBox="0 0 24 24"
|
|
1314
|
+
class="h-4 w-4 shrink-0"
|
|
1315
|
+
fill="none"
|
|
1316
|
+
stroke="currentColor"
|
|
1317
|
+
stroke-width="1.5"
|
|
1318
|
+
aria-hidden="true"
|
|
1319
|
+
>
|
|
1320
|
+
<path d="m9 5 7 7-7 7" />
|
|
1321
|
+
</svg>
|
|
1322
|
+
</a>
|
|
1323
|
+
</div>
|
|
1324
|
+
</div>
|
|
1325
|
+
</div>
|
|
1326
|
+
<div
|
|
1327
|
+
id="product-reviews"
|
|
1328
|
+
class="mt-14 scroll-mt-6 pt-10 border-0 border-t border-solid border-orionplace-border @min-[592px]/product:mt-20"
|
|
1329
|
+
>
|
|
1330
|
+
<ProductReviews
|
|
1331
|
+
:key="currentId"
|
|
1332
|
+
:product-id="currentId"
|
|
1333
|
+
/>
|
|
1334
|
+
</div>
|
|
1335
|
+
<ProductPreorderDialog
|
|
1336
|
+
:product-id="actions.preorder.value"
|
|
1337
|
+
:pending="actions.pending.value"
|
|
1338
|
+
:error="actions.error.value ? actionMessage : ''"
|
|
1339
|
+
:field-errors="actions.error.value?.fields"
|
|
1340
|
+
:suggest-sign-in="Boolean(actions.error.value?.signIn)"
|
|
1341
|
+
@submit="actions.submitPreorder($event.email, $event.phone)"
|
|
1342
|
+
@close="actions.preorder.value = undefined"
|
|
1343
|
+
/>
|
|
1344
|
+
<ProductSpecificationsDialog
|
|
1345
|
+
v-if="specificationsOpen"
|
|
1346
|
+
:groups="specifications"
|
|
1347
|
+
@close="specificationsOpen = false"
|
|
1348
|
+
/>
|
|
1349
|
+
<ProductReviewImageViewer
|
|
1350
|
+
v-if="viewerOpen && photos.length"
|
|
1351
|
+
:images="viewerPhotos"
|
|
1352
|
+
:index="image"
|
|
1353
|
+
:label="labels.productPhotos"
|
|
1354
|
+
:alt="title"
|
|
1355
|
+
@change="image = $event.index"
|
|
1356
|
+
@close="viewerOpen = false"
|
|
1357
|
+
/>
|
|
1358
|
+
</template>
|
|
1359
|
+
<div
|
|
1360
|
+
v-else-if="showSkeleton"
|
|
1361
|
+
class="grid items-start gap-8 animate-pulse motion-reduce:animate-none @min-[960px]/product:grid-cols-[minmax(0,7fr)_minmax(0,5fr)] @min-[960px]/product:items-stretch @min-[960px]/product:gap-x-12 @min-[1200px]/product:gap-x-20"
|
|
1362
|
+
aria-hidden="true"
|
|
1363
|
+
data-product-skeleton
|
|
1364
|
+
>
|
|
1365
|
+
<div
|
|
1366
|
+
class="grid min-w-0 gap-3 @min-[560px]/product:grid-cols-[72px_minmax(0,1fr)] @min-[560px]/product:gap-4 @min-[960px]/product:col-start-1 @min-[960px]/product:row-start-1"
|
|
1367
|
+
>
|
|
1368
|
+
<div
|
|
1369
|
+
class="box-border aspect-square max-h-[70vh] w-full border border-solid border-orionplace-border @min-[560px]/product:col-start-2 @min-[560px]/product:row-start-1 @min-[560px]/product:aspect-[4/5] @min-[960px]/product:aspect-auto @min-[960px]/product:max-h-none @min-[960px]/product:min-h-96"
|
|
1370
|
+
/>
|
|
1371
|
+
<div
|
|
1372
|
+
class="flex min-w-0 gap-2 overflow-hidden @min-[560px]/product:col-start-1 @min-[560px]/product:row-start-1 @min-[560px]/product:flex-col"
|
|
1373
|
+
>
|
|
1374
|
+
<span
|
|
1375
|
+
v-for="index in 4"
|
|
1376
|
+
:key="index"
|
|
1377
|
+
class="box-border h-[70px] w-14 shrink-0 border border-solid border-orionplace-border @min-[560px]/product:h-[90px] @min-[560px]/product:w-[72px]"
|
|
1378
|
+
/>
|
|
1379
|
+
</div>
|
|
1380
|
+
</div>
|
|
1381
|
+
<div
|
|
1382
|
+
class="grid min-w-0 content-start gap-6 @min-[960px]/product:col-start-2 @min-[960px]/product:row-start-1"
|
|
1383
|
+
>
|
|
1384
|
+
<div class="grid gap-3">
|
|
1385
|
+
<span class="h-7 w-4/5 bg-orionplace-border" />
|
|
1386
|
+
<span class="h-7 w-1/2 bg-orionplace-border" />
|
|
1387
|
+
</div>
|
|
1388
|
+
<span class="h-6 w-28 bg-orionplace-border" />
|
|
1389
|
+
<div class="grid gap-3">
|
|
1390
|
+
<span class="h-3 w-32 bg-orionplace-border" />
|
|
1391
|
+
<span class="h-3 w-full bg-orionplace-border" />
|
|
1392
|
+
<span class="h-3 w-full bg-orionplace-border" />
|
|
1393
|
+
<span class="h-3 w-2/3 bg-orionplace-border" />
|
|
1394
|
+
</div>
|
|
1395
|
+
<div class="grid">
|
|
1396
|
+
<span class="mb-2 h-3 w-36 bg-orionplace-border" />
|
|
1397
|
+
<span
|
|
1398
|
+
v-for="index in 3"
|
|
1399
|
+
:key="index"
|
|
1400
|
+
class="box-border h-10 w-full border-0 border-b border-solid border-orionplace-border"
|
|
1401
|
+
/>
|
|
1402
|
+
</div>
|
|
1403
|
+
<div class="grid gap-3">
|
|
1404
|
+
<span class="h-3 w-36 bg-orionplace-border" />
|
|
1405
|
+
<div class="flex gap-2">
|
|
1406
|
+
<span class="h-6 w-6 rounded-full bg-orionplace-border" />
|
|
1407
|
+
<span class="h-6 w-6 rounded-full bg-orionplace-border" />
|
|
1408
|
+
</div>
|
|
1409
|
+
</div>
|
|
1410
|
+
<span class="h-11 w-full bg-orionplace-border" />
|
|
1411
|
+
<div class="grid gap-3">
|
|
1412
|
+
<span
|
|
1413
|
+
v-for="index in 2"
|
|
1414
|
+
:key="index"
|
|
1415
|
+
class="box-border h-[74px] w-full border border-solid border-orionplace-border"
|
|
1416
|
+
/>
|
|
1417
|
+
</div>
|
|
1418
|
+
</div>
|
|
1419
|
+
</div>
|
|
1420
|
+
<OrionplaceEmptyState
|
|
1421
|
+
v-else-if="!task.state.pending && !task.state.error"
|
|
1422
|
+
kind="search"
|
|
1423
|
+
:message="labels.notFound"
|
|
1424
|
+
/>
|
|
1425
|
+
</section>
|
|
1426
|
+
</template>
|
|
1427
|
+
|
|
1428
|
+
<style scoped>
|
|
1429
|
+
/* The arrow buttons replace the native scrollbar of the thumbnail rail. */
|
|
1430
|
+
.product-thumbnails {
|
|
1431
|
+
scrollbar-width: none;
|
|
1432
|
+
}
|
|
1433
|
+
.product-thumbnails::-webkit-scrollbar {
|
|
1434
|
+
display: none;
|
|
1435
|
+
}
|
|
1436
|
+
.product-description {
|
|
1437
|
+
line-height: 1.7;
|
|
1438
|
+
overflow-wrap: anywhere;
|
|
1439
|
+
}
|
|
1440
|
+
.product-description :deep(p) {
|
|
1441
|
+
margin: 0.75rem 0;
|
|
1442
|
+
}
|
|
1443
|
+
.product-description :deep(p:first-child) {
|
|
1444
|
+
margin-top: 0;
|
|
1445
|
+
}
|
|
1446
|
+
.product-description :deep(img) {
|
|
1447
|
+
max-width: 100%;
|
|
1448
|
+
height: auto;
|
|
1449
|
+
}
|
|
1450
|
+
.product-description-short {
|
|
1451
|
+
max-height: 10rem;
|
|
1452
|
+
overflow: hidden;
|
|
1453
|
+
}
|
|
1454
|
+
.product-description-fade {
|
|
1455
|
+
mask-image: linear-gradient(to bottom, currentColor 65%, transparent);
|
|
1456
|
+
}
|
|
1457
|
+
/* The reserved height keeps the purchase controls in place; the rows that
|
|
1458
|
+
do not fit are read in the characteristics dialog. */
|
|
1459
|
+
.product-specifications {
|
|
1460
|
+
max-height: 14rem;
|
|
1461
|
+
overflow: hidden;
|
|
1462
|
+
}
|
|
1463
|
+
.product-specifications-fade {
|
|
1464
|
+
mask-image: linear-gradient(to bottom, currentColor 80%, transparent);
|
|
1465
|
+
}
|
|
1466
|
+
</style>
|