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,1025 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, nextTick, ref, watch } from 'vue';
|
|
3
|
+
import { NuxtLink } from '#components';
|
|
4
|
+
import { useOrionplaceStore } from '@/stores/orionplace';
|
|
5
|
+
import { useOrionplaceSelectionsStore } from '@/stores/orionplaceSelections';
|
|
6
|
+
import { useOrionplaceReviews } from '@/composables/useOrionplaceReviews';
|
|
7
|
+
import { useOrionplaceFeatureApi } from '@/composables/useOrionplaceFeature';
|
|
8
|
+
import { useOrionplaceSignIn } from '@/composables/useOrionplaceSignIn';
|
|
9
|
+
import { reviewLabels } from '@/utils/orionplace/reviewLabels';
|
|
10
|
+
import { featureLabels } from '@/utils/orionplace/featureLabels';
|
|
11
|
+
import { productLabels } from '@/utils/orionplace/productLabels';
|
|
12
|
+
import { getAvailableNestedValueFromObject } from '@/utils/orionplace/presentation';
|
|
13
|
+
import {
|
|
14
|
+
reviewDirectReplies,
|
|
15
|
+
reviewScopeFilters,
|
|
16
|
+
} from '@/utils/orionplace/reviewScope';
|
|
17
|
+
import { orderItemVariant } from '@/utils/orionplace/orderPresentation';
|
|
18
|
+
import { EProductFeedbackStatus } from '@/interfaces/orionplace/products/IProductFeedbackApi';
|
|
19
|
+
import type {
|
|
20
|
+
IProductReview,
|
|
21
|
+
IProductFeedbackListResponse,
|
|
22
|
+
} from '@/interfaces/orionplace/products/IProductFeedbackApi';
|
|
23
|
+
import type { IProductFeedbackImage } from '@/interfaces/orionplace/products/IProduct';
|
|
24
|
+
import ProductReviewForm from '@/components/orionplace/products/ProductReviewForm.vue';
|
|
25
|
+
import ProductReviewGallery from '@/components/orionplace/products/ProductReviewGallery.vue';
|
|
26
|
+
import ProductReviewImageViewer from '@/components/orionplace/products/ProductReviewImageViewer.vue';
|
|
27
|
+
import OrionplaceAvatar from '@/components/orionplace/shared/OrionplaceAvatar.vue';
|
|
28
|
+
import OrionplaceImage from '@/components/orionplace/shared/OrionplaceImage.vue';
|
|
29
|
+
import OrionplaceSelect from '@/components/orionplace/shared/OrionplaceSelect.vue';
|
|
30
|
+
import StorefrontPagination from '@/components/orionplace/shared/StorefrontPagination.vue';
|
|
31
|
+
import '@/components/orionplace/shared/features.css';
|
|
32
|
+
import OrionplaceEmptyState from '@/components/orionplace/shared/OrionplaceEmptyState.vue';
|
|
33
|
+
|
|
34
|
+
const props = defineProps<{
|
|
35
|
+
productId?: number;
|
|
36
|
+
sellerId?: number;
|
|
37
|
+
own?: boolean;
|
|
38
|
+
}>();
|
|
39
|
+
const store = useOrionplaceStore();
|
|
40
|
+
const selectionStore = useOrionplaceSelectionsStore();
|
|
41
|
+
const reviews = useOrionplaceReviews(
|
|
42
|
+
props.productId,
|
|
43
|
+
props.own,
|
|
44
|
+
props.sellerId,
|
|
45
|
+
);
|
|
46
|
+
const api = useOrionplaceFeatureApi();
|
|
47
|
+
const labels = computed(() => reviewLabels(selectionStore.localeCode));
|
|
48
|
+
const common = computed(() => featureLabels(selectionStore.localeCode));
|
|
49
|
+
const cardLabels = computed(() => productLabels(selectionStore.localeCode));
|
|
50
|
+
const gallery = ref(false);
|
|
51
|
+
// A guest goes to /profile, which returns to this product page afterwards.
|
|
52
|
+
const signIn = useOrionplaceSignIn();
|
|
53
|
+
const busy = computed(() => Boolean(reviews.state.pending));
|
|
54
|
+
const parent = computed(() => reviews.parents.value.at(-1));
|
|
55
|
+
const ratings = [5, 4, 3, 2, 1];
|
|
56
|
+
const orderOptions = computed(() => ({
|
|
57
|
+
'-date_created': labels.value.newest,
|
|
58
|
+
'-rating': labels.value.highest,
|
|
59
|
+
'rating': labels.value.lowest,
|
|
60
|
+
}));
|
|
61
|
+
const formKey = computed(
|
|
62
|
+
() =>
|
|
63
|
+
`${reviews.sent.value}:${reviews.editing.value?.id ?? ''}:${reviews.replying.value?.id ?? ''}`,
|
|
64
|
+
);
|
|
65
|
+
const root = ref<HTMLElement>();
|
|
66
|
+
// The photos of one review, opened in the viewer without leaving the page.
|
|
67
|
+
const viewer = ref<{
|
|
68
|
+
images: IProductFeedbackImage[];
|
|
69
|
+
index: number;
|
|
70
|
+
}>();
|
|
71
|
+
// A reply and an edited review belong to one review of the current list, so
|
|
72
|
+
// the form is shown inside that review instead of above the list.
|
|
73
|
+
const formReviewId = computed(
|
|
74
|
+
() => reviews.editing.value?.id ?? reviews.replying.value?.id,
|
|
75
|
+
);
|
|
76
|
+
const formNested = computed(() =>
|
|
77
|
+
reviews.reviews.value.some((review) => review.id === formReviewId.value),
|
|
78
|
+
);
|
|
79
|
+
// Errors of the open form's own fields (stars, text) are shown under those
|
|
80
|
+
// fields; the list's error banner and its refresh button stay for the rest.
|
|
81
|
+
const formFieldsOnly = computed(() => {
|
|
82
|
+
const keys = Object.keys(reviews.state.fields);
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
reviews.writing.value &&
|
|
86
|
+
keys.length > 0 &&
|
|
87
|
+
keys.every((key) => key === 'rating' || key === 'text')
|
|
88
|
+
);
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
function openImage(review: IProductReview, index: number) {
|
|
92
|
+
viewer.value = { images: review.images, index };
|
|
93
|
+
}
|
|
94
|
+
// The form opens where the reader pressed its button, so the focus moves
|
|
95
|
+
// into it without moving the page.
|
|
96
|
+
watch([() => reviews.writing.value, formKey], async ([writing]) => {
|
|
97
|
+
if (!writing) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
await nextTick();
|
|
101
|
+
root.value
|
|
102
|
+
?.querySelector<HTMLTextAreaElement>(
|
|
103
|
+
'[data-feature-part="ProductReviewForm"] textarea',
|
|
104
|
+
)
|
|
105
|
+
?.focus({ preventScroll: true });
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
// stats counts the published reviews of the product (or of every product of
|
|
109
|
+
// the seller) per rating, independently of the rating, photo and sorting
|
|
110
|
+
// filters of the current list.
|
|
111
|
+
const statTotal = computed(() =>
|
|
112
|
+
ratings.reduce((sum, rating) => sum + ratingCount(rating), 0),
|
|
113
|
+
);
|
|
114
|
+
const average = computed(() => {
|
|
115
|
+
if (!statTotal.value) {
|
|
116
|
+
return 0;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const points = ratings.reduce(
|
|
120
|
+
(sum, rating) => sum + rating * ratingCount(rating),
|
|
121
|
+
0,
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
return Math.round((points / statTotal.value) * 10) / 10;
|
|
125
|
+
});
|
|
126
|
+
const scoped = computed(() => Boolean(props.productId || props.sellerId));
|
|
127
|
+
// A seller page shows which product each review belongs to.
|
|
128
|
+
const showsProduct = computed(() => !props.productId && Boolean(props.sellerId));
|
|
129
|
+
const hasSummary = computed(
|
|
130
|
+
() => scoped.value && !props.own && statTotal.value > 0,
|
|
131
|
+
);
|
|
132
|
+
const totalCaption = computed(() =>
|
|
133
|
+
pluralWord(statTotal.value, cardLabels.value.reviews),
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
function ratingCount(rating: number) {
|
|
137
|
+
return Number(reviews.stats.value[rating] ?? 0);
|
|
138
|
+
}
|
|
139
|
+
function ratingShare(rating: number) {
|
|
140
|
+
return statTotal.value
|
|
141
|
+
? `${(ratingCount(rating) / statTotal.value) * 100}%`
|
|
142
|
+
: '0%';
|
|
143
|
+
}
|
|
144
|
+
function pluralWord(count: number, forms: string[]) {
|
|
145
|
+
let rule: string;
|
|
146
|
+
|
|
147
|
+
try {
|
|
148
|
+
rule = new Intl.PluralRules(selectionStore.localeCode).select(count);
|
|
149
|
+
} catch {
|
|
150
|
+
// Backend locale codes are not always valid BCP 47 tags.
|
|
151
|
+
rule = new Intl.PluralRules('en').select(count);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (rule === 'one') {
|
|
155
|
+
return forms[0];
|
|
156
|
+
}
|
|
157
|
+
if (rule === 'few' && forms.length > 2) {
|
|
158
|
+
return forms[1];
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return forms[forms.length - 1];
|
|
162
|
+
}
|
|
163
|
+
// Selecting the active rating again shows every rating.
|
|
164
|
+
function filterRating(rating: number | '') {
|
|
165
|
+
const value = String(rating);
|
|
166
|
+
|
|
167
|
+
if (busy.value) {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
reviews.rating.value = reviews.rating.value === value ? '' : value;
|
|
172
|
+
void reviews.load();
|
|
173
|
+
}
|
|
174
|
+
// The accessible name keeps the visible one-word label and the count.
|
|
175
|
+
function actionLabel(
|
|
176
|
+
hint: 'helpfulHint' | 'unhelpfulHint' | 'repliesHint',
|
|
177
|
+
label: 'liked' | 'disliked' | 'replies',
|
|
178
|
+
count: number,
|
|
179
|
+
) {
|
|
180
|
+
return `${labels.value[hint]} (${labels.value[label]}): ${count}`;
|
|
181
|
+
}
|
|
182
|
+
function stars(rating: number) {
|
|
183
|
+
return Math.min(5, Math.max(0, Math.round(rating)));
|
|
184
|
+
}
|
|
185
|
+
function authenticated(action: () => unknown) {
|
|
186
|
+
if (!store.isAuthenticated) {
|
|
187
|
+
return signIn.requireSignIn();
|
|
188
|
+
}
|
|
189
|
+
return action();
|
|
190
|
+
}
|
|
191
|
+
function productName(product: NonNullable<IProductReview['product']>) {
|
|
192
|
+
return (
|
|
193
|
+
getAvailableNestedValueFromObject(
|
|
194
|
+
product.locale,
|
|
195
|
+
selectionStore.localeCode,
|
|
196
|
+
'product_name',
|
|
197
|
+
) || `${labels.value.product} ${product.id}`
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
function productImage(product: NonNullable<IProductReview['product']>) {
|
|
201
|
+
return product.images?.small[0] || product.images?.full[0] || '';
|
|
202
|
+
}
|
|
203
|
+
function productVariant(product: NonNullable<IProductReview['product']>) {
|
|
204
|
+
return orderItemVariant(product, selectionStore.localeCode);
|
|
205
|
+
}
|
|
206
|
+
function name(review: IProductReview) {
|
|
207
|
+
return [review.user.first_name, review.user.last_name]
|
|
208
|
+
.filter(Boolean)
|
|
209
|
+
.join(' ');
|
|
210
|
+
}
|
|
211
|
+
function openImageReview(feedbackId: number) {
|
|
212
|
+
return reviews.run('photo-review', async (signal) => {
|
|
213
|
+
const data = await api.request<
|
|
214
|
+
NonNullable<IProductFeedbackListResponse['page_data']>
|
|
215
|
+
>(
|
|
216
|
+
'products_view_feedbacks_feedback_get',
|
|
217
|
+
{
|
|
218
|
+
filters: {
|
|
219
|
+
id: feedbackId,
|
|
220
|
+
...reviewScopeFilters({
|
|
221
|
+
productId: props.productId,
|
|
222
|
+
sellerId: props.sellerId,
|
|
223
|
+
}),
|
|
224
|
+
},
|
|
225
|
+
paginate: { page: 1, pp_items: 1 },
|
|
226
|
+
},
|
|
227
|
+
signal,
|
|
228
|
+
);
|
|
229
|
+
reviews.reviews.value = data.feedbacks.data;
|
|
230
|
+
reviews.pagination.value = data.feedbacks.rpag;
|
|
231
|
+
reviews.mine.value = false;
|
|
232
|
+
reviews.parents.value = [];
|
|
233
|
+
gallery.value = false;
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
</script>
|
|
237
|
+
|
|
238
|
+
<template>
|
|
239
|
+
<section
|
|
240
|
+
ref="root"
|
|
241
|
+
class="op-feature @container/reviews w-full max-w-[1120px]"
|
|
242
|
+
data-feature-part="ProductReviews"
|
|
243
|
+
>
|
|
244
|
+
<!--
|
|
245
|
+
The heading grows from 592px, the width the full-width product and
|
|
246
|
+
seller pages give the reviews on a 640px screen.
|
|
247
|
+
-->
|
|
248
|
+
<header
|
|
249
|
+
class="
|
|
250
|
+
mb-8 flex flex-wrap items-center justify-between gap-4
|
|
251
|
+
"
|
|
252
|
+
>
|
|
253
|
+
<h2
|
|
254
|
+
class="
|
|
255
|
+
m-0
|
|
256
|
+
text-lg font-medium uppercase tracking-[0.04em]
|
|
257
|
+
text-orionplace-text
|
|
258
|
+
@min-[592px]/reviews:text-2xl
|
|
259
|
+
"
|
|
260
|
+
>
|
|
261
|
+
{{ own ? labels.mine : labels.title }}
|
|
262
|
+
</h2>
|
|
263
|
+
<button
|
|
264
|
+
v-if="productId && !reviews.writing.value"
|
|
265
|
+
type="button"
|
|
266
|
+
class="op-feature-button op-feature-primary"
|
|
267
|
+
:disabled="busy"
|
|
268
|
+
data-review-write
|
|
269
|
+
:aria-label="labels.writeHint"
|
|
270
|
+
@click="authenticated(() => reviews.compose())"
|
|
271
|
+
>
|
|
272
|
+
{{ labels.writeAction }}
|
|
273
|
+
</button>
|
|
274
|
+
</header>
|
|
275
|
+
|
|
276
|
+
<div
|
|
277
|
+
class="grid min-w-0 gap-10"
|
|
278
|
+
:class="{
|
|
279
|
+
'@min-[820px]/reviews:grid-cols-[260px_minmax(0,1fr)]': hasSummary,
|
|
280
|
+
'@min-[820px]/reviews:gap-16': hasSummary,
|
|
281
|
+
}"
|
|
282
|
+
>
|
|
283
|
+
<aside
|
|
284
|
+
v-if="hasSummary"
|
|
285
|
+
class="
|
|
286
|
+
grid w-full min-w-0 max-w-[420px] content-start gap-6 self-start
|
|
287
|
+
@min-[820px]/reviews:sticky @min-[820px]/reviews:top-6
|
|
288
|
+
"
|
|
289
|
+
data-review-summary
|
|
290
|
+
>
|
|
291
|
+
<div class="flex items-end gap-4">
|
|
292
|
+
<span
|
|
293
|
+
class="
|
|
294
|
+
text-5xl font-medium leading-none tabular-nums
|
|
295
|
+
text-orionplace-text
|
|
296
|
+
"
|
|
297
|
+
data-review-average
|
|
298
|
+
>
|
|
299
|
+
{{ average }}
|
|
300
|
+
</span>
|
|
301
|
+
<span class="grid gap-1 pb-0.5">
|
|
302
|
+
<span
|
|
303
|
+
class="text-base tracking-[0.06em]"
|
|
304
|
+
role="img"
|
|
305
|
+
:aria-label="`${labels.average}: ${average} ${labels.ofFive}`"
|
|
306
|
+
>
|
|
307
|
+
<span
|
|
308
|
+
v-for="star in 5"
|
|
309
|
+
:key="star"
|
|
310
|
+
aria-hidden="true"
|
|
311
|
+
:class="
|
|
312
|
+
star <= stars(average)
|
|
313
|
+
? 'text-orionplace-text'
|
|
314
|
+
: 'text-orionplace-border'
|
|
315
|
+
"
|
|
316
|
+
>
|
|
317
|
+
★
|
|
318
|
+
</span>
|
|
319
|
+
</span>
|
|
320
|
+
<span class="text-xs text-orionplace-muted tabular-nums">
|
|
321
|
+
{{ statTotal }} {{ totalCaption }}
|
|
322
|
+
</span>
|
|
323
|
+
</span>
|
|
324
|
+
</div>
|
|
325
|
+
<div
|
|
326
|
+
role="group"
|
|
327
|
+
class="grid gap-1"
|
|
328
|
+
:aria-label="labels.ratingFilter"
|
|
329
|
+
data-review-rating-filters
|
|
330
|
+
>
|
|
331
|
+
<button
|
|
332
|
+
v-for="rating in ratings"
|
|
333
|
+
:key="rating"
|
|
334
|
+
type="button"
|
|
335
|
+
class="
|
|
336
|
+
grid grid-cols-[2.25rem_minmax(0,1fr)_2.5rem] items-center gap-3
|
|
337
|
+
min-h-8 w-full px-2
|
|
338
|
+
cursor-pointer border border-solid bg-transparent
|
|
339
|
+
text-left text-xs text-orionplace-text tabular-nums
|
|
340
|
+
outline-none transition-colors motion-reduce:transition-none
|
|
341
|
+
enabled:hover:bg-orionplace-hover
|
|
342
|
+
focus-visible:bg-orionplace-hover
|
|
343
|
+
disabled:cursor-default disabled:opacity-50
|
|
344
|
+
"
|
|
345
|
+
:class="
|
|
346
|
+
reviews.rating.value === String(rating)
|
|
347
|
+
? 'border-orionplace-text'
|
|
348
|
+
: 'border-transparent'
|
|
349
|
+
"
|
|
350
|
+
:disabled="busy || !ratingCount(rating)"
|
|
351
|
+
:aria-pressed="reviews.rating.value === String(rating)"
|
|
352
|
+
:aria-label="`${rating} ${labels.stars}: ${ratingCount(rating)}`"
|
|
353
|
+
:data-review-rating-filter="rating"
|
|
354
|
+
@click="filterRating(rating)"
|
|
355
|
+
>
|
|
356
|
+
<span>{{ rating }} ★</span>
|
|
357
|
+
<span
|
|
358
|
+
class="relative h-1.5 overflow-hidden bg-orionplace-border"
|
|
359
|
+
aria-hidden="true"
|
|
360
|
+
>
|
|
361
|
+
<span
|
|
362
|
+
class="absolute inset-y-0 left-0 bg-orionplace-text"
|
|
363
|
+
:style="{ width: ratingShare(rating) }"
|
|
364
|
+
/>
|
|
365
|
+
</span>
|
|
366
|
+
<span class="text-right text-orionplace-muted">
|
|
367
|
+
{{ ratingCount(rating) }}
|
|
368
|
+
</span>
|
|
369
|
+
</button>
|
|
370
|
+
</div>
|
|
371
|
+
</aside>
|
|
372
|
+
|
|
373
|
+
<div class="grid min-w-0 content-start gap-6">
|
|
374
|
+
<div
|
|
375
|
+
class="
|
|
376
|
+
flex flex-wrap items-center justify-between gap-x-6 gap-y-3
|
|
377
|
+
pb-3
|
|
378
|
+
border-0 border-b border-solid border-orionplace-border
|
|
379
|
+
"
|
|
380
|
+
data-review-toolbar
|
|
381
|
+
>
|
|
382
|
+
<div class="flex min-w-0 flex-wrap items-center gap-x-5 gap-y-2">
|
|
383
|
+
<button
|
|
384
|
+
v-if="!own"
|
|
385
|
+
type="button"
|
|
386
|
+
class="review-tab"
|
|
387
|
+
:disabled="busy"
|
|
388
|
+
:aria-pressed="!reviews.mine.value"
|
|
389
|
+
@click="reviews.selectMine(false)"
|
|
390
|
+
>
|
|
391
|
+
{{ labels.all }}
|
|
392
|
+
</button>
|
|
393
|
+
<button
|
|
394
|
+
v-if="store.isAuthenticated && !own"
|
|
395
|
+
type="button"
|
|
396
|
+
class="review-tab"
|
|
397
|
+
:disabled="busy"
|
|
398
|
+
:aria-pressed="reviews.mine.value"
|
|
399
|
+
@click="reviews.selectMine(true)"
|
|
400
|
+
>
|
|
401
|
+
{{ labels.mineTab }}
|
|
402
|
+
</button>
|
|
403
|
+
<button
|
|
404
|
+
v-if="scoped"
|
|
405
|
+
type="button"
|
|
406
|
+
class="review-tab"
|
|
407
|
+
:disabled="busy"
|
|
408
|
+
:aria-expanded="gallery"
|
|
409
|
+
data-review-gallery
|
|
410
|
+
@click="gallery = !gallery"
|
|
411
|
+
>
|
|
412
|
+
{{ labels.photosTab }}
|
|
413
|
+
</button>
|
|
414
|
+
<label
|
|
415
|
+
class="
|
|
416
|
+
inline-flex items-center gap-2
|
|
417
|
+
cursor-pointer text-xs uppercase tracking-[0.08em]
|
|
418
|
+
text-orionplace-muted
|
|
419
|
+
"
|
|
420
|
+
>
|
|
421
|
+
<input
|
|
422
|
+
v-model="reviews.photosOnly.value"
|
|
423
|
+
class="m-0 h-4 w-4 cursor-pointer accent-orionplace-accent"
|
|
424
|
+
type="checkbox"
|
|
425
|
+
:disabled="busy"
|
|
426
|
+
data-review-photos-only
|
|
427
|
+
@change="reviews.load()"
|
|
428
|
+
/>
|
|
429
|
+
{{ labels.photosOnly }}
|
|
430
|
+
</label>
|
|
431
|
+
</div>
|
|
432
|
+
<OrionplaceSelect
|
|
433
|
+
v-model="reviews.ordering.value"
|
|
434
|
+
:options="orderOptions"
|
|
435
|
+
:label="labels.order"
|
|
436
|
+
:disabled="busy"
|
|
437
|
+
compact
|
|
438
|
+
data-review-sort
|
|
439
|
+
@change="reviews.load()"
|
|
440
|
+
/>
|
|
441
|
+
</div>
|
|
442
|
+
|
|
443
|
+
<div
|
|
444
|
+
v-if="!hasSummary"
|
|
445
|
+
role="group"
|
|
446
|
+
class="flex flex-wrap gap-2"
|
|
447
|
+
:aria-label="labels.ratingFilter"
|
|
448
|
+
data-review-rating-filters
|
|
449
|
+
>
|
|
450
|
+
<button
|
|
451
|
+
type="button"
|
|
452
|
+
class="review-chip"
|
|
453
|
+
:disabled="busy"
|
|
454
|
+
:aria-pressed="!reviews.rating.value"
|
|
455
|
+
:aria-label="labels.allRatings"
|
|
456
|
+
@click="filterRating('')"
|
|
457
|
+
>
|
|
458
|
+
{{ labels.all }}
|
|
459
|
+
</button>
|
|
460
|
+
<button
|
|
461
|
+
v-for="rating in ratings"
|
|
462
|
+
:key="rating"
|
|
463
|
+
type="button"
|
|
464
|
+
class="review-chip tabular-nums"
|
|
465
|
+
:disabled="busy"
|
|
466
|
+
:aria-pressed="reviews.rating.value === String(rating)"
|
|
467
|
+
:aria-label="`${rating} ${labels.stars}`"
|
|
468
|
+
:data-review-rating-filter="rating"
|
|
469
|
+
@click="filterRating(rating)"
|
|
470
|
+
>
|
|
471
|
+
{{ rating }}★
|
|
472
|
+
</button>
|
|
473
|
+
</div>
|
|
474
|
+
|
|
475
|
+
<ProductReviewGallery
|
|
476
|
+
v-if="gallery && scoped"
|
|
477
|
+
:product-id="productId"
|
|
478
|
+
:seller-id="sellerId"
|
|
479
|
+
@select="openImageReview"
|
|
480
|
+
/>
|
|
481
|
+
<div
|
|
482
|
+
v-if="parent"
|
|
483
|
+
class="
|
|
484
|
+
grid gap-3 py-1 pl-4
|
|
485
|
+
border-0 border-l-2 border-solid border-orionplace-text
|
|
486
|
+
"
|
|
487
|
+
>
|
|
488
|
+
<button
|
|
489
|
+
type="button"
|
|
490
|
+
class="review-action justify-self-start"
|
|
491
|
+
:disabled="busy"
|
|
492
|
+
@click="reviews.back()"
|
|
493
|
+
>
|
|
494
|
+
← {{ common.back }}
|
|
495
|
+
</button>
|
|
496
|
+
<span class="flex min-w-0 items-center gap-3">
|
|
497
|
+
<OrionplaceAvatar
|
|
498
|
+
:src="parent.user.logo"
|
|
499
|
+
:name="name(parent)"
|
|
500
|
+
size="small"
|
|
501
|
+
/>
|
|
502
|
+
<span class="min-w-0 break-words text-sm font-medium">
|
|
503
|
+
{{ name(parent) }}
|
|
504
|
+
</span>
|
|
505
|
+
</span>
|
|
506
|
+
<p class="m-0 whitespace-pre-wrap break-words text-sm leading-6">
|
|
507
|
+
{{ parent.text }}
|
|
508
|
+
</p>
|
|
509
|
+
</div>
|
|
510
|
+
<div
|
|
511
|
+
v-if="reviews.state.error && !formFieldsOnly"
|
|
512
|
+
class="op-notice op-notice-error"
|
|
513
|
+
role="alert"
|
|
514
|
+
>
|
|
515
|
+
{{ reviews.state.error }}
|
|
516
|
+
<button
|
|
517
|
+
class="op-feature-button"
|
|
518
|
+
type="button"
|
|
519
|
+
:disabled="busy"
|
|
520
|
+
@click="reviews.load()"
|
|
521
|
+
>
|
|
522
|
+
{{ common.refresh }}
|
|
523
|
+
</button>
|
|
524
|
+
</div>
|
|
525
|
+
<ProductReviewForm
|
|
526
|
+
v-if="reviews.writing.value && !formNested"
|
|
527
|
+
:key="formKey"
|
|
528
|
+
:initial="reviews.editing.value"
|
|
529
|
+
:replying-to="
|
|
530
|
+
reviews.replying.value ? name(reviews.replying.value) : undefined
|
|
531
|
+
"
|
|
532
|
+
:pending="busy"
|
|
533
|
+
:rating-error="reviews.state.fields.rating"
|
|
534
|
+
:text-error="reviews.state.fields.text"
|
|
535
|
+
@submit="authenticated(() => reviews.submit($event))"
|
|
536
|
+
@cancel="reviews.writing.value = false"
|
|
537
|
+
/>
|
|
538
|
+
<p
|
|
539
|
+
class="op-feature-loading"
|
|
540
|
+
v-if="busy"
|
|
541
|
+
role="status"
|
|
542
|
+
>
|
|
543
|
+
<span class="sr-only">{{ common.loading }}</span>
|
|
544
|
+
</p>
|
|
545
|
+
<OrionplaceEmptyState
|
|
546
|
+
v-else-if="reviews.loaded.value && !reviews.reviews.value.length"
|
|
547
|
+
kind="reviews"
|
|
548
|
+
:message="labels.empty"
|
|
549
|
+
/>
|
|
550
|
+
<ol
|
|
551
|
+
class="m-0 grid list-none p-0"
|
|
552
|
+
:aria-busy="busy || undefined"
|
|
553
|
+
>
|
|
554
|
+
<li
|
|
555
|
+
v-for="review in reviews.reviews.value"
|
|
556
|
+
:key="review.id"
|
|
557
|
+
class="
|
|
558
|
+
grid min-w-0 gap-3 py-6
|
|
559
|
+
border-0 border-b border-solid border-orionplace-border
|
|
560
|
+
first:pt-0
|
|
561
|
+
"
|
|
562
|
+
:class="{ 'review-own': own && review.product }"
|
|
563
|
+
data-review
|
|
564
|
+
>
|
|
565
|
+
<!--
|
|
566
|
+
The customer's own reviews start with the product they were
|
|
567
|
+
written about, so each one says which product it concerns.
|
|
568
|
+
-->
|
|
569
|
+
<NuxtLink
|
|
570
|
+
v-if="own && review.product"
|
|
571
|
+
class="review-product group"
|
|
572
|
+
:to="{
|
|
573
|
+
path: `/product/${review.product.id}`,
|
|
574
|
+
query: { locale: selectionStore.localeCode },
|
|
575
|
+
}"
|
|
576
|
+
data-review-product-card
|
|
577
|
+
>
|
|
578
|
+
<OrionplaceImage
|
|
579
|
+
:src="productImage(review.product)"
|
|
580
|
+
alt=""
|
|
581
|
+
class="review-product-image"
|
|
582
|
+
/>
|
|
583
|
+
<span class="grid min-w-0 content-start gap-1">
|
|
584
|
+
<span
|
|
585
|
+
class="
|
|
586
|
+
text-[11px] uppercase tracking-[0.08em]
|
|
587
|
+
text-orionplace-muted
|
|
588
|
+
"
|
|
589
|
+
>
|
|
590
|
+
{{ labels.product }}
|
|
591
|
+
</span>
|
|
592
|
+
<span
|
|
593
|
+
class="
|
|
594
|
+
line-clamp-3 break-words text-sm leading-5
|
|
595
|
+
transition-opacity motion-reduce:transition-none
|
|
596
|
+
group-hover:opacity-70 group-focus-visible:opacity-70
|
|
597
|
+
"
|
|
598
|
+
>
|
|
599
|
+
{{ productName(review.product) }}
|
|
600
|
+
</span>
|
|
601
|
+
<span
|
|
602
|
+
v-if="productVariant(review.product)"
|
|
603
|
+
class="text-xs leading-5 text-orionplace-muted"
|
|
604
|
+
>
|
|
605
|
+
{{ productVariant(review.product) }}
|
|
606
|
+
</span>
|
|
607
|
+
</span>
|
|
608
|
+
</NuxtLink>
|
|
609
|
+
<div
|
|
610
|
+
class="flex min-w-0 items-start gap-3"
|
|
611
|
+
data-review-author
|
|
612
|
+
>
|
|
613
|
+
<OrionplaceAvatar
|
|
614
|
+
v-if="!own"
|
|
615
|
+
:src="review.user.logo"
|
|
616
|
+
:name="name(review)"
|
|
617
|
+
/>
|
|
618
|
+
<div class="grid min-w-0 flex-1 gap-0.5">
|
|
619
|
+
<div
|
|
620
|
+
class="
|
|
621
|
+
flex min-w-0 flex-wrap items-center justify-between
|
|
622
|
+
gap-x-3 gap-y-1
|
|
623
|
+
"
|
|
624
|
+
>
|
|
625
|
+
<span
|
|
626
|
+
v-if="!own"
|
|
627
|
+
class="
|
|
628
|
+
min-w-0 break-words
|
|
629
|
+
text-sm font-medium text-orionplace-text
|
|
630
|
+
"
|
|
631
|
+
>
|
|
632
|
+
{{ name(review) }}
|
|
633
|
+
</span>
|
|
634
|
+
<span
|
|
635
|
+
v-if="review.rating"
|
|
636
|
+
class="shrink-0 text-sm tracking-[0.06em]"
|
|
637
|
+
role="img"
|
|
638
|
+
:aria-label="`${labels.rating}: ${review.rating} ${labels.ofFive}`"
|
|
639
|
+
>
|
|
640
|
+
<span
|
|
641
|
+
v-for="star in 5"
|
|
642
|
+
:key="star"
|
|
643
|
+
aria-hidden="true"
|
|
644
|
+
:class="
|
|
645
|
+
star <= stars(review.rating)
|
|
646
|
+
? 'text-orionplace-text'
|
|
647
|
+
: 'text-orionplace-border'
|
|
648
|
+
"
|
|
649
|
+
>
|
|
650
|
+
★
|
|
651
|
+
</span>
|
|
652
|
+
</span>
|
|
653
|
+
</div>
|
|
654
|
+
<time class="text-xs text-orionplace-muted tabular-nums">
|
|
655
|
+
{{ review.date_created.date }}
|
|
656
|
+
{{ review.date_created.time }}
|
|
657
|
+
</time>
|
|
658
|
+
</div>
|
|
659
|
+
</div>
|
|
660
|
+
<div
|
|
661
|
+
class="grid min-w-0 content-start gap-3"
|
|
662
|
+
:class="{ '@min-[480px]/reviews:pl-[52px]': !own }"
|
|
663
|
+
>
|
|
664
|
+
<NuxtLink
|
|
665
|
+
v-if="showsProduct && review.product"
|
|
666
|
+
class="
|
|
667
|
+
group flex min-w-0 max-w-[68ch] items-center gap-3
|
|
668
|
+
justify-self-start
|
|
669
|
+
text-orionplace-text no-underline outline-none
|
|
670
|
+
"
|
|
671
|
+
:to="{
|
|
672
|
+
path: `/product/${review.product.id}`,
|
|
673
|
+
query: { locale: selectionStore.localeCode },
|
|
674
|
+
}"
|
|
675
|
+
data-review-product
|
|
676
|
+
>
|
|
677
|
+
<OrionplaceImage
|
|
678
|
+
:src="productImage(review.product)"
|
|
679
|
+
alt=""
|
|
680
|
+
class="
|
|
681
|
+
h-12 w-12 shrink-0 object-contain!
|
|
682
|
+
border border-solid border-orionplace-border
|
|
683
|
+
bg-orionplace-surface
|
|
684
|
+
transition-colors motion-reduce:transition-none
|
|
685
|
+
group-hover:border-orionplace-text
|
|
686
|
+
group-focus-visible:border-orionplace-text
|
|
687
|
+
"
|
|
688
|
+
/>
|
|
689
|
+
<span class="grid min-w-0 gap-0.5">
|
|
690
|
+
<span
|
|
691
|
+
class="
|
|
692
|
+
text-[11px] uppercase tracking-[0.08em]
|
|
693
|
+
text-orionplace-muted
|
|
694
|
+
"
|
|
695
|
+
>
|
|
696
|
+
{{ labels.product }}
|
|
697
|
+
</span>
|
|
698
|
+
<span
|
|
699
|
+
class="
|
|
700
|
+
line-clamp-2 break-words
|
|
701
|
+
text-sm leading-5
|
|
702
|
+
transition-opacity motion-reduce:transition-none
|
|
703
|
+
group-hover:opacity-70 group-focus-visible:opacity-70
|
|
704
|
+
"
|
|
705
|
+
>
|
|
706
|
+
{{ productName(review.product) }}
|
|
707
|
+
</span>
|
|
708
|
+
</span>
|
|
709
|
+
</NuxtLink>
|
|
710
|
+
<p
|
|
711
|
+
class="
|
|
712
|
+
m-0 max-w-[68ch] whitespace-pre-wrap break-words
|
|
713
|
+
text-sm leading-6 text-orionplace-text
|
|
714
|
+
"
|
|
715
|
+
>
|
|
716
|
+
{{ review.text }}
|
|
717
|
+
</p>
|
|
718
|
+
<p
|
|
719
|
+
v-if="review.status.int !== EProductFeedbackStatus.APROOVED"
|
|
720
|
+
class="
|
|
721
|
+
m-0 justify-self-start px-2 py-0.5
|
|
722
|
+
text-[11px] uppercase tracking-[0.08em]
|
|
723
|
+
border border-solid border-orionplace-border
|
|
724
|
+
text-orionplace-muted
|
|
725
|
+
"
|
|
726
|
+
>
|
|
727
|
+
{{
|
|
728
|
+
review.status.int === EProductFeedbackStatus.PENDING
|
|
729
|
+
? labels.pending
|
|
730
|
+
: labels.denied
|
|
731
|
+
}}
|
|
732
|
+
</p>
|
|
733
|
+
<div
|
|
734
|
+
v-if="review.images.length"
|
|
735
|
+
class="flex flex-wrap gap-2"
|
|
736
|
+
>
|
|
737
|
+
<button
|
|
738
|
+
v-for="(image, position) in review.images"
|
|
739
|
+
:key="image.id"
|
|
740
|
+
type="button"
|
|
741
|
+
class="
|
|
742
|
+
block h-20 w-20 overflow-hidden p-0
|
|
743
|
+
cursor-pointer rounded-none bg-orionplace-surface
|
|
744
|
+
border border-solid border-orionplace-border
|
|
745
|
+
outline-none transition-colors motion-reduce:transition-none
|
|
746
|
+
hover:border-orionplace-text
|
|
747
|
+
focus-visible:border-orionplace-text
|
|
748
|
+
"
|
|
749
|
+
:aria-label="`${labels.openImage}: ${labels.image} ${position + 1}`"
|
|
750
|
+
aria-haspopup="dialog"
|
|
751
|
+
data-review-image
|
|
752
|
+
@click="openImage(review, position)"
|
|
753
|
+
>
|
|
754
|
+
<OrionplaceImage
|
|
755
|
+
:src="image.image"
|
|
756
|
+
alt=""
|
|
757
|
+
class="h-full w-full object-cover!"
|
|
758
|
+
/>
|
|
759
|
+
</button>
|
|
760
|
+
</div>
|
|
761
|
+
<div
|
|
762
|
+
v-if="
|
|
763
|
+
review.status.int === EProductFeedbackStatus.APROOVED ||
|
|
764
|
+
(reviews.isOwner(review) && !review.total_c_approved_replies)
|
|
765
|
+
"
|
|
766
|
+
class="-ml-2 flex flex-wrap items-center gap-x-1 gap-y-1"
|
|
767
|
+
data-review-actions
|
|
768
|
+
>
|
|
769
|
+
<template
|
|
770
|
+
v-if="review.status.int === EProductFeedbackStatus.APROOVED"
|
|
771
|
+
>
|
|
772
|
+
<button
|
|
773
|
+
class="review-action"
|
|
774
|
+
type="button"
|
|
775
|
+
:disabled="busy"
|
|
776
|
+
:aria-pressed="review.user_like === true"
|
|
777
|
+
:aria-label="actionLabel('helpfulHint', 'liked', review.total_c_likes)"
|
|
778
|
+
@click="authenticated(() => reviews.react(review, true))"
|
|
779
|
+
>
|
|
780
|
+
<svg
|
|
781
|
+
viewBox="0 0 24 24"
|
|
782
|
+
class="h-4 w-4"
|
|
783
|
+
fill="none"
|
|
784
|
+
stroke="currentColor"
|
|
785
|
+
stroke-width="1.5"
|
|
786
|
+
aria-hidden="true"
|
|
787
|
+
>
|
|
788
|
+
<path
|
|
789
|
+
d="M7 10v11H3V10h4Zm0 0 4-7a2 2 0 0 1 3 2l-1 5h6a2 2 0 0 1 2 2.3l-1.3 7A2 2 0 0 1 17.7 21H7"
|
|
790
|
+
/>
|
|
791
|
+
</svg>
|
|
792
|
+
{{ labels.liked }}
|
|
793
|
+
<span class="tabular-nums">{{ review.total_c_likes }}</span>
|
|
794
|
+
</button>
|
|
795
|
+
<button
|
|
796
|
+
class="review-action"
|
|
797
|
+
type="button"
|
|
798
|
+
:disabled="busy"
|
|
799
|
+
:aria-pressed="review.user_like === false"
|
|
800
|
+
:aria-label="actionLabel('unhelpfulHint', 'disliked', review.total_c_dislikes)"
|
|
801
|
+
@click="authenticated(() => reviews.react(review, false))"
|
|
802
|
+
>
|
|
803
|
+
<svg
|
|
804
|
+
viewBox="0 0 24 24"
|
|
805
|
+
class="h-4 w-4"
|
|
806
|
+
fill="none"
|
|
807
|
+
stroke="currentColor"
|
|
808
|
+
stroke-width="1.5"
|
|
809
|
+
aria-hidden="true"
|
|
810
|
+
>
|
|
811
|
+
<path
|
|
812
|
+
d="M17 14V3h4v11h-4Zm0 0-4 7a2 2 0 0 1-3-2l1-5H5a2 2 0 0 1-2-2.3l1.3-7A2 2 0 0 1 6.3 3H17"
|
|
813
|
+
/>
|
|
814
|
+
</svg>
|
|
815
|
+
{{ labels.disliked }}
|
|
816
|
+
<span class="tabular-nums">
|
|
817
|
+
{{ review.total_c_dislikes }}
|
|
818
|
+
</span>
|
|
819
|
+
</button>
|
|
820
|
+
<button
|
|
821
|
+
class="review-action"
|
|
822
|
+
type="button"
|
|
823
|
+
:disabled="busy"
|
|
824
|
+
:aria-label="
|
|
825
|
+
actionLabel(
|
|
826
|
+
'repliesHint',
|
|
827
|
+
'replies',
|
|
828
|
+
reviewDirectReplies(review),
|
|
829
|
+
)
|
|
830
|
+
"
|
|
831
|
+
data-review-replies
|
|
832
|
+
@click="reviews.openReplies(review)"
|
|
833
|
+
>
|
|
834
|
+
{{ labels.replies }}
|
|
835
|
+
<span class="tabular-nums">
|
|
836
|
+
{{ reviewDirectReplies(review) }}
|
|
837
|
+
</span>
|
|
838
|
+
</button>
|
|
839
|
+
<button
|
|
840
|
+
class="review-action"
|
|
841
|
+
v-if="productId || review.product"
|
|
842
|
+
type="button"
|
|
843
|
+
:disabled="busy"
|
|
844
|
+
data-review-reply
|
|
845
|
+
@click="authenticated(() => reviews.compose(review))"
|
|
846
|
+
>
|
|
847
|
+
{{ labels.reply }}
|
|
848
|
+
</button>
|
|
849
|
+
</template>
|
|
850
|
+
<button
|
|
851
|
+
v-if="
|
|
852
|
+
reviews.isOwner(review) && !review.total_c_approved_replies
|
|
853
|
+
"
|
|
854
|
+
type="button"
|
|
855
|
+
class="review-action"
|
|
856
|
+
:disabled="busy"
|
|
857
|
+
data-review-edit
|
|
858
|
+
@click="reviews.edit(review)"
|
|
859
|
+
>
|
|
860
|
+
{{ common.edit }}
|
|
861
|
+
</button>
|
|
862
|
+
</div>
|
|
863
|
+
<div
|
|
864
|
+
v-if="reviews.writing.value && formReviewId === review.id"
|
|
865
|
+
:class="reviews.replying.value ? 'review-branch' : 'mt-1 min-w-0'"
|
|
866
|
+
data-review-form-branch
|
|
867
|
+
>
|
|
868
|
+
<ProductReviewForm
|
|
869
|
+
:key="formKey"
|
|
870
|
+
:initial="reviews.editing.value"
|
|
871
|
+
:replying-to="
|
|
872
|
+
reviews.replying.value
|
|
873
|
+
? name(reviews.replying.value)
|
|
874
|
+
: undefined
|
|
875
|
+
"
|
|
876
|
+
:pending="busy"
|
|
877
|
+
:rating-error="reviews.state.fields.rating"
|
|
878
|
+
:text-error="reviews.state.fields.text"
|
|
879
|
+
@submit="authenticated(() => reviews.submit($event))"
|
|
880
|
+
@cancel="reviews.writing.value = false"
|
|
881
|
+
/>
|
|
882
|
+
</div>
|
|
883
|
+
</div>
|
|
884
|
+
</li>
|
|
885
|
+
</ol>
|
|
886
|
+
<StorefrontPagination
|
|
887
|
+
:pagination="reviews.pagination.value"
|
|
888
|
+
:pending="busy"
|
|
889
|
+
@change="reviews.load"
|
|
890
|
+
/>
|
|
891
|
+
</div>
|
|
892
|
+
</div>
|
|
893
|
+
<ProductReviewImageViewer
|
|
894
|
+
v-if="viewer"
|
|
895
|
+
:images="viewer.images"
|
|
896
|
+
:index="viewer.index"
|
|
897
|
+
@close="viewer = undefined"
|
|
898
|
+
/>
|
|
899
|
+
</section>
|
|
900
|
+
</template>
|
|
901
|
+
|
|
902
|
+
<style scoped>
|
|
903
|
+
@reference "@/assets/css/orionplace.css";
|
|
904
|
+
|
|
905
|
+
.review-tab {
|
|
906
|
+
@apply inline-flex min-h-8 items-center px-0 py-1;
|
|
907
|
+
@apply cursor-pointer border-0 border-b border-solid bg-transparent;
|
|
908
|
+
@apply text-xs font-medium uppercase tracking-[0.08em];
|
|
909
|
+
@apply outline-none transition-colors motion-reduce:transition-none;
|
|
910
|
+
border-color: transparent;
|
|
911
|
+
color: var(--orionplace-muted);
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
.review-tab:focus-visible,
|
|
915
|
+
.review-tab[aria-pressed='true'],
|
|
916
|
+
.review-tab[aria-expanded='true'] {
|
|
917
|
+
color: var(--orionplace-text);
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
@media (hover: hover) {
|
|
921
|
+
.review-tab:hover {
|
|
922
|
+
color: var(--orionplace-text);
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
.review-tab[aria-pressed='true'],
|
|
927
|
+
.review-tab[aria-expanded='true'] {
|
|
928
|
+
border-color: var(--orionplace-text);
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
.review-tab:disabled,
|
|
932
|
+
.review-chip:disabled,
|
|
933
|
+
.review-action:disabled {
|
|
934
|
+
@apply cursor-default opacity-60;
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
.review-chip {
|
|
938
|
+
@apply box-border inline-flex h-8 items-center justify-center px-3;
|
|
939
|
+
@apply cursor-pointer border border-solid bg-transparent;
|
|
940
|
+
@apply text-xs;
|
|
941
|
+
@apply outline-none transition-colors motion-reduce:transition-none;
|
|
942
|
+
border-color: var(--orionplace-border);
|
|
943
|
+
color: var(--orionplace-text);
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
.review-chip:focus-visible {
|
|
947
|
+
border-color: var(--orionplace-text);
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
@media (hover: hover) {
|
|
951
|
+
.review-chip:hover {
|
|
952
|
+
border-color: var(--orionplace-text);
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
.review-chip[aria-pressed='true'] {
|
|
957
|
+
border-color: var(--orionplace-text);
|
|
958
|
+
box-shadow: inset 0 0 0 1px var(--orionplace-text);
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
.review-action {
|
|
962
|
+
@apply box-border inline-flex min-h-8 items-center gap-1.5 px-2;
|
|
963
|
+
@apply cursor-pointer border-0 bg-transparent;
|
|
964
|
+
@apply text-xs;
|
|
965
|
+
@apply outline-none transition-colors motion-reduce:transition-none;
|
|
966
|
+
color: var(--orionplace-muted);
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
.review-action:focus-visible {
|
|
970
|
+
background: var(--orionplace-hover);
|
|
971
|
+
color: var(--orionplace-text);
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
@media (hover: hover) {
|
|
975
|
+
.review-action:hover {
|
|
976
|
+
background: var(--orionplace-hover);
|
|
977
|
+
color: var(--orionplace-text);
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
.review-action[aria-pressed='true'] {
|
|
982
|
+
color: var(--orionplace-text);
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
/*
|
|
986
|
+
* A reply and an edited review are written inside the review they belong
|
|
987
|
+
* to. A reply is indented under the answered review; the form's own frame
|
|
988
|
+
* is its only border, so no second rule runs beside it. An edited review
|
|
989
|
+
* replaces the review in place without an indent.
|
|
990
|
+
*/
|
|
991
|
+
/*
|
|
992
|
+
* An own review sits beside its product: a product column on the left and
|
|
993
|
+
* the review on the right from 640px of the list width; a narrow list keeps
|
|
994
|
+
* the product as a compact row above the review.
|
|
995
|
+
*/
|
|
996
|
+
.review-own {
|
|
997
|
+
@apply @min-[640px]/reviews:grid-cols-[160px_minmax(0,1fr)];
|
|
998
|
+
@apply @min-[640px]/reviews:grid-rows-[auto_1fr];
|
|
999
|
+
@apply @min-[640px]/reviews:gap-x-8;
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
.review-own > :not(.review-product) {
|
|
1003
|
+
@apply @min-[640px]/reviews:col-start-2;
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
.review-product {
|
|
1007
|
+
@apply flex min-w-0 items-start gap-3 self-start;
|
|
1008
|
+
@apply text-orionplace-text no-underline outline-none;
|
|
1009
|
+
@apply @min-[640px]/reviews:row-span-2 @min-[640px]/reviews:flex-col;
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
.review-product-image {
|
|
1013
|
+
@apply box-border h-16 w-16 shrink-0 object-contain!;
|
|
1014
|
+
@apply border border-solid border-orionplace-border bg-orionplace-surface;
|
|
1015
|
+
@apply transition-colors motion-reduce:transition-none;
|
|
1016
|
+
@apply group-hover:border-orionplace-text;
|
|
1017
|
+
@apply group-focus-visible:border-orionplace-text;
|
|
1018
|
+
@apply @min-[640px]/reviews:h-auto @min-[640px]/reviews:w-full;
|
|
1019
|
+
@apply @min-[640px]/reviews:aspect-square;
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
.review-branch {
|
|
1023
|
+
@apply box-border mt-1 min-w-0 pl-4;
|
|
1024
|
+
}
|
|
1025
|
+
</style>
|