@salla.sa/twilight-theme-engine 1.0.85 → 1.0.87
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 +4 -3
- package/bin/twilight-check-manifest.mjs +16 -0
- package/dist/{AddToCartForm-B5C2M4OZ.js → AddToCartForm-P644O2QL.js} +4 -4
- package/dist/{AddToCartForm-B5C2M4OZ.js.map → AddToCartForm-P644O2QL.js.map} +1 -1
- package/dist/{BlogAuthorPage-GTF4UGSS.js → BlogAuthorPage-VWSO6MPY.js} +13 -11
- package/dist/BlogAuthorPage-VWSO6MPY.js.map +1 -0
- package/dist/{BlogCategoryPage-TN7Y4NBP.js → BlogCategoryPage-K2KSQ6T6.js} +13 -11
- package/dist/BlogCategoryPage-K2KSQ6T6.js.map +1 -0
- package/dist/{BlogPage-TDB3M3PI.js → BlogPage-XRM7VWOZ.js} +12 -10
- package/dist/BlogPage-XRM7VWOZ.js.map +1 -0
- package/dist/{BlogSinglePage-4A52Q5QW.js → BlogSinglePage-XIAXT54H.js} +12 -10
- package/dist/BlogSinglePage-XIAXT54H.js.map +1 -0
- package/dist/{BlogTagPage-TOVPBETA.js → BlogTagPage-IHOA267V.js} +13 -11
- package/dist/BlogTagPage-IHOA267V.js.map +1 -0
- package/dist/{BrandsPage-VUDGYSQI.js → BrandsPage-ZFEILRT3.js} +12 -10
- package/dist/BrandsPage-ZFEILRT3.js.map +1 -0
- package/dist/{Breadcrumb-CI3SN5YR.js → Breadcrumb-CVSISL2K.js} +12 -10
- package/dist/Breadcrumb-CVSISL2K.js.map +1 -0
- package/dist/{CartItem-BHLEURAB.js → CartItem-EOI7P3JA.js} +12 -10
- package/dist/CartItem-EOI7P3JA.js.map +1 -0
- package/dist/{CartSummary-QERVESYN.js → CartSummary-RZGUBDKJ.js} +12 -10
- package/dist/CartSummary-RZGUBDKJ.js.map +1 -0
- package/dist/{Copyright-RL6ALKRC.js → Copyright-5BLYSP24.js} +4 -4
- package/dist/{Copyright-RL6ALKRC.js.map → Copyright-5BLYSP24.js.map} +1 -1
- package/dist/{CustomerLayout-VRZUWGQK.js → CustomerLayout-6F4BJAMU.js} +12 -10
- package/dist/CustomerLayout-6F4BJAMU.js.map +1 -0
- package/dist/{Footer-ZWBZCMDL.js → Footer-NF2NLDLR.js} +6 -6
- package/dist/{Footer-ZWBZCMDL.js.map → Footer-NF2NLDLR.js.map} +1 -1
- package/dist/{Header-WNK4O66B.js → Header-6DQJ5X7J.js} +9 -7
- package/dist/{Header-WNK4O66B.js.map → Header-6DQJ5X7J.js.map} +1 -1
- package/dist/{LoyaltyPage-CGTHWJ76.js → LoyaltyPage-YHWHIWCS.js} +12 -10
- package/dist/LoyaltyPage-YHWHIWCS.js.map +1 -0
- package/dist/{LoyaltyPointsPage-QSU6K3PW.js → LoyaltyPointsPage-T6K3H5A5.js} +10 -3
- package/dist/LoyaltyPointsPage-T6K3H5A5.js.map +1 -0
- package/dist/{MainMenu-V3T7F32R.js → MainMenu-Y2TAM7DK.js} +4 -4
- package/dist/{MainMenu-V3T7F32R.js.map → MainMenu-Y2TAM7DK.js.map} +1 -1
- package/dist/{MasterLayout-XQF644LD.js → MasterLayout-GBEEFFPG.js} +12 -10
- package/dist/{MasterLayout-XQF644LD.js.map → MasterLayout-GBEEFFPG.js.map} +1 -1
- package/dist/{MobileMenu-U4BVQYKH.js → MobileMenu-RE5XVGZL.js} +12 -10
- package/dist/MobileMenu-RE5XVGZL.js.map +1 -0
- package/dist/{NotificationsPage-ZRRQY7TF.js → NotificationsPage-QAFWZAS3.js} +12 -10
- package/dist/NotificationsPage-QAFWZAS3.js.map +1 -0
- package/dist/{OrderSinglePage-O3XYVMG5.js → OrderSinglePage-T4PRXTKG.js} +12 -10
- package/dist/OrderSinglePage-T4PRXTKG.js.map +1 -0
- package/dist/{OrdersPage-CMXZF5MI.js → OrdersPage-3S6ZS56E.js} +12 -10
- package/dist/OrdersPage-3S6ZS56E.js.map +1 -0
- package/dist/{PageSingle-IIG2US43.js → PageSingle-W3UTXDOW.js} +4 -4
- package/dist/{PageSingle-IIG2US43.js.map → PageSingle-W3UTXDOW.js.map} +1 -1
- package/dist/{ProductDetails-65GDABI7.js → ProductDetails-X5A7TG3F.js} +14 -7
- package/dist/ProductDetails-X5A7TG3F.js.map +1 -0
- package/dist/{ProfilePage-SNJ4WXU4.js → ProfilePage-DUH3AILJ.js} +12 -10
- package/dist/ProfilePage-DUH3AILJ.js.map +1 -0
- package/dist/{ReviewsPage-UT7UT55J.js → ReviewsPage-2C2P7VS3.js} +4 -4
- package/dist/{ReviewsPage-UT7UT55J.js.map → ReviewsPage-2C2P7VS3.js.map} +1 -1
- package/dist/{SeoCartWidget-DBJAXJKT.js → SeoCartWidget-VYLGEW2I.js} +12 -10
- package/dist/SeoCartWidget-VYLGEW2I.js.map +1 -0
- package/dist/{SettingsPage-FLTIOPU5.js → SettingsPage-OZJEW6CW.js} +12 -10
- package/dist/SettingsPage-OZJEW6CW.js.map +1 -0
- package/dist/{StoreClosedNotification-ZT3QKDKS.js → StoreClosedNotification-QHIZBNXO.js} +13 -11
- package/dist/{StoreClosedNotification-ZT3QKDKS.js.map → StoreClosedNotification-QHIZBNXO.js.map} +1 -1
- package/dist/{TestimonialsPage-CU7HKU4O.js → TestimonialsPage-K6WJKKME.js} +4 -4
- package/dist/{TestimonialsPage-CU7HKU4O.js.map → TestimonialsPage-K6WJKKME.js.map} +1 -1
- package/dist/{ThankYouPage-5X6B4X3T.js → ThankYouPage-H6QQEI5R.js} +12 -10
- package/dist/ThankYouPage-H6QQEI5R.js.map +1 -0
- package/dist/{WalletPage-H2BKIDPA.js → WalletPage-G5IBGN6B.js} +12 -10
- package/dist/WalletPage-G5IBGN6B.js.map +1 -0
- package/dist/{WishlistPage-RS5UCIQ3.js → WishlistPage-AIOTAB6L.js} +12 -10
- package/dist/WishlistPage-AIOTAB6L.js.map +1 -0
- package/dist/api/advertisement.d.ts +33 -0
- package/dist/api/advertisement.d.ts.map +1 -0
- package/dist/api/advertisement.js +8 -0
- package/dist/api/advertisement.js.map +1 -0
- package/dist/boot/critical-style.d.ts +3 -0
- package/dist/boot/critical-style.d.ts.map +1 -0
- package/dist/boot/index.d.ts +15 -0
- package/dist/boot/index.d.ts.map +1 -0
- package/dist/boot.d.ts +1 -0
- package/dist/boot.js +69 -0
- package/dist/boot.js.map +1 -0
- package/dist/chunk-4FJGZQD3.js +6 -0
- package/dist/chunk-4FJGZQD3.js.map +1 -0
- package/dist/{chunk-SDFDS4Q3.js → chunk-BCJTF3V7.js} +20 -4
- package/dist/chunk-BCJTF3V7.js.map +1 -0
- package/dist/chunk-DBW7XXNE.js +103 -0
- package/dist/chunk-DBW7XXNE.js.map +1 -0
- package/dist/{chunk-22SH7OVF.js → chunk-E7WWO3V3.js} +3 -3
- package/dist/{chunk-22SH7OVF.js.map → chunk-E7WWO3V3.js.map} +1 -1
- package/dist/{chunk-SE5JYWOK.js → chunk-EZHXVHXY.js} +4 -4
- package/dist/{chunk-SE5JYWOK.js.map → chunk-EZHXVHXY.js.map} +1 -1
- package/dist/{chunk-JO7JWV34.js → chunk-FWYKOQV5.js} +5 -5
- package/dist/chunk-FWYKOQV5.js.map +1 -0
- package/dist/{chunk-JRNH3FUF.js → chunk-FYHF62KI.js} +4 -4
- package/dist/{chunk-JRNH3FUF.js.map → chunk-FYHF62KI.js.map} +1 -1
- package/dist/{chunk-UJKFBZFJ.js → chunk-GJ5IMPNY.js} +7 -7
- package/dist/{chunk-UJKFBZFJ.js.map → chunk-GJ5IMPNY.js.map} +1 -1
- package/dist/chunk-IVBOLREE.js +29 -0
- package/dist/chunk-IVBOLREE.js.map +1 -0
- package/dist/chunk-LWPKBVIE.js +14 -0
- package/dist/{chunk-7WAXN2PP.js.map → chunk-LWPKBVIE.js.map} +1 -1
- package/dist/{chunk-SX5MF2YA.js → chunk-N3BCZIGS.js} +4 -4
- package/dist/{chunk-SX5MF2YA.js.map → chunk-N3BCZIGS.js.map} +1 -1
- package/dist/{chunk-NZVR4OF7.js → chunk-NXQZ4RLM.js} +8 -8
- package/dist/chunk-NXQZ4RLM.js.map +1 -0
- package/dist/{chunk-NXQJA7D3.js → chunk-PCURRKIH.js} +3 -3
- package/dist/{chunk-NXQJA7D3.js.map → chunk-PCURRKIH.js.map} +1 -1
- package/dist/{chunk-4CZRUAZB.js → chunk-PU2LHFDQ.js} +10 -11
- package/dist/chunk-PU2LHFDQ.js.map +1 -0
- package/dist/{chunk-OWX2CPNQ.js → chunk-UQIVX4YA.js} +3 -3
- package/dist/{chunk-OWX2CPNQ.js.map → chunk-UQIVX4YA.js.map} +1 -1
- package/dist/chunk-X5NK4TZH.js +228 -0
- package/dist/chunk-X5NK4TZH.js.map +1 -0
- package/dist/{chunk-6SWDSRIL.js → chunk-XKNXYQ2K.js} +6 -6
- package/dist/{chunk-6SWDSRIL.js.map → chunk-XKNXYQ2K.js.map} +1 -1
- package/dist/{chunk-KHBSGD2D.js → chunk-XO7B3VWS.js} +3 -3
- package/dist/{chunk-KHBSGD2D.js.map → chunk-XO7B3VWS.js.map} +1 -1
- package/dist/cli/check-manifest.d.ts +10 -0
- package/dist/cli/check-manifest.d.ts.map +1 -0
- package/dist/cli/check-manifest.js +44 -0
- package/dist/cli/check-manifest.js.map +1 -0
- package/dist/components/cart/index.js +1 -1
- package/dist/components/common/index.js +2 -2
- package/dist/components/drawer/index.js +10 -8
- package/dist/components/home/index.js +12 -10
- package/dist/components/layout/Footer.d.ts.map +1 -1
- package/dist/components/layout/MasterLayout.d.ts.map +1 -1
- package/dist/components/layout/PageAdvertisements.d.ts +7 -0
- package/dist/components/layout/PageAdvertisements.d.ts.map +1 -0
- package/dist/components/layout/index.d.ts +1 -0
- package/dist/components/layout/index.d.ts.map +1 -1
- package/dist/components/layout/index.js +8 -1
- package/dist/components/product/index.js +11 -9
- package/dist/components/store/index.js +12 -10
- package/dist/components/store/index.js.map +1 -1
- package/dist/{document-class-67HTP45G.js → document-class-FRL7JHWD.js} +6 -5
- package/dist/{document-class-67HTP45G.js.map → document-class-FRL7JHWD.js.map} +1 -1
- package/dist/hooks/index.js +10 -8
- package/dist/hooks/useGtm.js +10 -8
- package/dist/hooks/useMoney.js +10 -8
- package/dist/hooks/useStore.js +10 -8
- package/dist/index.js +10 -8
- package/dist/index.js.map +1 -1
- package/dist/{not-found-QTHBFPNT.js → not-found-E6AR4CZ4.js} +12 -10
- package/dist/not-found-E6AR4CZ4.js.map +1 -0
- package/dist/providers/index.js +10 -8
- package/dist/routes/account/orders.js +1 -1
- package/dist/routes/account.js +6 -6
- package/dist/routes/blog.js +5 -5
- package/dist/routes/brands.js +1 -1
- package/dist/routes/cart.js +14 -12
- package/dist/routes/cart.js.map +1 -1
- package/dist/routes/home.js +13 -11
- package/dist/routes/loyalty.js +2 -2
- package/dist/routes/page.js +1 -1
- package/dist/routes/product-listing.js +12 -10
- package/dist/routes/product-listing.js.map +1 -1
- package/dist/routes/product.js +12 -10
- package/dist/routes/product.js.map +1 -1
- package/dist/routes/root/beforeLoad.d.ts +2 -2
- package/dist/routes/root/beforeLoad.d.ts.map +1 -1
- package/dist/routes/root/head.d.ts.map +1 -1
- package/dist/routes/testimonials.js +2 -2
- package/dist/routes/thank-you.js +1 -1
- package/dist/skeleton.js +13 -11
- package/dist/tanstack/document-class.d.ts.map +1 -1
- package/dist/tanstack/index.d.ts +1 -0
- package/dist/tanstack/index.d.ts.map +1 -1
- package/dist/tanstack/stylesheet.d.ts +15 -0
- package/dist/tanstack/stylesheet.d.ts.map +1 -0
- package/dist/tanstack.js +33 -4
- package/dist/tanstack.js.map +1 -1
- package/dist/utils/index.js +2 -2
- package/dist/vite/index.d.ts +1 -1
- package/dist/vite/index.d.ts.map +1 -1
- package/dist/vite/index.js +14 -25
- package/dist/vite/index.js.map +1 -1
- package/dist/vite/plugins/twilight-manifest.d.ts +23 -0
- package/dist/vite/plugins/twilight-manifest.d.ts.map +1 -1
- package/dist/vite/plugins/twilight-schema.plugin.d.ts.map +1 -1
- package/package.json +16 -3
- package/tailwind/components/Component.tsx.txt +21 -0
- package/tailwind/components/ComponentRegistry.ts.txt +66 -0
- package/tailwind/components/cart/CartItem.tsx.txt +211 -0
- package/tailwind/components/cart/CartSummary.tsx.txt +269 -0
- package/tailwind/components/cart/PreOrderNotification.tsx.txt +16 -0
- package/tailwind/components/cart/PriceQuoteButton.tsx.txt +21 -0
- package/tailwind/components/cart/SeoCartWidget.tsx.txt +99 -0
- package/tailwind/components/cart/index.ts.txt +11 -0
- package/tailwind/components/cart/lazy.ts.txt +15 -0
- package/tailwind/components/collapse/Collapse.tsx.txt +95 -0
- package/tailwind/components/collapse/index.ts.txt +41 -0
- package/tailwind/components/common/Breadcrumb.tsx.txt +27 -0
- package/tailwind/components/common/BreadcrumbJsonLd.tsx.txt +40 -0
- package/tailwind/components/common/BreadcrumbTrail.tsx.txt +97 -0
- package/tailwind/components/common/CurrencySymbol.tsx.txt +8 -0
- package/tailwind/components/common/DeferredData.tsx.txt +122 -0
- package/tailwind/components/common/ErrorPage.tsx.txt +69 -0
- package/tailwind/components/common/Image.tsx.txt +119 -0
- package/tailwind/components/common/Link.tsx.txt +36 -0
- package/tailwind/components/common/Link.types.ts.txt +85 -0
- package/tailwind/components/common/NoContent.tsx.txt +27 -0
- package/tailwind/components/common/RenderWhenVisible.tsx.txt +92 -0
- package/tailwind/components/common/index.ts.txt +42 -0
- package/tailwind/components/common/lazy.ts.txt +28 -0
- package/tailwind/components/defineComponent.ts.txt +32 -0
- package/tailwind/components/drawer/Drawer.tsx.txt +219 -0
- package/tailwind/components/drawer/index.ts.txt +38 -0
- package/tailwind/components/dropdown/Dropdown.tsx.txt +166 -0
- package/tailwind/components/dropdown/index.ts.txt +40 -0
- package/tailwind/components/home/BundleComponent.tsx.txt +35 -0
- package/tailwind/components/home/ComponentErrorBoundary.tsx.txt +98 -0
- package/tailwind/components/home/FeaturedProductsStyle1.tsx.txt +125 -0
- package/tailwind/components/home/FeaturedProductsStyle2.tsx.txt +127 -0
- package/tailwind/components/home/FeaturedProductsStyle3.tsx.txt +71 -0
- package/tailwind/components/home/FixedBanner.tsx.txt +68 -0
- package/tailwind/components/home/FixedProducts.tsx.txt +72 -0
- package/tailwind/components/home/HomePageRenderer.tsx.txt +284 -0
- package/tailwind/components/home/PageBlocks.tsx.txt +24 -0
- package/tailwind/components/home/ParallaxBackground.tsx.txt +50 -0
- package/tailwind/components/home/PhotosSlider.tsx.txt +61 -0
- package/tailwind/components/home/ProductsSlider.tsx.txt +87 -0
- package/tailwind/components/home/ReorderProducts.tsx.txt +38 -0
- package/tailwind/components/home/SquarePhotos.tsx.txt +68 -0
- package/tailwind/components/home/StoreFeatures.tsx.txt +34 -0
- package/tailwind/components/home/Testimonials.tsx.txt +36 -0
- package/tailwind/components/home/Youtube.tsx.txt +48 -0
- package/tailwind/components/home/index.ts.txt +50 -0
- package/tailwind/components/home/lazy.ts.txt +17 -0
- package/tailwind/components/home/register.ts.txt +44 -0
- package/tailwind/components/home/reorder-hooks.ts.txt +52 -0
- package/tailwind/components/home/types.ts.txt +4 -0
- package/tailwind/components/layout/Copyright.tsx.txt +23 -0
- package/tailwind/components/layout/CustomerLayout.tsx.txt +91 -0
- package/tailwind/components/layout/Footer.tsx.txt +341 -0
- package/tailwind/components/layout/Header.tsx.txt +154 -0
- package/tailwind/components/layout/MasterLayout.tsx.txt +62 -0
- package/tailwind/components/layout/PageAdvertisements.tsx.txt +131 -0
- package/tailwind/components/layout/WidgetHead.tsx.txt +53 -0
- package/tailwind/components/layout/index.ts.txt +27 -0
- package/tailwind/components/layout/lazy.ts.txt +25 -0
- package/tailwind/components/layout/types.ts.txt +11 -0
- package/tailwind/components/modal/ImageModal.tsx.txt +70 -0
- package/tailwind/components/modal/Modal.tsx.txt +245 -0
- package/tailwind/components/modal/index.ts.txt +39 -0
- package/tailwind/components/modal/lazy.ts.txt +10 -0
- package/tailwind/components/navigation/MainMenu.tsx.txt +94 -0
- package/tailwind/components/navigation/MobileMenu.tsx.txt +160 -0
- package/tailwind/components/navigation/index.ts.txt +4 -0
- package/tailwind/components/navigation/lazy.ts.txt +11 -0
- package/tailwind/components/product/AddToCartForm.tsx.txt +365 -0
- package/tailwind/components/product/ProductCard.tsx.txt +305 -0
- package/tailwind/components/product/ProductDetails.tsx.txt +267 -0
- package/tailwind/components/product/ProductGallery.tsx.txt +234 -0
- package/tailwind/components/product/index.ts.txt +15 -0
- package/tailwind/components/product/lazy.ts.txt +9 -0
- package/tailwind/components/snippets/AppsSnippets.tsx.txt +225 -0
- package/tailwind/components/snippets/SallaSdkScripts.tsx.txt +14 -0
- package/tailwind/components/snippets/index.ts.txt +4 -0
- package/tailwind/components/store/StoreClosedNotification.tsx.txt +73 -0
- package/tailwind/components/store/index.ts.txt +8 -0
- package/tailwind/components/store/lazy.ts.txt +8 -0
- package/tailwind/components/toast/Toaster.tsx.txt +177 -0
- package/tailwind/components/toast/index.ts.txt +10 -0
- package/tailwind/components/toast/types.ts.txt +38 -0
- package/tailwind/components/toast/useToast.ts.txt +61 -0
- package/tailwind/components/tracking/GoogleTag.tsx.txt +77 -0
- package/tailwind/components/tracking/SiftSnippet.tsx.txt +49 -0
- package/tailwind/components/tracking/TwilightBundles.tsx.txt +67 -0
- package/tailwind/components/tracking/index.ts.txt +11 -0
- package/tailwind/components/tracking/lazy.ts.txt +11 -0
- package/tailwind/components/useComponent.ts.txt +12 -0
- package/tailwind/routes/account/index.tsx.txt +16 -0
- package/tailwind/routes/account/notifications/NotificationsPage.tsx.txt +54 -0
- package/tailwind/routes/account/notifications/index.tsx.txt +39 -0
- package/tailwind/routes/account/notifications/loader.ts.txt +22 -0
- package/tailwind/routes/account/notifications/types.ts.txt +18 -0
- package/tailwind/routes/account/orders/OrderSinglePage.tsx.txt +181 -0
- package/tailwind/routes/account/orders/OrdersPage.tsx.txt +28 -0
- package/tailwind/routes/account/orders/index.tsx.txt +86 -0
- package/tailwind/routes/account/orders/loader.ts.txt +66 -0
- package/tailwind/routes/account/orders/single/OrderActions.tsx.txt +197 -0
- package/tailwind/routes/account/orders/single/OrderHeader.tsx.txt +143 -0
- package/tailwind/routes/account/orders/single/OrderItemRow.tsx.txt +209 -0
- package/tailwind/routes/account/orders/single/OrderSections.tsx.txt +215 -0
- package/tailwind/routes/account/orders/single/types.ts.txt +38 -0
- package/tailwind/routes/account/orders/types.ts.txt +29 -0
- package/tailwind/routes/account/profile/ProfilePage.tsx.txt +30 -0
- package/tailwind/routes/account/profile/index.tsx.txt +39 -0
- package/tailwind/routes/account/profile/loader.ts.txt +16 -0
- package/tailwind/routes/account/profile/types.ts.txt +5 -0
- package/tailwind/routes/account/settings/SettingsPage.tsx.txt +13 -0
- package/tailwind/routes/account/settings/index.tsx.txt +39 -0
- package/tailwind/routes/account/settings/loader.ts.txt +13 -0
- package/tailwind/routes/account/settings/types.ts.txt +5 -0
- package/tailwind/routes/account/types.ts.txt +320 -0
- package/tailwind/routes/account/wallet/WalletPage.tsx.txt +195 -0
- package/tailwind/routes/account/wallet/index.tsx.txt +38 -0
- package/tailwind/routes/account/wallet/loader.ts.txt +27 -0
- package/tailwind/routes/account/wallet/types.ts.txt +11 -0
- package/tailwind/routes/account/wishlist/WishlistPage.tsx.txt +314 -0
- package/tailwind/routes/account/wishlist/WishlistShare.tsx.txt +248 -0
- package/tailwind/routes/account/wishlist/index.tsx.txt +40 -0
- package/tailwind/routes/account/wishlist/loader.ts.txt +26 -0
- package/tailwind/routes/account/wishlist/types.ts.txt +9 -0
- package/tailwind/routes/blog/BlogAuthorPage.tsx.txt +82 -0
- package/tailwind/routes/blog/BlogCategoryPage.tsx.txt +84 -0
- package/tailwind/routes/blog/BlogPage.tsx.txt +191 -0
- package/tailwind/routes/blog/BlogSinglePage.tsx.txt +168 -0
- package/tailwind/routes/blog/BlogTagPage.tsx.txt +84 -0
- package/tailwind/routes/blog/BlogTags.tsx.txt +54 -0
- package/tailwind/routes/blog/components.tsx.txt +87 -0
- package/tailwind/routes/blog/index.tsx.txt +238 -0
- package/tailwind/routes/blog/loader.ts.txt +173 -0
- package/tailwind/routes/blog/types.ts.txt +106 -0
- package/tailwind/routes/brands/BrandsPage.tsx.txt +179 -0
- package/tailwind/routes/brands/index.tsx.txt +47 -0
- package/tailwind/routes/brands/loader.ts.txt +14 -0
- package/tailwind/routes/brands/types.ts.txt +53 -0
- package/tailwind/routes/cart/CartPage.tsx.txt +112 -0
- package/tailwind/routes/cart/index.tsx.txt +39 -0
- package/tailwind/routes/cart/loader.ts.txt +15 -0
- package/tailwind/routes/cart/types.ts.txt +6 -0
- package/tailwind/routes/home/HomePage.tsx.txt +53 -0
- package/tailwind/routes/home/index.tsx.txt +56 -0
- package/tailwind/routes/home/loader.ts.txt +24 -0
- package/tailwind/routes/home/types.ts.txt +11 -0
- package/tailwind/routes/index.ts.txt +94 -0
- package/tailwind/routes/lazy.ts.txt +105 -0
- package/tailwind/routes/loyalty/LoyaltyPage.tsx.txt +17 -0
- package/tailwind/routes/loyalty/LoyaltyPointsPage.tsx.txt +11 -0
- package/tailwind/routes/loyalty/index.tsx.txt +81 -0
- package/tailwind/routes/loyalty/loader.ts.txt +53 -0
- package/tailwind/routes/loyalty/types.ts.txt +109 -0
- package/tailwind/routes/not-found.tsx.txt +50 -0
- package/tailwind/routes/page/PageSingle.tsx.txt +34 -0
- package/tailwind/routes/page/index.tsx.txt +60 -0
- package/tailwind/routes/page/loader.ts.txt +19 -0
- package/tailwind/routes/page/types.ts.txt +34 -0
- package/tailwind/routes/product/ProductPage.tsx.txt +77 -0
- package/tailwind/routes/product/index.tsx.txt +157 -0
- package/tailwind/routes/product/loader.ts.txt +35 -0
- package/tailwind/routes/product/types.ts.txt +6 -0
- package/tailwind/routes/product-listing/ProductListPage.tsx.txt +321 -0
- package/tailwind/routes/product-listing/index.tsx.txt +95 -0
- package/tailwind/routes/product-listing/loader.ts.txt +323 -0
- package/tailwind/routes/product-listing/types.ts.txt +96 -0
- package/tailwind/routes/product-listing/useAppliedFilters.ts.txt +130 -0
- package/tailwind/routes/product-short-link.ts.txt +104 -0
- package/tailwind/routes/root/beforeLoad.ts.txt +354 -0
- package/tailwind/routes/root/head.ts.txt +424 -0
- package/tailwind/routes/root/index.ts.txt +2 -0
- package/tailwind/routes/seo-redirects.ts.txt +82 -0
- package/tailwind/routes/testimonials/ReviewsPage.tsx.txt +12 -0
- package/tailwind/routes/testimonials/TestimonialsPage.tsx.txt +80 -0
- package/tailwind/routes/testimonials/index.tsx.txt +80 -0
- package/tailwind/routes/testimonials/loader.ts.txt +29 -0
- package/tailwind/routes/testimonials/types.ts.txt +9 -0
- package/tailwind/routes/thank-you/ThankYouPage.tsx.txt +241 -0
- package/tailwind/routes/thank-you/index.tsx.txt +49 -0
- package/tailwind/routes/thank-you/loader.ts.txt +40 -0
- package/tailwind/routes/thank-you/types.ts.txt +16 -0
- package/tailwind/routes/types.ts.txt +41 -0
- package/dist/BlogAuthorPage-GTF4UGSS.js.map +0 -1
- package/dist/BlogCategoryPage-TN7Y4NBP.js.map +0 -1
- package/dist/BlogPage-TDB3M3PI.js.map +0 -1
- package/dist/BlogSinglePage-4A52Q5QW.js.map +0 -1
- package/dist/BlogTagPage-TOVPBETA.js.map +0 -1
- package/dist/BrandsPage-VUDGYSQI.js.map +0 -1
- package/dist/Breadcrumb-CI3SN5YR.js.map +0 -1
- package/dist/CartItem-BHLEURAB.js.map +0 -1
- package/dist/CartSummary-QERVESYN.js.map +0 -1
- package/dist/CustomerLayout-VRZUWGQK.js.map +0 -1
- package/dist/LoyaltyPage-CGTHWJ76.js.map +0 -1
- package/dist/LoyaltyPointsPage-QSU6K3PW.js.map +0 -1
- package/dist/MobileMenu-U4BVQYKH.js.map +0 -1
- package/dist/NotificationsPage-ZRRQY7TF.js.map +0 -1
- package/dist/OrderSinglePage-O3XYVMG5.js.map +0 -1
- package/dist/OrdersPage-CMXZF5MI.js.map +0 -1
- package/dist/ProductDetails-65GDABI7.js.map +0 -1
- package/dist/ProfilePage-SNJ4WXU4.js.map +0 -1
- package/dist/SeoCartWidget-DBJAXJKT.js.map +0 -1
- package/dist/SettingsPage-FLTIOPU5.js.map +0 -1
- package/dist/ThankYouPage-5X6B4X3T.js.map +0 -1
- package/dist/WalletPage-H2BKIDPA.js.map +0 -1
- package/dist/WishlistPage-RS5UCIQ3.js.map +0 -1
- package/dist/chunk-4CZRUAZB.js.map +0 -1
- package/dist/chunk-7WAXN2PP.js +0 -14
- package/dist/chunk-JO7JWV34.js.map +0 -1
- package/dist/chunk-NZVR4OF7.js.map +0 -1
- package/dist/chunk-SDFDS4Q3.js.map +0 -1
- package/dist/not-found-QTHBFPNT.js.map +0 -1
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { useRef, useCallback } from 'react';
|
|
2
|
+
import { ItemsList } from '@salla.sa/twilight-components-react';
|
|
3
|
+
import { HookSlot } from '../../hooks';
|
|
4
|
+
import { useTranslation } from '../../providers/I18nProvider';
|
|
5
|
+
import { useLocation } from '../../providers/NavigationProvider';
|
|
6
|
+
import { Breadcrumb, NoContent } from '../../components/common';
|
|
7
|
+
import { blog } from '../../api/blog';
|
|
8
|
+
import { BlogArticleCard, BlogListLayout } from './components';
|
|
9
|
+
import type { BlogAuthorLoaderData, ArticleSummary } from './types';
|
|
10
|
+
|
|
11
|
+
const EMPTY_CATEGORIES: BlogAuthorLoaderData['categories'] = [];
|
|
12
|
+
const EMPTY_ARTICLES: ArticleSummary[] = [];
|
|
13
|
+
|
|
14
|
+
export function BlogAuthorPage({
|
|
15
|
+
page,
|
|
16
|
+
author,
|
|
17
|
+
categories = EMPTY_CATEGORIES,
|
|
18
|
+
articles = EMPTY_ARTICLES,
|
|
19
|
+
cursor,
|
|
20
|
+
}: BlogAuthorLoaderData) {
|
|
21
|
+
const { t } = useTranslation();
|
|
22
|
+
const { pathname, searchStr } = useLocation();
|
|
23
|
+
const nextCursorRef = useRef<string | null>(cursor?.next ?? null);
|
|
24
|
+
|
|
25
|
+
const loader = useCallback(async () => {
|
|
26
|
+
const nextUrl = nextCursorRef.current;
|
|
27
|
+
const cursorMatch = nextUrl?.match(/[?&]cursor=([^&]+)/);
|
|
28
|
+
const cursorValue = cursorMatch ? decodeURIComponent(cursorMatch[1]) : (nextUrl ?? undefined);
|
|
29
|
+
|
|
30
|
+
const result = await blog.articles.list({ author: String(page.id), cursor: cursorValue });
|
|
31
|
+
nextCursorRef.current = result.cursor?.next ?? null;
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
items: result.data,
|
|
35
|
+
next: result.cursor?.next ?? null,
|
|
36
|
+
};
|
|
37
|
+
}, [page.id]);
|
|
38
|
+
|
|
39
|
+
if (articles.length === 0) {
|
|
40
|
+
return (
|
|
41
|
+
<div className="container mb-8 sm:mb-24">
|
|
42
|
+
<Breadcrumb page={page} />
|
|
43
|
+
<BlogListLayout categories={categories}>
|
|
44
|
+
<HookSlot name="blog:author.start" />
|
|
45
|
+
<NoContent icon="sicon-inbox" message={t('pages.blog_categories.no_articles')} />
|
|
46
|
+
<HookSlot name="blog:author.end" />
|
|
47
|
+
</BlogListLayout>
|
|
48
|
+
</div>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<div className="container mb-8 sm:mb-24">
|
|
54
|
+
<Breadcrumb page={page} />
|
|
55
|
+
|
|
56
|
+
<BlogListLayout categories={categories}>
|
|
57
|
+
<HookSlot name="blog:author.start" />
|
|
58
|
+
|
|
59
|
+
<div className="mb-6">
|
|
60
|
+
<h1 className="font-bold text-xl">{author.name}</h1>
|
|
61
|
+
</div>
|
|
62
|
+
|
|
63
|
+
<ItemsList<ArticleSummary>
|
|
64
|
+
items={articles}
|
|
65
|
+
loader={cursor?.next ? loader : undefined}
|
|
66
|
+
mode={cursor?.next ? 'infinite' : 'static'}
|
|
67
|
+
pageUrl={pathname + searchStr}
|
|
68
|
+
className="s-blog-list"
|
|
69
|
+
itemsClassName="grid md:grid-cols-2 gap-2.5 md:gap-8"
|
|
70
|
+
empty={<NoContent icon="sicon-inbox" message={t('pages.blog_categories.no_articles')} />}
|
|
71
|
+
t={(key, fallback) => t(key, fallback || key)}
|
|
72
|
+
>
|
|
73
|
+
{(items) =>
|
|
74
|
+
items.map((article) => <BlogArticleCard key={article.id} article={article} />)
|
|
75
|
+
}
|
|
76
|
+
</ItemsList>
|
|
77
|
+
|
|
78
|
+
<HookSlot name="blog:author.end" />
|
|
79
|
+
</BlogListLayout>
|
|
80
|
+
</div>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { useRef, useCallback } from 'react';
|
|
2
|
+
import { ItemsList } from '@salla.sa/twilight-components-react';
|
|
3
|
+
import { HookSlot } from '../../hooks';
|
|
4
|
+
import { useTranslation } from '../../providers/I18nProvider';
|
|
5
|
+
import { useLocation } from '../../providers/NavigationProvider';
|
|
6
|
+
import { Breadcrumb, NoContent } from '../../components/common';
|
|
7
|
+
import { blog } from '../../api/blog';
|
|
8
|
+
import { BlogArticleCard, BlogListLayout } from './components';
|
|
9
|
+
import type { BlogCategoryLoaderData, ArticleSummary } from './types';
|
|
10
|
+
|
|
11
|
+
const EMPTY_CATEGORIES: BlogCategoryLoaderData['categories'] = [];
|
|
12
|
+
const EMPTY_ARTICLES: ArticleSummary[] = [];
|
|
13
|
+
|
|
14
|
+
export function BlogCategoryPage({
|
|
15
|
+
page,
|
|
16
|
+
blogCategory,
|
|
17
|
+
categories = EMPTY_CATEGORIES,
|
|
18
|
+
articles = EMPTY_ARTICLES,
|
|
19
|
+
cursor,
|
|
20
|
+
}: BlogCategoryLoaderData) {
|
|
21
|
+
const { t } = useTranslation();
|
|
22
|
+
const { pathname, searchStr } = useLocation();
|
|
23
|
+
const nextCursorRef = useRef<string | null>(cursor?.next ?? null);
|
|
24
|
+
|
|
25
|
+
const loader = useCallback(async () => {
|
|
26
|
+
const nextUrl = nextCursorRef.current;
|
|
27
|
+
const cursorMatch = nextUrl?.match(/[?&]cursor=([^&]+)/);
|
|
28
|
+
const cursorValue = cursorMatch ? decodeURIComponent(cursorMatch[1]) : (nextUrl ?? undefined);
|
|
29
|
+
|
|
30
|
+
const result = await blog.articles.list({ category: blogCategory.id, cursor: cursorValue });
|
|
31
|
+
nextCursorRef.current = result.cursor?.next ?? null;
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
items: result.data,
|
|
35
|
+
next: result.cursor?.next ?? null,
|
|
36
|
+
};
|
|
37
|
+
}, [blogCategory.id]);
|
|
38
|
+
|
|
39
|
+
if (articles.length === 0) {
|
|
40
|
+
return (
|
|
41
|
+
<div className="container mb-8 sm:mb-24">
|
|
42
|
+
<Breadcrumb page={page} />
|
|
43
|
+
<BlogListLayout categories={categories}>
|
|
44
|
+
<HookSlot name="blog:category.start" />
|
|
45
|
+
<NoContent icon="sicon-inbox" message={t('pages.blog_categories.no_articles')} />
|
|
46
|
+
<HookSlot name="blog:category.end" />
|
|
47
|
+
</BlogListLayout>
|
|
48
|
+
</div>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<div className="container mb-8 sm:mb-24">
|
|
54
|
+
<Breadcrumb page={page} />
|
|
55
|
+
|
|
56
|
+
<BlogListLayout categories={categories}>
|
|
57
|
+
<HookSlot name="blog:category.start" />
|
|
58
|
+
|
|
59
|
+
<div className="mb-6">
|
|
60
|
+
<h1 className="font-bold text-xl">{blogCategory.name}</h1>
|
|
61
|
+
</div>
|
|
62
|
+
|
|
63
|
+
<ItemsList<ArticleSummary>
|
|
64
|
+
items={articles}
|
|
65
|
+
loader={cursor?.next ? loader : undefined}
|
|
66
|
+
mode={cursor?.next ? 'infinite' : 'static'}
|
|
67
|
+
pageUrl={pathname + searchStr}
|
|
68
|
+
className="s-blog-list"
|
|
69
|
+
itemsClassName="grid md:grid-cols-2 gap-2.5 md:gap-8"
|
|
70
|
+
empty={<NoContent icon="sicon-inbox" message={t('pages.blog_categories.no_articles')} />}
|
|
71
|
+
t={(key, fallback) => t(key, fallback || key)}
|
|
72
|
+
>
|
|
73
|
+
{(items) =>
|
|
74
|
+
items.map((article) => (
|
|
75
|
+
<BlogArticleCard key={article.id} article={article} showAuthor />
|
|
76
|
+
))
|
|
77
|
+
}
|
|
78
|
+
</ItemsList>
|
|
79
|
+
|
|
80
|
+
<HookSlot name="blog:category.end" />
|
|
81
|
+
</BlogListLayout>
|
|
82
|
+
</div>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { SallaSlider } from '@salla.sa/twilight-components-react/slider';
|
|
2
|
+
import { HookSlot, useDate } from '../../hooks';
|
|
3
|
+
import { useTranslation } from '../../providers/I18nProvider';
|
|
4
|
+
import type { BlogPageProps, ArticleSummary } from './types';
|
|
5
|
+
import { Breadcrumb, NoContent, Link, Image } from '../../components/common';
|
|
6
|
+
import { BlogTags } from './BlogTags';
|
|
7
|
+
|
|
8
|
+
const EMPTY_CATEGORIES: NonNullable<BlogPageProps['categories']> = [];
|
|
9
|
+
const EMPTY_ARTICLES: ArticleSummary[] = [];
|
|
10
|
+
const EMPTY_SLIDES: NonNullable<BlogPageProps['slides']> = [];
|
|
11
|
+
|
|
12
|
+
export function BlogPage({
|
|
13
|
+
page,
|
|
14
|
+
categories = EMPTY_CATEGORIES,
|
|
15
|
+
articles = EMPTY_ARTICLES,
|
|
16
|
+
slides = EMPTY_SLIDES,
|
|
17
|
+
}: BlogPageProps) {
|
|
18
|
+
const { t } = useTranslation();
|
|
19
|
+
const { format: formatDate } = useDate();
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<div className="container mb-8 sm:mb-24">
|
|
23
|
+
<div className="center-between">
|
|
24
|
+
<Breadcrumb page={page} />
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<div className="grid grid-cols-1 lg:grid-cols-8 gap-8">
|
|
28
|
+
<nav aria-label="Sidebar" className="hidden lg:block lg:sticky shrink-0 top-24 col-span-2">
|
|
29
|
+
<h2 className="font-bold mb-3">{t('pages.blog_categories.categories')}</h2>
|
|
30
|
+
<ul>
|
|
31
|
+
{categories.map((category) => (
|
|
32
|
+
<li key={category.id} className={category.is_current ? 'text-primary' : ''}>
|
|
33
|
+
<Link className="py-3 block text-sm hover:text-primary" to={category.url}>
|
|
34
|
+
{category.name}
|
|
35
|
+
</Link>
|
|
36
|
+
</li>
|
|
37
|
+
))}
|
|
38
|
+
</ul>
|
|
39
|
+
</nav>
|
|
40
|
+
|
|
41
|
+
<div className="main-content lg:col-span-6">
|
|
42
|
+
<HookSlot name="blog:start" />
|
|
43
|
+
|
|
44
|
+
{slides.length > 0 && (
|
|
45
|
+
<SallaSlider
|
|
46
|
+
id="blog-home-slider"
|
|
47
|
+
type="blog"
|
|
48
|
+
autoPlay
|
|
49
|
+
autoHeight
|
|
50
|
+
showControls={false}
|
|
51
|
+
pagination
|
|
52
|
+
className="blog-slider block rounded overflow-hidden mb-2.5 lg:mb-8"
|
|
53
|
+
sliderConfig={{ watchOverflow: true }}
|
|
54
|
+
>
|
|
55
|
+
<div slot="items">
|
|
56
|
+
{slides.map((article, index) => (
|
|
57
|
+
<div
|
|
58
|
+
key={article.id}
|
|
59
|
+
className="swiper-slide has-overlay blog-slider__slide h-[300px] md:h-[400px] relative bg-border-color flex justify-center"
|
|
60
|
+
>
|
|
61
|
+
<Image
|
|
62
|
+
className="object-cover h-full w-full"
|
|
63
|
+
src={article.image}
|
|
64
|
+
alt={article.name}
|
|
65
|
+
aspectRatio="3/1"
|
|
66
|
+
priority={index === 0}
|
|
67
|
+
/>
|
|
68
|
+
<div className="absolute z-10 bottom-0 rtl:right-0 ltr:left-0 p-4 pb-10 rtl:lg:pr-10 ltr:lg:pl-10 lg:pb-20">
|
|
69
|
+
<div className="blog-slider__content relative">
|
|
70
|
+
<div className="z-20 w-full md:w-5/6 lg:w-6/12 text-white">
|
|
71
|
+
<div className="block-slide-anime">
|
|
72
|
+
<div className="mb-2.5 rounded-md inline-flex text-sm rtl:space-x-reverse space-x-5">
|
|
73
|
+
<div className="flex items-center">
|
|
74
|
+
<i className="sicon-calendar-date rtl:ml-1 ltr:mr-1"></i>
|
|
75
|
+
<span className="whitespace-nowrap">
|
|
76
|
+
{formatDate(article.created_at)}
|
|
77
|
+
</span>
|
|
78
|
+
</div>
|
|
79
|
+
<Link
|
|
80
|
+
to={article.author?.url || '#'}
|
|
81
|
+
className="flex items-center hover:underline"
|
|
82
|
+
>
|
|
83
|
+
<i className="sicon-user rtl:ml-1 ltr:mr-1"></i>
|
|
84
|
+
<span className="whitespace-nowrap">{article.author?.name}</span>
|
|
85
|
+
</Link>
|
|
86
|
+
</div>
|
|
87
|
+
<h3 className="text-sm font-bold leading-normal mb-4">
|
|
88
|
+
<Link to={article.url}>{article.name}</Link>
|
|
89
|
+
</h3>
|
|
90
|
+
</div>
|
|
91
|
+
<p className="line-clamp-2 block-slide-anime description">
|
|
92
|
+
{article.description}
|
|
93
|
+
</p>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
))}
|
|
99
|
+
</div>
|
|
100
|
+
</SallaSlider>
|
|
101
|
+
)}
|
|
102
|
+
|
|
103
|
+
{!slides.length && (
|
|
104
|
+
<div className="sr-only lg:not-sr-only">
|
|
105
|
+
<h1 className="blog-category__title font-bold text-lg mb-8">
|
|
106
|
+
{t('blocks.footer.blog')}
|
|
107
|
+
</h1>
|
|
108
|
+
</div>
|
|
109
|
+
)}
|
|
110
|
+
|
|
111
|
+
{slides.length > 0 && <h1 className="sr-only">{t('blocks.footer.blog')}</h1>}
|
|
112
|
+
|
|
113
|
+
{articles.length > 0 ? (
|
|
114
|
+
<>
|
|
115
|
+
<HookSlot name="blog:items.start" />
|
|
116
|
+
<div className="grid md:grid-cols-2 gap-2.5 md:gap-8">
|
|
117
|
+
{articles.map((article) => (
|
|
118
|
+
<div
|
|
119
|
+
key={article.id}
|
|
120
|
+
className="list-block post-entry relative h-full transition-shadow duration-500 bg-white hover:shadow-default rounded-lg justify-around overflow-hidden flex flex-col"
|
|
121
|
+
>
|
|
122
|
+
<Link
|
|
123
|
+
to={article.url}
|
|
124
|
+
className="post-entry__image relative overflow-hidden hover:opacity-90 w-full h-56 bg-border-color flex items-center justify-center"
|
|
125
|
+
>
|
|
126
|
+
<Image
|
|
127
|
+
className="h-full w-full object-cover"
|
|
128
|
+
src={article.image}
|
|
129
|
+
alt={article.name}
|
|
130
|
+
aspectRatio="16/9"
|
|
131
|
+
/>
|
|
132
|
+
</Link>
|
|
133
|
+
|
|
134
|
+
<div className="flex-1 px-5 pt-5 pb-7">
|
|
135
|
+
<div className="mb-2.5 text-gray-500 rounded-md inline-flex text-sm rtl:space-x-reverse space-x-5">
|
|
136
|
+
<div className="flex items-center">
|
|
137
|
+
<i className="sicon-calendar-date rtl:ml-1 ltr:mr-1"></i>
|
|
138
|
+
<span>{formatDate(article.created_at)}</span>
|
|
139
|
+
</div>
|
|
140
|
+
<Link
|
|
141
|
+
to={article.author?.url || '#'}
|
|
142
|
+
className="flex items-center hover:text-dark"
|
|
143
|
+
>
|
|
144
|
+
<i className="sicon-user rtl:ml-1 ltr:mr-1"></i>
|
|
145
|
+
<span>{article.author?.name}</span>
|
|
146
|
+
</Link>
|
|
147
|
+
</div>
|
|
148
|
+
|
|
149
|
+
<h3 className="post-entry__title text-sm font-bold text-gray-800 leading-6 mb-2.5">
|
|
150
|
+
<Link to={article.url}>{article.name}</Link>
|
|
151
|
+
</h3>
|
|
152
|
+
<p className="text-sm text-gray-500 leading-6 mb-2.5">
|
|
153
|
+
{article.description}
|
|
154
|
+
</p>
|
|
155
|
+
|
|
156
|
+
{((article.stats?.likes ?? 0) > 0 || (article.stats?.comments ?? 0) > 0) && (
|
|
157
|
+
<div className="post-entry__icons flex items-center gap-2.5 text-gray-500 text-sm">
|
|
158
|
+
{(article.stats?.likes ?? 0) > 0 && (
|
|
159
|
+
<div className="flex items-center gap-1">
|
|
160
|
+
<i className="sicon-thumbs-up"></i>
|
|
161
|
+
{article.stats?.likes}
|
|
162
|
+
</div>
|
|
163
|
+
)}
|
|
164
|
+
{(article.stats?.comments ?? 0) > 0 && (
|
|
165
|
+
<div className="flex items-center gap-1">
|
|
166
|
+
<i className="sicon-chat"></i>
|
|
167
|
+
{article.stats?.comments}
|
|
168
|
+
</div>
|
|
169
|
+
)}
|
|
170
|
+
</div>
|
|
171
|
+
)}
|
|
172
|
+
</div>
|
|
173
|
+
|
|
174
|
+
{article.tags && <BlogTags tags={article.tags} />}
|
|
175
|
+
</div>
|
|
176
|
+
))}
|
|
177
|
+
</div>
|
|
178
|
+
<HookSlot name="blog:items.end" />
|
|
179
|
+
</>
|
|
180
|
+
) : (
|
|
181
|
+
!slides.length && (
|
|
182
|
+
<NoContent icon="sicon-inbox" message={t('pages.blog_categories.no_articles')} />
|
|
183
|
+
)
|
|
184
|
+
)}
|
|
185
|
+
|
|
186
|
+
<HookSlot name="blog:end" />
|
|
187
|
+
</div>
|
|
188
|
+
</div>
|
|
189
|
+
</div>
|
|
190
|
+
);
|
|
191
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { SallaComments } from '@salla.sa/twilight-components-react/comments';
|
|
2
|
+
import { HookSlot, useAsset, useDate } from '../../hooks';
|
|
3
|
+
import { useBlogLike } from '../../hooks/useBlogLike';
|
|
4
|
+
import { useComments } from '../../hooks/useComments';
|
|
5
|
+
import { useTranslation } from '../../providers/I18nProvider';
|
|
6
|
+
import type { BlogSinglePageProps } from './types';
|
|
7
|
+
import { Breadcrumb, Image, Link } from '../../components/common';
|
|
8
|
+
import { useTwilight } from '../../providers/twilight-context';
|
|
9
|
+
|
|
10
|
+
export function BlogSinglePage({ page, article, related = [] }: BlogSinglePageProps) {
|
|
11
|
+
const { t } = useTranslation();
|
|
12
|
+
const { store } = useTwilight();
|
|
13
|
+
const { cdn } = useAsset();
|
|
14
|
+
const { format: formatDate } = useDate();
|
|
15
|
+
const { active, count, toggle, loading } = useBlogLike(
|
|
16
|
+
Number(article.id) || 0,
|
|
17
|
+
article.stats?.likes ?? 0
|
|
18
|
+
);
|
|
19
|
+
const { commentsKey } = useComments();
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<div key={article.id} className="container mb-8 sm:mb-24">
|
|
23
|
+
<Breadcrumb page={page} />
|
|
24
|
+
|
|
25
|
+
<div className="md:flex items-start">
|
|
26
|
+
<div className="main-content blog-category md:w-96 flex-1 bg-white lg:p-8 rounded-md mb-10 md:mb-0">
|
|
27
|
+
<HookSlot name="blog:single.start" />
|
|
28
|
+
|
|
29
|
+
<h1 className="font-bold text-3xl mb-5 leading-10">{article.name}</h1>
|
|
30
|
+
|
|
31
|
+
<div className="mb-10 text-gray-500 rounded-md inline-flex text-sm rtl:space-x-reverse space-x-5">
|
|
32
|
+
<div className="flex items-center">
|
|
33
|
+
<i className="sicon-calendar-date rtl:ml-1 ltr:mr-1"></i>
|
|
34
|
+
<span>{formatDate(article.created_at)}</span>
|
|
35
|
+
</div>
|
|
36
|
+
<Link to={article.author?.url || '#'} className="flex items-center hover:text-dark">
|
|
37
|
+
<i className="sicon-user rtl:ml-1 ltr:mr-1"></i>
|
|
38
|
+
<span>{article.author?.name}</span>
|
|
39
|
+
</Link>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
{article.image && (
|
|
43
|
+
<Image
|
|
44
|
+
src={article.image}
|
|
45
|
+
alt={article.name}
|
|
46
|
+
className="h-80 mb-10 w-full rounded-md"
|
|
47
|
+
aspectRatio="16/9"
|
|
48
|
+
priority
|
|
49
|
+
noWrapper
|
|
50
|
+
/>
|
|
51
|
+
)}
|
|
52
|
+
|
|
53
|
+
{store.settings?.blog?.allow_likes_and_comments && (
|
|
54
|
+
<div className="flex items-center gap-2.5 text-gray-500 text-base mb-2">
|
|
55
|
+
<button
|
|
56
|
+
type="button"
|
|
57
|
+
id="blog-like"
|
|
58
|
+
data-blog-id={article.id}
|
|
59
|
+
className={`flex items-center gap-1 transition-colors ${active ? 'text-primary font-semibold liked' : ''}`}
|
|
60
|
+
onClick={toggle}
|
|
61
|
+
disabled={loading}
|
|
62
|
+
>
|
|
63
|
+
{loading ? (
|
|
64
|
+
<span className="loader loader--small"></span>
|
|
65
|
+
) : (
|
|
66
|
+
<i className={`sicon-thumbs-up ${active ? 'text-primary' : ''}`}></i>
|
|
67
|
+
)}
|
|
68
|
+
<span>{count}</span>
|
|
69
|
+
</button>
|
|
70
|
+
{(article.stats?.comments ?? 0) > 0 && (
|
|
71
|
+
<div className="flex items-center gap-1">
|
|
72
|
+
<i className="sicon-chat text-primary"></i>
|
|
73
|
+
{article.stats?.comments}
|
|
74
|
+
</div>
|
|
75
|
+
)}
|
|
76
|
+
</div>
|
|
77
|
+
)}
|
|
78
|
+
|
|
79
|
+
<article
|
|
80
|
+
className="leading-7 text-sm mb-10"
|
|
81
|
+
dangerouslySetInnerHTML={{ __html: article.description?.replace(/ /g, ' ') || '' }}
|
|
82
|
+
/>
|
|
83
|
+
|
|
84
|
+
{article.tags && article.tags.length > 0 && (
|
|
85
|
+
<div className="p-4 flex flex-wrap items-center border-t border-gray-200">
|
|
86
|
+
{article.tags.map((tag) => (
|
|
87
|
+
<Link
|
|
88
|
+
key={tag.id}
|
|
89
|
+
to={tag.url}
|
|
90
|
+
className="py-2 px-4 rounded-large inline-flex items-center text-gray-500 hover:text-dark justify-center text-sm"
|
|
91
|
+
>
|
|
92
|
+
<i className="font-medium sicon-tag rtl:ml-1.5 ltr:mr-1.5"></i>
|
|
93
|
+
<span className="fix-align whitespace-nowrap">{tag.name}</span>
|
|
94
|
+
</Link>
|
|
95
|
+
))}
|
|
96
|
+
</div>
|
|
97
|
+
)}
|
|
98
|
+
|
|
99
|
+
{store.settings?.blog?.allow_likes_and_comments && (
|
|
100
|
+
<SallaComments
|
|
101
|
+
key={commentsKey}
|
|
102
|
+
itemId={Number(article.id) || 0}
|
|
103
|
+
type={'blog' as any}
|
|
104
|
+
/>
|
|
105
|
+
)}
|
|
106
|
+
|
|
107
|
+
<HookSlot name="blog:single.end" />
|
|
108
|
+
</div>
|
|
109
|
+
|
|
110
|
+
<aside
|
|
111
|
+
aria-label="Sidebar"
|
|
112
|
+
className="sticky shrink-0 top-24 md:w-96 rtl:lg:mr-8 ltr:lg:ml-8 pb-11"
|
|
113
|
+
>
|
|
114
|
+
{related.length > 0 && (
|
|
115
|
+
<>
|
|
116
|
+
<h2 className="font-bold mb-3">{t('pages.blog_articles.related')}</h2>
|
|
117
|
+
|
|
118
|
+
<HookSlot name="blog:single.related.start" />
|
|
119
|
+
|
|
120
|
+
{related.map((relatedArticle) => (
|
|
121
|
+
<div
|
|
122
|
+
key={relatedArticle.id}
|
|
123
|
+
className="mt-5 flex items-center bg-white p-5 rounded-md"
|
|
124
|
+
>
|
|
125
|
+
<div className="shrink-0">
|
|
126
|
+
<Link
|
|
127
|
+
to={relatedArticle.url}
|
|
128
|
+
className="bg-border-color h-24 w-24 rounded-md overflow-hidden flex items-center justify-center"
|
|
129
|
+
>
|
|
130
|
+
<span className="sr-only">{relatedArticle.name}</span>
|
|
131
|
+
{relatedArticle.image ? (
|
|
132
|
+
<Image
|
|
133
|
+
className="h-full w-full object-cover"
|
|
134
|
+
src={relatedArticle.image}
|
|
135
|
+
alt={relatedArticle.name}
|
|
136
|
+
aspectRatio="1/1"
|
|
137
|
+
/>
|
|
138
|
+
) : (
|
|
139
|
+
<Image
|
|
140
|
+
className="sm:h-full w-10 object-contain opacity-60"
|
|
141
|
+
src={cdn('/images/placeholder.png')}
|
|
142
|
+
alt="post image"
|
|
143
|
+
/>
|
|
144
|
+
)}
|
|
145
|
+
</Link>
|
|
146
|
+
</div>
|
|
147
|
+
<div className="rtl:mr-3 ltr:ml-3">
|
|
148
|
+
<div className="flex items-center text-sm text-gray-500 mb-2">
|
|
149
|
+
<i className="sicon-calendar-date rtl:ml-1 ltr:mr-1 rtl:pl-px ltr:pr-px"></i>
|
|
150
|
+
<time>{formatDate(relatedArticle.created_at)}</time>
|
|
151
|
+
</div>
|
|
152
|
+
<h3 className="text-sm font-bold text-gray-800 leading-6">
|
|
153
|
+
<Link to={relatedArticle.url} className="hover:underline">
|
|
154
|
+
{relatedArticle.name}
|
|
155
|
+
</Link>
|
|
156
|
+
</h3>
|
|
157
|
+
</div>
|
|
158
|
+
</div>
|
|
159
|
+
))}
|
|
160
|
+
|
|
161
|
+
<HookSlot name="blog:single.related.end" />
|
|
162
|
+
</>
|
|
163
|
+
)}
|
|
164
|
+
</aside>
|
|
165
|
+
</div>
|
|
166
|
+
</div>
|
|
167
|
+
);
|
|
168
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { useRef, useCallback } from 'react';
|
|
2
|
+
import { ItemsList } from '@salla.sa/twilight-components-react';
|
|
3
|
+
import { HookSlot } from '../../hooks';
|
|
4
|
+
import { useTranslation } from '../../providers/I18nProvider';
|
|
5
|
+
import { useLocation } from '../../providers/NavigationProvider';
|
|
6
|
+
import { Breadcrumb, NoContent } from '../../components/common';
|
|
7
|
+
import { blog } from '../../api/blog';
|
|
8
|
+
import { BlogArticleCard, BlogListLayout } from './components';
|
|
9
|
+
import type { BlogTagLoaderData, ArticleSummary } from './types';
|
|
10
|
+
|
|
11
|
+
const EMPTY_CATEGORIES: BlogTagLoaderData['categories'] = [];
|
|
12
|
+
const EMPTY_ARTICLES: ArticleSummary[] = [];
|
|
13
|
+
|
|
14
|
+
export function BlogTagPage({
|
|
15
|
+
page,
|
|
16
|
+
blogTag,
|
|
17
|
+
categories = EMPTY_CATEGORIES,
|
|
18
|
+
articles = EMPTY_ARTICLES,
|
|
19
|
+
cursor,
|
|
20
|
+
}: BlogTagLoaderData) {
|
|
21
|
+
const { t } = useTranslation();
|
|
22
|
+
const { pathname, searchStr } = useLocation();
|
|
23
|
+
const nextCursorRef = useRef<string | null>(cursor?.next ?? null);
|
|
24
|
+
|
|
25
|
+
const loader = useCallback(async () => {
|
|
26
|
+
const nextUrl = nextCursorRef.current;
|
|
27
|
+
const cursorMatch = nextUrl?.match(/[?&]cursor=([^&]+)/);
|
|
28
|
+
const cursorValue = cursorMatch ? decodeURIComponent(cursorMatch[1]) : (nextUrl ?? undefined);
|
|
29
|
+
|
|
30
|
+
const result = await blog.articles.list({ tag: String(blogTag.id), cursor: cursorValue });
|
|
31
|
+
nextCursorRef.current = result.cursor?.next ?? null;
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
items: result.data,
|
|
35
|
+
next: result.cursor?.next ?? null,
|
|
36
|
+
};
|
|
37
|
+
}, [blogTag.id]);
|
|
38
|
+
|
|
39
|
+
if (articles.length === 0) {
|
|
40
|
+
return (
|
|
41
|
+
<div className="container mb-8 sm:mb-24">
|
|
42
|
+
<Breadcrumb page={page} />
|
|
43
|
+
<BlogListLayout categories={categories}>
|
|
44
|
+
<HookSlot name="blog:tag.start" />
|
|
45
|
+
<NoContent icon="sicon-inbox" message={t('pages.blog_categories.no_articles')} />
|
|
46
|
+
<HookSlot name="blog:tag.end" />
|
|
47
|
+
</BlogListLayout>
|
|
48
|
+
</div>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<div className="container mb-8 sm:mb-24">
|
|
54
|
+
<Breadcrumb page={page} />
|
|
55
|
+
|
|
56
|
+
<BlogListLayout categories={categories}>
|
|
57
|
+
<HookSlot name="blog:tag.start" />
|
|
58
|
+
|
|
59
|
+
<div className="mb-6">
|
|
60
|
+
<h1 className="font-bold text-xl">{blogTag.name}</h1>
|
|
61
|
+
</div>
|
|
62
|
+
|
|
63
|
+
<ItemsList<ArticleSummary>
|
|
64
|
+
items={articles}
|
|
65
|
+
loader={cursor?.next ? loader : undefined}
|
|
66
|
+
mode={cursor?.next ? 'infinite' : 'static'}
|
|
67
|
+
pageUrl={pathname + searchStr}
|
|
68
|
+
className="s-blog-list"
|
|
69
|
+
itemsClassName="grid md:grid-cols-2 gap-2.5 md:gap-8"
|
|
70
|
+
empty={<NoContent icon="sicon-inbox" message={t('pages.blog_categories.no_articles')} />}
|
|
71
|
+
t={(key, fallback) => t(key, fallback || key)}
|
|
72
|
+
>
|
|
73
|
+
{(items) =>
|
|
74
|
+
items.map((article) => (
|
|
75
|
+
<BlogArticleCard key={article.id} article={article} showAuthor />
|
|
76
|
+
))
|
|
77
|
+
}
|
|
78
|
+
</ItemsList>
|
|
79
|
+
|
|
80
|
+
<HookSlot name="blog:tag.end" />
|
|
81
|
+
</BlogListLayout>
|
|
82
|
+
</div>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { Link } from '../../components/common';
|
|
3
|
+
import { useTranslation } from '../../providers/I18nProvider';
|
|
4
|
+
import type { BlogTag } from './types';
|
|
5
|
+
|
|
6
|
+
/** Tags shown on a blog card before the rest fold behind a "+N" toggle. */
|
|
7
|
+
export const BLOG_CARD_VISIBLE_TAGS = 3;
|
|
8
|
+
|
|
9
|
+
interface BlogTagsProps {
|
|
10
|
+
tags: BlogTag[];
|
|
11
|
+
/** How many tags to show before folding the rest. */
|
|
12
|
+
visible?: number;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The tag row of a blog card. Articles can carry dozens of tags, which used to wrap into
|
|
17
|
+
* a wall of links and stretch the card; show the first few as compact chips and fold the
|
|
18
|
+
* rest behind a "+N" toggle that expands them in place (and "Show less" to fold back).
|
|
19
|
+
* Nothing folds when the tags fit.
|
|
20
|
+
*/
|
|
21
|
+
export function BlogTags({ tags, visible = BLOG_CARD_VISIBLE_TAGS }: BlogTagsProps) {
|
|
22
|
+
const { t } = useTranslation();
|
|
23
|
+
const [expanded, setExpanded] = useState(false);
|
|
24
|
+
|
|
25
|
+
if (tags.length === 0) return null;
|
|
26
|
+
|
|
27
|
+
const hiddenCount = Math.max(0, tags.length - visible);
|
|
28
|
+
const shown = expanded ? tags : tags.slice(0, visible);
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<div className="s-blog-tags p-4 flex flex-wrap items-center gap-2 border-t border-gray-200">
|
|
32
|
+
{shown.map((tag) => (
|
|
33
|
+
<Link
|
|
34
|
+
key={tag.id}
|
|
35
|
+
to={tag.url}
|
|
36
|
+
className="s-blog-tags-item py-1 px-3 rounded-full border border-gray-200 inline-flex items-center max-w-full text-gray-500 hover:text-dark hover:border-gray-300 text-xs"
|
|
37
|
+
>
|
|
38
|
+
<i className="font-medium sicon-tag rtl:ml-1.5 ltr:mr-1.5"></i>
|
|
39
|
+
<span className="fix-align truncate">{tag.name}</span>
|
|
40
|
+
</Link>
|
|
41
|
+
))}
|
|
42
|
+
{hiddenCount > 0 && (
|
|
43
|
+
<button
|
|
44
|
+
type="button"
|
|
45
|
+
className="s-blog-tags-more py-1 px-3 rounded-full text-xs font-medium text-primary hover:opacity-80"
|
|
46
|
+
aria-expanded={expanded}
|
|
47
|
+
onClick={() => setExpanded((open) => !open)}
|
|
48
|
+
>
|
|
49
|
+
{expanded ? t('common.elements.show_less', 'Show less') : `+${hiddenCount}`}
|
|
50
|
+
</button>
|
|
51
|
+
)}
|
|
52
|
+
</div>
|
|
53
|
+
);
|
|
54
|
+
}
|