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.
Files changed (104) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/ecomplus-stores/barra-doce/functions/many/package.json +3 -3
  3. package/ecomplus-stores/barra-doce/functions/ssr/content/layout.json +13 -13
  4. package/ecomplus-stores/barra-doce/functions/ssr/content/pages/home.json +10 -10
  5. package/ecomplus-stores/barra-doce/functions/ssr/content/pages/products.json +17 -0
  6. package/ecomplus-stores/barra-doce/functions/ssr/content/settings.json +8 -8
  7. package/ecomplus-stores/barra-doce/functions/ssr/package.json +6 -6
  8. package/ecomplus-stores/barra-doce/functions/ssr/src/components/AccountMenu.vue +11 -11
  9. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopFooter.vue +24 -24
  10. package/ecomplus-stores/barra-doce/functions/ssr/src/layouts/PageFooter.astro +4 -4
  11. package/ecomplus-stores/barra-doce/functions/with-apps/package.json +3 -3
  12. package/ecomplus-stores/barra-doce/package.json +2 -2
  13. package/ecomplus-stores/monocard/functions/many/package.json +3 -3
  14. package/ecomplus-stores/monocard/functions/ssr/content/layout.json +11 -11
  15. package/ecomplus-stores/monocard/functions/ssr/content/pages/home.json +16 -16
  16. package/ecomplus-stores/monocard/functions/ssr/content/pages/products.json +2 -4
  17. package/ecomplus-stores/monocard/functions/ssr/content/settings.json +11 -11
  18. package/ecomplus-stores/monocard/functions/ssr/package.json +6 -6
  19. package/ecomplus-stores/monocard/functions/ssr/src/components/AccountMenu.vue +1 -1
  20. package/ecomplus-stores/monocard/functions/ssr/src/components/DocDescription.vue +33 -0
  21. package/ecomplus-stores/monocard/functions/ssr/src/components/FeatureTabs.vue +3 -3
  22. package/ecomplus-stores/monocard/functions/ssr/src/components/ShopFooter.vue +3 -3
  23. package/ecomplus-stores/monocard/functions/ssr/src/components/ShopHeader.vue +5 -13
  24. package/ecomplus-stores/monocard/functions/ssr/src/layouts/PageFooter.astro +2 -2
  25. package/ecomplus-stores/monocard/functions/ssr/src/main/Home.astro +1 -1
  26. package/ecomplus-stores/monocard/functions/ssr/src/main/Sections.astro +1 -1
  27. package/ecomplus-stores/monocard/functions/with-apps/package.json +3 -3
  28. package/ecomplus-stores/monocard/package.json +2 -2
  29. package/package.json +2 -2
  30. package/packages/api/package.json +1 -1
  31. package/packages/apps/affilate-program/package.json +1 -1
  32. package/packages/apps/correios/package.json +1 -1
  33. package/packages/apps/custom-payment/package.json +1 -1
  34. package/packages/apps/custom-shipping/package.json +1 -1
  35. package/packages/apps/datafrete/package.json +1 -1
  36. package/packages/apps/discounts/package.json +1 -1
  37. package/packages/apps/emails/lib/functios-lib/utils.js +1 -1
  38. package/packages/apps/emails/lib/functios-lib/utils.js.map +1 -1
  39. package/packages/apps/emails/package.json +1 -1
  40. package/packages/apps/emails/src/functios-lib/utils.ts +1 -1
  41. package/packages/apps/fb-conversions/package.json +1 -1
  42. package/packages/apps/flash-courier/package.json +1 -1
  43. package/packages/apps/frenet/package.json +1 -1
  44. package/packages/apps/galaxpay/package.json +1 -1
  45. package/packages/apps/google-analytics/package.json +1 -1
  46. package/packages/apps/jadlog/package.json +1 -1
  47. package/packages/apps/loyalty-points/lib/functions-lib/cron-add-points.d.ts +2 -0
  48. package/packages/apps/loyalty-points/lib/functions-lib/cron-add-points.js +98 -0
  49. package/packages/apps/loyalty-points/lib/functions-lib/cron-add-points.js.map +1 -0
  50. package/packages/apps/loyalty-points/lib/functions-lib/handle-loyalty-points-event.js +59 -23
  51. package/packages/apps/loyalty-points/lib/functions-lib/handle-loyalty-points-event.js.map +1 -1
  52. package/packages/apps/loyalty-points/lib/loyalty-create-transaction.js +9 -4
  53. package/packages/apps/loyalty-points/lib/loyalty-create-transaction.js.map +1 -1
  54. package/packages/apps/loyalty-points/lib/loyalty-list-payments.js +7 -2
  55. package/packages/apps/loyalty-points/lib/loyalty-list-payments.js.map +1 -1
  56. package/packages/apps/loyalty-points/lib/loyalty-points-events.d.ts +3 -1
  57. package/packages/apps/loyalty-points/lib/loyalty-points-events.js +9 -0
  58. package/packages/apps/loyalty-points/lib/loyalty-points-events.js.map +1 -1
  59. package/packages/apps/loyalty-points/package.json +3 -2
  60. package/packages/apps/loyalty-points/src/functions-lib/cron-add-points.ts +104 -0
  61. package/packages/apps/loyalty-points/src/functions-lib/handle-loyalty-points-event.ts +67 -25
  62. package/packages/apps/loyalty-points/src/loyalty-create-transaction.ts +11 -4
  63. package/packages/apps/loyalty-points/src/loyalty-list-payments.ts +9 -2
  64. package/packages/apps/loyalty-points/src/loyalty-points-events.ts +12 -1
  65. package/packages/apps/melhor-envio/package.json +1 -1
  66. package/packages/apps/mercadopago/assets/onload-expression.js +5 -1
  67. package/packages/apps/mercadopago/assets/onload-expression.min.js +1 -1
  68. package/packages/apps/mercadopago/lib/mp-create-transaction.js +16 -6
  69. package/packages/apps/mercadopago/lib/mp-create-transaction.js.map +1 -1
  70. package/packages/apps/mercadopago/package.json +1 -1
  71. package/packages/apps/mercadopago/src/mp-create-transaction.ts +19 -7
  72. package/packages/apps/pagarme/package.json +1 -1
  73. package/packages/apps/paghiper/package.json +1 -1
  74. package/packages/apps/pix/package.json +1 -1
  75. package/packages/apps/tiny-erp/package.json +1 -1
  76. package/packages/apps/webhooks/package.json +1 -1
  77. package/packages/cli/package.json +1 -1
  78. package/packages/config/lib/config.js +2 -2
  79. package/packages/config/lib/config.js.map +1 -1
  80. package/packages/config/package.json +1 -1
  81. package/packages/config/src/config.ts +2 -2
  82. package/packages/emails/package.json +1 -1
  83. package/packages/eslint/package.json +1 -1
  84. package/packages/events/package.json +1 -1
  85. package/packages/feeds/package.json +1 -1
  86. package/packages/firebase/package.json +1 -1
  87. package/packages/i18n/package.json +1 -1
  88. package/packages/modules/package.json +1 -1
  89. package/packages/passport/package.json +1 -1
  90. package/packages/ssr/package.json +1 -1
  91. package/packages/storefront/config/storefront.cms.js +2 -2
  92. package/packages/storefront/package.json +1 -1
  93. package/packages/storefront/src/lib/components/ContentClearfix.vue +1 -1
  94. package/packages/storefront/src/lib/components/PaymentMethodFlag.vue +1 -1
  95. package/packages/storefront/src/lib/composables/use-pitch-bar.ts +2 -2
  96. package/packages/storefront/src/lib/content.d.ts +5 -5
  97. package/packages/storefront/src/lib/layouts/Base.astro +4 -4
  98. package/packages/storefront/src/lib/layouts/BaseHead.astro +7 -7
  99. package/packages/storefront/src/lib/layouts/use-page-header.ts +9 -4
  100. package/packages/storefront/src/lib/layouts/use-page-main.ts +13 -33
  101. package/packages/test-base/package.json +1 -1
  102. package/packages/types/index.ts +14 -14
  103. package/packages/types/package.json +1 -1
  104. package/ecomplus-stores/monocard/functions/ssr/src/components/DocDescription.astro +0 -30
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-mercadopago",
3
3
  "type": "module",
