cloudcommerce 0.16.0 → 0.16.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 +14 -0
- package/package.json +6 -6
- package/packages/api/package.json +1 -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/infinitepay/package.json +1 -1
- package/packages/apps/jadlog/package.json +1 -1
- package/packages/apps/loyalty-points/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/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 +2 -2
- package/packages/config/package.json +1 -1
- package/packages/emails/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/modules/tests/modules.test.mjs +1 -1
- package/packages/passport/package.json +1 -1
- package/packages/ssr/lib/firebase/serve-storefront.js +9 -0
- package/packages/ssr/lib/firebase/serve-storefront.js.map +1 -1
- package/packages/ssr/package.json +3 -3
- package/packages/ssr/src/firebase/serve-storefront.ts +10 -0
- package/packages/storefront/dist/client/_astro/Carousel.f39be3c0.js +1 -0
- package/packages/storefront/dist/client/_astro/HeroSlider.3d4a1d1c.js +1 -0
- package/packages/storefront/dist/client/_astro/PitchBar.c53e6d0b.js +1 -0
- package/packages/storefront/dist/client/_astro/Prices.de6df3cb.js +1 -0
- package/packages/storefront/dist/client/_astro/ProductShelf.f013b3ee.js +1 -0
- package/packages/storefront/dist/client/_astro/ShopHeader.c0ba5061.js +4 -0
- package/packages/storefront/dist/client/_astro/{_...slug_.ab554647.css → _...slug_.45bc69ca.css} +1 -1
- package/packages/storefront/dist/client/_astro/{_plugin-vue_export-helper.8870d8dc.js → _plugin-vue_export-helper.d3aaeb0d.js} +1 -1
- package/packages/storefront/dist/client/_astro/client.2d950540.js +1 -0
- package/packages/storefront/dist/client/_astro/{firebase-app.5325b6d5.js → firebase-app.84207480.js} +3 -3
- package/packages/storefront/dist/client/_astro/{format-money.3868f219.js → format-money.3b884fcb.js} +1 -1
- package/packages/storefront/dist/client/_astro/{hoisted.6aebc438.js → hoisted.9d9d7ac4.js} +1 -1
- package/packages/storefront/dist/client/_astro/img.517fec8e.js +1 -0
- package/packages/storefront/dist/client/_astro/index.33347cbd.js +1 -0
- package/packages/storefront/dist/client/_astro/{modules-info.c65d970c.js → modules-info.ad27b027.js} +1 -1
- package/packages/storefront/dist/client/_astro/preload-helper.cf010ec4.js +1 -0
- package/packages/storefront/dist/client/_astro/runtime-dom.esm-bundler.00b967e0.js +1 -0
- package/packages/storefront/dist/client/sw.js +1 -1
- package/packages/storefront/dist/server/chunks/{_...5993f704.mjs → _...06f412d0.mjs} +3 -3
- package/packages/storefront/dist/server/chunks/{account@_@astro.f35b9c8d.mjs → account@_@astro.d58b2d34.mjs} +3 -3
- package/packages/storefront/dist/server/chunks/{astro.c449fda8.mjs → astro.2df8d1c5.mjs} +284 -292
- package/packages/storefront/dist/server/chunks/{endpoint@_@js.c74a899a.mjs → endpoint@_@js.ce919661.mjs} +3 -3
- package/packages/storefront/dist/server/chunks/{fallback@_@astro.50cbf3a3.mjs → fallback@_@astro.6c7c4acd.mjs} +3 -3
- package/packages/storefront/dist/server/chunks/{index@_@astro.a9e6a560.mjs → index@_@astro.8e359cb4.mjs} +3 -3
- package/packages/storefront/dist/server/chunks/{index@_@astro.2a31c91e.mjs → index@_@astro.f7e2409d.mjs} +3 -3
- package/packages/storefront/dist/server/chunks/pages/{_...slug_.astro.116acf2f.mjs → _...slug_.astro.f0a57b8d.mjs} +51 -31
- package/packages/storefront/dist/server/chunks/pages/{account.astro.7074390b.mjs → account.astro.f630663e.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/pages/{endpoint.js.7cc60df6.mjs → endpoint.js.1d889b2f.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/pages/{fallback.astro.c8d2f06a.mjs → fallback.astro.42f81a9a.mjs} +3 -3
- package/packages/storefront/dist/server/chunks/pages/{index.astro.bf79b1d4.mjs → index.astro.533679e1.mjs} +97 -23
- package/packages/storefront/dist/server/entry.mjs +9 -9
- package/packages/storefront/dist/server/renderers.mjs +2 -2
- package/packages/storefront/package.json +5 -5
- package/packages/storefront/src/lib/components/Carousel.vue +34 -14
- package/packages/storefront/src/lib/components/CarouselControl.vue +7 -7
- package/packages/storefront/src/lib/components/_injection-keys.ts +1 -1
- package/packages/types/package.json +1 -1
- package/packages/storefront/dist/client/_astro/Carousel.93c2309b.js +0 -1
- package/packages/storefront/dist/client/_astro/HeroSlider.c5b673b3.js +0 -1
- package/packages/storefront/dist/client/_astro/PitchBar.d0e3362e.js +0 -1
- package/packages/storefront/dist/client/_astro/Prices.51598206.js +0 -1
- package/packages/storefront/dist/client/_astro/Prices.5186c09f.js +0 -1
- package/packages/storefront/dist/client/_astro/ProductShelf.d90bfc6e.js +0 -1
- package/packages/storefront/dist/client/_astro/ShopHeader.e88dedbc.js +0 -4
- package/packages/storefront/dist/client/_astro/client.06720904.js +0 -1
- package/packages/storefront/dist/client/_astro/img.2ae78c70.js +0 -1
- package/packages/storefront/dist/client/_astro/index.3de006ba.js +0 -1
- package/packages/storefront/dist/client/_astro/preload-helper.101896b7.js +0 -1
- package/packages/storefront/dist/client/_astro/runtime-dom.esm-bundler.7a95af90.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.16.1](https://github.com/ecomplus/cloud-commerce/compare/v0.16.0...v0.16.1) (2023-07-11)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **ssr:** Debug SSR time on new X-SSR-Took response header ([ed333c9](https://github.com/ecomplus/cloud-commerce/commit/ed333c9fba55164b55b32511142859adb1b9923e))
|
|
11
|
+
* **storefront:** Update <Carousel> to support multi-slides per page ([1d07555](https://github.com/ecomplus/cloud-commerce/commit/1d075551c3e4f270ee6896c5fa0b47e916d3b204))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* **deps:** Update non-major dependencies ([#192](https://github.com/ecomplus/cloud-commerce/issues/192)) ([5bc9102](https://github.com/ecomplus/cloud-commerce/commit/5bc9102debf14e4c32bc9228704ff40138f7558b))
|
|
17
|
+
* **storefront:** Update dependency astro to v2.8.0 ([#193](https://github.com/ecomplus/cloud-commerce/issues/193)) ([058acbc](https://github.com/ecomplus/cloud-commerce/commit/058acbc9ee6b17ad880b8aa7cf1c9dee8975cfe6))
|
|
18
|
+
|
|
5
19
|
## [0.16.0](https://github.com/ecomplus/cloud-commerce/compare/v0.15.1...v0.16.0) (2023-07-07)
|
|
6
20
|
|
|
7
21
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloudcommerce",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.16.
|
|
4
|
+
"version": "0.16.1",
|
|
5
5
|
"description": "Open fair-code headless commerce platform: API-first, microservices based, event driven and cloud native",
|
|
6
6
|
"main": "packages/api/lib/index.js",
|
|
7
7
|
"author": "E-Com Club Softwares para E-commerce <ti@e-com.club>",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"@commitlint/config-conventional": "^17.6.6",
|
|
21
21
|
"@commitlint/rules": "^17.6.5",
|
|
22
22
|
"@types/node": "^18.16.19",
|
|
23
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
24
|
-
"@typescript-eslint/parser": "^5.
|
|
23
|
+
"@typescript-eslint/eslint-plugin": "^5.61.0",
|
|
24
|
+
"@typescript-eslint/parser": "^5.61.0",
|
|
25
25
|
"eslint": "^8.44.0",
|
|
26
26
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
27
27
|
"eslint-plugin-import": "^2.27.5",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"turbo": "1.10.6",
|
|
33
33
|
"typescript": "~5.0.4",
|
|
34
34
|
"uglify-js": "^3.17.4",
|
|
35
|
-
"vite": "^4.
|
|
36
|
-
"vitest": "^0.
|
|
37
|
-
"zx": "^7.2.
|
|
35
|
+
"vite": "^4.4.2",
|
|
36
|
+
"vitest": "^0.33.0",
|
|
37
|
+
"zx": "^7.2.3"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"fix-install": "bash scripts/pre-install.sh && pnpm i",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.16.
|
|
4
|
+
"version": "0.16.1",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce CLI tools",
|
|
6
6
|
"bin": {
|
|
7
7
|
"cloudcommerce": "./bin/run.mjs"
|
|
@@ -29,6 +29,6 @@
|
|
|
29
29
|
"@cloudcommerce/api": "workspace:*",
|
|
30
30
|
"libsodium-wrappers": "^0.7.11",
|
|
31
31
|
"md5": "^2.3.0",
|
|
32
|
-
"zx": "^7.2.
|
|
32
|
+
"zx": "^7.2.3"
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import assert from 'node:assert';
|
|
2
2
|
import test, { describe } from 'node:test';
|
|
3
3
|
|
|
4
|
-
const baseUrl = 'http://127.0.0.1:5001/ecom2-
|
|
4
|
+
const baseUrl = 'http://127.0.0.1:5001/ecom2-demo/us-east4/modules';
|
|
5
5
|
|
|
6
6
|
describe('Test Schemas', async () => {
|
|
7
7
|
test('@checkout', async (/* t */) => {
|
|
@@ -69,6 +69,15 @@ export default (req, res) => {
|
|
|
69
69
|
res.sendStatus(400);
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
|
+
const ssrStartedAt = Date.now();
|
|
73
|
+
const _end = res.end;
|
|
74
|
+
/* eslint-disable prefer-rest-params */
|
|
75
|
+
// @ts-ignore
|
|
76
|
+
res.end = function resEnd() {
|
|
77
|
+
res.set('X-SSR-Took', String(Date.now() - ssrStartedAt));
|
|
78
|
+
// @ts-ignore
|
|
79
|
+
_end.apply(res, arguments);
|
|
80
|
+
};
|
|
72
81
|
/*
|
|
73
82
|
https://github.com/withastro/astro/blob/main/examples/ssr/server/server.mjs
|
|
74
83
|
import { handler as renderStorefront } from '../dist/server/entry.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve-storefront.js","sourceRoot":"","sources":["../../src/firebase/serve-storefront.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAW/C,MAAM,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;AAC5C,MAAM,OAAO,GAAG,mBAAmB,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;AACrD,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC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GAAG,EAAE,EAAE,UAAU,CAAC,CAAC;QAC7C,IAAI;YACF,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,KAAK,CAAC,CAAC;YACnC,iBAAiB,CAAC,GAAG,EAAE,kCAAkC,CAAC;iBACvD,IAAI,CAAC,IAAI,CAAC,CAAC;SACf;QAAC,OAAO,CAAC,EAAE;YACV,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;SAClB;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/ssr",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.16.
|
|
4
|
+
"version": "0.16.1",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce storefront SSR",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
"@ecomplus/utils": "1.5.0-rc.5",
|
|
31
31
|
"@headlessui/vue": "^1.7.14",
|
|
32
32
|
"@vueuse/core": "10.2.1",
|
|
33
|
-
"astro": "2.
|
|
33
|
+
"astro": "2.8.0",
|
|
34
34
|
"firebase-admin": "^11.9.0",
|
|
35
35
|
"firebase-functions": "^4.4.1",
|
|
36
|
-
"semver": "^7.5.
|
|
36
|
+
"semver": "^7.5.4",
|
|
37
37
|
"vue": "^3.3.4"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
@@ -84,6 +84,16 @@ export default (req: Request, res: Response) => {
|
|
|
84
84
|
return;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
const ssrStartedAt = Date.now();
|
|
88
|
+
const _end = res.end;
|
|
89
|
+
/* eslint-disable prefer-rest-params */
|
|
90
|
+
// @ts-ignore
|
|
91
|
+
res.end = function resEnd() {
|
|
92
|
+
res.set('X-SSR-Took', String(Date.now() - ssrStartedAt));
|
|
93
|
+
// @ts-ignore
|
|
94
|
+
_end.apply(res, arguments);
|
|
95
|
+
};
|
|
96
|
+
|
|
87
97
|
/*
|
|
88
98
|
https://github.com/withastro/astro/blob/main/examples/ssr/server/server.mjs
|
|
89
99
|
import { handler as renderStorefront } from '../dist/server/entry.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as X,a as Y,b as Z}from"./index.33347cbd.js";import{_ as K,s as M,V as q,x as P,u as G,D as v,z as J,C as A,N as c,K as h,W as D,r as F,X as Q,L as ee,Y as te,Z as ae,E as oe,w as L,G as le,v as H,$ as se,a0 as re}from"./_plugin-vue_export-helper.d3aaeb0d.js";const U=Symbol("carousel"),ne=M({__name:"CarouselControl",props:{isPrev:{type:Boolean,default:!1}},setup(r,{expose:u}){u();const{changeSlide:l}=q(U),t={changeSlide:l};return Object.defineProperty(t,"__isScriptSetup",{enumerable:!1,value:!0}),t}}),ue=["aria-label","data-carousel-control"];function ie(r,u,l,t,n,o){return P(),G("button",{type:"button","aria-label":l.isPrev?"Anterior":"Próximo",onClick:u[0]||(u[0]=m=>t.changeSlide(l.isPrev?-1:1)),class:A(["group absolute top-0 z-1",l.isPrev?"left-0":"right-0"]),"data-carousel-control":l.isPrev?"previous":"next"},[v(r.$slots,"default",{},()=>[J("i",{class:A(["m-0",l.isPrev?"i-chevron-left group-active:-translate-x-1":"i-chevron-right group-active:translate-x-1"])},null,2)])],10,ue)}const ce=K(ne,[["render",ie]]),de=M({__name:"Carousel",props:{as:{default:"ul"},modelValue:{default:1},autoplay:{}},emits:["update:modelValue"],setup(r,{expose:u,emit:l}){u();const t=r,n=c(t.modelValue-1);h(D(t,"modelValue"),e=>{n.value=e-1}),h(n,(e,a)=>{e!==a&&l("update:modelValue",e+1)});const o=c(null),{x:m,isScrolling:B,arrivedState:_}=X(o),W=F(()=>_.left),T=F(()=>_.right),s=c([]),g=c(0),p=c(0),I=c(0),V=()=>{o.value&&(g.value=o.value.scrollWidth,p.value=o.value.offsetWidth)},k=()=>{if(!o.value)return;let e=[...o.value.children];e.length===1&&e[0].tagName.endsWith("SLOT")&&(e=[...e[0].children]),s.value=e.map(a=>({offsetLeft:a.offsetLeft,width:a.offsetWidth}))},z=e=>{let a=n.value+e;if(a>=s.value.length)return 0;a<0&&(a=s.value.length+a);const{offsetLeft:b,width:d}=s.value[a]||{};return d?b:0},x=()=>{const e=s.value.findIndex(a=>Math.abs(a.offsetLeft-m.value)<=5);e>-1&&(n.value=e||0)},E=()=>{const e=g.value-p.value;I.value=s.value.findIndex(({offsetLeft:a})=>a>=e-5)};let i;const f=()=>{t.autoplay&&(clearTimeout(i),i=setTimeout(()=>{C(1)},t.autoplay))},C=(e,a=!0)=>{if(s.value.length<2)return;if(a&&(e===1||e===-1)){let d=0,$=0;for(let S=n.value;S<s.value.length;S++){const{width:j}=s.value[S]||{};if(j&&(d+=1,$+=j,$>=p.value))break}d&&(e=e>0?d:-d)}t.autoplay||console.log({direction:e},n.value,s.value.length);const b=z(e);o.value?.scrollTo({left:b,behavior:"smooth"}),f()};h(B,e=>{e?clearTimeout(i):(x(),f())});const N=c(null),O=Y(N);h(O,e=>{e?clearTimeout(i):f()});const w=()=>{o.value&&(V(),k(),x(),E())},y=Z(()=>{o.value&&(o.value.scrollLeft=0,w())},400);Q(()=>{w(),ee(()=>{o.value&&[...o.value.children].forEach(e=>{e.setAttribute("tabindex","0")})}),f(),window.addEventListener("resize",y)}),te(()=>{window.removeEventListener("resize",y),clearTimeout(i)}),ae(U,{autoplay:D(t,"autoplay"),changeSlide:C,isBoundLeft:W,isBoundRight:T});const R={props:t,emit:l,currentIndex:n,wrapper:o,currentPos:m,isScrolling:B,arrivedState:_,isBoundLeft:W,isBoundRight:T,slidesWidth:s,wrapperScrollWidth:g,wrapperVisibleWidth:p,indexCount:I,calcWrapperWidth:V,calcSlidesWidth:k,calcNextOffsetLeft:z,calcCurrentIndex:x,calcIndexCount:E,get autoplayTimer(){return i},set autoplayTimer(e){i=e},restartAutoplay:f,changeSlide:C,carousel:N,isHovered:O,calcOnInit:w,onResize:y,CarouselControl:ce};return Object.defineProperty(R,"__isScriptSetup",{enumerable:!1,value:!0}),R}}),fe={ref:"carousel",class:"relative","data-carousel":""};function ve(r,u,l,t,n,o){return P(),G("div",fe,[(P(),oe(le(l.as),{ref:"wrapper",class:"flex overflow-x-scroll overflow-y-hidden list-none m-0 p-0 snap-x snap-mandatory scroll-smooth [&>*]:snap-start [&>*]:outline-none",style:{"scrollbar-width":"none","-webkit-overflow-scrolling":"touch","-ms-overflow-style":"none"},"data-carousel-wrapper":""},{default:L(()=>[v(r.$slots,"default")]),_:3},512)),v(r.$slots,"controls",se(re({changeSlide:t.changeSlide,isBoundLeft:t.isBoundLeft,isBoundRight:t.isBoundRight,currentPage:t.currentIndex+1,pageCount:t.indexCount+1})),()=>[H(t.CarouselControl,{"is-prev":""},{default:L(()=>[v(r.$slots,"previous")]),_:3}),H(t.CarouselControl,null,{default:L(()=>[v(r.$slots,"next")]),_:3})])],512)}const me=K(de,[["render",ve]]);export{me as C,ce as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{v as x}from"./runtime-dom.esm-bundler.00b967e0.js";import{p as d}from"./modules-info.ad27b027.js";import{r as b,_ as g,s as v,u as o,v as m,w as i,x as r,y as w,z as a,F as y,A as C,C as f,D as S,E as k,G as H,H as T,I as p,J as h}from"./_plugin-vue_export-helper.d3aaeb0d.js";import{C as B,a as D}from"./Carousel.f39be3c0.js";import"./session-utm.744b0db3.js";import"./idle-callback.889bf0ea.js";import"./format-money.3b884fcb.js";import"./index.33347cbd.js";const N=l=>({parsedSlides:b(()=>l.slides.map(e=>{const s=e.title?d(e.title).value:"",n=e.subtitle?d(e.subtitle).value:"",_=e.buttonText?d(e.buttonText).value:"";return{...e,hasHeader:!!(s||n||_)}}))}),V=v({__name:"HeroSlider",props:{autoplay:{},slides:{}},setup(l,{expose:c}){c();const e=l,{parsedSlides:s}=N(e),n={props:e,parsedSlides:s,Carousel:B,CarouselControl:D};return Object.defineProperty(n,"__isScriptSetup",{enumerable:!1,value:!0}),n}}),z={class:"relative mx-auto"},j=["href"],E={key:0,class:"basis-1/2 grow-0 p-12 xl:ps-32 mb-3 md:mb-0"},F={key:0,class:"text-lg mt-4 md:mt-6"},L=["href"],P={class:"absolute z-10 bottom-5 flex justify-end items-center w-screen right-5 xl:right-auto xl:max-w-screen-xl xl:left-1/2 xl:-ms-[640px]"},A={class:"relative w-20 h-10 rounded-full bg-white/50 text-primary shadow-sm ring-1 ring-black/5"},G=a("i",{class:"i-arrow-left"},null,-1),I=a("i",{class:"i-arrow-right"},null,-1);function J(l,c,e,s,n,_){return r(),o("section",z,[m(s.Carousel,{autoplay:e.autoplay},{controls:i(()=>[w(a("div",P,[a("div",A,[m(s.CarouselControl,{class:"w-10 h-10 rounded-full hover:bg-primary/10","is-prev":""},{default:i(()=>[G]),_:1}),m(s.CarouselControl,{class:"w-10 h-10 rounded-full hover:bg-primary/10"},{default:i(()=>[I]),_:1})])],512),[[x,s.parsedSlides.length>1]])]),default:i(()=>[(r(!0),o(y,null,C(s.parsedSlides,(t,u)=>(r(),o("li",{key:u,class:"shrink-0 basis-full h-full secondary"},[a("div",{class:f(["w-screen max-w-screen-2xl mx-auto overflow-x-hidden",t.hasHeader?"grid grid-cols-1 md:grid-cols-2 items-center":null])},[a("a",{href:t.href,class:f(t.hasHeader?"basis-1/2 grow-0 md:order-last":null)},[S(l.$slots,`picture-${u}`)],10,j),t.hasHeader?(r(),o("div",E,[(r(),k(H(u===0?"h2":"h3"),{class:"ui-title mt-1"},{default:i(()=>[T(p(t.title),1)]),_:2},1024)),t.subtitle?(r(),o("p",F,p(t.subtitle),1)):h("",!0),t.buttonText?(r(),o("a",{key:1,href:t.buttonLink,class:"ui-btn-lg ui-btn-contrast min-w-[150px] mt-7 md:mt-10"},p(t.buttonText),9,L)):h("",!0)])):h("",!0)],2)]))),128))]),_:3},8,["autoplay"])])}const X=g(V,[["render",J]]);export{X as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{v as h}from"./runtime-dom.esm-bundler.00b967e0.js";import{p as _}from"./modules-info.ad27b027.js";import{U as f,r as u,_ as v,s as C,u as l,z as m,v as d,w as p,x as n,y as g,F as b,A as x,E as w,G as y,C as S,J as k}from"./_plugin-vue_export-helper.d3aaeb0d.js";import{C as B,a as P}from"./Carousel.f39be3c0.js";import"./session-utm.744b0db3.js";import"./idle-callback.889bf0ea.js";import"./format-money.3b884fcb.js";import"./index.33347cbd.js";function V(t,s){{const a=btoa(JSON.stringify({filename:t}));window.parent.postMessage(JSON.parse(JSON.stringify({type:"open",filename:t,id:a})),window.location.origin),window.addEventListener("message",e=>{e.data.id===a&&s(e.data.data)})}}const L=t=>{const s=f(null);return window.$isCmsPreview&&V(t,a=>{s.value=a}),{liveContent:s}},N=t=>{const s={slides:[]};return t.header?.pitch_bar&&(s.slides=t.header.pitch_bar),s},J=t=>{const{liveContent:s}=L("layout"),a=u(()=>(s.value?N(s.value).slides:t.slides).map(({html:o})=>_(o).value.replace(/<\/?p>/g,"").replace(/<(\/?d-md)>/g,"<$1>"))),e=u(()=>a.value.filter(r=>r).length);return{parsedContents:a,countValidSlides:e}},O=C({__name:"PitchBar",props:{slides:{}},setup(t,{expose:s}){s();const a=t,{parsedContents:e,countValidSlides:r}=J(a),o={props:a,parsedContents:e,countValidSlides:r,Carousel:B,CarouselControl:P};return Object.defineProperty(o,"__isScriptSetup",{enumerable:!1,value:!0}),o}}),z={class:"bg-base-100 relative z-20"},E={class:"container md:w-2/3 mx-auto px-3 py-1"},M=["innerHTML"],A={class:"text-xl leading-none text-base-400"};function D(t,s,a,e,r,o){return n(),l("div",z,[m("div",E,[d(e.Carousel,{autoplay:e.countValidSlides>1?7e3:void 0},{controls:p(()=>[g(m("div",A,[d(e.CarouselControl,{class:"pr-2 bg-base-100 hover:text-base-700","is-prev":""}),d(e.CarouselControl,{class:"pl-2 bg-base-100 hover:text-base-700"})],512),[[h,e.countValidSlides>1]])]),default:p(()=>[(n(!0),l(b,null,x(a.slides,(i,c)=>(n(),l("li",{key:c,class:"shrink-0 basis-full h-full text-center"},[(n(),w(y(i.href?"ALink":"span"),{href:i.href,target:i.target,class:S(["inline-block px-8",i.href?"hover:underline":null])},{default:p(()=>[e.parsedContents[c]?(n(),l("span",{key:0,innerHTML:e.parsedContents[c],class:"prose text-sm text-base-800"},null,8,M)):k("",!0)]),_:2},1032,["href","target","class"]))]))),128))]),_:1},8,["autoplay"])])])}const I=v(O,[["render",D]]);export{I as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{m as g}from"./modules-info.ad27b027.js";import{g as k,c as A}from"./format-money.3b884fcb.js";import{r as a,_ as S,s as M,a2 as T,u as i,I as o,J as u,z as h,H as C,C as I,v as L,w as D,x as l}from"./_plugin-vue_export-helper.d3aaeb0d.js";import"./session-utm.744b0db3.js";import"./idle-callback.889bf0ea.js";const j=(n,c)=>{const{type:s,value:t}=c;let r;return t?(s==="percentage"?r=n*((100-t)/100):r=n-t,r>0?r:0):n},E=n=>{const c=a(()=>n.product||{price:n.price||0,base_price:n.basePrice}),s=a(()=>{const{variations:e}=c.value;if(e){const _=k(c.value);for(let v=0;v<e.length;v++)if(k({...c.value,...e[v]})>_)return!0}return!1}),t=a(()=>g.apply_discount.available_extra_discount),r=a(()=>{const e=k(c.value),_=t.value;return _&&(!_.min_amount||e>_.min_amount)?j(e,_):e}),f=a(()=>{if(A(c.value))return c.value.base_price;const e=k(c.value);return e>r.value?e:0}),m=a(()=>n.installmentsOption||g.list_payments.installments_option||{max_number:1}),y=a(()=>{if(m.value.max_number<=1)return 1;const e=m.value.min_installment||5,_=Math.round(r.value/e);return Math.min(_,m.value.max_number)}),b=a(()=>m.value.monthly_interest||0),x=a(()=>{if(y.value>=2){if(!b.value)return r.value/y.value;const e=b.value/100;return r.value*e/(1-(1+e)**-y.value)}return 0}),p=a(()=>{const e=n.discountOption||g.list_payments.discount_option;return e&&(!e.min_amount||e.min_amount<=r.value)&&(!n.isAmountTotal||e.apply_at==="total")?e:{}}),V=a(()=>{const{label:e}=p.value;return e?e.includes(" ")?e:`via ${e}`:""}),O=a(()=>j(r.value,p.value)),d=a(()=>{if(n.loyaltyPointsProgram)return n.loyaltyPointsProgram;const e=g.list_payments.loyalty_points_programs;if(e){const _=Object.keys(e);for(let v=0;v<_.length;v++){const P=e[_[v]];if(P?.earn_percentage&&P.earn_percentage>0)return P}}return{ratio:0}}),w=a(()=>d.value.min_subtotal_to_earn||0),z=a(()=>d.value.name||""),N=a(()=>d.value.earn_percentage||0),B=a(()=>N.value*d.value.ratio),W=a(()=>B.value>=1?r.value*(B.value/100):0);return{hasVariedPrices:s,salePrice:r,comparePrice:f,installmentsObject:m,installmentsNumber:y,monthlyInterest:b,installmentValue:x,discountObject:p,discountLabel:V,priceWithDiscount:O,pointsProgramObject:d,pointsMinPrice:w,pointsProgramName:z,earnPointsPercentage:N,cashbackPercentage:B,cashbackValue:W}},F=M({__name:"Prices",props:{isBig:{type:Boolean},isLiteral:{type:Boolean},hasCashback:{type:Boolean,default:!0},hasPriceOptions:{type:Boolean,default:!0},product:{},price:{},basePrice:{},isAmountTotal:{type:Boolean},installmentsOption:{},discountOption:{},loyaltyPointsProgram:{}},setup(n,{expose:c}){c();const s=n,{hasVariedPrices:t,salePrice:r,comparePrice:f,cashbackPercentage:m,cashbackValue:y,installmentsNumber:b,monthlyInterest:x,installmentValue:p,priceWithDiscount:V,discountLabel:O}=E(s),d={props:s,hasVariedPrices:t,salePrice:r,comparePrice:f,cashbackPercentage:m,cashbackValue:y,installmentsNumber:b,monthlyInterest:x,installmentValue:p,priceWithDiscount:V,discountLabel:O};return Object.defineProperty(d,"__isScriptSetup",{enumerable:!1,value:!0}),d}}),H={key:0,class:"text-base-500 mr-1 [font-size:87%]"},J={key:0},R={key:1},q={key:0},G={key:0,class:"relative z-10"},K=["data-tooltip"],Q=h("i",{class:"i-cashback mr-1"},null,-1),U={class:"font-medium"},X=h("small",null," cashback",-1),Y={key:0},Z={key:0},$={key:1},ee={key:2},te={key:0},ne={key:0},ae={key:1};function se(n,c,s,t,r,f){const m=T("Fade");return l(),i("div",{class:I(["text-base-600 [&>div]:[font-size:90%] [&_small]:lowercase [&_small]:[font-size:92%]",s.isBig?"text-lg":null]),"data-prices":""},[t.comparePrice?(l(),i("span",H,[s.isLiteral?(l(),i("small",J,o("De "))):u("",!0),h("s",null,o(n.$money(t.comparePrice)),1),s.isLiteral?(l(),i("small",R,o(" Por"))):u("",!0)])):u("",!0),h("strong",{class:I(["inline-block text-base-800",s.isBig?"text-5xl block":null])},[t.hasVariedPrices?(l(),i("small",q,o("A partir de "))):u("",!0),C(" "+o(n.$money(t.salePrice)),1)],2),L(m,{slide:"down"},{default:D(()=>[t.cashbackValue&&s.hasCashback?(l(),i("div",G,[h("span",{"data-tooltip":"Receba $1 de volta".replace("$1",n.$percentage(t.cashbackPercentage))},[Q,h("span",U,o(n.$money(t.cashbackValue)),1),X],8,K)])):u("",!0)]),_:1}),L(m,{slide:"down"},{default:D(()=>[t.installmentValue&&s.hasPriceOptions?(l(),i("div",Y,[s.isLiteral?(l(),i("small",Z,o("Até "))):u("",!0),C(" "+o(t.installmentsNumber)+"x ",1),s.isLiteral?(l(),i("small",$,o(" De "))):u("",!0),h("span",null,o(n.$money(t.installmentValue)),1),!t.monthlyInterest&&s.isLiteral?(l(),i("small",ee,o("Sem juros"))):u("",!0)])):u("",!0)]),_:1}),L(m,{slide:"down"},{default:D(()=>[t.priceWithDiscount<t.salePrice&&s.hasPriceOptions?(l(),i("div",te,[t.discountLabel?u("",!0):(l(),i("small",ne,o("A partir de "))),h("span",null,o(n.$money(t.priceWithDiscount)),1),t.discountLabel?(l(),i("small",ae,o(` ${t.discountLabel}`),1)):u("",!0)])):u("",!0)]),_:1})],2)}const ue=S(F,[["render",se]]);export{ue as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{v as z}from"./runtime-dom.esm-bundler.00b967e0.js";import{a as C}from"./api.7f62c1ff.js";import{T as F,N as g,a1 as E,r as v,_ as N,s as Q,a2 as B,x as i,u as h,E as x,w,z as b,F as P,v as k,J as H,G as A,C as T,H as I,I as S,y as V,A as D}from"./_plugin-vue_export-helper.d3aaeb0d.js";import{C as M,a as G}from"./Carousel.f39be3c0.js";import{a as J,w as R}from"./index.33347cbd.js";import{i as K,g as O}from"./img.517fec8e.js";import{g as j,c as U}from"./format-money.3b884fcb.js";import W from"./Prices.de6df3cb.js";import"./modules-info.ad27b027.js";import"./session-utm.744b0db3.js";import"./idle-callback.889bf0ea.js";const X=(t,n=F.get("lang"))=>n&&t.i18n&&t.i18n[n]?t.i18n[n]:t.name||t.title||K(t.i18n,n)||"",Y=X,Z=t=>t&&t.min_quantity||1,$=Z,tt=t=>!t.hasOwnProperty("quantity")||t.quantity>=$(t),q=tt,et=t=>{const n=g(t.title||""),a=g(t.titleLink||""),e=g(!1);let o=null;const u=g(null),l=E(t.products||[]);return t.products||(e.value=!0,o=(async()=>{let c=t.searchQuery||"",d;if(t.collectionId){try{const{data:s}=await C.get(`collections/${t.collectionId}`);d=s}catch(s){console.error(s),u.value=s}const r=d?.products;Array.isArray(r)&&r.length&&(c+=`&_id=${r.slice(0,60).join(",")}`),!n.value&&n.value!==null&&d?.name&&(n.value=d?.name)}const m=t.limit||24;let _=`offset=${t.page?(t.page-1)*m:0}&limit=${m}`;t.sort&&(_+=`&sort=${t.sort}`),_+=c;try{const{data:r}=await C.get(`search/v1?${_}`);if(t.isShuffle){let s=r.result.filter(L=>L.available&&q(L)).length,p,f;for(;s;)f=Math.floor(Math.random()*s--),p=r.result[s],r.result[s]=r.result[f],r.result[f]=p}r.result.forEach(s=>l.push(s))}catch(r){console.error(r),u.value=r}e.value=!1})()),{title:n,titleLink:a,isFetching:e,fetching:o,fetchError:u,products:l}},rt=t=>{const n=g(!1);let a=null;const e=g(null),o=E({...t.product,price:j(t.product||{})}),u=v(()=>Y(o)),l=v(()=>{const{slug:r}=o;return typeof r=="string"?`/${r}`:null}),c=v(()=>{const{pictures:r}=o,s=[];if(r)r.forEach(p=>{const f=O(p);f&&s.push(f)});else{const{picture:p}=o;if(p){const f=O(p);f&&s.push(f)}}return s}),d=v(()=>q(o)),m=v(()=>d.value&&o.available&&o.visible),y=v(()=>{if(U(o)){const r=o.base_price;return Math.round((r-j(o))*100/r)}return 0}),{productId:_}=t;return!t.product&&_&&(n.value=!0,a=(async()=>{try{const{data:r}=await C.get(`products/${_}`);Object.assign(o,r)}catch(r){console.error(r),e.value=r}n.value=!1})()),{isFetching:n,fetching:a,fetchError:e,product:o,title:u,link:l,images:c,isInStock:d,isActive:m,discountPercentage:y}},ot=Q({__name:"ProductCard",props:{product:{},productId:{},headingTag:{default:"h3"}},setup(t,{expose:n}){n();const a=t,{product:e,title:o,link:u,images:l}=rt({product:a.product,productId:a.productId}),c=g(null),d=J(c),m=g(!1);R(d,()=>{m.value=!0});const y={props:a,product:e,title:o,link:u,images:l,card:c,isHovered:d,wasHoveredOnce:m,Prices:W};return Object.defineProperty(y,"__isScriptSetup",{enumerable:!1,value:!0}),y}}),nt=["data-sku"],st={class:"aspect-square p-2 motion-safe:group-hover:scale-110 transition-transform"},at={class:"relative w-full h-full bg-white rounded overflow-hidden group-hover:rounded-none"},lt={key:1,class:"w-full h-full bg-gradient-to-br from-base-50/20 to-base-100"},ct={class:"flex flex-col grow justify-between p-4 group-hover:backdrop-blur-md bg-white/40 z-10"},it={class:"pt-2"};function ut(t,n,a,e,o,u){const l=B("AImg");return i(),h("article",{ref:"card","data-sku":e.product.sku,class:"relative h-full max-w-[350px] mx-auto py-3 group"},[(i(),x(A(e.link?"ALink":"span"),{href:e.link,class:"flex flex-col h-full rounded overflow-hidden group-hover:shadow group-hover:ring-1 ring-black/5"},{default:w(()=>[b("div",st,[b("div",at,[e.images?.length?(i(),h(P,{key:0},[k(l,{picture:e.images[0],class:"absolute top-0 left-0 block w-full h-full object-cover"},null,8,["picture"]),e.images[1]&&e.wasHoveredOnce?(i(),x(l,{key:0,picture:e.images[1],class:"absolute top-0 left-0 block w-full h-full object-cover opacity-0 group-hover:opacity-100 transition-opacity motion-safe:duration-300 text-transparent z-10"},null,8,["picture"])):H("",!0)],64)):(i(),h("div",lt))])]),b("div",ct,[(i(),x(A(a.headingTag),{class:T(["ui-link text-base-700 no-underline line-clamp-2",e.link?"group-hover:underline group-hover:text-primary":null])},{default:w(()=>[I(S(e.title),1)]),_:1},8,["class"])),b("div",it,[k(e.Prices,{product:e.product},null,8,["product"])])])]),_:1},8,["href"]))],8,nt)}const dt=N(ot,[["render",ut]]),ft=Q({__name:"ProductShelf",props:{collectionId:{},searchQuery:{},sort:{},title:{},titleLink:{},isShuffle:{type:Boolean},limit:{},page:{},products:{}},async setup(t,{expose:n}){n();const a=t,{title:e,titleLink:o,fetching:u,products:l}=et(a),c={props:a,title:e,titleLink:o,fetching:u,products:l,Carousel:M,CarouselControl:G,ProductCard:dt};return Object.defineProperty(c,"__isScriptSetup",{enumerable:!1,value:!0}),c}}),ht={class:"container mx-auto"},gt={key:0},mt={class:"text-3xl lg:text-xl leading-none text-primary lg:opacity-0 group-hover/shelf:opacity-90 transition-opacity"};function pt(t,n,a,e,o,u){const l=B("ALink");return i(),h("section",ht,[e.title?(i(),h("h2",gt,[e.titleLink?(i(),x(l,{key:0,href:e.titleLink},{default:w(()=>[I(S(e.title),1)]),_:1},8,["href"])):(i(),h(P,{key:1},[I(S(e.title),1)],64))])):H("",!0),k(e.Carousel,{class:"group/shelf"},{controls:w(()=>[V(b("div",mt,[k(e.CarouselControl,{class:"!top-1/2 lg:-left-2 w-10 h-10 bg-transparent lg:bg-white/80 lg:hover:bg-primary/10 rounded-full lg:shadow-sm lg:ring-1 ring-black/5","is-prev":""}),k(e.CarouselControl,{class:"!top-1/2 lg:-right-2 w-10 h-10 bg-transparent lg:bg-white/80 lg:hover:bg-primary/10 rounded-full lg:shadow-sm lg:ring-1 ring-black/5"})],512),[[z,e.products.length>2]])]),default:w(()=>[(i(!0),h(P,null,D(e.products,c=>(i(),h("li",{key:c._id,class:"basis-1/2 md:basis-1/3 lg:basis-1/4 shrink-0"},[k(e.ProductCard,{product:c},null,8,["product"])]))),128))]),_:1})])}const Lt=N(ft,[["render",pt]]);export{Lt as default};
|