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,897 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<article
|
|
3
|
+
v-if="product"
|
|
4
|
+
ref="card"
|
|
5
|
+
:style="{ minHeight }"
|
|
6
|
+
class="
|
|
7
|
+
box-border grid min-w-0 content-start
|
|
8
|
+
font-orionplace text-orionplace-text
|
|
9
|
+
"
|
|
10
|
+
:class="layoutClass"
|
|
11
|
+
:data-product-id="product.id"
|
|
12
|
+
:data-product-layout="layout"
|
|
13
|
+
:aria-busy="variantLoading || undefined"
|
|
14
|
+
>
|
|
15
|
+
<div
|
|
16
|
+
v-if="!details"
|
|
17
|
+
ref="imageArea"
|
|
18
|
+
class="relative w-full min-w-0 self-start justify-self-start"
|
|
19
|
+
:class="{
|
|
20
|
+
'col-span-full max-w-52 @min-[22rem]:col-span-1 @min-[22rem]:row-span-3 @min-[22rem]:max-w-44':
|
|
21
|
+
isCompact,
|
|
22
|
+
}"
|
|
23
|
+
:style="photoInsetStyle"
|
|
24
|
+
data-product-image
|
|
25
|
+
>
|
|
26
|
+
<component
|
|
27
|
+
:is="productHref ? 'a' : 'button'"
|
|
28
|
+
data-product-part="OrionplaceImage"
|
|
29
|
+
data-product-image-viewport
|
|
30
|
+
:data-product-photo-swipe="photos.length > 1 || undefined"
|
|
31
|
+
:href="productHref"
|
|
32
|
+
:type="productHref ? undefined : 'button'"
|
|
33
|
+
:disabled="productHref ? undefined : disabled"
|
|
34
|
+
:aria-disabled="productHref && disabled ? 'true' : undefined"
|
|
35
|
+
class="
|
|
36
|
+
relative block w-full overflow-hidden
|
|
37
|
+
cursor-pointer border-0 bg-transparent p-0
|
|
38
|
+
outline-none transition-opacity motion-reduce:transition-none
|
|
39
|
+
hover:opacity-85 focus-visible:opacity-70
|
|
40
|
+
"
|
|
41
|
+
:class="{ 'aspect-[3/4]': !isCompact }"
|
|
42
|
+
@click="selectProduct"
|
|
43
|
+
@pointerenter="photosPrimed = true"
|
|
44
|
+
@pointermove="pointAtPhoto"
|
|
45
|
+
@pointerleave="leavePhotos"
|
|
46
|
+
@touchstart.passive="startPhotoSwipe"
|
|
47
|
+
@touchend="endPhotoSwipe"
|
|
48
|
+
>
|
|
49
|
+
<template
|
|
50
|
+
v-for="(photo, index) in photoSources"
|
|
51
|
+
:key="`${index}:${photo}`"
|
|
52
|
+
>
|
|
53
|
+
<OrionplaceImage
|
|
54
|
+
v-if="index === 0 || photosPrimed || index === activePhoto"
|
|
55
|
+
:src="photo"
|
|
56
|
+
:alt="name"
|
|
57
|
+
:width="3"
|
|
58
|
+
:height="4"
|
|
59
|
+
:loading="index === 0 ? 'lazy' : 'eager'"
|
|
60
|
+
:aria-hidden="photos.length > 1 ? index !== activePhoto : undefined"
|
|
61
|
+
class="
|
|
62
|
+
box-border w-full object-contain
|
|
63
|
+
transition-opacity duration-200 motion-reduce:transition-none
|
|
64
|
+
"
|
|
65
|
+
:class="[
|
|
66
|
+
index > 0
|
|
67
|
+
? 'absolute inset-0 h-full'
|
|
68
|
+
: isCompact
|
|
69
|
+
? 'h-52 @min-[22rem]:h-44'
|
|
70
|
+
: 'h-full',
|
|
71
|
+
{ 'opacity-0': index !== activePhoto },
|
|
72
|
+
]"
|
|
73
|
+
@load="measurePhoto"
|
|
74
|
+
/>
|
|
75
|
+
</template>
|
|
76
|
+
</component>
|
|
77
|
+
<span
|
|
78
|
+
v-if="photos.length > 1"
|
|
79
|
+
data-product-photo-bars
|
|
80
|
+
aria-hidden="true"
|
|
81
|
+
class="pointer-events-none absolute flex gap-1"
|
|
82
|
+
>
|
|
83
|
+
<span
|
|
84
|
+
v-for="(photo, index) in photos"
|
|
85
|
+
:key="`${index}:${photo}`"
|
|
86
|
+
class="
|
|
87
|
+
block h-0.5 flex-1 transition-colors
|
|
88
|
+
duration-150 motion-reduce:transition-none
|
|
89
|
+
"
|
|
90
|
+
:class="
|
|
91
|
+
index === activePhoto
|
|
92
|
+
? 'bg-orionplace-accent'
|
|
93
|
+
: 'bg-orionplace-text/20'
|
|
94
|
+
"
|
|
95
|
+
/>
|
|
96
|
+
</span>
|
|
97
|
+
<span
|
|
98
|
+
v-if="variantLoading"
|
|
99
|
+
data-product-variant-loading
|
|
100
|
+
aria-hidden="true"
|
|
101
|
+
class="
|
|
102
|
+
pointer-events-none absolute inset-0
|
|
103
|
+
flex items-center justify-center
|
|
104
|
+
bg-orionplace-surface/50
|
|
105
|
+
"
|
|
106
|
+
>
|
|
107
|
+
<span
|
|
108
|
+
class="
|
|
109
|
+
h-6 w-6 rounded-full
|
|
110
|
+
border-2 border-solid border-orionplace-text border-t-transparent
|
|
111
|
+
animate-spin motion-reduce:animate-none
|
|
112
|
+
"
|
|
113
|
+
/>
|
|
114
|
+
</span>
|
|
115
|
+
<ProductCardBadges
|
|
116
|
+
data-product-part="ProductCardBadges"
|
|
117
|
+
v-if="!isCompact"
|
|
118
|
+
:product-id="displayedProductId"
|
|
119
|
+
:collection="collection"
|
|
120
|
+
low-stock-label=""
|
|
121
|
+
class="pointer-events-none absolute"
|
|
122
|
+
/>
|
|
123
|
+
<ProductCardActions
|
|
124
|
+
data-product-part="ProductCardActions"
|
|
125
|
+
v-if="purchaseActions"
|
|
126
|
+
:product-id="displayedProductId"
|
|
127
|
+
:collection="collection"
|
|
128
|
+
:disabled="purchaseDisabled"
|
|
129
|
+
class="absolute max-w-full"
|
|
130
|
+
icon-only
|
|
131
|
+
@request-variants="variantControls?.openForPurchase()"
|
|
132
|
+
@add="emit('add', $event)"
|
|
133
|
+
@remove="emit('remove', $event)"
|
|
134
|
+
@subscribe="emit('subscribe', $event)"
|
|
135
|
+
@unsubscribe="emit('unsubscribe', $event)"
|
|
136
|
+
@preorder="emit('preorder', $event)"
|
|
137
|
+
/>
|
|
138
|
+
<ProductCardFavorite
|
|
139
|
+
data-product-part="ProductCardFavorite"
|
|
140
|
+
v-if="purchaseActions"
|
|
141
|
+
:product-id="displayedProductId"
|
|
142
|
+
:collection="collection"
|
|
143
|
+
:disabled="purchaseDisabled"
|
|
144
|
+
class="absolute"
|
|
145
|
+
@toggle="
|
|
146
|
+
emit('toggleFavorite', {
|
|
147
|
+
product: displayedProductId,
|
|
148
|
+
selected: $event,
|
|
149
|
+
})
|
|
150
|
+
"
|
|
151
|
+
/>
|
|
152
|
+
</div>
|
|
153
|
+
<div
|
|
154
|
+
data-product-heading
|
|
155
|
+
class="grid min-w-0 content-start gap-1 empty:hidden"
|
|
156
|
+
:class="{ 'col-span-full @min-[22rem]:col-start-2': isCompact }"
|
|
157
|
+
>
|
|
158
|
+
<ProductCardSeller
|
|
159
|
+
v-if="!details"
|
|
160
|
+
data-product-part="ProductCardSeller"
|
|
161
|
+
:product-id="displayedProductId"
|
|
162
|
+
:collection="collection"
|
|
163
|
+
:disabled="disabled"
|
|
164
|
+
@select="emit('selectSeller', $event)"
|
|
165
|
+
/>
|
|
166
|
+
<component
|
|
167
|
+
:is="productHref ? 'a' : 'button'"
|
|
168
|
+
v-if="!details"
|
|
169
|
+
:href="productHref"
|
|
170
|
+
:type="productHref ? undefined : 'button'"
|
|
171
|
+
:disabled="productHref ? undefined : disabled"
|
|
172
|
+
:aria-disabled="productHref && disabled ? 'true' : undefined"
|
|
173
|
+
class="
|
|
174
|
+
block w-full
|
|
175
|
+
cursor-pointer border-0 bg-transparent p-0
|
|
176
|
+
text-left text-orionplace-text no-underline
|
|
177
|
+
outline-none transition-opacity motion-reduce:transition-none
|
|
178
|
+
hover:opacity-70 focus-visible:bg-orionplace-hover
|
|
179
|
+
"
|
|
180
|
+
@click="selectProduct"
|
|
181
|
+
>
|
|
182
|
+
<ProductCardTitle
|
|
183
|
+
data-product-part="ProductCardTitle"
|
|
184
|
+
:product-id="displayedProductId"
|
|
185
|
+
:collection="collection"
|
|
186
|
+
/>
|
|
187
|
+
</component>
|
|
188
|
+
<p
|
|
189
|
+
v-if="variantFailed"
|
|
190
|
+
role="alert"
|
|
191
|
+
data-product-variant-error
|
|
192
|
+
class="m-0 text-xs leading-5 text-orionplace-danger"
|
|
193
|
+
>
|
|
194
|
+
{{ copy.variantFailed }}
|
|
195
|
+
</p>
|
|
196
|
+
<p
|
|
197
|
+
v-else-if="variantLoading"
|
|
198
|
+
role="status"
|
|
199
|
+
data-product-variant-status
|
|
200
|
+
class="sr-only"
|
|
201
|
+
>
|
|
202
|
+
{{ copy.variantLoading }}
|
|
203
|
+
</p>
|
|
204
|
+
</div>
|
|
205
|
+
<ProductCardBadges
|
|
206
|
+
data-product-part="ProductCardBadges"
|
|
207
|
+
v-if="details"
|
|
208
|
+
:product-id="displayedProductId"
|
|
209
|
+
:collection="collection"
|
|
210
|
+
low-stock-label=""
|
|
211
|
+
/>
|
|
212
|
+
<ProductCardPrice
|
|
213
|
+
data-product-part="ProductCardPrice"
|
|
214
|
+
:class="{
|
|
215
|
+
'col-span-full @min-[22rem]:col-start-2 @min-[22rem]:row-start-2':
|
|
216
|
+
isCompact,
|
|
217
|
+
}"
|
|
218
|
+
:product-id="displayedProductId"
|
|
219
|
+
:collection="collection"
|
|
220
|
+
/>
|
|
221
|
+
<div
|
|
222
|
+
v-if="details && $slots.afterPrice"
|
|
223
|
+
data-product-after-price
|
|
224
|
+
class="min-w-0"
|
|
225
|
+
>
|
|
226
|
+
<slot
|
|
227
|
+
name="afterPrice"
|
|
228
|
+
:product="product"
|
|
229
|
+
/>
|
|
230
|
+
</div>
|
|
231
|
+
<p
|
|
232
|
+
v-if="details && variantCaption"
|
|
233
|
+
class="m-0 -mb-2 text-xs text-orionplace-muted first-letter:uppercase"
|
|
234
|
+
data-product-variant-caption
|
|
235
|
+
>
|
|
236
|
+
{{ variantCaption.name }}:
|
|
237
|
+
<span class="text-orionplace-text">{{ variantCaption.value }}</span>
|
|
238
|
+
</p>
|
|
239
|
+
<ProductCardVariants
|
|
240
|
+
data-product-part="ProductCardVariants"
|
|
241
|
+
ref="variantControls"
|
|
242
|
+
:actions-disabled="purchaseDisabled"
|
|
243
|
+
@add="emit('add', $event)"
|
|
244
|
+
@remove="emit('remove', $event)"
|
|
245
|
+
@subscribe="emit('subscribe', $event)"
|
|
246
|
+
@unsubscribe="emit('unsubscribe', $event)"
|
|
247
|
+
@preorder="emit('preorder', $event)"
|
|
248
|
+
:class="{
|
|
249
|
+
'col-span-full @min-[22rem]:col-start-2 @min-[22rem]:row-start-3':
|
|
250
|
+
isCompact,
|
|
251
|
+
}"
|
|
252
|
+
:product-id="displayedProductId"
|
|
253
|
+
:collection="collection"
|
|
254
|
+
:variant-product-ids="variantProductIds"
|
|
255
|
+
:disabled="disabled"
|
|
256
|
+
@select="selectVariant"
|
|
257
|
+
@select-secondary="selectSecondaryVariant"
|
|
258
|
+
@request-secondary="emit('requestSecondaryVariants', $event)"
|
|
259
|
+
/>
|
|
260
|
+
<ProductCardRating
|
|
261
|
+
data-product-part="ProductCardRating"
|
|
262
|
+
v-if="!isCompact && !details"
|
|
263
|
+
:product-id="displayedProductId"
|
|
264
|
+
:collection="collection"
|
|
265
|
+
/>
|
|
266
|
+
<ProductCardStockNotice
|
|
267
|
+
data-product-part="ProductCardStockNotice"
|
|
268
|
+
v-if="!isCompact"
|
|
269
|
+
:product-id="displayedProductId"
|
|
270
|
+
:collection="collection"
|
|
271
|
+
/>
|
|
272
|
+
<ProductCardDescription
|
|
273
|
+
data-product-part="ProductCardDescription"
|
|
274
|
+
v-if="!isCompact && !details"
|
|
275
|
+
:product-id="displayedProductId"
|
|
276
|
+
:collection="collection"
|
|
277
|
+
class="line-clamp-2"
|
|
278
|
+
/>
|
|
279
|
+
<div
|
|
280
|
+
v-if="details && purchaseActions"
|
|
281
|
+
class="flex items-start gap-2 pt-2"
|
|
282
|
+
>
|
|
283
|
+
<ProductCardActions
|
|
284
|
+
data-product-part="ProductCardActions"
|
|
285
|
+
:product-id="displayedProductId"
|
|
286
|
+
:collection="collection"
|
|
287
|
+
:disabled="purchaseDisabled"
|
|
288
|
+
class="min-w-0 flex-1"
|
|
289
|
+
variant-selection-resolved
|
|
290
|
+
@request-variants="variantControls?.openForPurchase()"
|
|
291
|
+
@add="emit('add', $event)"
|
|
292
|
+
@remove="emit('remove', $event)"
|
|
293
|
+
@subscribe="emit('subscribe', $event)"
|
|
294
|
+
@unsubscribe="emit('unsubscribe', $event)"
|
|
295
|
+
@preorder="emit('preorder', $event)"
|
|
296
|
+
/>
|
|
297
|
+
<ProductCardFavorite
|
|
298
|
+
data-product-part="ProductCardFavorite"
|
|
299
|
+
:product-id="displayedProductId"
|
|
300
|
+
:collection="collection"
|
|
301
|
+
:disabled="purchaseDisabled"
|
|
302
|
+
@toggle="
|
|
303
|
+
emit('toggleFavorite', {
|
|
304
|
+
product: displayedProductId,
|
|
305
|
+
selected: $event,
|
|
306
|
+
})
|
|
307
|
+
"
|
|
308
|
+
/>
|
|
309
|
+
</div>
|
|
310
|
+
<div
|
|
311
|
+
v-if="$slots.footer"
|
|
312
|
+
data-product-footer
|
|
313
|
+
class="min-w-0"
|
|
314
|
+
>
|
|
315
|
+
<slot
|
|
316
|
+
name="footer"
|
|
317
|
+
:product="product"
|
|
318
|
+
/>
|
|
319
|
+
</div>
|
|
320
|
+
</article>
|
|
321
|
+
</template>
|
|
322
|
+
|
|
323
|
+
<script setup lang="ts">
|
|
324
|
+
import { useOrionplaceStableHeight } from '@/composables/useOrionplaceStableHeight';
|
|
325
|
+
import { useOrionplaceStore } from '@/stores/orionplace';
|
|
326
|
+
import { useOrionplaceProductsStore } from '@/stores/orionplaceProducts';
|
|
327
|
+
import { useOrionplaceSelectionsStore } from '@/stores/orionplaceSelections';
|
|
328
|
+
import { useOrionplaceProductLink } from '@/composables/useOrionplaceProductLink';
|
|
329
|
+
import { computed, nextTick, onMounted, onScopeDispose, ref, watch } from 'vue';
|
|
330
|
+
import OrionplaceImage from '@/components/orionplace/shared/OrionplaceImage.vue';
|
|
331
|
+
import {
|
|
332
|
+
getAvailableNestedValueFromObject,
|
|
333
|
+
getAvailableValueFromObject,
|
|
334
|
+
} from '@/utils/orionplace/presentation';
|
|
335
|
+
import { productLabels } from '@/utils/orionplace/productLabels';
|
|
336
|
+
import {
|
|
337
|
+
productPhotoAfterSwipe,
|
|
338
|
+
productPhotoAtPointer,
|
|
339
|
+
productPhotos,
|
|
340
|
+
} from '@/utils/orionplace/productPhotos';
|
|
341
|
+
import ProductCardSeller from '@/components/orionplace/products/ProductCardSeller.vue';
|
|
342
|
+
import ProductCardTitle from '@/components/orionplace/products/ProductCardTitle.vue';
|
|
343
|
+
import ProductCardBadges from '@/components/orionplace/products/ProductCardBadges.vue';
|
|
344
|
+
import ProductCardDescription from '@/components/orionplace/products/ProductCardDescription.vue';
|
|
345
|
+
import ProductCardPrice from '@/components/orionplace/products/ProductCardPrice.vue';
|
|
346
|
+
import ProductCardRating from '@/components/orionplace/products/ProductCardRating.vue';
|
|
347
|
+
import ProductCardVariants from '@/components/orionplace/products/ProductCardVariants.vue';
|
|
348
|
+
import ProductCardActions from '@/components/orionplace/products/ProductCardActions.vue';
|
|
349
|
+
import ProductCardFavorite from '@/components/orionplace/products/ProductCardFavorite.vue';
|
|
350
|
+
import ProductCardStockNotice from '@/components/orionplace/products/ProductCardStockNotice.vue';
|
|
351
|
+
import type { IProductSecondaryVariantRequest } from '@/interfaces/orionplace/products/IProductSecondaryVariantRequest';
|
|
352
|
+
import type {
|
|
353
|
+
IProduct,
|
|
354
|
+
IProductSeller,
|
|
355
|
+
IProductVariantValue,
|
|
356
|
+
IProductSecondaryVariant,
|
|
357
|
+
} from '@/interfaces/orionplace/products/IProduct';
|
|
358
|
+
|
|
359
|
+
const card = ref<HTMLElement>();
|
|
360
|
+
const { minHeight } = useOrionplaceStableHeight(card);
|
|
361
|
+
|
|
362
|
+
const props = withDefaults(
|
|
363
|
+
defineProps<{
|
|
364
|
+
productId: number;
|
|
365
|
+
collection?: 'products' | 'featured';
|
|
366
|
+
compact?: boolean;
|
|
367
|
+
details?: boolean;
|
|
368
|
+
disabled?: boolean;
|
|
369
|
+
actionsDisabled?: boolean;
|
|
370
|
+
purchaseActions?: boolean;
|
|
371
|
+
variantProductIds?: number[];
|
|
372
|
+
}>(),
|
|
373
|
+
{
|
|
374
|
+
collection: 'products',
|
|
375
|
+
compact: false,
|
|
376
|
+
details: false,
|
|
377
|
+
disabled: false,
|
|
378
|
+
actionsDisabled: false,
|
|
379
|
+
purchaseActions: true,
|
|
380
|
+
},
|
|
381
|
+
);
|
|
382
|
+
|
|
383
|
+
const store = useOrionplaceStore();
|
|
384
|
+
const productStore = useOrionplaceProductsStore();
|
|
385
|
+
const selectionStore = useOrionplaceSelectionsStore();
|
|
386
|
+
const isCompact = computed(() => props.compact && !props.details);
|
|
387
|
+
const layout = computed(() => {
|
|
388
|
+
if (props.details) {
|
|
389
|
+
return 'details';
|
|
390
|
+
}
|
|
391
|
+
return isCompact.value ? 'compact' : 'card';
|
|
392
|
+
});
|
|
393
|
+
const layoutClass = computed(() => {
|
|
394
|
+
if (props.details) {
|
|
395
|
+
return 'gap-5';
|
|
396
|
+
}
|
|
397
|
+
return isCompact.value
|
|
398
|
+
? '@container grid-cols-[minmax(0,11rem)_minmax(0,1fr)] gap-x-5 gap-y-3'
|
|
399
|
+
: 'w-full max-w-72 gap-0';
|
|
400
|
+
});
|
|
401
|
+
|
|
402
|
+
const variantControls = ref<InstanceType<typeof ProductCardVariants>>();
|
|
403
|
+
const displayedProductId = ref(props.productId);
|
|
404
|
+
const requestedProductId = ref(props.productId);
|
|
405
|
+
const product = computed(() =>
|
|
406
|
+
productStore.getProduct(displayedProductId.value, props.collection),
|
|
407
|
+
);
|
|
408
|
+
const copy = computed(() => productLabels(selectionStore.localeCode));
|
|
409
|
+
// With a product page address from the host, the image and name are
|
|
410
|
+
// links: the page HTML then links to the product for search engines.
|
|
411
|
+
const productLink = useOrionplaceProductLink();
|
|
412
|
+
const productHref = computed(() =>
|
|
413
|
+
productLink && product.value ? productLink(product.value.id) : undefined,
|
|
414
|
+
);
|
|
415
|
+
|
|
416
|
+
// The host marks a missing target while it loads; see useOrionplaceProductVariants.
|
|
417
|
+
const variantRequest = computed(() =>
|
|
418
|
+
requestedProductId.value === displayedProductId.value
|
|
419
|
+
? undefined
|
|
420
|
+
: productStore.getProductRequest(requestedProductId.value),
|
|
421
|
+
);
|
|
422
|
+
const variantLoading = computed(() => variantRequest.value === 'loading');
|
|
423
|
+
const variantFailed = ref(false);
|
|
424
|
+
// Actions wait for the chosen variant, so they never target the previous product.
|
|
425
|
+
const purchaseDisabled = computed(
|
|
426
|
+
() => props.disabled || props.actionsDisabled || variantLoading.value,
|
|
427
|
+
);
|
|
428
|
+
|
|
429
|
+
// The product page names the chosen main variant above its choices.
|
|
430
|
+
const variantCaption = computed(() => {
|
|
431
|
+
const group = product.value?.variants.main_variant;
|
|
432
|
+
const selected = group?.value.find(
|
|
433
|
+
(value) => value.reload_product === displayedProductId.value,
|
|
434
|
+
);
|
|
435
|
+
|
|
436
|
+
if (!group || !selected) {
|
|
437
|
+
return undefined;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
return {
|
|
441
|
+
name: getAvailableValueFromObject(group.locale, selectionStore.localeCode) ?? '',
|
|
442
|
+
value: getAvailableValueFromObject(selected.locale, selectionStore.localeCode) ?? '',
|
|
443
|
+
};
|
|
444
|
+
});
|
|
445
|
+
|
|
446
|
+
const name = computed(
|
|
447
|
+
() =>
|
|
448
|
+
getAvailableNestedValueFromObject(
|
|
449
|
+
product.value?.locale,
|
|
450
|
+
selectionStore.localeCode,
|
|
451
|
+
'product_name',
|
|
452
|
+
) || '',
|
|
453
|
+
);
|
|
454
|
+
|
|
455
|
+
// A product with several photos switches them in the card: the mouse picks
|
|
456
|
+
// the photo of its zone (one equal zone per photo, left to right), a
|
|
457
|
+
// sideways swipe steps to the next or previous one, and the bars at the
|
|
458
|
+
// bottom show which photo is shown. Leaving the picture shows the first
|
|
459
|
+
// photo again. The other photos load once the visitor points at or
|
|
460
|
+
// touches the picture. A click on any photo selects the product.
|
|
461
|
+
const photos = computed(() =>
|
|
462
|
+
productPhotos(product.value?.images, isCompact.value),
|
|
463
|
+
);
|
|
464
|
+
// Without photos the image shows its placeholder.
|
|
465
|
+
const photoSources = computed(() =>
|
|
466
|
+
photos.value.length ? photos.value : [undefined],
|
|
467
|
+
);
|
|
468
|
+
const activePhoto = ref(0);
|
|
469
|
+
const photosPrimed = ref(false);
|
|
470
|
+
let photoSwipeStart: { x: number; y: number } | undefined;
|
|
471
|
+
let photoSwipedAt = 0;
|
|
472
|
+
|
|
473
|
+
watch(
|
|
474
|
+
() => photos.value.join('\n'),
|
|
475
|
+
() => {
|
|
476
|
+
activePhoto.value = 0;
|
|
477
|
+
photosPrimed.value = false;
|
|
478
|
+
},
|
|
479
|
+
);
|
|
480
|
+
watch(activePhoto, () => nextTick(measurePhoto));
|
|
481
|
+
|
|
482
|
+
function pointAtPhoto(event: PointerEvent) {
|
|
483
|
+
// A touch switches photos by swiping, not by where the finger rests.
|
|
484
|
+
if (event.pointerType === 'touch' || photos.value.length < 2) {
|
|
485
|
+
return;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
photosPrimed.value = true;
|
|
489
|
+
activePhoto.value = productPhotoAtPointer(
|
|
490
|
+
event.clientX,
|
|
491
|
+
(event.currentTarget as HTMLElement).getBoundingClientRect(),
|
|
492
|
+
photos.value.length,
|
|
493
|
+
);
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
function leavePhotos(event: PointerEvent) {
|
|
497
|
+
if (event.pointerType !== 'touch') {
|
|
498
|
+
activePhoto.value = 0;
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
// A sideways swipe switches photos only where the picture keeps sideways
|
|
503
|
+
// moves for itself (`touch-action: pan-y`). A horizontal row of cards,
|
|
504
|
+
// such as a product group on a phone, turns that off so the row scrolls.
|
|
505
|
+
function startPhotoSwipe(event: TouchEvent) {
|
|
506
|
+
const touch = event.touches[0];
|
|
507
|
+
const viewport = event.currentTarget as HTMLElement;
|
|
508
|
+
|
|
509
|
+
photosPrimed.value = true;
|
|
510
|
+
photoSwipeStart =
|
|
511
|
+
touch &&
|
|
512
|
+
event.touches.length === 1 &&
|
|
513
|
+
getComputedStyle(viewport).touchAction === 'pan-y'
|
|
514
|
+
? { x: touch.clientX, y: touch.clientY }
|
|
515
|
+
: undefined;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
function endPhotoSwipe(event: TouchEvent) {
|
|
519
|
+
const touch = event.changedTouches[0];
|
|
520
|
+
const start = photoSwipeStart;
|
|
521
|
+
|
|
522
|
+
photoSwipeStart = undefined;
|
|
523
|
+
if (!start || !touch) {
|
|
524
|
+
return;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
const next = productPhotoAfterSwipe(
|
|
528
|
+
activePhoto.value,
|
|
529
|
+
photos.value.length,
|
|
530
|
+
touch.clientX - start.x,
|
|
531
|
+
touch.clientY - start.y,
|
|
532
|
+
);
|
|
533
|
+
|
|
534
|
+
if (next !== activePhoto.value) {
|
|
535
|
+
activePhoto.value = next;
|
|
536
|
+
photoSwipedAt = Date.now();
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
// A photo keeps its own proportions inside the card's image area, so that
|
|
541
|
+
// area can show empty space beside or above the picture. These offsets are
|
|
542
|
+
// measured from the loaded image and keep the badges, the wishlist control
|
|
543
|
+
// and the purchase actions on the picture's own corners.
|
|
544
|
+
const imageArea = ref<HTMLElement>();
|
|
545
|
+
const photoInset = ref({ x: 0, y: 0 });
|
|
546
|
+
const photoInsetStyle = computed(() => ({
|
|
547
|
+
'--product-photo-inset-x': `${photoInset.value.x}px`,
|
|
548
|
+
'--product-photo-inset-y': `${photoInset.value.y}px`,
|
|
549
|
+
}));
|
|
550
|
+
|
|
551
|
+
let areaObserver: ResizeObserver | undefined;
|
|
552
|
+
|
|
553
|
+
function setPhotoInset(x: number, y: number) {
|
|
554
|
+
if (photoInset.value.x === x && photoInset.value.y === y) {
|
|
555
|
+
return;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
photoInset.value = { x, y };
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
function clearPhotoInset() {
|
|
562
|
+
setPhotoInset(0, 0);
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
function measurePhoto() {
|
|
566
|
+
// A renderer without a browser layout, such as a test host, has
|
|
567
|
+
// nothing to measure.
|
|
568
|
+
const image =
|
|
569
|
+
imageArea.value?.querySelector?.<HTMLImageElement>('img[aria-hidden="false"]') ??
|
|
570
|
+
imageArea.value?.querySelector?.('img');
|
|
571
|
+
|
|
572
|
+
if (!image?.naturalWidth || !image.naturalHeight) {
|
|
573
|
+
clearPhotoInset();
|
|
574
|
+
return;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
const area = image.getBoundingClientRect();
|
|
578
|
+
const scale = Math.min(
|
|
579
|
+
area.width / image.naturalWidth,
|
|
580
|
+
area.height / image.naturalHeight,
|
|
581
|
+
);
|
|
582
|
+
|
|
583
|
+
setPhotoInset(
|
|
584
|
+
Math.max(0, (area.width - image.naturalWidth * scale) / 2),
|
|
585
|
+
Math.max(0, (area.height - image.naturalHeight * scale) / 2),
|
|
586
|
+
);
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
onMounted(() => {
|
|
590
|
+
// A cached picture is already decoded before the load listener attaches.
|
|
591
|
+
measurePhoto();
|
|
592
|
+
// A failed picture is replaced by the placeholder, which fills the whole
|
|
593
|
+
// area. OrionplaceImage handles that failure itself, so the card listens
|
|
594
|
+
// for the event on its way down to the image instead of on the image.
|
|
595
|
+
imageArea.value?.addEventListener?.('error', clearPhotoInset, true);
|
|
596
|
+
|
|
597
|
+
if (typeof ResizeObserver === 'undefined') {
|
|
598
|
+
return;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
areaObserver = new ResizeObserver(() => measurePhoto());
|
|
602
|
+
|
|
603
|
+
if (imageArea.value) {
|
|
604
|
+
areaObserver.observe(imageArea.value);
|
|
605
|
+
}
|
|
606
|
+
});
|
|
607
|
+
|
|
608
|
+
watch(imageArea, (node, previous) => {
|
|
609
|
+
if (previous) {
|
|
610
|
+
areaObserver?.unobserve(previous);
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
if (node) {
|
|
614
|
+
areaObserver?.observe(node);
|
|
615
|
+
measurePhoto();
|
|
616
|
+
}
|
|
617
|
+
});
|
|
618
|
+
|
|
619
|
+
onScopeDispose(() => {
|
|
620
|
+
imageArea.value?.removeEventListener?.('error', clearPhotoInset, true);
|
|
621
|
+
areaObserver?.disconnect();
|
|
622
|
+
});
|
|
623
|
+
|
|
624
|
+
defineSlots<{
|
|
625
|
+
footer?(props: { product: IProduct }): unknown;
|
|
626
|
+
afterPrice?(props: { product: IProduct }): unknown;
|
|
627
|
+
}>();
|
|
628
|
+
|
|
629
|
+
const emit = defineEmits<{
|
|
630
|
+
select: [product: IProduct];
|
|
631
|
+
selectSeller: [seller: IProductSeller];
|
|
632
|
+
toggleFavorite: [selection: { product: number; selected: boolean }];
|
|
633
|
+
requestSecondaryVariants: [selection: IProductSecondaryVariantRequest];
|
|
634
|
+
selectVariant: [
|
|
635
|
+
selection: { product: number; variant: IProductVariantValue },
|
|
636
|
+
];
|
|
637
|
+
selectSecondaryVariant: [
|
|
638
|
+
selection: { product: number; variant: IProductSecondaryVariant },
|
|
639
|
+
];
|
|
640
|
+
add: [selection: { product: number; quantity: number }];
|
|
641
|
+
remove: [selection: { product: number; cartItem: number }];
|
|
642
|
+
subscribe: [selection: { product: number }];
|
|
643
|
+
unsubscribe: [selection: { product: number }];
|
|
644
|
+
preorder: [selection: { product: number }];
|
|
645
|
+
}>();
|
|
646
|
+
|
|
647
|
+
watch(
|
|
648
|
+
[
|
|
649
|
+
() => props.productId,
|
|
650
|
+
() => props.collection,
|
|
651
|
+
() => store.init,
|
|
652
|
+
() => productStore.productUpdates,
|
|
653
|
+
],
|
|
654
|
+
() => {
|
|
655
|
+
displayedProductId.value = props.productId;
|
|
656
|
+
requestedProductId.value = props.productId;
|
|
657
|
+
variantFailed.value = false;
|
|
658
|
+
},
|
|
659
|
+
{ flush: 'sync' },
|
|
660
|
+
);
|
|
661
|
+
|
|
662
|
+
// A failed target leaves the current product and its selected choice in place.
|
|
663
|
+
watch(
|
|
664
|
+
variantRequest,
|
|
665
|
+
(state) => {
|
|
666
|
+
if (state === 'failed') {
|
|
667
|
+
requestedProductId.value = displayedProductId.value;
|
|
668
|
+
variantFailed.value = true;
|
|
669
|
+
}
|
|
670
|
+
},
|
|
671
|
+
{ flush: 'sync' },
|
|
672
|
+
);
|
|
673
|
+
|
|
674
|
+
watch(
|
|
675
|
+
() => productStore.getProduct(requestedProductId.value, props.collection),
|
|
676
|
+
(target) => {
|
|
677
|
+
if (target) {
|
|
678
|
+
displayedProductId.value = target.id;
|
|
679
|
+
}
|
|
680
|
+
},
|
|
681
|
+
{ flush: 'sync' },
|
|
682
|
+
);
|
|
683
|
+
|
|
684
|
+
// A plain click emits select and the host navigates; a click with a
|
|
685
|
+
// modifier key keeps the browser's own link behavior, such as a new tab.
|
|
686
|
+
function selectProduct(event: MouseEvent) {
|
|
687
|
+
// The click a browser may send after a photo swipe does not open the product.
|
|
688
|
+
if (Date.now() - photoSwipedAt < 500) {
|
|
689
|
+
event.preventDefault();
|
|
690
|
+
return;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
const browserHandles =
|
|
694
|
+
Boolean(productHref.value) &&
|
|
695
|
+
!props.disabled &&
|
|
696
|
+
(event.button > 0 ||
|
|
697
|
+
event.metaKey ||
|
|
698
|
+
event.ctrlKey ||
|
|
699
|
+
event.shiftKey ||
|
|
700
|
+
event.altKey);
|
|
701
|
+
|
|
702
|
+
if (browserHandles) {
|
|
703
|
+
return;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
event.preventDefault();
|
|
707
|
+
|
|
708
|
+
if (!props.disabled && product.value) {
|
|
709
|
+
emit('select', product.value);
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
function showVariant(id: number) {
|
|
714
|
+
const otherCollection =
|
|
715
|
+
props.collection === 'products' ? 'featured' : 'products';
|
|
716
|
+
const target =
|
|
717
|
+
productStore.getProduct(id, props.collection) ??
|
|
718
|
+
productStore.getProduct(id, otherCollection);
|
|
719
|
+
requestedProductId.value = id;
|
|
720
|
+
variantFailed.value = false;
|
|
721
|
+
|
|
722
|
+
if (target) {
|
|
723
|
+
productStore.setProduct(target, props.collection);
|
|
724
|
+
displayedProductId.value = target.id;
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
function selectVariant(variant: IProductVariantValue) {
|
|
729
|
+
if (!product.value || props.disabled || !variant.reload_product) {
|
|
730
|
+
return;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
if (variant.reload_product === product.value.id) {
|
|
734
|
+
requestedProductId.value = product.value.id;
|
|
735
|
+
return;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
const selection = { product: product.value.id, variant };
|
|
739
|
+
// Selecting a failed choice again is a retry.
|
|
740
|
+
if (productStore.getProductRequest(variant.reload_product) === 'failed') {
|
|
741
|
+
productStore.setProductRequest(variant.reload_product);
|
|
742
|
+
}
|
|
743
|
+
showVariant(variant.reload_product);
|
|
744
|
+
emit('selectVariant', selection);
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
function selectSecondaryVariant(variant: IProductSecondaryVariant) {
|
|
748
|
+
if (
|
|
749
|
+
!product.value ||
|
|
750
|
+
props.disabled ||
|
|
751
|
+
variant.product.id === product.value.id
|
|
752
|
+
) {
|
|
753
|
+
return;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
const selection = { product: product.value.id, variant };
|
|
757
|
+
const target =
|
|
758
|
+
productStore.productUpdates[props.collection][variant.product.id] ??
|
|
759
|
+
variant.product;
|
|
760
|
+
// The secondary response supplies this group separately from its products.
|
|
761
|
+
productStore.setProduct(
|
|
762
|
+
{
|
|
763
|
+
...target,
|
|
764
|
+
secondary_variants:
|
|
765
|
+
target.secondary_variants ?? product.value.secondary_variants,
|
|
766
|
+
},
|
|
767
|
+
props.collection,
|
|
768
|
+
);
|
|
769
|
+
showVariant(variant.product.id);
|
|
770
|
+
emit('selectSecondaryVariant', selection);
|
|
771
|
+
}
|
|
772
|
+
</script>
|
|
773
|
+
|
|
774
|
+
<style scoped>
|
|
775
|
+
/*
|
|
776
|
+
* Labels and controls drawn over the picture follow its own edges. The card
|
|
777
|
+
* measures how much empty space the picture leaves inside the image area and
|
|
778
|
+
* publishes it as these offsets, so the purchase actions stay in the
|
|
779
|
+
* picture's bottom right corner whatever proportions the photo has.
|
|
780
|
+
*/
|
|
781
|
+
[data-product-image] > [data-product-part='ProductCardActions'] {
|
|
782
|
+
right: calc(var(--product-photo-inset-x, 0px) + 0.5rem);
|
|
783
|
+
bottom: calc(var(--product-photo-inset-y, 0px) + 0.5rem);
|
|
784
|
+
}
|
|
785
|
+
[data-product-image] > [data-product-part='ProductCardFavorite'] {
|
|
786
|
+
right: calc(var(--product-photo-inset-x, 0px) + 0.25rem);
|
|
787
|
+
top: calc(var(--product-photo-inset-y, 0px) + 0.25rem);
|
|
788
|
+
}
|
|
789
|
+
[data-product-image] > [data-product-part='ProductCardBadges'] {
|
|
790
|
+
left: calc(var(--product-photo-inset-x, 0px) + 0.5rem);
|
|
791
|
+
top: calc(var(--product-photo-inset-y, 0px) + 0.5rem);
|
|
792
|
+
max-width: calc(100% - 3.5rem - 2 * var(--product-photo-inset-x, 0px));
|
|
793
|
+
}
|
|
794
|
+
/* One segment per photo zone along the picture's bottom edge, below the buttons. */
|
|
795
|
+
[data-product-image] > [data-product-photo-bars] {
|
|
796
|
+
right: calc(var(--product-photo-inset-x, 0px) + 0.5rem);
|
|
797
|
+
bottom: calc(var(--product-photo-inset-y, 0px) + 0.125rem);
|
|
798
|
+
left: calc(var(--product-photo-inset-x, 0px) + 0.5rem);
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
/* Sideways moves on a picture with several photos switch the photo. */
|
|
802
|
+
[data-product-photo-swipe] {
|
|
803
|
+
touch-action: pan-y;
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
/*
|
|
807
|
+
* Explicit rows keep every card part on the same line when a product group
|
|
808
|
+
* aligns neighbouring cards through a subgrid and some parts are absent.
|
|
809
|
+
*/
|
|
810
|
+
[data-product-layout='card'] > [data-product-image] {
|
|
811
|
+
grid-row: 1;
|
|
812
|
+
}
|
|
813
|
+
[data-product-layout='card'] > [data-product-heading] {
|
|
814
|
+
grid-row: 2;
|
|
815
|
+
margin-top: 0.75rem;
|
|
816
|
+
}
|
|
817
|
+
[data-product-layout='card'] > [data-product-part='ProductCardVariants'] {
|
|
818
|
+
grid-row: 3;
|
|
819
|
+
margin-top: 0.625rem;
|
|
820
|
+
}
|
|
821
|
+
[data-product-layout='card'] > [data-product-part='ProductCardPrice'] {
|
|
822
|
+
grid-row: 4;
|
|
823
|
+
margin-top: 0.5rem;
|
|
824
|
+
}
|
|
825
|
+
[data-product-layout='card'] > [data-product-part='ProductCardRating'] {
|
|
826
|
+
grid-row: 5;
|
|
827
|
+
margin-top: 0.5rem;
|
|
828
|
+
}
|
|
829
|
+
[data-product-layout='card'] > [data-product-part='ProductCardStockNotice'] {
|
|
830
|
+
grid-row: 6;
|
|
831
|
+
margin-top: 0.25rem;
|
|
832
|
+
}
|
|
833
|
+
[data-product-layout='card'] > [data-product-part='ProductCardDescription'] {
|
|
834
|
+
grid-row: 7;
|
|
835
|
+
margin-top: 0.5rem;
|
|
836
|
+
}
|
|
837
|
+
[data-product-layout='card'] > [data-product-footer] {
|
|
838
|
+
grid-row: 8;
|
|
839
|
+
margin-top: 0.75rem;
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
/*
|
|
843
|
+
* A compact card puts the photo beside the text from 22rem of its own
|
|
844
|
+
* width (a measuring box for its parts, which take both columns below
|
|
845
|
+
* that); an added footer stays under the choices, beside the image.
|
|
846
|
+
*/
|
|
847
|
+
[data-product-layout='compact'] > [data-product-footer] {
|
|
848
|
+
grid-column: 1 / -1;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
@container (width >= 22rem) {
|
|
852
|
+
[data-product-layout='compact'] > [data-product-footer] {
|
|
853
|
+
grid-column: 2;
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
[data-product-layout='details'] :deep([data-product-favorite]) {
|
|
858
|
+
width: 2.75rem;
|
|
859
|
+
height: 2.75rem;
|
|
860
|
+
border-radius: 0;
|
|
861
|
+
border-color: var(--orionplace-text);
|
|
862
|
+
background: transparent;
|
|
863
|
+
backdrop-filter: none;
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
/* Grid cards keep every variant choice reachable on one scrollable row. */
|
|
867
|
+
[data-product-layout='card']
|
|
868
|
+
:deep([data-product-variants] [role='group'] > div) {
|
|
869
|
+
flex-wrap: nowrap;
|
|
870
|
+
overflow-x: auto;
|
|
871
|
+
/* Room for the swatches' 24px touch targets, without moving the row. */
|
|
872
|
+
margin: -2px -3px;
|
|
873
|
+
padding: 3px;
|
|
874
|
+
scrollbar-width: thin;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
/* The product page shows the same variant choices at a slightly larger size. */
|
|
878
|
+
[data-product-layout='details'] :deep([data-product-variant].rounded-full),
|
|
879
|
+
[data-product-layout='details'] :deep([data-secondary-variant].rounded-full) {
|
|
880
|
+
width: 1.5rem;
|
|
881
|
+
height: 1.5rem;
|
|
882
|
+
}
|
|
883
|
+
[data-product-layout='details']
|
|
884
|
+
:deep([data-product-variant]:not(.rounded-full)),
|
|
885
|
+
[data-product-layout='details']
|
|
886
|
+
:deep([data-secondary-variant]:not(.rounded-full)) {
|
|
887
|
+
height: 2rem;
|
|
888
|
+
padding-inline: 0.75rem;
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
[data-product-layout='details']
|
|
892
|
+
> [data-product-part='ProductCardPrice']
|
|
893
|
+
:deep(span) {
|
|
894
|
+
font-size: 1.5rem;
|
|
895
|
+
line-height: 2rem;
|
|
896
|
+
}
|
|
897
|
+
</style>
|