cloudcommerce 2.0.0 → 2.0.1
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/CHANGELOG.md +8 -0
- package/ecomplus-stores/barra-doce/conf/firebase.json +7 -0
- package/ecomplus-stores/barra-doce/functions/many/package.json +3 -3
- package/ecomplus-stores/barra-doce/functions/ssr/astro.config.mjs +18 -3
- package/ecomplus-stores/barra-doce/functions/ssr/content/blog/3.md +24 -0
- package/ecomplus-stores/barra-doce/functions/ssr/content/blog/4.md +24 -0
- package/ecomplus-stores/barra-doce/functions/ssr/content/blog/5.md +24 -0
- package/ecomplus-stores/barra-doce/functions/ssr/content/blog/dos.md +24 -0
- package/ecomplus-stores/barra-doce/functions/ssr/content/blog/uno.md +24 -0
- package/ecomplus-stores/barra-doce/functions/ssr/content/extra-pages/contato.md +9 -0
- package/ecomplus-stores/barra-doce/functions/ssr/content/extra-pages/terms.md +20 -0
- package/ecomplus-stores/barra-doce/functions/ssr/content/extra-pages/trocas.md +9 -0
- package/ecomplus-stores/barra-doce/functions/ssr/content/pages/brands.json +16 -0
- package/ecomplus-stores/barra-doce/functions/ssr/content/pages/categories.json +16 -0
- package/ecomplus-stores/barra-doce/functions/ssr/content/pages/collections.json +16 -0
- package/ecomplus-stores/barra-doce/functions/ssr/content/pages/search.json +7 -0
- package/ecomplus-stores/barra-doce/functions/ssr/package.json +10 -9
- package/ecomplus-stores/barra-doce/functions/ssr/src/assets/style.css +23 -9
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/BannersGrid.astro +1 -1
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/BlogPosts.vue +88 -0
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/Breadcrumbs.vue +49 -0
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/CartSidebar.vue +2 -2
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/CheckoutPage.vue +14 -0
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/Collapse.vue +4 -4
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/ContentEntry.vue +23 -0
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/DocBanners.vue +26 -0
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/FooterStamps.vue +1 -1
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/HeroSlider.vue +1 -1
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/ImagesGallery.vue +5 -4
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/LoginForm.vue +2 -2
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/PageTitle.vue +43 -0
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/Pagination.vue +67 -0
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/Prices.vue +1 -1
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/ProductCard.vue +3 -4
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/ProductDetails.vue +4 -3
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/ProductShelf.vue +34 -18
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/ProductSpecifications.vue +1 -1
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/SearchFilters.vue +122 -0
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/SearchModal.vue +97 -1
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/SearchShowcase.vue +169 -0
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopFooter.vue +10 -6
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopHeader.vue +61 -63
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopHeaderSubmenu.vue +1 -1
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopSidenav.vue +1 -1
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/SkuSelector.vue +7 -7
- package/ecomplus-stores/barra-doce/functions/ssr/src/env.d.ts +4 -0
- package/ecomplus-stores/barra-doce/functions/ssr/src/layouts/PageFooter.astro +4 -1
- package/ecomplus-stores/barra-doce/functions/ssr/src/layouts/PageHeader.astro +2 -2
- package/ecomplus-stores/barra-doce/functions/ssr/src/main/Fallback.astro +28 -5
- package/ecomplus-stores/barra-doce/functions/ssr/src/main/Main.astro +26 -0
- package/ecomplus-stores/barra-doce/functions/ssr/src/main/content/Hero.astro +33 -0
- package/ecomplus-stores/barra-doce/functions/ssr/src/main/{Sections.astro → content/Sections.astro} +27 -4
- package/ecomplus-stores/barra-doce/functions/ssr/src/pages/[...slug].astro +35 -8
- package/ecomplus-stores/barra-doce/functions/ssr/src/pages/app/account.astro +6 -2
- package/ecomplus-stores/barra-doce/functions/ssr/src/pages/app/index.astro +24 -4
- package/ecomplus-stores/barra-doce/functions/ssr/src/pages/blog/[page].astro +71 -0
- package/ecomplus-stores/barra-doce/functions/ssr/src/pages/blog/_blog-pages.ts +9 -0
- package/ecomplus-stores/barra-doce/functions/ssr/src/pages/~fallback.astro +9 -2
- package/ecomplus-stores/barra-doce/functions/with-apps/package.json +3 -3
- package/ecomplus-stores/barra-doce/package.json +2 -2
- package/package.json +2 -2
- package/packages/api/package.json +1 -1
- package/packages/apps/affiliate-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/package.json +1 -1
- package/packages/config/package.json +1 -1
- package/packages/emails/package.json +1 -1
- package/packages/eslint/package.json +1 -1
- 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 +1 -1
- package/packages/storefront/config/astro/context-directive.mjs +16 -2
- package/packages/storefront/config/astro/index.d.ts +3 -1
- package/packages/storefront/package.json +1 -1
- package/packages/storefront/src/lib/components/SharedData.astro +1 -1
- package/packages/storefront/src/lib/composables/use-shared-data.ts +2 -1
- package/packages/test-base/package.json +1 -1
- package/packages/types/package.json +1 -1
- package/ecomplus-stores/barra-doce/functions/ssr/content/blog/.gitkeep +0 -0
- package/ecomplus-stores/barra-doce/functions/ssr/content/extra-pages/contato.json +0 -11
- package/ecomplus-stores/barra-doce/functions/ssr/content/extra-pages/terms.json +0 -11
- package/ecomplus-stores/barra-doce/functions/ssr/content/extra-pages/trocas.json +0 -11
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/Breadcrumbs.astro +0 -44
- package/ecomplus-stores/barra-doce/functions/ssr/src/main/Home.astro +0 -37
- package/ecomplus-stores/barra-doce/functions/ssr/src/main/Wildcard.astro +0 -18
- package/ecomplus-stores/barra-doce/functions/ssr/src/pages/index.astro +0 -32
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Hydrate on context script executed (`$storefront.apiContext` ready)
|
|
3
|
-
* Check event emits at BaseHead.astro
|
|
3
|
+
* Check event emits at BaseHead.astro and use-shared-data.ts
|
|
4
4
|
* @type {import('astro').ClientDirective}
|
|
5
5
|
*/
|
|
6
6
|
export default (load, opts) => {
|
|
@@ -9,7 +9,21 @@ export default (load, opts) => {
|
|
|
9
9
|
await hydrate();
|
|
10
10
|
};
|
|
11
11
|
const next = () => {
|
|
12
|
-
|
|
12
|
+
const arrOpts = Array.isArray(opts.value) ? opts.value : [opts.value];
|
|
13
|
+
for (let i = 0; i < arrOpts.length; i++) {
|
|
14
|
+
if (typeof arrOpts[i] === 'string' && arrOpts[i].startsWith('data:')) {
|
|
15
|
+
const field = arrOpts[i].substring(5);
|
|
16
|
+
if (!window.$storefront?.data?.[field]) {
|
|
17
|
+
window.addEventListener(
|
|
18
|
+
`storefront:data:${field}`,
|
|
19
|
+
next,
|
|
20
|
+
{ once: true },
|
|
21
|
+
);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (arrOpts.includes('idle')) {
|
|
13
27
|
if (typeof window.requestIdleCallback === 'function') {
|
|
14
28
|
setTimeout(() => window.requestIdleCallback(hy), 9);
|
|
15
29
|
return;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
import 'astro';
|
|
3
3
|
|
|
4
|
+
type ClientContextOption = 'idle' | `data:${string}`;
|
|
5
|
+
|
|
4
6
|
declare module 'astro' {
|
|
5
7
|
interface AstroClientDirectives {
|
|
6
|
-
'client:context'?: boolean |
|
|
8
|
+
'client:context'?: boolean | ClientContextOption | ClientContextOption[];
|
|
7
9
|
}
|
|
8
10
|
}
|
|
@@ -38,7 +38,8 @@ const useSharedData = async <T extends string = string>(props: Props<T>) => {
|
|
|
38
38
|
return {
|
|
39
39
|
value,
|
|
40
40
|
getInlineClientJS: () => `
|
|
41
|
-
window.$storefront.data['${field}'] = ${JSON.stringify(value)}
|
|
41
|
+
window.$storefront.data['${field}'] = ${JSON.stringify(value)};
|
|
42
|
+
window.dispatchEvent(new Event('storefront:data:${field}'));`,
|
|
42
43
|
};
|
|
43
44
|
};
|
|
44
45
|
|
|
File without changes
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import {
|
|
3
|
-
type Props as UseBreadcrumbsProps,
|
|
4
|
-
useBreadcrumbs,
|
|
5
|
-
} from '@@sf/composables/use-breadcrumbs';
|
|
6
|
-
|
|
7
|
-
export interface Props extends UseBreadcrumbsProps {}
|
|
8
|
-
|
|
9
|
-
const { breadcrumbs, inlineJSONLd } = await useBreadcrumbs(Astro.props);
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
{breadcrumbs.length > 0 &&
|
|
13
|
-
<section class={`ui-section-slim ${breadcrumbs.length > 1 ? '' : 'hidden lg:block'}`}>
|
|
14
|
-
<nav aria-label="Breadcrumb" class="w-full overflow-hidden text-lg md:text-sm">
|
|
15
|
-
<ol class="flex items-center gap-1 text-base-600">
|
|
16
|
-
<li>
|
|
17
|
-
<a href="/" class="hover:text-primary">
|
|
18
|
-
<span class="sr-only"> Home </span>
|
|
19
|
-
<i class="i-home"></i>
|
|
20
|
-
</a>
|
|
21
|
-
</li>
|
|
22
|
-
{breadcrumbs.map(({ name, link }, i) =>
|
|
23
|
-
<>
|
|
24
|
-
{i + 1 < breadcrumbs.length
|
|
25
|
-
? <li class="text-base-300">
|
|
26
|
-
<i class="i-chevron-right"></i>
|
|
27
|
-
</li>
|
|
28
|
-
<li class="whitespace-nowrap">
|
|
29
|
-
<a href={link} class="hover:text-primary">{name}</a>
|
|
30
|
-
</li>
|
|
31
|
-
: <li class="hidden lg:block text-base-300">
|
|
32
|
-
<i class="i-chevron-right"></i>
|
|
33
|
-
</li>
|
|
34
|
-
<li class="hidden lg:block whitespace-nowrap overflow-hidden text-ellipsis">
|
|
35
|
-
<span class="text-base-500">{name}</span>
|
|
36
|
-
</li>
|
|
37
|
-
}
|
|
38
|
-
</>
|
|
39
|
-
)}
|
|
40
|
-
</ol>
|
|
41
|
-
</nav>
|
|
42
|
-
{inlineJSONLd && <script type="application/ld+json" set:html={inlineJSONLd} />}
|
|
43
|
-
</section>
|
|
44
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import { usePageHero } from '@@sf/layouts/use-page-main';
|
|
3
|
-
import BannerPictures from '@@sf/components/BannerPictures.astro';
|
|
4
|
-
import HeroSlider from '~/components/HeroSlider.vue';
|
|
5
|
-
import Sections from '~/main/Sections.astro';
|
|
6
|
-
|
|
7
|
-
const { routeContext } = Astro.locals;
|
|
8
|
-
const { heroSlider } = await usePageHero({ routeContext });
|
|
9
|
-
const heroSlides = heroSlider.slides;
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
<main>
|
|
13
|
-
{heroSlider.slides.length &&
|
|
14
|
-
<HeroSlider {...heroSlider} client:idle>
|
|
15
|
-
{heroSlides[0] && <BannerPictures
|
|
16
|
-
slot="picture-0" {...heroSlides[0]} index={0}
|
|
17
|
-
widths={[640, 856, 1024, 1536]} class="max-w-screen-sm sm:max-w-screen-lg" />}
|
|
18
|
-
{heroSlides[1] && <BannerPictures
|
|
19
|
-
slot="picture-1" {...heroSlides[1]} index={1}
|
|
20
|
-
widths={[856, 1024, 1536]} class="max-w-screen-sm sm:max-w-screen-lg" />}
|
|
21
|
-
{heroSlides[2] && <BannerPictures
|
|
22
|
-
slot="picture-2" {...heroSlides[2]} index={2}
|
|
23
|
-
widths={[856, 1024, 1536]} class="max-w-screen-sm sm:max-w-screen-lg" />}
|
|
24
|
-
{heroSlides[3] && <BannerPictures
|
|
25
|
-
slot="picture-3" {...heroSlides[3]} index={3}
|
|
26
|
-
widths={[856, 1024, 1536]} class="max-w-screen-sm sm:max-w-screen-lg" />}
|
|
27
|
-
{heroSlides[4] && <BannerPictures
|
|
28
|
-
slot="picture-4" {...heroSlides[4]} index={4}
|
|
29
|
-
widths={[856, 1024, 1536]} class="max-w-screen-sm sm:max-w-screen-lg" />}
|
|
30
|
-
{heroSlides[5] && <BannerPictures
|
|
31
|
-
slot="picture-5" {...heroSlides[5]} index={5}
|
|
32
|
-
widths={[856, 1024, 1536]} class="max-w-screen-sm sm:max-w-screen-lg" />}
|
|
33
|
-
<!-- https://github.com/withastro/astro/issues/5066#issuecomment-1277998365 -->
|
|
34
|
-
</HeroSlider>
|
|
35
|
-
}
|
|
36
|
-
<Sections />
|
|
37
|
-
</main>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import api from '@cloudcommerce/api';
|
|
3
|
-
import SharedData from '@@sf/components/SharedData.astro';
|
|
4
|
-
import Sections from '~/main/Sections.astro';
|
|
5
|
-
|
|
6
|
-
const { fetchingApiContext } = Astro.locals.routeContext;
|
|
7
|
-
const [
|
|
8
|
-
{ data: { result: grids } },
|
|
9
|
-
] = await Promise.all([
|
|
10
|
-
api.get('grids'),
|
|
11
|
-
fetchingApiContext,
|
|
12
|
-
]);
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
<main>
|
|
16
|
-
<SharedData field="grids" value={grids} />
|
|
17
|
-
<Sections />
|
|
18
|
-
</main>
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import loadRouteContext, { type RouteContext } from '@@sf/ssr-context';
|
|
3
|
-
import BaseHead from '@@sf/layouts/BaseHead.astro';
|
|
4
|
-
import Base from '~/layouts/Base.astro';
|
|
5
|
-
import PageHeader from '~/layouts/PageHeader.astro';
|
|
6
|
-
import PageFooter from '~/layouts/PageFooter.astro';
|
|
7
|
-
import HomeMain from '~/main/Home.astro';
|
|
8
|
-
|
|
9
|
-
let routeContext: RouteContext | undefined;
|
|
10
|
-
let loadError: any;
|
|
11
|
-
try {
|
|
12
|
-
routeContext = await loadRouteContext(Astro);
|
|
13
|
-
} catch (err: any) {
|
|
14
|
-
if (err.astroResponse) {
|
|
15
|
-
return err.astroResponse;
|
|
16
|
-
}
|
|
17
|
-
loadError = err;
|
|
18
|
-
}
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
<!DOCTYPE html>
|
|
22
|
-
<html lang={routeContext?.lang.replace('_', '-')}>
|
|
23
|
-
{routeContext &&
|
|
24
|
-
<Base>
|
|
25
|
-
<BaseHead slot="base-head" />
|
|
26
|
-
<PageHeader />
|
|
27
|
-
<HomeMain />
|
|
28
|
-
<PageFooter />
|
|
29
|
-
</Base>
|
|
30
|
-
}
|
|
31
|
-
{loadError && <Fragment set:html={loadError.responseHTML} />}
|
|
32
|
-
</html>
|