cloudcommerce 2.5.0 → 2.6.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/CHANGELOG.md +23 -0
- package/ecomplus-stores/barradoce/functions/many/package.json +3 -3
- package/ecomplus-stores/barradoce/functions/ssr/package.json +6 -6
- package/ecomplus-stores/barradoce/functions/ssr/src/components/CartSidebar.vue +20 -0
- package/ecomplus-stores/barradoce/functions/ssr/src/components/HeroSlider.vue +1 -3
- package/ecomplus-stores/barradoce/functions/ssr/src/components/ProductDetails.vue +12 -4
- package/ecomplus-stores/barradoce/functions/ssr/src/components/ShippingCalculator.vue +100 -0
- package/ecomplus-stores/barradoce/functions/with-apps/package.json +3 -3
- package/ecomplus-stores/barradoce/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/ci/bunny-prepare-ab.sh +4 -4
- 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/eslint/storefront.eslintrc.cjs +1 -0
- 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 +3 -3
- package/packages/storefront/package.json +4 -3
- package/packages/storefront/src/__fixtures__/calculate_shipping.json +161 -0
- package/packages/storefront/src/helpers/afetch.ts +1 -0
- package/packages/storefront/src/lib/components/Spinner.vue +16 -0
- package/packages/storefront/src/lib/components/globals/Skeleton.vue +25 -7
- package/packages/storefront/src/lib/composables/use-shipping-calculator.ts +90 -31
- package/packages/storefront/src/lib/layouts/BaseBody.astro +0 -13
- package/packages/storefront/src/lib/scripts/experimental-web-ide.ts +29 -0
- package/packages/storefront/src/lib/ssr-context.ts +9 -0
- package/packages/storefront/src/web-ide/webcontainer.ts +104 -0
- package/packages/test-base/package.json +1 -1
- package/packages/types/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,29 @@
|
|
|
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
|
+
## [2.6.0](https://github.com/ecomplus/cloud-commerce/compare/v2.5.1...v2.6.0) (2024-02-22)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **storefront:** New `<Spinner>` basic component ([b83b594](https://github.com/ecomplus/cloud-commerce/commit/b83b594c133635413829bf4fca15b9177187cf3c))
|
|
11
|
+
* **storefront:** New `getShippingDeadline` and `getShippingPrice` methods on calculator composable ([4dc32e1](https://github.com/ecomplus/cloud-commerce/commit/4dc32e1c2a3d1b235c6d46f91602a263b393d432))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* **storefront:** Bump Astro to latest v4.4.1 and VueUse v10.8 ([e01fb6d](https://github.com/ecomplus/cloud-commerce/commit/e01fb6d2d307c93fbdf34e413b4b7bad5f939a5c))
|
|
17
|
+
* **storefront:** Exporting `isFetching` state from shipping calculator composable ([9266d0c](https://github.com/ecomplus/cloud-commerce/commit/9266d0c8d4a5c7dd6ffa99b44170988891e7257a))
|
|
18
|
+
* **storefront:** Prevent "=undefined" params on modules (and other internals) fetch ([a4f594e](https://github.com/ecomplus/cloud-commerce/commit/a4f594ea40269c6ef8b22cb166c3298fa877023d))
|
|
19
|
+
* **storefront:** Receiving `zipCode` ref instead of input on shipping calculator composable ([813dcb1](https://github.com/ecomplus/cloud-commerce/commit/813dcb16943f922ac52995778c42840d96195d67))
|
|
20
|
+
|
|
21
|
+
### [2.5.1](https://github.com/ecomplus/cloud-commerce/compare/v2.5.0...v2.5.1) (2024-02-19)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Bug Fixes
|
|
25
|
+
|
|
26
|
+
* **storefront:** Removing version debug at all ([2615483](https://github.com/ecomplus/cloud-commerce/commit/261548384b6914de432403c7711a8b325ee1999d))
|
|
27
|
+
|
|
5
28
|
## [2.5.0](https://github.com/ecomplus/cloud-commerce/compare/v2.4.3...v2.5.0) (2024-02-19)
|
|
6
29
|
|
|
7
30
|
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"main": "index.js",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@cloudcommerce/feeds": "^2.
|
|
19
|
-
"@cloudcommerce/firebase": "^2.
|
|
20
|
-
"@cloudcommerce/passport": "^2.
|
|
18
|
+
"@cloudcommerce/feeds": "^2.5.1",
|
|
19
|
+
"@cloudcommerce/firebase": "^2.5.1",
|
|
20
|
+
"@cloudcommerce/passport": "^2.5.1"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -19,16 +19,16 @@
|
|
|
19
19
|
},
|
|
20
20
|
"main": "index.js",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@cloudcommerce/api": "^2.
|
|
23
|
-
"@cloudcommerce/firebase": "^2.
|
|
24
|
-
"@cloudcommerce/ssr": "^2.
|
|
22
|
+
"@cloudcommerce/api": "^2.5.1",
|
|
23
|
+
"@cloudcommerce/firebase": "^2.5.1",
|
|
24
|
+
"@cloudcommerce/ssr": "^2.5.1",
|
|
25
25
|
"@headlessui/vue": "^1.7.18",
|
|
26
26
|
"micromark": "^4.0.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@cloudcommerce/i18n": "^2.
|
|
30
|
-
"@cloudcommerce/storefront": "^2.
|
|
31
|
-
"@cloudcommerce/types": "^2.
|
|
29
|
+
"@cloudcommerce/i18n": "^2.5.1",
|
|
30
|
+
"@cloudcommerce/storefront": "^2.5.1",
|
|
31
|
+
"@cloudcommerce/types": "^2.5.1",
|
|
32
32
|
"@iconify-json/mingcute": "^1.1.16",
|
|
33
33
|
"photoswipe": "^5.4.3"
|
|
34
34
|
}
|
|
@@ -39,6 +39,24 @@
|
|
|
39
39
|
</div>
|
|
40
40
|
<Prices :price="shoppingCart.subtotal" class="col-span-3 text-lg" />
|
|
41
41
|
</div>
|
|
42
|
+
<div v-if="!hasShippingCalculator" class="my-2.5 text-right">
|
|
43
|
+
<a
|
|
44
|
+
href="#"
|
|
45
|
+
class="ui-link text-base-700"
|
|
46
|
+
@click.prevent.stop="hasShippingCalculator = true"
|
|
47
|
+
>
|
|
48
|
+
{{ $t.i19calculateShipping }}
|
|
49
|
+
<i class="i-truck ml-1"></i>
|
|
50
|
+
</a>
|
|
51
|
+
</div>
|
|
52
|
+
<Fade slide="down">
|
|
53
|
+
<ShippingCalculator
|
|
54
|
+
v-if="hasShippingCalculator"
|
|
55
|
+
:shipped-items="shoppingCart.items"
|
|
56
|
+
class="my-2.5 flex flex-wrap justify-end"
|
|
57
|
+
can-auto-submit
|
|
58
|
+
/>
|
|
59
|
+
</Fade>
|
|
42
60
|
<CheckoutLink
|
|
43
61
|
to="checkout"
|
|
44
62
|
class="ui-btn-lg ui-btn-primary my-2.5 w-full text-right"
|
|
@@ -64,6 +82,8 @@ import { shoppingCart, totalItems } from '@@sf/state/shopping-cart';
|
|
|
64
82
|
import CheckoutLink from '@@sf/components/CheckoutLink.vue';
|
|
65
83
|
import Prices from '~/components/Prices.vue';
|
|
66
84
|
import CartItem from '~/components/CartItem.vue';
|
|
85
|
+
import ShippingCalculator from '~/components/ShippingCalculator.vue';
|
|
67
86
|
|
|
68
87
|
const emit = defineEmits(['close']);
|
|
88
|
+
const hasShippingCalculator = ref(false);
|
|
69
89
|
</script>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<section class="ui-section relative grid grid-cols-1 items-start
|
|
3
|
-
gap-5
|
|
3
|
+
gap-x-5 lg:grid-cols-4 lg:gap-x-4 2xl:gap-x-6">
|
|
4
4
|
<div class="w-full lg:col-span-3">
|
|
5
5
|
<template v-if="product.pictures?.length">
|
|
6
|
-
<ImagesGallery :pictures="product.pictures" />
|
|
6
|
+
<ImagesGallery :pictures="product.pictures" class="mb-5" />
|
|
7
7
|
</template>
|
|
8
8
|
</div>
|
|
9
|
-
<div class="lg:sticky-header:translate-y-24 top-0
|
|
10
|
-
transition-transform lg:sticky">
|
|
9
|
+
<div class="lg:sticky-header:translate-y-24 top-0 pt-4
|
|
10
|
+
transition-transform lg:sticky lg:pb-4">
|
|
11
11
|
<h1 class="text-secondary-900 ui-text-brand text-lg">
|
|
12
12
|
{{ title }}
|
|
13
13
|
</h1>
|
|
@@ -56,6 +56,13 @@
|
|
|
56
56
|
{{ $t.i19addToCart }}
|
|
57
57
|
</button>
|
|
58
58
|
</div>
|
|
59
|
+
<div class="border-base-50 border-t-secondary-100 mt-6
|
|
60
|
+
rounded border-2 p-4 lg:mt-4">
|
|
61
|
+
<ShippingCalculator
|
|
62
|
+
:shipped-items="[{ ...product, quantity }]"
|
|
63
|
+
has-label
|
|
64
|
+
/>
|
|
65
|
+
</div>
|
|
59
66
|
</div>
|
|
60
67
|
</div>
|
|
61
68
|
<div class="w-full lg:col-span-3">
|
|
@@ -74,6 +81,7 @@ import QuantitySelector from '@@sf/components/QuantitySelector.vue';
|
|
|
74
81
|
import Prices from '~/components/Prices.vue';
|
|
75
82
|
import ImagesGallery from '~/components/ImagesGallery.vue';
|
|
76
83
|
import SkuSelector from '~/components/SkuSelector.vue';
|
|
84
|
+
import ShippingCalculator from '~/components/ShippingCalculator.vue';
|
|
77
85
|
|
|
78
86
|
export interface Props {
|
|
79
87
|
product?: Products;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="max-w-sm">
|
|
3
|
+
<form
|
|
4
|
+
class="group"
|
|
5
|
+
@submit.prevent="() => !isFetching && fetchShippingServices()"
|
|
6
|
+
>
|
|
7
|
+
<label
|
|
8
|
+
:for="zipInputId"
|
|
9
|
+
:class="hasLabel
|
|
10
|
+
? 'lg:text-sm text-base-700 flex flex-wrap gap-x-5 items-center mb-1.5'
|
|
11
|
+
: 'sr-only'"
|
|
12
|
+
>
|
|
13
|
+
<span>{{ $t.i19calculateShipping }}</span>
|
|
14
|
+
<ALink
|
|
15
|
+
v-if="hasLabel && $settings.countryCode === 'BR'"
|
|
16
|
+
href="https://buscacepinter.correios.com.br/app/endereco/index.php"
|
|
17
|
+
class="ui-link text-base-500 text-xs font-normal"
|
|
18
|
+
>
|
|
19
|
+
Não sei meu CEP
|
|
20
|
+
<i class="i-arrow-top-right-on-square mr-1 opacity-50"></i>
|
|
21
|
+
</ALink>
|
|
22
|
+
</label>
|
|
23
|
+
<div class="relative max-w-52">
|
|
24
|
+
<input
|
|
25
|
+
ref="zipInput"
|
|
26
|
+
:id="zipInputId"
|
|
27
|
+
type="tel"
|
|
28
|
+
:readonly="isFetching"
|
|
29
|
+
v-model.trim="zipCode"
|
|
30
|
+
placeholder="12345-123"
|
|
31
|
+
class="w-full"
|
|
32
|
+
:class="isFetching && 'bg-base-50'"
|
|
33
|
+
/>
|
|
34
|
+
<button
|
|
35
|
+
class="hover:text-primary group-focus-within:text-primary absolute inset-y-0 end-0
|
|
36
|
+
grid w-12
|
|
37
|
+
place-content-center text-xl"
|
|
38
|
+
:class="isMounted && !shippingServices.length && zipCode.length > 1
|
|
39
|
+
? 'text-primary' : 'text-base-600'"
|
|
40
|
+
:aria-label="$t.i19calculateShipping"
|
|
41
|
+
>
|
|
42
|
+
<Spinner v-if="isFetching" class="size-5" />
|
|
43
|
+
<i v-else class="i-truck"></i>
|
|
44
|
+
</button>
|
|
45
|
+
</div>
|
|
46
|
+
</form>
|
|
47
|
+
<Fade slide="down">
|
|
48
|
+
<ul
|
|
49
|
+
v-if="!isFetching && shippingServices.length"
|
|
50
|
+
class="divide-base-200 bg-base-50/50 border-base-100 mt-2
|
|
51
|
+
grow divide-y rounded border px-3 py-1"
|
|
52
|
+
>
|
|
53
|
+
<li
|
|
54
|
+
v-for="({ label, shipping_line: shipping }, i) in shippingServices"
|
|
55
|
+
:key="`${zipCode}-${i}`"
|
|
56
|
+
class="text-base-800 py-2.5 md:text-sm"
|
|
57
|
+
>
|
|
58
|
+
<div class="flex flex-wrap items-center">
|
|
59
|
+
<div class="grow">
|
|
60
|
+
<strong class="mr-2 font-semibold">
|
|
61
|
+
{{ getShippingDeadline(shipping) }}
|
|
62
|
+
</strong>
|
|
63
|
+
<span class="mr-2">{{ getShippingPrice(shipping) }}</span>
|
|
64
|
+
</div>
|
|
65
|
+
<small class="text-base-600">{{ label }}</small>
|
|
66
|
+
</div>
|
|
67
|
+
<small v-if="shipping.delivery_instructions" class="text-base-700">
|
|
68
|
+
{{ shipping.delivery_instructions }}
|
|
69
|
+
</small>
|
|
70
|
+
</li>
|
|
71
|
+
</ul>
|
|
72
|
+
</Fade>
|
|
73
|
+
</div>
|
|
74
|
+
</template>
|
|
75
|
+
|
|
76
|
+
<script setup lang="ts">
|
|
77
|
+
import {
|
|
78
|
+
type Props as UseShippingCalculatorProps,
|
|
79
|
+
useShippingCalculator,
|
|
80
|
+
} from '@@sf/composables/use-shipping-calculator';
|
|
81
|
+
import { useId } from '@@sf/sf-lib';
|
|
82
|
+
import Spinner from '@@sf/components/Spinner.vue';
|
|
83
|
+
|
|
84
|
+
export interface Props extends UseShippingCalculatorProps {
|
|
85
|
+
hasLabel?: boolean;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const props = defineProps<Props>();
|
|
89
|
+
const zipCode = ref('');
|
|
90
|
+
const zipInputId = useId('ZipInput');
|
|
91
|
+
const {
|
|
92
|
+
isFetching,
|
|
93
|
+
fetchShippingServices,
|
|
94
|
+
shippingServices,
|
|
95
|
+
getShippingDeadline,
|
|
96
|
+
getShippingPrice,
|
|
97
|
+
} = useShippingCalculator({ ...props, zipCode });
|
|
98
|
+
const isMounted = ref(false);
|
|
99
|
+
onMounted(() => { isMounted.value = true; });
|
|
100
|
+
</script>
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"main": "index.js",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@cloudcommerce/events": "^2.
|
|
19
|
-
"@cloudcommerce/firebase": "^2.
|
|
20
|
-
"@cloudcommerce/modules": "^2.
|
|
18
|
+
"@cloudcommerce/events": "^2.5.1",
|
|
19
|
+
"@cloudcommerce/firebase": "^2.5.1",
|
|
20
|
+
"@cloudcommerce/modules": "^2.5.1"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"url": "https://github.com/ecomplus/cloud-commerce/issues"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@cloudcommerce/cli": "^2.
|
|
29
|
+
"@cloudcommerce/cli": "^2.5.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@cloudcommerce/eslint": "^2.
|
|
32
|
+
"@cloudcommerce/eslint": "^2.5.1",
|
|
33
33
|
"husky": "^9.0.10",
|
|
34
34
|
"lint-staged": "^15.2.2"
|
|
35
35
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloudcommerce",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.6.0",
|
|
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>",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"vite": "^5.0.11",
|
|
37
37
|
"vitest": "^1.3.0",
|
|
38
38
|
"zx": "^7.2.3",
|
|
39
|
-
"@cloudcommerce/eslint": "2.
|
|
39
|
+
"@cloudcommerce/eslint": "2.6.0"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"fix-install": "bash scripts/pre-install.sh && pnpm i",
|
|
@@ -115,10 +115,10 @@ ab_testing_data="
|
|
|
115
115
|
\"Enabled\": true
|
|
116
116
|
}"
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
ab_testing_ttl_data="
|
|
119
119
|
{
|
|
120
120
|
\"ActionType\": 3,
|
|
121
|
-
\"ActionParameter1\": \"
|
|
121
|
+
\"ActionParameter1\": \"120\",
|
|
122
122
|
\"ActionParameter2\": \"\",
|
|
123
123
|
\"Triggers\": [
|
|
124
124
|
{
|
|
@@ -131,7 +131,7 @@ ab_testing_bypass_data="
|
|
|
131
131
|
}
|
|
132
132
|
],
|
|
133
133
|
\"TriggerMatchingType\": 1,
|
|
134
|
-
\"Description\": \"A/B CDN cache
|
|
134
|
+
\"Description\": \"A/B CDN short cache [$GIT_BRANCH]\",
|
|
135
135
|
\"Enabled\": true
|
|
136
136
|
}"
|
|
137
137
|
|
|
@@ -156,7 +156,7 @@ ab_testing_perma_bypass_data="
|
|
|
156
156
|
}"
|
|
157
157
|
|
|
158
158
|
configure_edge_rule "A/B testing [$GIT_BRANCH]" "$ab_testing_data"
|
|
159
|
-
configure_edge_rule "A/B CDN cache
|
|
159
|
+
configure_edge_rule "A/B CDN short cache [$GIT_BRANCH]" "$ab_testing_ttl_data"
|
|
160
160
|
configure_edge_rule "A/B perma-cache bypass [$GIT_BRANCH]" "$ab_testing_perma_bypass_data"
|
|
161
161
|
|
|
162
162
|
curl --silent --request POST \
|