cloudcommerce 0.27.0 → 0.28.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 +20 -0
- package/ecomplus-stores/barra-doce/functions/many/package.json +3 -3
- package/ecomplus-stores/barra-doce/functions/ssr/content/layout.json +13 -13
- package/ecomplus-stores/barra-doce/functions/ssr/content/pages/home.json +10 -10
- package/ecomplus-stores/barra-doce/functions/ssr/content/pages/products.json +17 -0
- package/ecomplus-stores/barra-doce/functions/ssr/content/settings.json +8 -8
- package/ecomplus-stores/barra-doce/functions/ssr/package.json +6 -6
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/AccountMenu.vue +11 -11
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopFooter.vue +24 -24
- package/ecomplus-stores/barra-doce/functions/ssr/src/layouts/PageFooter.astro +4 -4
- package/ecomplus-stores/barra-doce/functions/with-apps/package.json +3 -3
- package/ecomplus-stores/barra-doce/package.json +2 -2
- package/ecomplus-stores/monocard/functions/many/package.json +3 -3
- package/ecomplus-stores/monocard/functions/ssr/content/layout.json +11 -11
- package/ecomplus-stores/monocard/functions/ssr/content/pages/home.json +16 -16
- package/ecomplus-stores/monocard/functions/ssr/content/pages/products.json +2 -4
- package/ecomplus-stores/monocard/functions/ssr/content/settings.json +11 -11
- package/ecomplus-stores/monocard/functions/ssr/package.json +6 -6
- package/ecomplus-stores/monocard/functions/ssr/src/components/AccountMenu.vue +1 -1
- package/ecomplus-stores/monocard/functions/ssr/src/components/DocDescription.vue +33 -0
- package/ecomplus-stores/monocard/functions/ssr/src/components/FeatureTabs.vue +3 -3
- package/ecomplus-stores/monocard/functions/ssr/src/components/ShopFooter.vue +3 -3
- package/ecomplus-stores/monocard/functions/ssr/src/components/ShopHeader.vue +5 -13
- package/ecomplus-stores/monocard/functions/ssr/src/layouts/PageFooter.astro +2 -2
- package/ecomplus-stores/monocard/functions/ssr/src/main/Home.astro +1 -1
- package/ecomplus-stores/monocard/functions/ssr/src/main/Sections.astro +1 -1
- package/ecomplus-stores/monocard/functions/with-apps/package.json +3 -3
- package/ecomplus-stores/monocard/package.json +2 -2
- package/package.json +2 -2
- 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/lib/functios-lib/utils.js +1 -1
- package/packages/apps/emails/lib/functios-lib/utils.js.map +1 -1
- package/packages/apps/emails/package.json +1 -1
- package/packages/apps/emails/src/functios-lib/utils.ts +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/lib/functions-lib/cron-add-points.d.ts +2 -0
- package/packages/apps/loyalty-points/lib/functions-lib/cron-add-points.js +98 -0
- package/packages/apps/loyalty-points/lib/functions-lib/cron-add-points.js.map +1 -0
- package/packages/apps/loyalty-points/lib/functions-lib/handle-loyalty-points-event.js +59 -23
- package/packages/apps/loyalty-points/lib/functions-lib/handle-loyalty-points-event.js.map +1 -1
- package/packages/apps/loyalty-points/lib/loyalty-create-transaction.js +9 -4
- package/packages/apps/loyalty-points/lib/loyalty-create-transaction.js.map +1 -1
- package/packages/apps/loyalty-points/lib/loyalty-list-payments.js +7 -2
- package/packages/apps/loyalty-points/lib/loyalty-list-payments.js.map +1 -1
- package/packages/apps/loyalty-points/lib/loyalty-points-events.d.ts +3 -1
- package/packages/apps/loyalty-points/lib/loyalty-points-events.js +9 -0
- package/packages/apps/loyalty-points/lib/loyalty-points-events.js.map +1 -1
- package/packages/apps/loyalty-points/package.json +3 -2
- package/packages/apps/loyalty-points/src/functions-lib/cron-add-points.ts +104 -0
- package/packages/apps/loyalty-points/src/functions-lib/handle-loyalty-points-event.ts +67 -25
- package/packages/apps/loyalty-points/src/loyalty-create-transaction.ts +11 -4
- package/packages/apps/loyalty-points/src/loyalty-list-payments.ts +9 -2
- package/packages/apps/loyalty-points/src/loyalty-points-events.ts +12 -1
- package/packages/apps/melhor-envio/package.json +1 -1
- package/packages/apps/mercadopago/assets/onload-expression.js +5 -1
- package/packages/apps/mercadopago/assets/onload-expression.min.js +1 -1
- package/packages/apps/mercadopago/lib/mp-create-transaction.js +16 -6
- package/packages/apps/mercadopago/lib/mp-create-transaction.js.map +1 -1
- package/packages/apps/mercadopago/package.json +1 -1
- package/packages/apps/mercadopago/src/mp-create-transaction.ts +19 -7
- 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 +1 -1
- package/packages/config/lib/config.js +2 -2
- package/packages/config/lib/config.js.map +1 -1
- package/packages/config/package.json +1 -1
- package/packages/config/src/config.ts +2 -2
- 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/storefront.cms.js +2 -2
- package/packages/storefront/package.json +1 -1
- package/packages/storefront/src/lib/components/ContentClearfix.vue +1 -1
- package/packages/storefront/src/lib/components/PaymentMethodFlag.vue +1 -1
- package/packages/storefront/src/lib/composables/use-pitch-bar.ts +2 -2
- package/packages/storefront/src/lib/content.d.ts +5 -5
- package/packages/storefront/src/lib/layouts/Base.astro +4 -4
- package/packages/storefront/src/lib/layouts/BaseHead.astro +7 -7
- package/packages/storefront/src/lib/layouts/use-page-header.ts +9 -4
- package/packages/storefront/src/lib/layouts/use-page-main.ts +13 -33
- package/packages/test-base/package.json +1 -1
- package/packages/types/index.ts +14 -14
- package/packages/types/package.json +1 -1
- package/ecomplus-stores/monocard/functions/ssr/src/components/DocDescription.astro +0 -30
|
@@ -34,12 +34,15 @@ export default async (appData: AppModuleBody) => {
|
|
|
34
34
|
|
|
35
35
|
let token: string | undefined;
|
|
36
36
|
let paymentMethodId: string;
|
|
37
|
+
let deviceId;
|
|
37
38
|
const isPix = params.payment_method.code === 'account_deposit';
|
|
38
39
|
if (params.credit_card && params.credit_card.hash) {
|
|
39
40
|
const hashParts = params.credit_card.hash.split(' // ');
|
|
40
41
|
[token] = hashParts;
|
|
41
42
|
try {
|
|
42
|
-
|
|
43
|
+
const parsed = JSON.parse(hashParts[1]);
|
|
44
|
+
paymentMethodId = parsed.payment_method_id;
|
|
45
|
+
deviceId = parsed.deviceId;
|
|
43
46
|
} catch (e) {
|
|
44
47
|
paymentMethodId = params.credit_card.company || 'visa';
|
|
45
48
|
}
|
|
@@ -159,14 +162,20 @@ export default async (appData: AppModuleBody) => {
|
|
|
159
162
|
}
|
|
160
163
|
|
|
161
164
|
try {
|
|
165
|
+
const headers = {
|
|
166
|
+
Authorization: `Bearer ${process.env.MERCADOPAGO_TOKEN}`,
|
|
167
|
+
'Content-Type': 'application/json',
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
if (deviceId) {
|
|
171
|
+
Object.assign(headers, { 'X-meli-session-id': deviceId });
|
|
172
|
+
}
|
|
173
|
+
|
|
162
174
|
// https://www.mercadopago.com.br/developers/pt/reference/payments/_payments/post
|
|
163
175
|
const { data } = await axios({
|
|
164
176
|
url: 'https://api.mercadopago.com/v1/payments',
|
|
165
177
|
method: 'post',
|
|
166
|
-
headers
|
|
167
|
-
Authorization: `Bearer ${process.env.MERCADOPAGO_TOKEN}`,
|
|
168
|
-
'Content-Type': 'application/json',
|
|
169
|
-
},
|
|
178
|
+
headers,
|
|
170
179
|
data: payment,
|
|
171
180
|
});
|
|
172
181
|
if (data) {
|
|
@@ -254,8 +263,11 @@ export default async (appData: AppModuleBody) => {
|
|
|
254
263
|
const qrCode = data.point_of_interaction.transaction_data.qr_code;
|
|
255
264
|
const qrCodeBase64 = data.point_of_interaction.transaction_data.qr_code_base64;
|
|
256
265
|
transaction.notes = '<div style="display:block;margin:0 auto"> '
|
|
257
|
-
|
|
258
|
-
|
|
266
|
+
+ `<img width="280" height="280" style="margin:5px auto" src='data:image/jpeg;base64,${qrCodeBase64}'/> `
|
|
267
|
+
+ `<input readonly type="text" id="pix-copy" value="${qrCode}" />`
|
|
268
|
+
+ `<button type="button" class="btn btn-sm btn-light" onclick="let codePix = document.getElementById('pix-copy')
|
|
269
|
+
codePix.select()
|
|
270
|
+
document.execCommand('copy')">Copiar Pix</button></div>`;
|
|
259
271
|
}
|
|
260
272
|
|
|
261
273
|
return {
|
|
@@ -31,8 +31,8 @@ export default {
|
|
|
31
31
|
if (settingsContent) {
|
|
32
32
|
config.lang = config.lang || settingsContent.lang;
|
|
33
33
|
config.currency = config.currency || settingsContent.currency;
|
|
34
|
-
config.currencySymbol = config.currencySymbol || settingsContent.
|
|
35
|
-
config.countryCode = config.currencySymbol || settingsContent.
|
|
34
|
+
config.currencySymbol = config.currencySymbol || settingsContent.currencySymbol;
|
|
35
|
+
config.countryCode = config.currencySymbol || settingsContent.countryCode;
|
|
36
36
|
}
|
|
37
37
|
self.config = deepmerge(self.config, config);
|
|
38
38
|
if (config.storeId) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,YAAY,CAAC;AAWpB,MAAM,IAAI,GAAG,CACX,CAAC,OAAO,OAAO,KAAK,QAAQ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AG,MAAM,CAAC,cAAc,IAAI,eAAe,CAAC,cAAc,CAAC;YAChF,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC,cAAc,IAAI,eAAe,CAAC,WAAW,CAAC;SAC3E;QACD,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC7C,IAAI,MAAM,CAAC,OAAO,EAAE;YAClB,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC;SACrC;QACD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;QACpD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;QAChE,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,oBAAoB,IAAI,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC;QACpF,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,IAAI,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;IAC7E,CAAC;CACF,CAAC"}
|
|
@@ -48,8 +48,8 @@ export default {
|
|
|
48
48
|
if (settingsContent) {
|
|
49
49
|
config.lang = config.lang || settingsContent.lang;
|
|
50
50
|
config.currency = config.currency || settingsContent.currency;
|
|
51
|
-
config.currencySymbol = config.currencySymbol || settingsContent.
|
|
52
|
-
config.countryCode = config.currencySymbol || settingsContent.
|
|
51
|
+
config.currencySymbol = config.currencySymbol || settingsContent.currencySymbol;
|
|
52
|
+
config.countryCode = config.currencySymbol || settingsContent.countryCode;
|
|
53
53
|
}
|
|
54
54
|
self.config = deepmerge(self.config, config);
|
|
55
55
|
if (config.storeId) {
|
|
@@ -62,8 +62,8 @@ global.__storefrontCMS = (fs, resolvePath) => {
|
|
|
62
62
|
settings = {};
|
|
63
63
|
}
|
|
64
64
|
const { domain } = settings;
|
|
65
|
-
const primaryColor = settings.
|
|
66
|
-
const secondaryColor = settings.
|
|
65
|
+
const primaryColor = settings.primaryColor || '#137c5c';
|
|
66
|
+
const secondaryColor = settings.secondaryColor || primaryColor;
|
|
67
67
|
|
|
68
68
|
return {
|
|
69
69
|
domain,
|
|
@@ -8,7 +8,7 @@ const parsedHTML = html.replace(/<(img|iframe) /g, '<$1 loading="lazy" ');
|
|
|
8
8
|
</script>
|
|
9
9
|
|
|
10
10
|
<template>
|
|
11
|
-
<article class="prose !max-w-full overflow-x-auto
|
|
11
|
+
<article class="prose !max-w-full overflow-x-auto" v-once>
|
|
12
12
|
<div
|
|
13
13
|
class="[&_iframe]:max-w-full [&_img]:max-w-full [&_table]:max-w-full"
|
|
14
14
|
v-html="parsedHTML"
|
|
@@ -4,7 +4,7 @@ import { computed } from 'vue';
|
|
|
4
4
|
|
|
5
5
|
export interface Props {
|
|
6
6
|
as?: string;
|
|
7
|
-
flag: Exclude<SettingsContent['
|
|
7
|
+
flag: Exclude<SettingsContent['paymentMethods'], undefined>[number];
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
const props = withDefaults(defineProps<Props>(), {
|
|
@@ -13,8 +13,8 @@ export interface Props {
|
|
|
13
13
|
|
|
14
14
|
const parseLayoutContent = (layoutContent: LayoutContent) => {
|
|
15
15
|
const pitchBar: Props = { slides: [] };
|
|
16
|
-
if (layoutContent.header?.
|
|
17
|
-
pitchBar.slides = layoutContent.header.
|
|
16
|
+
if (layoutContent.header?.pitchBar) {
|
|
17
|
+
pitchBar.slides = layoutContent.header.pitchBar;
|
|
18
18
|
}
|
|
19
19
|
return pitchBar;
|
|
20
20
|
};
|
|
@@ -18,16 +18,16 @@ export interface PageContent {
|
|
|
18
18
|
autoplay?: number,
|
|
19
19
|
slides: Array<{
|
|
20
20
|
[k: string]: unknown,
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
startsAt?: string,
|
|
22
|
+
endsAt?: string,
|
|
23
23
|
img: string,
|
|
24
24
|
alt?: string,
|
|
25
|
-
|
|
25
|
+
mobileImg?: string,
|
|
26
26
|
href?: string,
|
|
27
27
|
title?: string,
|
|
28
28
|
subtitle?: string
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
buttonLink?: string,
|
|
30
|
+
buttonText?: string,
|
|
31
31
|
}>,
|
|
32
32
|
};
|
|
33
33
|
sections: Array<Record<string, any> & {
|
|
@@ -3,13 +3,13 @@ import { Head } from 'astro-capo';
|
|
|
3
3
|
import BaseBody from '@@sf/layouts/BaseBody.astro';
|
|
4
4
|
|
|
5
5
|
const { getContent } = Astro.locals.routeContext;
|
|
6
|
-
const {
|
|
6
|
+
const { customCode } = await getContent('layout');
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
<Head>
|
|
10
10
|
<slot name="base-head" />
|
|
11
|
-
{
|
|
12
|
-
{
|
|
11
|
+
{customCode?.css && <style>{customCode.css}</style>}
|
|
12
|
+
{customCode?.htmlHead && <Fragment set:html={customCode.htmlHead} />}
|
|
13
13
|
<slot name="base-head-scripts">
|
|
14
14
|
<script src="../scripts/modules-info-preset"></script>
|
|
15
15
|
</slot>
|
|
@@ -17,7 +17,7 @@ const { custom_code: customCodeContent } = await getContent('layout');
|
|
|
17
17
|
</Head>
|
|
18
18
|
<BaseBody>
|
|
19
19
|
<slot />
|
|
20
|
-
{
|
|
20
|
+
{customCode?.htmlBody && <Fragment set:html={customCode.htmlBody} />}
|
|
21
21
|
<slot name="base-body-scripts">
|
|
22
22
|
<script src="../scripts/session-utm"></script>
|
|
23
23
|
</slot>
|
|
@@ -48,9 +48,9 @@ if (apiDoc) {
|
|
|
48
48
|
ogImage = picture && picture.url;
|
|
49
49
|
}
|
|
50
50
|
if (!ogImage) {
|
|
51
|
-
if (metatagsContent?.
|
|
52
|
-
ogImage = metatagsContent.
|
|
53
|
-
? `https://${domain}${metatagsContent.
|
|
51
|
+
if (metatagsContent?.ogImage) {
|
|
52
|
+
ogImage = metatagsContent.ogImage.charAt(0) === '/'
|
|
53
|
+
? `https://${domain}${metatagsContent.ogImage}` : metatagsContent.ogImage;
|
|
54
54
|
}
|
|
55
55
|
} else {
|
|
56
56
|
ogImage = ogImage.replace(/(\w+\.)?(ecoms\d)\.com/i, '$2-nyc3.nyc3.cdn.digitaloceanspaces.com');
|
|
@@ -154,11 +154,11 @@ const inlineJSONLd = JSON.stringify({
|
|
|
154
154
|
<meta property="og:type" content="website">
|
|
155
155
|
<meta property="og:locale" content={ogLocale}>
|
|
156
156
|
{ogImage && <meta property="og:image" content={ogImage} />}
|
|
157
|
-
{metatagsContent?.
|
|
158
|
-
<meta property="fb:app_id" content={metatagsContent.
|
|
157
|
+
{metatagsContent?.fbAppId &&
|
|
158
|
+
<meta property="fb:app_id" content={metatagsContent.fbAppId} />}
|
|
159
159
|
<meta name="twitter:card" content="summary">
|
|
160
|
-
{metatagsContent?.
|
|
161
|
-
<meta name="twitter:site" content={metatagsContent.
|
|
160
|
+
{metatagsContent?.twitterUsername &&
|
|
161
|
+
<meta name="twitter:site" content={metatagsContent.twitterUsername} />}
|
|
162
162
|
<meta name="ecom-store-id" content={String(storeId)}>
|
|
163
163
|
|
|
164
164
|
<script>
|
|
@@ -13,7 +13,12 @@ export interface Props {
|
|
|
13
13
|
const usePageHeader = async ({ routeContext, listedCategoryFields }: Props) => {
|
|
14
14
|
const { apiState, getContent } = routeContext;
|
|
15
15
|
const layoutContent = await getContent('layout');
|
|
16
|
-
const {
|
|
16
|
+
const {
|
|
17
|
+
header: {
|
|
18
|
+
inlineMenuCategories,
|
|
19
|
+
isAlphabeticalSortSubmenu,
|
|
20
|
+
},
|
|
21
|
+
} = layoutContent;
|
|
17
22
|
const pitchBar = parseLayoutContent(layoutContent);
|
|
18
23
|
let { categories } = apiState;
|
|
19
24
|
if (!categories && listedCategoryFields !== null) {
|
|
@@ -36,9 +41,9 @@ const usePageHeader = async ({ routeContext, listedCategoryFields }: Props) => {
|
|
|
36
41
|
}
|
|
37
42
|
const shopHeader: ShopHeaderProps = {
|
|
38
43
|
categories,
|
|
39
|
-
menuCategorySlugs:
|
|
40
|
-
menuRandomCategories:
|
|
41
|
-
isAlphabeticalSortSubmenu
|
|
44
|
+
menuCategorySlugs: inlineMenuCategories?.featured,
|
|
45
|
+
menuRandomCategories: inlineMenuCategories?.random,
|
|
46
|
+
isAlphabeticalSortSubmenu,
|
|
42
47
|
};
|
|
43
48
|
/*
|
|
44
49
|
if (import.meta.env.DEV) {
|
|
@@ -3,7 +3,6 @@ import type { PageContent } from '@@sf/content';
|
|
|
3
3
|
import type { RouteContext } from '@@sf/ssr-context';
|
|
4
4
|
import type { Props as UseBannerProps } from '@@sf/composables/use-banner';
|
|
5
5
|
import type { Props as UseProductShelfProps } from '@@sf/composables/use-product-shelf';
|
|
6
|
-
import type { Props as UseBreadcrumbsProps } from '@@sf/composables/use-breadcrumbs';
|
|
7
6
|
import { useProductShelf } from '@@sf/composables/use-product-shelf';
|
|
8
7
|
|
|
9
8
|
export interface Props {
|
|
@@ -17,23 +16,13 @@ const now = Date.now();
|
|
|
17
16
|
const parseBanners = (banners: PageContentHero['slides']) => {
|
|
18
17
|
const validBanners: UseBannerProps[] = [];
|
|
19
18
|
banners.forEach(({
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
mobile_img: mobileImg,
|
|
24
|
-
button_link: buttonLink,
|
|
25
|
-
button_text: buttonText,
|
|
26
|
-
...rest
|
|
19
|
+
startsAt,
|
|
20
|
+
endsAt,
|
|
21
|
+
...bannerProps
|
|
27
22
|
}) => {
|
|
28
|
-
if (
|
|
29
|
-
if (
|
|
30
|
-
validBanners.push(
|
|
31
|
-
...rest,
|
|
32
|
-
img,
|
|
33
|
-
mobileImg,
|
|
34
|
-
buttonLink,
|
|
35
|
-
buttonText,
|
|
36
|
-
});
|
|
23
|
+
if (startsAt && new Date(startsAt).getTime() < now) return;
|
|
24
|
+
if (endsAt && new Date(endsAt).getTime() > now) return;
|
|
25
|
+
validBanners.push(bannerProps);
|
|
37
26
|
});
|
|
38
27
|
return validBanners;
|
|
39
28
|
};
|
|
@@ -61,8 +50,8 @@ export const usePageSections = async <T extends CustomSection = CustomSection>
|
|
|
61
50
|
T
|
|
62
51
|
| { type: 'product-shelf', props: UseProductShelfProps }
|
|
63
52
|
| { type: 'banners-grid', props: { banners: UseBannerProps[] } }
|
|
64
|
-
| { type: '
|
|
65
|
-
| { type: '
|
|
53
|
+
| { type: 'product-details', props: { hasDescription?: boolean } }
|
|
54
|
+
| { type: 'breadcrumbs', props: {} }
|
|
66
55
|
| { type: 'related-products', props: {} }
|
|
67
56
|
| { type: 'doc-description', props: {} }
|
|
68
57
|
| { type: 'product-specifications', props: {} }
|
|
@@ -71,9 +60,9 @@ export const usePageSections = async <T extends CustomSection = CustomSection>
|
|
|
71
60
|
await Promise.all(sectionsContent.map(async ({ type, ...sectionContent }, index) => {
|
|
72
61
|
if (type === 'product-shelf') {
|
|
73
62
|
const {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
63
|
+
collectionIdAndInfo,
|
|
64
|
+
isHeadless,
|
|
65
|
+
isShuffle,
|
|
77
66
|
...rest
|
|
78
67
|
} = sectionContent;
|
|
79
68
|
let { sort, title } = sectionContent;
|
|
@@ -127,16 +116,7 @@ export const usePageSections = async <T extends CustomSection = CustomSection>
|
|
|
127
116
|
await fetching;
|
|
128
117
|
sections[index] = {
|
|
129
118
|
type,
|
|
130
|
-
props: {
|
|
131
|
-
...rest,
|
|
132
|
-
collectionId,
|
|
133
|
-
searchQuery,
|
|
134
|
-
sort,
|
|
135
|
-
title: isHeadless ? null : title,
|
|
136
|
-
titleLink,
|
|
137
|
-
isShuffle,
|
|
138
|
-
products,
|
|
139
|
-
},
|
|
119
|
+
props: { ...props, products },
|
|
140
120
|
};
|
|
141
121
|
return;
|
|
142
122
|
}
|
|
@@ -159,7 +139,7 @@ export const usePageSections = async <T extends CustomSection = CustomSection>
|
|
|
159
139
|
// Bypassed sections
|
|
160
140
|
sections[index] = {
|
|
161
141
|
type,
|
|
162
|
-
props:
|
|
142
|
+
props: sectionContent,
|
|
163
143
|
};
|
|
164
144
|
return;
|
|
165
145
|
default:
|
package/packages/types/index.ts
CHANGED
|
@@ -97,18 +97,18 @@ type SettingsContent = {
|
|
|
97
97
|
description: string,
|
|
98
98
|
logo: string,
|
|
99
99
|
icon: string,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
primaryColor: string,
|
|
101
|
+
secondaryColor?: string,
|
|
102
|
+
bgColor?: string,
|
|
103
103
|
email: string,
|
|
104
104
|
phone: string,
|
|
105
105
|
address: string,
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
corporateName: string,
|
|
107
|
+
docNumber: string,
|
|
108
108
|
lang: string,
|
|
109
109
|
currency: string,
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
currencySymbol: string,
|
|
111
|
+
countryCode: string,
|
|
112
112
|
whatsapp?: string,
|
|
113
113
|
instagram?: string,
|
|
114
114
|
facebook?: string,
|
|
@@ -117,11 +117,11 @@ type SettingsContent = {
|
|
|
117
117
|
tiktok?: string,
|
|
118
118
|
pinterest?: string,
|
|
119
119
|
threads?: string,
|
|
120
|
-
|
|
120
|
+
serviceLinks?: Array<{
|
|
121
121
|
title: string,
|
|
122
122
|
href: string,
|
|
123
123
|
}>,
|
|
124
|
-
|
|
124
|
+
paymentMethods?: PaymentMethodFlag[],
|
|
125
125
|
modules?: {
|
|
126
126
|
list_payments?: {
|
|
127
127
|
installments_option?: Partial<ListPaymentsResponse['installments_option']>,
|
|
@@ -139,11 +139,11 @@ type SettingsContent = {
|
|
|
139
139
|
available_extra_discount?: Partial<ApplyDiscountResponse['available_extra_discount']>,
|
|
140
140
|
},
|
|
141
141
|
},
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
142
|
+
cartUrl?: string,
|
|
143
|
+
checkoutUrl?: string,
|
|
144
|
+
accountUrl?: string,
|
|
145
|
+
ordersUrl?: string,
|
|
146
|
+
favoritesUrl?: string,
|
|
147
147
|
metafields?: Record<string, any>,
|
|
148
148
|
};
|
|
149
149
|
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import type {
|
|
3
|
-
Products,
|
|
4
|
-
Categories,
|
|
5
|
-
Brands,
|
|
6
|
-
Collections,
|
|
7
|
-
} from '@cloudcommerce/api/types';
|
|
8
|
-
import { i19description } from '@@i18n';
|
|
9
|
-
import ContentClearfix from '@@sf/components/ContentClearfix.astro';
|
|
10
|
-
|
|
11
|
-
export interface Props {
|
|
12
|
-
apiDoc: Partial<Products | Categories | Brands | Collections>;
|
|
13
|
-
title?: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const { apiDoc, title } = Astro.props;
|
|
17
|
-
const html = apiDoc.body_html || apiDoc.body_text;
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
{html &&
|
|
21
|
-
<section class="ui-section">
|
|
22
|
-
<p class="text-2xl font-medium lowercase text-base-700">
|
|
23
|
-
<a href="#description" id="description">
|
|
24
|
-
<i class="i-link text-base-400 mr-1"></i>
|
|
25
|
-
{title || i19description}
|
|
26
|
-
</a>
|
|
27
|
-
</p>
|
|
28
|
-
<ContentClearfix html={html} />
|
|
29
|
-
</section>
|
|
30
|
-
}
|