cloudcommerce 0.37.0 → 0.38.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/.github/workflows/test-apps.yml +2 -2
- package/.gitmodules +0 -3
- package/.vscode/settings.json +1 -2
- package/CHANGELOG.md +50 -0
- package/action.yml +2 -2
- package/ecomplus-stores/barra-doce/functions/many/package.json +3 -3
- package/ecomplus-stores/barra-doce/functions/ssr/package.json +6 -6
- package/ecomplus-stores/barra-doce/functions/with-apps/package.json +3 -3
- package/ecomplus-stores/barra-doce/package.json +2 -2
- package/package.json +7 -7
- package/packages/api/lib/api.d.ts +2 -2
- package/packages/api/package.json +1 -1
- package/packages/api/types.d.ts +4 -1
- package/packages/apps/affilate-program/package.json +1 -1
- package/packages/apps/correios/package.json +1 -1
- package/packages/apps/custom-payment/package.json +1 -1
- package/packages/apps/custom-shipping/package.json +1 -1
- package/packages/apps/datafrete/package.json +1 -1
- package/packages/apps/discounts/package.json +1 -1
- package/packages/apps/emails/package.json +1 -1
- package/packages/apps/fb-conversions/package.json +1 -1
- package/packages/apps/flash-courier/package.json +1 -1
- package/packages/apps/frenet/package.json +1 -1
- package/packages/apps/galaxpay/package.json +1 -1
- package/packages/apps/google-analytics/package.json +1 -1
- package/packages/apps/jadlog/package.json +1 -1
- package/packages/apps/loyalty-points/package.json +1 -1
- package/packages/apps/mandae/package.json +1 -1
- package/packages/apps/melhor-envio/package.json +1 -1
- package/packages/apps/mercadopago/package.json +1 -1
- package/packages/apps/pagarme/package.json +1 -1
- package/packages/apps/pagarme-v5/package.json +1 -1
- package/packages/apps/paghiper/package.json +1 -1
- package/packages/apps/pix/package.json +1 -1
- package/packages/apps/tiny-erp/package.json +1 -1
- package/packages/apps/webhooks/package.json +1 -1
- package/packages/cli/config/firestore.rules +4 -1
- package/packages/cli/lib/cli.js +30 -9
- package/packages/cli/package.json +2 -1
- package/packages/cli/src/cli.ts +37 -9
- package/packages/config/package.json +1 -1
- package/packages/emails/package.json +1 -1
- package/packages/eslint/package.json +3 -3
- package/packages/events/package.json +1 -1
- package/packages/feeds/package.json +1 -1
- package/packages/firebase/package.json +1 -1
- package/packages/i18n/package.json +1 -1
- package/packages/modules/package.json +1 -1
- package/packages/passport/package.json +1 -1
- package/packages/ssr/package.json +5 -5
- package/packages/storefront/.auto-imports.d.ts +1 -0
- package/packages/storefront/client.d.ts +1 -0
- package/packages/storefront/config/storefront.tailwind.cjs +21 -20
- package/packages/storefront/config/storefront.unocss.cjs +11 -0
- package/packages/storefront/dist/client/_astro/{AccountPage.700be123.js → AccountPage.j0C5JBLY.js} +1 -1
- package/packages/storefront/dist/client/_astro/{CartSidebar.430b55df.js → CartSidebar.1kUFk9Xn.js} +1 -1
- package/packages/storefront/dist/client/_astro/HeroSlider.tR1dVXyu.js +1 -0
- package/packages/storefront/dist/client/_astro/{PitchBar.06e0f831.js → PitchBar.FelC04wE.js} +1 -1
- package/packages/storefront/dist/client/_astro/{Prices.0e829c31.js → Prices.PuQc6C7F.js} +1 -1
- package/packages/storefront/dist/client/_astro/ProductCard.ephJafAE.js +1 -0
- package/packages/storefront/dist/client/_astro/ProductDetails.B6Ih5MGf.js +7 -0
- package/packages/storefront/dist/client/_astro/ProductShelf.GESxuPZ_.js +1 -0
- package/packages/storefront/dist/client/_astro/{QuantitySelector.ebf60845.js → QuantitySelector.YNmWjN8y.js} +1 -1
- package/packages/storefront/dist/client/_astro/SearchContainer.BzixfU3R.js +1 -0
- package/packages/storefront/dist/client/_astro/SearchModal.F7vbwxIv.js +1 -0
- package/packages/storefront/dist/client/_astro/ShopHeader.5vR1LgSW.js +10 -0
- package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.sk5AFsEV.js +1 -0
- package/packages/storefront/dist/client/_astro/_slug_.r8QHNfdw.css +1 -0
- package/packages/storefront/dist/client/_astro/client.RF8UxjZd.js +1 -0
- package/packages/storefront/dist/client/_astro/customer-session._VkzXnXT.js +7 -0
- package/packages/storefront/dist/client/_astro/ecom-utils.gJYgRPRz.js +1 -0
- package/packages/storefront/dist/client/_astro/{firebase-app.992a296f.js → firebase-app.cPMfoOsn.js} +1 -1
- package/packages/storefront/dist/client/_astro/{format-money.9cf6b04d.js → format-money.FMQXgKHB.js} +1 -1
- package/packages/storefront/dist/client/_astro/{hoisted.c90fc6ab.js → hoisted.B6fKrLPR.js} +1 -1
- package/packages/storefront/dist/client/_astro/{hoisted.54eaab04.js → hoisted._FbzheVm.js} +1 -1
- package/packages/storefront/dist/client/_astro/{i18n.29216eeb.js → i18n.m7SpISxy.js} +1 -1
- package/packages/storefront/dist/client/_astro/{img.4f23a3dd.js → img.zh-Drf-O.js} +1 -1
- package/packages/storefront/dist/client/_astro/{index-61e5ac61.bdc8d0cd.js → index-dd468b12.D5s8VdAL.js} +92 -107
- package/packages/storefront/dist/client/_astro/{index.570b84fe.js → index.5PN-EYMS.js} +1 -1
- package/packages/storefront/dist/client/_astro/index.XrHFaN2F.js +1 -0
- package/packages/storefront/dist/client/_astro/{modules-info.55780599.js → modules-info.sD0tdb2b.js} +1 -1
- package/packages/storefront/dist/client/_astro/name.HU5l7TJo.js +1 -0
- package/packages/storefront/dist/client/_astro/{photoswipe-lightbox.esm.c157838f.js → photoswipe-lightbox.esm.dZBqKD9u.js} +1 -1
- package/packages/storefront/dist/client/_astro/{photoswipe.01431ec7.js → photoswipe.0V7m2jWu.js} +1 -2
- package/packages/storefront/dist/client/_astro/{photoswipe.esm.92c2d901.js → photoswipe.esm.Ylh9TGkz.js} +1 -1
- package/packages/storefront/dist/client/_astro/sf-utils.5t7r9A2G.js +1 -0
- package/packages/storefront/dist/client/_astro/{shopping-cart.d9f601dd.js → shopping-cart.A-1jhlKi.js} +1 -1
- package/packages/storefront/dist/client/_astro/use-analytics.1EVxbrS7.js +1 -0
- package/packages/storefront/dist/client/_astro/{use-product-card.437911bb.js → use-product-card.erbOV6Fv.js} +1 -1
- package/packages/storefront/dist/client/robots.txt +1 -0
- package/packages/storefront/dist/server/chunks/{CartSidebar_eab28771.mjs → CartSidebar_hAgJQJgm.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/SearchModal_eWb5SdQM.mjs +351 -0
- package/packages/storefront/dist/server/chunks/{_.._5a781fb3.mjs → _.._S7DDBn_b.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/{account_519edb70.mjs → account_3ySmGzMc.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/astro/{assets-service_a9d9ab5f.mjs → assets-service_QlOZG8ov.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/{astro_d98f7186.mjs → astro_zcC1GStV.mjs} +17 -34
- package/packages/storefront/dist/server/chunks/{index_5e3ed8a0.mjs → index_nIwq11oA.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/{index_10e14f85.mjs → index_uAR5ZV4d.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/{node_1119b0d1.mjs → node_2VvC7trl.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/pages/{__93ade2dd.mjs → __MSibDuuV.mjs} +652 -255
- package/packages/storefront/dist/server/chunks/pages/{account_e5d410a7.mjs → account_iG-YqJ5q.mjs} +3 -2
- package/packages/storefront/dist/server/chunks/pages/{index_7e25afc1.mjs → index_BtDyKPh_.mjs} +3 -2
- package/packages/storefront/dist/server/chunks/pages/{node_bd378ac0.mjs → node_bKqL47eZ.mjs} +2 -2
- package/packages/storefront/dist/server/chunks/pages/{~fallback_73578d2f.mjs → ~fallback_73R5VA6j.mjs} +3 -2
- package/packages/storefront/dist/server/chunks/{photoswipe_9528923e.mjs → photoswipe_IcWDJiwc.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/{~fallback_41122b9b.mjs → ~fallback_7q1dqY4e.mjs} +1 -1
- package/packages/storefront/dist/server/entry.mjs +970 -93
- package/packages/storefront/dist/server/manifest_dSwvaOdW.mjs +195 -0
- package/packages/storefront/dist/server/renderers.mjs +2 -2
- package/packages/storefront/package.json +13 -13
- package/packages/storefront/src/helpers/sf-utils.ts +37 -6
- package/packages/storefront/src/lib/composables/use-search-container.ts +48 -0
- package/packages/storefront/src/lib/composables/use-search-modal.ts +31 -27
- package/packages/storefront/src/lib/composables/use-shop-header.ts +78 -1
- package/packages/storefront/src/lib/composables/use-sticky-header.ts +2 -0
- package/packages/storefront/src/lib/layouts/BaseHead.astro +8 -1
- package/packages/storefront/src/lib/layouts/use-page-main.ts +15 -0
- package/packages/storefront/src/lib/scripts/firestore.ts +27 -0
- package/packages/storefront/src/lib/ssr-context.ts +14 -0
- package/packages/storefront/src/lib/state/search-engine.ts +80 -27
- package/packages/storefront/src/lib/state/use-analytics.ts +36 -21
- package/packages/test-base/package.json +1 -1
- package/packages/types/package.json +1 -1
- package/ecomplus-stores/monocard/.devcontainer/devcontainer.json +0 -30
- package/ecomplus-stores/monocard/.editorconfig +0 -13
- package/ecomplus-stores/monocard/.eslintrc.cjs +0 -3
- package/ecomplus-stores/monocard/.firebaserc +0 -5
- package/ecomplus-stores/monocard/.github/build-and-deploy +0 -1
- package/ecomplus-stores/monocard/.github/renovate.json +0 -5
- package/ecomplus-stores/monocard/.github/workflows/build-and-deploy.yml +0 -37
- package/ecomplus-stores/monocard/.github/workflows/calibreapp-image-actions.yml +0 -23
- package/ecomplus-stores/monocard/.gitpod.yml +0 -12
- package/ecomplus-stores/monocard/.idx/dev.nix +0 -24
- package/ecomplus-stores/monocard/.nvmrc +0 -1
- package/ecomplus-stores/monocard/.vscode/extensions.json +0 -8
- package/ecomplus-stores/monocard/.vscode/launch.json +0 -11
- package/ecomplus-stores/monocard/.vscode/settings.json +0 -13
- package/ecomplus-stores/monocard/LICENSE.md +0 -230
- package/ecomplus-stores/monocard/README.md +0 -31
- package/ecomplus-stores/monocard/SETUP.md +0 -129
- package/ecomplus-stores/monocard/SETUP.pt-BR.md +0 -129
- package/ecomplus-stores/monocard/functions/config.json +0 -3
- package/ecomplus-stores/monocard/functions/example.env +0 -10
- package/ecomplus-stores/monocard/functions/many/index.js +0 -14
- package/ecomplus-stores/monocard/functions/many/package.json +0 -22
- package/ecomplus-stores/monocard/functions/ssr/.eslintrc.cjs +0 -6
- package/ecomplus-stores/monocard/functions/ssr/astro.config.mjs +0 -4
- package/ecomplus-stores/monocard/functions/ssr/content/blog/.gitkeep +0 -0
- package/ecomplus-stores/monocard/functions/ssr/content/extra-pages/terms.json +0 -11
- package/ecomplus-stores/monocard/functions/ssr/content/extra-pages/trocas.json +0 -11
- package/ecomplus-stores/monocard/functions/ssr/content/layout.json +0 -52
- package/ecomplus-stores/monocard/functions/ssr/content/pages/home.json +0 -20
- package/ecomplus-stores/monocard/functions/ssr/content/pages/products.json +0 -18
- package/ecomplus-stores/monocard/functions/ssr/content/settings.json +0 -78
- package/ecomplus-stores/monocard/functions/ssr/index.js +0 -18
- package/ecomplus-stores/monocard/functions/ssr/package.json +0 -36
- package/ecomplus-stores/monocard/functions/ssr/public/admin/.gitkeep +0 -0
- package/ecomplus-stores/monocard/functions/ssr/public/assets/lotties/img_1.png +0 -0
- package/ecomplus-stores/monocard/functions/ssr/public/assets/lotties/img_1.webp +0 -0
- package/ecomplus-stores/monocard/functions/ssr/public/assets/lotties/phone-nfc.json +0 -1
- package/ecomplus-stores/monocard/functions/ssr/public/img/icon.png +0 -0
- package/ecomplus-stores/monocard/functions/ssr/public/img/large-icon.png +0 -0
- package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/card-phone.png +0 -0
- package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/devices.jpg +0 -0
- package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/ecom-icon.png +0 -0
- package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/edit-suit.jpg +0 -0
- package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/favicon.png +0 -0
- package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/icon.png +0 -0
- package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/large-icon.png +0 -0
- package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/logo-arcelor-mittal.webp +0 -0
- package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/logo-azul.webp +0 -0
- package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/logo-banco-pan.webp +0 -0
- package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/logo-brinks.webp +0 -0
- package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/logo-mastercard.webp +0 -0
- package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/logo-pfizer.webp +0 -0
- package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/logo-prudential.webp +0 -0
- package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/logo-unimed.webp +0 -0
- package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/logo.webp +0 -0
- package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/mockup-editar.png +0 -0
- package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/og-image.png +0 -0
- package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/padronagem-tilada.png +0 -0
- package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/qrcode-camera.png +0 -0
- package/ecomplus-stores/monocard/functions/ssr/public/img/uploads/sua-logo-aqui.png +0 -0
- package/ecomplus-stores/monocard/functions/ssr/public/robots.txt +0 -6
- package/ecomplus-stores/monocard/functions/ssr/scripts/build.sh +0 -14
- package/ecomplus-stores/monocard/functions/ssr/src/assets/card.css +0 -99
- package/ecomplus-stores/monocard/functions/ssr/src/assets/style.css +0 -79
- package/ecomplus-stores/monocard/functions/ssr/src/components/AccountMenu.vue +0 -97
- package/ecomplus-stores/monocard/functions/ssr/src/components/AccountPage.vue +0 -62
- package/ecomplus-stores/monocard/functions/ssr/src/components/Banner.vue +0 -59
- package/ecomplus-stores/monocard/functions/ssr/src/components/BannersGrid.astro +0 -25
- package/ecomplus-stores/monocard/functions/ssr/src/components/Breadcrumbs.astro +0 -44
- package/ecomplus-stores/monocard/functions/ssr/src/components/CartItem.vue +0 -64
- package/ecomplus-stores/monocard/functions/ssr/src/components/CartSidebar.vue +0 -69
- package/ecomplus-stores/monocard/functions/ssr/src/components/CasesGrid.astro +0 -49
- package/ecomplus-stores/monocard/functions/ssr/src/components/CheckoutPage.vue +0 -33
- package/ecomplus-stores/monocard/functions/ssr/src/components/Collapse.vue +0 -19
- package/ecomplus-stores/monocard/functions/ssr/src/components/DemoVideo.vue +0 -10
- package/ecomplus-stores/monocard/functions/ssr/src/components/DocDescription.vue +0 -28
- package/ecomplus-stores/monocard/functions/ssr/src/components/FeatureTabs.vue +0 -286
- package/ecomplus-stores/monocard/functions/ssr/src/components/FeaturesSection.astro +0 -28
- package/ecomplus-stores/monocard/functions/ssr/src/components/FooterStamps.vue +0 -63
- package/ecomplus-stores/monocard/functions/ssr/src/components/ImagesGallery.vue +0 -154
- package/ecomplus-stores/monocard/functions/ssr/src/components/LoginForm.vue +0 -107
- package/ecomplus-stores/monocard/functions/ssr/src/components/LottiePhoneNFC.vue +0 -20
- package/ecomplus-stores/monocard/functions/ssr/src/components/MonocardCustomizer.vue +0 -261
- package/ecomplus-stores/monocard/functions/ssr/src/components/PitchBar.vue +0 -61
- package/ecomplus-stores/monocard/functions/ssr/src/components/Prices.vue +0 -95
- package/ecomplus-stores/monocard/functions/ssr/src/components/ProductCard.vue +0 -117
- package/ecomplus-stores/monocard/functions/ssr/src/components/ProductDetails.vue +0 -122
- package/ecomplus-stores/monocard/functions/ssr/src/components/ProductShelf.vue +0 -57
- package/ecomplus-stores/monocard/functions/ssr/src/components/ProductSpecifications.vue +0 -42
- package/ecomplus-stores/monocard/functions/ssr/src/components/SearchModal.vue +0 -6
- package/ecomplus-stores/monocard/functions/ssr/src/components/ShopFooter.vue +0 -71
- package/ecomplus-stores/monocard/functions/ssr/src/components/ShopHeader.vue +0 -137
- package/ecomplus-stores/monocard/functions/ssr/src/components/ShopHeaderMenu.vue +0 -92
- package/ecomplus-stores/monocard/functions/ssr/src/components/ShopSidenav.vue +0 -64
- package/ecomplus-stores/monocard/functions/ssr/src/components/ShopSidenavCategory.vue +0 -77
- package/ecomplus-stores/monocard/functions/ssr/src/components/SkuSelector.vue +0 -58
- package/ecomplus-stores/monocard/functions/ssr/src/env.d.ts +0 -13
- package/ecomplus-stores/monocard/functions/ssr/src/layouts/Base.astro +0 -15
- package/ecomplus-stores/monocard/functions/ssr/src/layouts/PageFooter.astro +0 -53
- package/ecomplus-stores/monocard/functions/ssr/src/layouts/PageHeader.astro +0 -35
- package/ecomplus-stores/monocard/functions/ssr/src/main/Fallback.astro +0 -10
- package/ecomplus-stores/monocard/functions/ssr/src/main/Home.astro +0 -95
- package/ecomplus-stores/monocard/functions/ssr/src/main/Sections.astro +0 -52
- package/ecomplus-stores/monocard/functions/ssr/src/main/Wildcard.astro +0 -18
- package/ecomplus-stores/monocard/functions/ssr/src/pages/[...slug].astro +0 -42
- package/ecomplus-stores/monocard/functions/ssr/src/pages/_vue.ts +0 -10
- package/ecomplus-stores/monocard/functions/ssr/src/pages/app/account.astro +0 -34
- package/ecomplus-stores/monocard/functions/ssr/src/pages/app/index.astro +0 -62
- package/ecomplus-stores/monocard/functions/ssr/src/pages/comprar/index.astro +0 -52
- package/ecomplus-stores/monocard/functions/ssr/src/pages/index.astro +0 -32
- package/ecomplus-stores/monocard/functions/ssr/src/pages/~fallback.astro +0 -23
- package/ecomplus-stores/monocard/functions/ssr/src/scripts/InlineScripts.astro +0 -10
- package/ecomplus-stores/monocard/functions/ssr/tailwind.config.cjs +0 -18
- package/ecomplus-stores/monocard/functions/ssr/tsconfig.json +0 -12
- package/ecomplus-stores/monocard/functions/ssr/uno.config.cjs +0 -5
- package/ecomplus-stores/monocard/functions/with-apps/index.js +0 -12
- package/ecomplus-stores/monocard/functions/with-apps/package.json +0 -22
- package/ecomplus-stores/monocard/package.json +0 -31
- package/ecomplus-stores/monocard/scripts/install.sh +0 -24
- package/packages/storefront/dist/client/_astro/HeroSlider.bd684ed8.js +0 -1
- package/packages/storefront/dist/client/_astro/ProductDetails.06da998d.js +0 -1
- package/packages/storefront/dist/client/_astro/ProductShelf.3f4f38b5.js +0 -1
- package/packages/storefront/dist/client/_astro/ProductShelf.bf82838b.js +0 -1
- package/packages/storefront/dist/client/_astro/SearchModal.b6aa5ef7.js +0 -1
- package/packages/storefront/dist/client/_astro/ShopHeader.2d6e361a.js +0 -4
- package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.f75743ee.js +0 -1
- package/packages/storefront/dist/client/_astro/_slug_.e7cac999.css +0 -1
- package/packages/storefront/dist/client/_astro/client.41b42098.js +0 -1
- package/packages/storefront/dist/client/_astro/customer-session.5ab9ab1a.js +0 -1
- package/packages/storefront/dist/client/_astro/ecom-utils.5cbfb95e.js +0 -1
- package/packages/storefront/dist/client/_astro/index.8ac1db99.js +0 -1
- package/packages/storefront/dist/client/_astro/name.01410784.js +0 -1
- package/packages/storefront/dist/client/_astro/sf-utils.b04e1813.js +0 -1
- package/packages/storefront/dist/client/_astro/use-analytics.cc95e346.js +0 -1
- package/packages/storefront/dist/server/chunks/SearchModal_f66549d4.mjs +0 -147
- package/packages/storefront/dist/server/manifest_221d806b.mjs +0 -1069
- /package/packages/storefront/dist/client/_astro/{afetch.f4507208.js → afetch.5c8VmT0-.js} +0 -0
- /package/packages/storefront/dist/client/_astro/{img-sizes.41e0efe4.js → img-sizes.gxAI9JNh.js} +0 -0
- /package/packages/storefront/dist/client/_astro/{price.04ceb6c4.js → price.Easct8WC.js} +0 -0
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import '@astrojs/internal-helpers/path';
|
|
2
|
+
import 'cookie';
|
|
3
|
+
import { bold, red, yellow, dim, blue } from 'kleur/colors';
|
|
4
|
+
import 'string-width';
|
|
5
|
+
import './chunks/astro_zcC1GStV.mjs';
|
|
6
|
+
import 'clsx';
|
|
7
|
+
import { compile } from 'path-to-regexp';
|
|
8
|
+
|
|
9
|
+
const dateTimeFormat = new Intl.DateTimeFormat([], {
|
|
10
|
+
hour: "2-digit",
|
|
11
|
+
minute: "2-digit",
|
|
12
|
+
second: "2-digit",
|
|
13
|
+
hour12: false
|
|
14
|
+
});
|
|
15
|
+
const levels = {
|
|
16
|
+
debug: 20,
|
|
17
|
+
info: 30,
|
|
18
|
+
warn: 40,
|
|
19
|
+
error: 50,
|
|
20
|
+
silent: 90
|
|
21
|
+
};
|
|
22
|
+
function log(opts, level, label, message) {
|
|
23
|
+
const logLevel = opts.level;
|
|
24
|
+
const dest = opts.dest;
|
|
25
|
+
const event = {
|
|
26
|
+
label,
|
|
27
|
+
level,
|
|
28
|
+
message
|
|
29
|
+
};
|
|
30
|
+
if (!isLogLevelEnabled(logLevel, level)) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
dest.write(event);
|
|
34
|
+
}
|
|
35
|
+
function isLogLevelEnabled(configuredLogLevel, level) {
|
|
36
|
+
return levels[configuredLogLevel] <= levels[level];
|
|
37
|
+
}
|
|
38
|
+
function info(opts, label, message) {
|
|
39
|
+
return log(opts, "info", label, message);
|
|
40
|
+
}
|
|
41
|
+
function warn(opts, label, message) {
|
|
42
|
+
return log(opts, "warn", label, message);
|
|
43
|
+
}
|
|
44
|
+
function error(opts, label, message) {
|
|
45
|
+
return log(opts, "error", label, message);
|
|
46
|
+
}
|
|
47
|
+
function debug(...args) {
|
|
48
|
+
if ("_astroGlobalDebug" in globalThis) {
|
|
49
|
+
globalThis._astroGlobalDebug(...args);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function getEventPrefix({ level, label }) {
|
|
53
|
+
const timestamp = `${dateTimeFormat.format(/* @__PURE__ */ new Date())}`;
|
|
54
|
+
const prefix = [];
|
|
55
|
+
if (level === "error" || level === "warn") {
|
|
56
|
+
prefix.push(bold(timestamp));
|
|
57
|
+
prefix.push(`[${level.toUpperCase()}]`);
|
|
58
|
+
} else {
|
|
59
|
+
prefix.push(timestamp);
|
|
60
|
+
}
|
|
61
|
+
if (label) {
|
|
62
|
+
prefix.push(`[${label}]`);
|
|
63
|
+
}
|
|
64
|
+
if (level === "error") {
|
|
65
|
+
return red(prefix.join(" "));
|
|
66
|
+
}
|
|
67
|
+
if (level === "warn") {
|
|
68
|
+
return yellow(prefix.join(" "));
|
|
69
|
+
}
|
|
70
|
+
if (prefix.length === 1) {
|
|
71
|
+
return dim(prefix[0]);
|
|
72
|
+
}
|
|
73
|
+
return dim(prefix[0]) + " " + blue(prefix.splice(1).join(" "));
|
|
74
|
+
}
|
|
75
|
+
if (typeof process !== "undefined") {
|
|
76
|
+
let proc = process;
|
|
77
|
+
if ("argv" in proc && Array.isArray(proc.argv)) {
|
|
78
|
+
if (proc.argv.includes("--verbose")) ; else if (proc.argv.includes("--silent")) ; else ;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
class Logger {
|
|
82
|
+
options;
|
|
83
|
+
constructor(options) {
|
|
84
|
+
this.options = options;
|
|
85
|
+
}
|
|
86
|
+
info(label, message) {
|
|
87
|
+
info(this.options, label, message);
|
|
88
|
+
}
|
|
89
|
+
warn(label, message) {
|
|
90
|
+
warn(this.options, label, message);
|
|
91
|
+
}
|
|
92
|
+
error(label, message) {
|
|
93
|
+
error(this.options, label, message);
|
|
94
|
+
}
|
|
95
|
+
debug(label, ...messages) {
|
|
96
|
+
debug(label, ...messages);
|
|
97
|
+
}
|
|
98
|
+
level() {
|
|
99
|
+
return this.options.level;
|
|
100
|
+
}
|
|
101
|
+
forkIntegrationLogger(label) {
|
|
102
|
+
return new AstroIntegrationLogger(this.options, label);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
class AstroIntegrationLogger {
|
|
106
|
+
options;
|
|
107
|
+
label;
|
|
108
|
+
constructor(logging, label) {
|
|
109
|
+
this.options = logging;
|
|
110
|
+
this.label = label;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Creates a new logger instance with a new label, but the same log options.
|
|
114
|
+
*/
|
|
115
|
+
fork(label) {
|
|
116
|
+
return new AstroIntegrationLogger(this.options, label);
|
|
117
|
+
}
|
|
118
|
+
info(message) {
|
|
119
|
+
info(this.options, this.label, message);
|
|
120
|
+
}
|
|
121
|
+
warn(message) {
|
|
122
|
+
warn(this.options, this.label, message);
|
|
123
|
+
}
|
|
124
|
+
error(message) {
|
|
125
|
+
error(this.options, this.label, message);
|
|
126
|
+
}
|
|
127
|
+
debug(message) {
|
|
128
|
+
debug(this.label, message);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function getRouteGenerator(segments, addTrailingSlash) {
|
|
133
|
+
const template = segments.map((segment) => {
|
|
134
|
+
return "/" + segment.map((part) => {
|
|
135
|
+
if (part.spread) {
|
|
136
|
+
return `:${part.content.slice(3)}(.*)?`;
|
|
137
|
+
} else if (part.dynamic) {
|
|
138
|
+
return `:${part.content}`;
|
|
139
|
+
} else {
|
|
140
|
+
return part.content.normalize().replace(/\?/g, "%3F").replace(/#/g, "%23").replace(/%5B/g, "[").replace(/%5D/g, "]").replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
141
|
+
}
|
|
142
|
+
}).join("");
|
|
143
|
+
}).join("");
|
|
144
|
+
let trailing = "";
|
|
145
|
+
if (addTrailingSlash === "always" && segments.length) {
|
|
146
|
+
trailing = "/";
|
|
147
|
+
}
|
|
148
|
+
const toPath = compile(template + trailing);
|
|
149
|
+
return toPath;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function deserializeRouteData(rawRouteData) {
|
|
153
|
+
return {
|
|
154
|
+
route: rawRouteData.route,
|
|
155
|
+
type: rawRouteData.type,
|
|
156
|
+
pattern: new RegExp(rawRouteData.pattern),
|
|
157
|
+
params: rawRouteData.params,
|
|
158
|
+
component: rawRouteData.component,
|
|
159
|
+
generate: getRouteGenerator(rawRouteData.segments, rawRouteData._meta.trailingSlash),
|
|
160
|
+
pathname: rawRouteData.pathname || void 0,
|
|
161
|
+
segments: rawRouteData.segments,
|
|
162
|
+
prerender: rawRouteData.prerender,
|
|
163
|
+
redirect: rawRouteData.redirect,
|
|
164
|
+
redirectRoute: rawRouteData.redirectRoute ? deserializeRouteData(rawRouteData.redirectRoute) : void 0,
|
|
165
|
+
fallbackRoutes: rawRouteData.fallbackRoutes.map((fallback) => {
|
|
166
|
+
return deserializeRouteData(fallback);
|
|
167
|
+
})
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function deserializeManifest(serializedManifest) {
|
|
172
|
+
const routes = [];
|
|
173
|
+
for (const serializedRoute of serializedManifest.routes) {
|
|
174
|
+
routes.push({
|
|
175
|
+
...serializedRoute,
|
|
176
|
+
routeData: deserializeRouteData(serializedRoute.routeData)
|
|
177
|
+
});
|
|
178
|
+
const route = serializedRoute;
|
|
179
|
+
route.routeData = deserializeRouteData(serializedRoute.routeData);
|
|
180
|
+
}
|
|
181
|
+
const assets = new Set(serializedManifest.assets);
|
|
182
|
+
const componentMetadata = new Map(serializedManifest.componentMetadata);
|
|
183
|
+
const clientDirectives = new Map(serializedManifest.clientDirectives);
|
|
184
|
+
return {
|
|
185
|
+
...serializedManifest,
|
|
186
|
+
assets,
|
|
187
|
+
componentMetadata,
|
|
188
|
+
clientDirectives,
|
|
189
|
+
routes
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
const manifest = deserializeManifest({"adapterName":"@astrojs/node","routes":[{"file":"","links":[],"scripts":[],"styles":[],"routeData":{"type":"endpoint","route":"/_image","pattern":"^\\/_image$","segments":[[{"content":"_image","dynamic":false,"spread":false}]],"params":[],"component":"../../node_modules/.pnpm/astro@4.0.4_@types+node@18.19.3_typescript@5.2.2/node_modules/astro/dist/assets/endpoint/node.js","pathname":"/_image","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted._FbzheVm.js"}],"styles":[{"type":"external","src":"/_astro/_slug_.r8QHNfdw.css"}],"routeData":{"route":"/","type":"page","pattern":"^\\/$","segments":[],"params":[],"component":"src/pages/index.astro","pathname":"/","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted._FbzheVm.js"}],"styles":[{"type":"external","src":"/_astro/_slug_.r8QHNfdw.css"}],"routeData":{"route":"/~fallback","type":"page","pattern":"^\\/~fallback\\/?$","segments":[[{"content":"~fallback","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/~fallback.astro","pathname":"/~fallback","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.B6fKrLPR.js"}],"styles":[{"type":"external","src":"/_astro/_slug_.r8QHNfdw.css"}],"routeData":{"route":"/app","type":"page","pattern":"^\\/app\\/?$","segments":[[{"content":"app","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/app/index.astro","pathname":"/app","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted._FbzheVm.js"}],"styles":[{"type":"external","src":"/_astro/_slug_.r8QHNfdw.css"}],"routeData":{"route":"/app/account","type":"page","pattern":"^\\/app\\/account\\/?$","segments":[[{"content":"app","dynamic":false,"spread":false}],[{"content":"account","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/app/account.astro","pathname":"/app/account","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted._FbzheVm.js"}],"styles":[{"type":"external","src":"/_astro/_slug_.r8QHNfdw.css"}],"routeData":{"route":"/[...slug]","type":"page","pattern":"^(?:\\/(.*?))?\\/?$","segments":[[{"content":"...slug","dynamic":true,"spread":true}]],"params":["...slug"],"component":"src/pages/[...slug].astro","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}}],"site":"https://demo.ecomplus.app","base":"/","trailingSlash":"ignore","compressHTML":false,"componentMetadata":[["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/BaseHead.astro",{"propagation":"in-tree","containsHead":false}],["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/[...slug].astro",{"propagation":"in-tree","containsHead":false}],["\u0000@astro-page:src/pages/[...slug]@_@astro",{"propagation":"in-tree","containsHead":false}],["\u0000@astrojs-ssr-virtual-entry",{"propagation":"in-tree","containsHead":false}],["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/app/account.astro",{"propagation":"in-tree","containsHead":false}],["\u0000@astro-page:src/pages/app/account@_@astro",{"propagation":"in-tree","containsHead":false}],["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/app/index.astro",{"propagation":"in-tree","containsHead":false}],["\u0000@astro-page:src/pages/app/index@_@astro",{"propagation":"in-tree","containsHead":false}],["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/index.astro",{"propagation":"in-tree","containsHead":false}],["\u0000@astro-page:src/pages/index@_@astro",{"propagation":"in-tree","containsHead":false}],["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/~fallback.astro",{"propagation":"in-tree","containsHead":false}],["\u0000@astro-page:src/pages/~fallback@_@astro",{"propagation":"in-tree","containsHead":false}]],"renderers":[],"clientDirectives":[["idle","(()=>{var i=t=>{let e=async()=>{await(await t())()};\"requestIdleCallback\"in window?window.requestIdleCallback(e):setTimeout(e,200)};(self.Astro||(self.Astro={})).idle=i;window.dispatchEvent(new Event(\"astro:idle\"));})();"],["load","(()=>{var e=async t=>{await(await t())()};(self.Astro||(self.Astro={})).load=e;window.dispatchEvent(new Event(\"astro:load\"));})();"],["media","(()=>{var s=(i,t)=>{let a=async()=>{await(await i())()};if(t.value){let e=matchMedia(t.value);e.matches?a():e.addEventListener(\"change\",a,{once:!0})}};(self.Astro||(self.Astro={})).media=s;window.dispatchEvent(new Event(\"astro:media\"));})();"],["only","(()=>{var e=async t=>{await(await t())()};(self.Astro||(self.Astro={})).only=e;window.dispatchEvent(new Event(\"astro:only\"));})();"],["visible","(()=>{var r=(i,c,s)=>{let n=async()=>{await(await i())()},t=new IntersectionObserver(e=>{for(let o of e)if(o.isIntersecting){t.disconnect(),n();break}});for(let e of s.children)t.observe(e)};(self.Astro||(self.Astro={})).visible=r;window.dispatchEvent(new Event(\"astro:visible\"));})();"],["context","(()=>{var n=(d,i)=>{let t=async()=>{await(await d())()},e=()=>{if(i.value===\"idle\"){if(typeof window.requestIdleCallback==\"function\"){setTimeout(()=>window.requestIdleCallback(t),9);return}setTimeout(t,200);return}t()},o=window.$storefront?.apiContext?.doc._id||null;if(window._firstLoadContextId===o&&window._emitedContextId===o){console.log(\"[ctx] first load\"),e(),document.addEventListener(\"astro:beforeload\",()=>{delete window._firstLoadContextId},{once:!0});return}window.addEventListener(\"storefront:apiContext\",e,{once:!0})};(self.Astro||(self.Astro={})).context=n;window.dispatchEvent(new Event(\"astro:context\"));})();\n"]],"entryModules":{"\u0000@astrojs-ssr-virtual-entry":"entry.mjs","\u0000@astro-renderers":"renderers.mjs","\u0000empty-middleware":"_empty-middleware.mjs","/src/pages/app/account.astro":"chunks/pages/account_iG-YqJ5q.mjs","/../../node_modules/.pnpm/astro@4.0.4_@types+node@18.19.3_typescript@5.2.2/node_modules/astro/dist/assets/endpoint/node.js":"chunks/pages/node_bKqL47eZ.mjs","/src/pages/~fallback.astro":"chunks/pages/~fallback_73R5VA6j.mjs","\u0000@astrojs-manifest":"manifest_dSwvaOdW.mjs","\u0000@astro-page:../../node_modules/.pnpm/astro@4.0.4_@types+node@18.19.3_typescript@5.2.2/node_modules/astro/dist/assets/endpoint/node@_@js":"chunks/node_2VvC7trl.mjs","\u0000@astro-page:src/pages/index@_@astro":"chunks/index_nIwq11oA.mjs","\u0000@astro-page:src/pages/~fallback@_@astro":"chunks/~fallback_7q1dqY4e.mjs","\u0000@astro-page:src/pages/app/index@_@astro":"chunks/index_uAR5ZV4d.mjs","\u0000@astro-page:src/pages/app/account@_@astro":"chunks/account_3ySmGzMc.mjs","\u0000@astro-page:src/pages/[...slug]@_@astro":"chunks/_.._S7DDBn_b.mjs","/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/components/SearchModal.vue":"_astro/SearchModal.F7vbwxIv.js","/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/components/CartSidebar.vue":"_astro/CartSidebar.1kUFk9Xn.js","/home/leo/code/ecomplus/cloud-commerce/node_modules/photoswipe/dist/photoswipe.css?inline":"_astro/photoswipe.0V7m2jWu.js","/home/leo/code/ecomplus/cloud-commerce/node_modules/photoswipe/dist/photoswipe-lightbox.esm.js":"_astro/photoswipe-lightbox.esm.dZBqKD9u.js","/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/scripts/firebase-app.ts":"_astro/firebase-app.cPMfoOsn.js","~/components/PitchBar.vue":"_astro/PitchBar.FelC04wE.js","~/components/SearchContainer.vue":"_astro/SearchContainer.BzixfU3R.js","~/components/AccountPage.vue":"_astro/AccountPage.j0C5JBLY.js","~/components/HeroSlider.vue":"_astro/HeroSlider.tR1dVXyu.js","/astro/hoisted.js?q=0":"_astro/hoisted.B6fKrLPR.js","~/components/ProductDetails.vue":"_astro/ProductDetails.B6Ih5MGf.js","~/components/ProductShelf.vue":"_astro/ProductShelf.GESxuPZ_.js","@astrojs/vue/client.js":"_astro/client.RF8UxjZd.js","/astro/hoisted.js?q=1":"_astro/hoisted._FbzheVm.js","/home/leo/code/ecomplus/cloud-commerce/node_modules/photoswipe/dist/photoswipe.esm.js":"_astro/photoswipe.esm.Ylh9TGkz.js","~/components/ShopHeader.vue":"_astro/ShopHeader.5vR1LgSW.js","astro:scripts/before-hydration.js":""},"assets":["/_astro/_slug_.r8QHNfdw.css","/robots.txt","/_astro/AccountPage.j0C5JBLY.js","/_astro/CartSidebar.1kUFk9Xn.js","/_astro/HeroSlider.tR1dVXyu.js","/_astro/PitchBar.FelC04wE.js","/_astro/Prices.PuQc6C7F.js","/_astro/ProductCard.ephJafAE.js","/_astro/ProductDetails.B6Ih5MGf.js","/_astro/ProductShelf.GESxuPZ_.js","/_astro/QuantitySelector.YNmWjN8y.js","/_astro/SearchContainer.BzixfU3R.js","/_astro/SearchModal.F7vbwxIv.js","/_astro/ShopHeader.5vR1LgSW.js","/_astro/_plugin-vue_export-helper.sk5AFsEV.js","/_astro/afetch.5c8VmT0-.js","/_astro/client.RF8UxjZd.js","/_astro/customer-session._VkzXnXT.js","/_astro/ecom-utils.gJYgRPRz.js","/_astro/firebase-app.cPMfoOsn.js","/_astro/format-money.FMQXgKHB.js","/_astro/hoisted.B6fKrLPR.js","/_astro/hoisted._FbzheVm.js","/_astro/i18n.m7SpISxy.js","/_astro/img-sizes.gxAI9JNh.js","/_astro/img.zh-Drf-O.js","/_astro/index-dd468b12.D5s8VdAL.js","/_astro/index.5PN-EYMS.js","/_astro/index.XrHFaN2F.js","/_astro/modules-info.sD0tdb2b.js","/_astro/name.HU5l7TJo.js","/_astro/photoswipe-lightbox.esm.dZBqKD9u.js","/_astro/photoswipe.0V7m2jWu.js","/_astro/photoswipe.esm.Ylh9TGkz.js","/_astro/price.Easct8WC.js","/_astro/sf-utils.5t7r9A2G.js","/_astro/shopping-cart.A-1jhlKi.js","/_astro/use-analytics.1EVxbrS7.js","/_astro/use-product-card.erbOV6Fv.js","/img/icon.png","/img/large-icon.png","/img/uploads/banner2.webp","/img/uploads/ecom-icon.png","/img/uploads/headphone.webp","/img/uploads/logo.png","/img/uploads/og-image.png","/img/uploads/passion.webp","/img/uploads/rect8589.png","/img/uploads/rect859.png","/img/uploads/rect89.webp"]});
|
|
194
|
+
|
|
195
|
+
export { AstroIntegrationLogger as A, Logger as L, getEventPrefix as g, levels as l, manifest };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useSSRContext, defineComponent, computed, createVNode, resolveDynamicComponent, mergeProps, withCtx, renderSlot, inject, ref, watch, toRef, onMounted, onBeforeUnmount, provide, h, createSSRApp } from 'vue';
|
|
2
2
|
import { ssrRenderSlotInner, ssrRenderVNode, ssrRenderSlot, ssrRenderAttrs, ssrRenderClass, ssrRenderComponent, renderToString } from 'vue/server-renderer';
|
|
3
3
|
import { img, imgSizes, i18n, formatMoney } from '@ecomplus/utils';
|
|
4
|
-
import { _ as _export_sfc } from './chunks/pages/
|
|
4
|
+
import { _ as _export_sfc } from './chunks/pages/__MSibDuuV.mjs';
|
|
5
5
|
import { useScroll, useElementHover, useDebounceFn } from '@vueuse/core';
|
|
6
6
|
|
|
7
7
|
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
@@ -322,7 +322,7 @@ function _sfc_ssrRender$1(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
|
|
|
322
322
|
_push(`<button${ssrRenderAttrs(mergeProps({
|
|
323
323
|
type: "button",
|
|
324
324
|
"aria-label": !$props.isPrev ? "Pr\xF3ximo" : "Anterior",
|
|
325
|
-
class: ["group absolute z-[
|
|
325
|
+
class: ["group absolute z-[11]", $setup.isX ? `${!$props.isPrev ? "right-0" : "left-0"} top-0` : `${!$props.isPrev ? "bottom-0" : "top-0"} left-0`],
|
|
326
326
|
"data-carousel-control": !$props.isPrev ? "next" : "previous"
|
|
327
327
|
}, _attrs))}>`);
|
|
328
328
|
ssrRenderSlot(_ctx.$slots, "default", {}, () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/storefront",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.38.0",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce storefront with Astro",
|
|
6
6
|
"bin": {
|
|
7
7
|
"storefront": "./scripts/build-prod.sh"
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"prepare-monorepo": "bash scripts/prepare-monorepo.sh"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@astrojs/node": "
|
|
33
|
-
"@astrojs/vue": "
|
|
32
|
+
"@astrojs/node": "7.0.1",
|
|
33
|
+
"@astrojs/vue": "4.0.3",
|
|
34
34
|
"@cloudcommerce/api": "workspace:*",
|
|
35
35
|
"@cloudcommerce/config": "workspace:*",
|
|
36
36
|
"@cloudcommerce/i18n": "workspace:*",
|
|
@@ -39,26 +39,26 @@
|
|
|
39
39
|
"@iconify-json/fa6-brands": "^1.1.17",
|
|
40
40
|
"@iconify-json/heroicons": "^1.1.15",
|
|
41
41
|
"@iconify-json/logos": "^1.1.40",
|
|
42
|
-
"@orama/orama": "2.0.0-beta.8",
|
|
43
42
|
"@types/gtag.js": "^0.0.18",
|
|
44
|
-
"@vite-pwa/astro": "^0.
|
|
45
|
-
"@vueuse/core": "10.
|
|
46
|
-
"astro": "
|
|
43
|
+
"@vite-pwa/astro": "^0.2.0",
|
|
44
|
+
"@vueuse/core": "10.7.0",
|
|
45
|
+
"astro": "4.0.4",
|
|
47
46
|
"astro-capo": "^0.0.1",
|
|
48
47
|
"chroma-js": "^2.4.2",
|
|
49
48
|
"dotenv": "^16.3.1",
|
|
50
|
-
"firebase": "^10.7.
|
|
49
|
+
"firebase": "^10.7.1",
|
|
51
50
|
"image-size": "^1.0.2",
|
|
52
51
|
"mime": "^3.0.0",
|
|
53
52
|
"mitt": "^3.0.1",
|
|
54
53
|
"semver": "^7.5.4",
|
|
55
54
|
"sharp": "^0.32.6",
|
|
56
|
-
"tailwindcss": "^3.3.
|
|
55
|
+
"tailwindcss": "^3.3.6",
|
|
57
56
|
"unocss": "^0.57.7",
|
|
58
|
-
"unplugin-auto-import": "^0.
|
|
59
|
-
"vite": "^
|
|
60
|
-
"vite-plugin-pwa": "^0.17.
|
|
61
|
-
"vue": "3.3.
|
|
57
|
+
"unplugin-auto-import": "^0.17.2",
|
|
58
|
+
"vite": "^5.0.8",
|
|
59
|
+
"vite-plugin-pwa": "^0.17.4",
|
|
60
|
+
"vue": "3.3.11",
|
|
61
|
+
"wade": "0.3.3"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@cloudcommerce/eslint": "workspace:*",
|
|
@@ -11,17 +11,48 @@ export const requestIdleCallback = (fn: (...args: any[]) => any, fallbackMs = 30
|
|
|
11
11
|
}
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
export const
|
|
14
|
+
export const clearAccents = (str: string) => {
|
|
15
15
|
return str
|
|
16
|
-
.toLowerCase()
|
|
17
|
-
.trim()
|
|
18
16
|
.replace(/[ÁáÃãÂâÀà]/g, 'a')
|
|
19
|
-
.replace(/[
|
|
17
|
+
.replace(/[ÉéÊê]/g, 'e')
|
|
20
18
|
.replace(/[Íí]/g, 'i')
|
|
21
|
-
.replace(/[
|
|
19
|
+
.replace(/[ÕõÓóÔô]/g, 'o')
|
|
22
20
|
.replace(/[Úú]/g, 'u')
|
|
23
|
-
.replace(/[Çç]/g, 'c')
|
|
21
|
+
.replace(/[Çç]/g, 'c');
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const slugify = (str: string) => {
|
|
25
|
+
return clearAccents(str.trim())
|
|
26
|
+
.toLowerCase()
|
|
24
27
|
.replace(/[\W\r\n]/gm, '-')
|
|
25
28
|
.replace(/-{2,}/g, '-')
|
|
26
29
|
.replace(/(^-)|(-$)/g, '');
|
|
27
30
|
};
|
|
31
|
+
|
|
32
|
+
export const toLowerCaseAccents = (str: string) => {
|
|
33
|
+
return str
|
|
34
|
+
.toLowerCase()
|
|
35
|
+
.replace(/Á/g, 'á')
|
|
36
|
+
.replace(/Ã/g, 'ã')
|
|
37
|
+
.replace(/Â/g, 'â')
|
|
38
|
+
.replace(/À/g, 'à')
|
|
39
|
+
.replace(/É/g, 'é')
|
|
40
|
+
.replace(/Ê/g, 'ê')
|
|
41
|
+
.replace(/Í/g, 'í')
|
|
42
|
+
.replace(/Õ/g, 'õ')
|
|
43
|
+
.replace(/Ó/g, 'ó')
|
|
44
|
+
.replace(/Ô/g, 'ô')
|
|
45
|
+
.replace(/Ú/g, 'ú')
|
|
46
|
+
.replace(/Ç/g, 'ç');
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const termify = (str: string) => {
|
|
50
|
+
return toLowerCaseAccents(str.trim())
|
|
51
|
+
.replace(/[\r\n]/gm, ' ')
|
|
52
|
+
.replace(/[^\w-&%áãâàéêíõóôúç]/g, ' ')
|
|
53
|
+
.replace(/\s{2,}/g, ' ');
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const getSearchUrl = (term: string, baseUrl = '/s/') => {
|
|
57
|
+
return `${baseUrl}${encodeURIComponent(termify(term))}`;
|
|
58
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { SearchItem } from '@cloudcommerce/types';
|
|
2
|
+
import { watch, shallowReactive } from 'vue';
|
|
3
|
+
import { SearchEngine } from '@@sf/state/search-engine';
|
|
4
|
+
|
|
5
|
+
export interface Props {
|
|
6
|
+
searchEngine?: InstanceType<typeof SearchEngine>;
|
|
7
|
+
term?: string | null;
|
|
8
|
+
sort?: '-sales' | '-created_at' | 'price' | '-price' | '-price_discount' | string;
|
|
9
|
+
products?: SearchItem[];
|
|
10
|
+
ssrError?: string | null;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const useSearchContainer = (props: Props) => {
|
|
14
|
+
let { term, searchEngine } = props;
|
|
15
|
+
if (props.ssrError && !import.meta.env.SSR) {
|
|
16
|
+
console.error(new Error(`SSR search error: ${props.ssrError}`));
|
|
17
|
+
if (window.location.pathname.startsWith('/s/')) {
|
|
18
|
+
window.location.href = `/s?q=${encodeURIComponent(term || '')}`;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
const products = shallowReactive<SearchItem[]>(props.products || []);
|
|
22
|
+
if (!searchEngine) {
|
|
23
|
+
searchEngine = new SearchEngine({ debounce: 50 });
|
|
24
|
+
if (term === undefined && !import.meta.env.SSR) {
|
|
25
|
+
term = new URLSearchParams(window.location.search).get('q') || null;
|
|
26
|
+
}
|
|
27
|
+
if (term !== undefined) {
|
|
28
|
+
searchEngine.term.value = term;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
if (!searchEngine.wasFetched.value && !props.products) {
|
|
32
|
+
searchEngine.fetch().catch(console.error);
|
|
33
|
+
}
|
|
34
|
+
watch(searchEngine.products, () => {
|
|
35
|
+
products.splice(0);
|
|
36
|
+
searchEngine?.products.forEach((item) => products.push(item));
|
|
37
|
+
});
|
|
38
|
+
return {
|
|
39
|
+
searchEngine,
|
|
40
|
+
fetching: searchEngine.fetching.value,
|
|
41
|
+
isFetching: searchEngine.isFetching,
|
|
42
|
+
products,
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export default useSearchContainer;
|
|
47
|
+
|
|
48
|
+
export { useSearchContainer };
|
|
@@ -3,13 +3,9 @@ import type {
|
|
|
3
3
|
Brands,
|
|
4
4
|
Collections,
|
|
5
5
|
} from '@cloudcommerce/api/types';
|
|
6
|
-
import type { Orama } from '@orama/orama';
|
|
7
6
|
import { ref, watch, toRef } from 'vue';
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
search as oramaSearch,
|
|
11
|
-
insert as oramaInsert,
|
|
12
|
-
} from '@orama/orama';
|
|
7
|
+
import Wade from 'wade';
|
|
8
|
+
import { clearAccents } from '@@sf/sf-lib';
|
|
13
9
|
import { SearchEngine, searchHistory } from '@@sf/state/search-engine';
|
|
14
10
|
|
|
15
11
|
export interface Props {
|
|
@@ -18,36 +14,37 @@ export interface Props {
|
|
|
18
14
|
productsLimit?: number;
|
|
19
15
|
}
|
|
20
16
|
|
|
21
|
-
const oramaDocSchema = {
|
|
22
|
-
name: 'string',
|
|
23
|
-
slug: 'string',
|
|
24
|
-
short_description: 'string',
|
|
25
|
-
} as const;
|
|
26
|
-
const oramaDocs: Array<{ [k:string]:any } & { name: string, slug: string }> = [];
|
|
27
17
|
const storefrontData = globalThis.$storefront.data as {
|
|
28
18
|
categories?: Array<Partial<Categories>>,
|
|
29
19
|
brands?: Array<Partial<Brands>>,
|
|
30
20
|
collections?: Array<Partial<Collections>>,
|
|
31
21
|
};
|
|
22
|
+
const wadeDocs: Array<{
|
|
23
|
+
text: string,
|
|
24
|
+
type: 'categories' | 'brands' | 'collections' | 'blog',
|
|
25
|
+
data: Record<string, any> & { name: string, slug: string },
|
|
26
|
+
}> = [];
|
|
32
27
|
(['categories', 'brands', 'collections'] as const).forEach((resource) => {
|
|
33
28
|
const docsList = storefrontData[resource];
|
|
34
29
|
if (docsList) {
|
|
35
30
|
for (let i = 0; i < docsList.length; i++) {
|
|
36
31
|
const doc = docsList[i];
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
if (doc.name && doc.slug) {
|
|
33
|
+
wadeDocs.push({
|
|
34
|
+
text: clearAccents(`${doc.name} ${(doc as Categories).short_description}`),
|
|
35
|
+
type: resource,
|
|
36
|
+
data: doc as typeof wadeDocs[number]['data'],
|
|
37
|
+
});
|
|
40
38
|
}
|
|
41
39
|
}
|
|
42
40
|
}
|
|
43
41
|
});
|
|
44
|
-
let
|
|
45
|
-
if (
|
|
46
|
-
(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
})();
|
|
42
|
+
let wadeSearch: ((t: string) => { index: number, score: number }[]) | undefined;
|
|
43
|
+
if (wadeDocs.length) {
|
|
44
|
+
if (globalThis.$storefront.settings.lang === 'pt_br') {
|
|
45
|
+
Wade.config.stopWords = ['e', 'a', 'o', 'de', 'para', 'com', 'tem'];
|
|
46
|
+
}
|
|
47
|
+
wadeSearch = Wade(wadeDocs.map(({ text }) => text));
|
|
51
48
|
}
|
|
52
49
|
|
|
53
50
|
export const useSearchModal = (props: Props) => {
|
|
@@ -61,9 +58,10 @@ export const useSearchModal = (props: Props) => {
|
|
|
61
58
|
const linkHits = ref<Array<{ title: string, href: string }>>([]);
|
|
62
59
|
watch(toRef(props, 'term'), async (term) => {
|
|
63
60
|
searchEngine.fetch(term);
|
|
64
|
-
if (
|
|
65
|
-
const
|
|
66
|
-
linkHits.value =
|
|
61
|
+
if (wadeSearch) {
|
|
62
|
+
const wadeResults = wadeSearch(clearAccents(term));
|
|
63
|
+
linkHits.value = wadeResults.map(({ index }) => {
|
|
64
|
+
const { name, slug } = wadeDocs[index].data;
|
|
67
65
|
return { title: name, href: `/${slug}` };
|
|
68
66
|
});
|
|
69
67
|
}
|
|
@@ -73,11 +71,17 @@ export const useSearchModal = (props: Props) => {
|
|
|
73
71
|
watch(searchEngine.meta, () => {
|
|
74
72
|
productCount.value = searchEngine.meta.count || 0;
|
|
75
73
|
});
|
|
74
|
+
const filteredHistory = ref<string[]>([]);
|
|
75
|
+
watch(searchHistory, () => {
|
|
76
|
+
filteredHistory.value = searchHistory.filter((term) => term !== props.term);
|
|
77
|
+
}, {
|
|
78
|
+
immediate: true,
|
|
79
|
+
});
|
|
76
80
|
return {
|
|
77
|
-
searchHistory,
|
|
81
|
+
searchHistory: filteredHistory,
|
|
78
82
|
searchEngine,
|
|
79
83
|
isFetching: searchEngine.isFetching,
|
|
80
|
-
|
|
84
|
+
products: searchEngine.products,
|
|
81
85
|
productCount,
|
|
82
86
|
linkHits,
|
|
83
87
|
};
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import type { Ref } from 'vue';
|
|
2
2
|
import type { Categories } from '@cloudcommerce/api/types';
|
|
3
|
-
import { computed } from 'vue';
|
|
3
|
+
import { ref, computed, watch } from 'vue';
|
|
4
|
+
import { watchOnce } from '@vueuse/core';
|
|
5
|
+
import { getSearchUrl } from '@@sf/sf-lib';
|
|
6
|
+
import { totalItems } from '@@sf/state/shopping-cart';
|
|
4
7
|
import useStickyHeader from '@@sf/composables/use-sticky-header';
|
|
5
8
|
|
|
6
9
|
type PartCategory = Partial<Categories>;
|
|
7
10
|
|
|
8
11
|
export interface Props {
|
|
9
12
|
header: Ref<HTMLElement | null>;
|
|
13
|
+
searchInput?: Ref<HTMLInputElement | null>;
|
|
10
14
|
categories?: PartCategory[];
|
|
11
15
|
menuCategorySlugs?: string[];
|
|
12
16
|
menuRandomCategories?: number;
|
|
@@ -78,6 +82,7 @@ const filterSubcategories = (
|
|
|
78
82
|
const useShopHeader = (props: Props) => {
|
|
79
83
|
const {
|
|
80
84
|
header,
|
|
85
|
+
searchInput,
|
|
81
86
|
categories = (globalThis.$storefront.data.categories || []) as PartCategory[],
|
|
82
87
|
menuCategorySlugs,
|
|
83
88
|
menuRandomCategories = 7,
|
|
@@ -120,6 +125,69 @@ const useShopHeader = (props: Props) => {
|
|
|
120
125
|
}
|
|
121
126
|
return false;
|
|
122
127
|
});
|
|
128
|
+
|
|
129
|
+
const isSearchOpen = ref(false);
|
|
130
|
+
const isSearchOpenOnce = ref(false);
|
|
131
|
+
watchOnce(isSearchOpen, () => {
|
|
132
|
+
isSearchOpenOnce.value = true;
|
|
133
|
+
});
|
|
134
|
+
const searchTerm = ref('');
|
|
135
|
+
const isSearchPage = !import.meta.env.SSR && /^\/s\/?/.test(window.location.pathname);
|
|
136
|
+
let urlSearchQ: string | null | undefined;
|
|
137
|
+
if (isSearchPage) {
|
|
138
|
+
const { pathname, search } = window.location;
|
|
139
|
+
urlSearchQ = new URLSearchParams(search).get('q');
|
|
140
|
+
if (!urlSearchQ && pathname.startsWith('/s/')) {
|
|
141
|
+
urlSearchQ = decodeURIComponent(pathname.split('/')[2]);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
if (typeof urlSearchQ === 'string') {
|
|
145
|
+
searchTerm.value = urlSearchQ;
|
|
146
|
+
}
|
|
147
|
+
const quickSearchTerm = computed(() => {
|
|
148
|
+
if (searchTerm.value && searchTerm.value.length >= 2
|
|
149
|
+
&& searchTerm.value !== urlSearchQ) {
|
|
150
|
+
return searchTerm.value;
|
|
151
|
+
}
|
|
152
|
+
return '';
|
|
153
|
+
});
|
|
154
|
+
const toggleSearch = (ev: Event) => {
|
|
155
|
+
ev.preventDefault();
|
|
156
|
+
if (isSearchOpen.value && searchTerm.value) {
|
|
157
|
+
window.location.href = getSearchUrl(searchTerm.value);
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
isSearchOpen.value = !isSearchOpen.value;
|
|
161
|
+
if (isSearchOpen.value && searchInput) {
|
|
162
|
+
setTimeout(() => {
|
|
163
|
+
if (!searchInput.value) return;
|
|
164
|
+
const { length } = searchTerm.value;
|
|
165
|
+
searchInput.value.setSelectionRange(length, length);
|
|
166
|
+
searchInput.value.focus();
|
|
167
|
+
}, 50);
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
const isCartOpen = ref(false);
|
|
171
|
+
const isCartOpenOnce = ref(false);
|
|
172
|
+
watchOnce(isCartOpen, () => {
|
|
173
|
+
isCartOpenOnce.value = true;
|
|
174
|
+
});
|
|
175
|
+
const delayedCartItems = ref(0);
|
|
176
|
+
const handleOnMounted = () => {
|
|
177
|
+
watch(totalItems, (newTotalItems, prevTotalItems) => {
|
|
178
|
+
if (typeof prevTotalItems === 'number') {
|
|
179
|
+
if (prevTotalItems < newTotalItems) {
|
|
180
|
+
isCartOpen.value = true;
|
|
181
|
+
} else if (prevTotalItems && !newTotalItems) {
|
|
182
|
+
isCartOpen.value = false;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
delayedCartItems.value = newTotalItems;
|
|
186
|
+
}, {
|
|
187
|
+
immediate: true,
|
|
188
|
+
});
|
|
189
|
+
};
|
|
190
|
+
|
|
123
191
|
return {
|
|
124
192
|
isSticky,
|
|
125
193
|
staticHeight,
|
|
@@ -130,6 +198,15 @@ const useShopHeader = (props: Props) => {
|
|
|
130
198
|
getCategoryTree,
|
|
131
199
|
categoryTrees,
|
|
132
200
|
inlineMenuTrees,
|
|
201
|
+
isSearchOpen,
|
|
202
|
+
isSearchOpenOnce,
|
|
203
|
+
searchTerm,
|
|
204
|
+
quickSearchTerm,
|
|
205
|
+
toggleSearch,
|
|
206
|
+
isCartOpen,
|
|
207
|
+
isCartOpenOnce,
|
|
208
|
+
cartTotalItems: delayedCartItems,
|
|
209
|
+
handleOnMounted,
|
|
133
210
|
};
|
|
134
211
|
};
|
|
135
212
|
|
|
@@ -109,6 +109,8 @@ const useStickyHeader = (props: Props) => {
|
|
|
109
109
|
const headerElm = header.value as HTMLElement;
|
|
110
110
|
headerElm.style.opacity = opacity;
|
|
111
111
|
headerElm.style.transform = transform;
|
|
112
|
+
const bodyClassAction = _isSticky && !opacity ? 'add' : 'remove';
|
|
113
|
+
document.body.classList[bodyClassAction]('StickyHeader');
|
|
112
114
|
});
|
|
113
115
|
watch(transition, (_transition) => {
|
|
114
116
|
(header.value as HTMLElement).style.transition = _transition;
|
|
@@ -19,6 +19,7 @@ const getIconUrl = (size: number) => {
|
|
|
19
19
|
|
|
20
20
|
const {
|
|
21
21
|
storeId,
|
|
22
|
+
searchPageTerm,
|
|
22
23
|
cmsContent,
|
|
23
24
|
fetchingApiContext,
|
|
24
25
|
apiContext,
|
|
@@ -38,11 +39,17 @@ if (fetchingApiContext) {
|
|
|
38
39
|
|
|
39
40
|
const apiDoc = apiContext.doc;
|
|
40
41
|
const state: Record<string, any> = apiDoc || cmsContent || {};
|
|
41
|
-
|
|
42
|
+
let title = state.meta_title ||
|
|
42
43
|
state.metaTitle ||
|
|
43
44
|
(state.name && `${state.name} | ${settings.name}`) ||
|
|
44
45
|
(state.title && `${state.title} | ${settings.name}`) ||
|
|
45
46
|
settings.name;
|
|
47
|
+
if (searchPageTerm) {
|
|
48
|
+
title = title.replace('$term', searchPageTerm);
|
|
49
|
+
if (!title.includes(searchPageTerm)) {
|
|
50
|
+
title = `${searchPageTerm} | ${title}`;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
46
53
|
const description = state.meta_description ||
|
|
47
54
|
state.metaDescription ||
|
|
48
55
|
state.short_description ||
|