4
- "version": "0.27.0",
4
+ "version": "0.28.0",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate Mercado Pago",
6
6
  "main": "lib/mercadopago.js",
7
7
  "exports": {
@@ -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
- paymentMethodId = JSON.parse(hashParts[1]).payment_method_id;
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
- + `<img width="280" height="280" style="margin:5px auto" src='data:image/jpeg;base64,${qrCodeBase64}'/> `
258
- + `<lable> ${qrCode} </label></div>`;
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 {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-pagarme",
3
3
  "type": "module",
4
- "version": "0.27.0",
4
+ "version": "0.28.0",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate Pagar.me",
6
6
  "main": "lib/pagarme.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-paghiper",
3
3
  "type": "module",
4
- "version": "0.27.0",
4
+ "version": "0.28.0",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate PagHiper",
6
6
  "main": "lib/paghiper.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-pix",
3
3
  "type": "module",
4
- "version": "0.27.0",
4
+ "version": "0.28.0",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate Pix API (Bacen)",
6
6
  "main": "lib/pix.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-tiny-erp",
3
3
  "type": "module",
4
- "version": "0.27.0",
4
+ "version": "0.28.0",
5
5
  "description": "E-Com Plus Cloud Commerce app for Tiny ERP",
6
6
  "main": "lib/tiny-erp.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-webhooks",
3
3
  "type": "module",
4
- "version": "0.27.0",
4
+ "version": "0.28.0",
5
5
  "description": "E-Com Plus Cloud Commerce app for general order webhooks",
6
6
  "main": "lib/index.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/cli",
3
3
  "type": "module",
4
- "version": "0.27.0",
4
+ "version": "0.28.0",
5
5
  "description": "E-Com Plus Cloud Commerce CLI tools",
6
6
  "bin": {
7
7
  "cloudcommerce": "./bin/run.mjs"
@@ -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.currency_symbol;
35
- config.countryCode = config.currencySymbol || settingsContent.country_code;
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,C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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"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/config",
3
3
  "type": "module",
4
- "version": "0.27.0",
4
+ "version": "0.28.0",
5
5
  "description": "E-Com Plus Cloud Commerce base config",
6
6
  "main": "lib/config.js",
7
7
  "exports": {
@@ -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.currency_symbol;
52
- config.countryCode = config.currencySymbol || settingsContent.country_code;
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) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/emails",
3
3
  "type": "module",
4
- "version": "0.27.0",
4
+ "version": "0.28.0",
5
5
  "description": "E-Com Plus Cloud Commerce email sender",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/eslint",
3
3
  "type": "module",
4
- "version": "0.27.0",
4
+ "version": "0.28.0",
5
5
  "description": "E-Com Plus Cloud Commerce ESLint config",
6
6
  "main": "lib/index.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/events",
3
3
  "type": "module",
4
- "version": "0.27.0",
4
+ "version": "0.28.0",
5
5
  "description": "E-Com Plus Cloud Commerce app events",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/feeds",
3
3
  "type": "module",
4
- "version": "0.27.0",
4
+ "version": "0.28.0",
5
5
  "description": "E-Com Plus Cloud Commerce catalog feeds",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/firebase",
3
3
  "type": "module",
4
- "version": "0.27.0",
4
+ "version": "0.28.0",
5
5
  "description": "E-Com Plus Cloud Commerce on Firebase",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/i18n",
3
3
  "type": "module",
4
- "version": "0.27.0",
4
+ "version": "0.28.0",
5
5
  "description": "E-Com Plus Cloud Commerce i18n",
6
6
  "main": "lib/all.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/modules",
3
3
  "type": "module",
4
- "version": "0.27.0",
4
+ "version": "0.28.0",
5
5
  "description": "E-Com Plus Cloud Commerce modules API",
6
6
  "main": "lib/index.cjs",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/passport",
3
3
  "type": "module",
4
- "version": "0.27.0",
4
+ "version": "0.28.0",
5
5
  "description": "E-Com Plus Cloud Commerce customers authentication (passport) API",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/ssr",
3
3
  "type": "module",
4
- "version": "0.27.0",
4
+ "version": "0.28.0",
5
5
  "description": "E-Com Plus Cloud Commerce storefront SSR",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -62,8 +62,8 @@ global.__storefrontCMS = (fs, resolvePath) => {
62
62
  settings = {};
63
63
  }
64
64
  const { domain } = settings;
65
- const primaryColor = settings.primary_color || '#137c5c';
66
- const secondaryColor = settings.secondary_color || primaryColor;
65
+ const primaryColor = settings.primaryColor || '#137c5c';
66
+ const secondaryColor = settings.secondaryColor || primaryColor;
67
67
 
68
68
  return {
69
69
  domain,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/storefront",
3
3
  "type": "module",
4
- "version": "0.27.0",
4
+ "version": "0.28.0",
5
5
  "description": "E-Com Plus Cloud Commerce storefront with Astro",
6
6
  "bin": {
7
7
  "storefront": "./scripts/build-prod.sh"
@@ -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 lg:overflow-x-hidden" v-once>
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['payment_methods'], undefined>[number];
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?.pitch_bar) {
17
- pitchBar.slides = layoutContent.header.pitch_bar;
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
- start?: string,
22
- end?: string,
21
+ startsAt?: string,
22
+ endsAt?: string,
23
23
  img: string,
24
24
  alt?: string,
25
- mobile_img?: string,
25
+ mobileImg?: string,
26
26
  href?: string,
27
27
  title?: string,
28
28
  subtitle?: string
29
- button_link?: string,
30
- button_text?: string,
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 { custom_code: customCodeContent } = await getContent('layout');
6
+ const { customCode } = await getContent('layout');
7
7
  ---
8
8
 
9
9
  <Head>
10
10
  <slot name="base-head" />
11
- {customCodeContent?.css && <style>{customCodeContent.css}</style>}
12
- {customCodeContent?.html_head && <Fragment set:html={customCodeContent.html_head} />}
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
- {customCodeContent?.html_body && <Fragment set:html={customCodeContent.html_body} />}
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?.og_image) {
52
- ogImage = metatagsContent.og_image.charAt(0) === '/'
53
- ? `https://${domain}${metatagsContent.og_image}` : metatagsContent.og_image;
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?.fb_app_id &&
158
- <meta property="fb:app_id" content={metatagsContent.fb_app_id} />}
157
+ {metatagsContent?.fbAppId &&
158
+ <meta property="fb:app_id" content={metatagsContent.fbAppId} />}
159
159
  <meta name="twitter:card" content="summary">
160
- {metatagsContent?.twitter_username &&
161
- <meta name="twitter:site" content={metatagsContent.twitter_username} />}
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 { header: headerContent } = layoutContent;
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: headerContent.inline_menu_categories?.featured,
40
- menuRandomCategories: headerContent.inline_menu_categories?.random,
41
- isAlphabeticalSortSubmenu: headerContent.alphabetical_sort_submenu,
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
- img,
21
- start,
22
- end,
23
- mobile_img: mobileImg,
24
- button_link: buttonLink,
25
- button_text: buttonText,
26
- ...rest
19
+ startsAt,
20
+ endsAt,
21
+ ...bannerProps
27
22
  }) => {
28
- if (start && new Date(start).getTime() < now) return;
29
- if (end && new Date(end).getTime() > now) return;
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: 'breadcrumbs', props: UseBreadcrumbsProps }
65
- | { type: 'product-details', props: {} }
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
- collection_id: collectionIdAndInfo,
75
- headless: isHeadless,
76
- shuffle: isShuffle,
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:
@@ -2,7 +2,7 @@
2
2
  "name": "@cloudcommerce/test-base",
3
3
  "private": true,
4
4
  "type": "module",
5
- "version": "0.27.0",
5
+ "version": "0.28.0",
6
6
  "description": "E-Com Plus Cloud Commerce basic setup for testing",
7
7
  "main": "lib/index.js",
8
8
  "repository": {
@@ -97,18 +97,18 @@ type SettingsContent = {
97
97
  description: string,
98
98
  logo: string,
99
99
  icon: string,
100
- primary_color: string,
101
- secondary_color?: string,
102
- bg_color?: string,
100
+ primaryColor: string,
101
+ secondaryColor?: string,
102
+ bgColor?: string,
103
103
  email: string,
104
104
  phone: string,
105
105
  address: string,
106
- corporate_name: string,
107
- doc_number: string,
106
+ corporateName: string,
107
+ docNumber: string,
108
108
  lang: string,
109
109
  currency: string,
110
- currency_symbol: string,
111
- country_code: string,
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
- service_links?: Array<{
120
+ serviceLinks?: Array<{
121
121
  title: string,
122
122
  href: string,
123
123
  }>,
124
- payment_methods?: PaymentMethodFlag[],
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
- cart_url?: string,
143
- checkout_url?: string,
144
- account_url?: string,
145
- orders_url?: string,
146
- favorites_url?: string,
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,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/types",
3
3
  "type": "module",
4
- "version": "0.27.0",
4
+ "version": "0.28.0",
5
5
  "description": "E-Com Plus Cloud Commerce reusable type definitions",
6
6
  "main": "index.ts",
7
7
  "repository": {
@@ -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
- }