@sentecacommerce-theme/lib 0.12.89 → 0.12.93

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 (41) hide show
  1. package/dist/cjs/analytics/Pixel/hooks/index.js +36 -0
  2. package/dist/cjs/analytics/Pixel/hooks/usePixelFinishOrder.js +27 -0
  3. package/dist/cjs/analytics/Pixel/hooks/usePixelProductClick.js +3 -7
  4. package/dist/cjs/analytics/Pixel/hooks/usePixelProductsImpression.js +42 -32
  5. package/dist/cjs/analytics/Pixel/hooks/usePixelViewBasket.js +24 -0
  6. package/dist/cjs/analytics/Pixel/hooks/usePixelViewCategory.js +29 -0
  7. package/dist/cjs/analytics/Pixel/mainScript.js +197 -14
  8. package/dist/cjs/analytics/Pixel/minifiedPixel.js +1 -1
  9. package/dist/cjs/analytics/Pixel/usePixel.js +3 -0
  10. package/dist/cjs/analytics/Pixel/utils.js +17 -0
  11. package/dist/cjs/hooks/ui-hooks/useAccordion/index.js +0 -1
  12. package/dist/cjs/listing/api/queries/useListingQuery.js +4 -2
  13. package/dist/cjs/listing/ssr/prefetchListing.js +2 -1
  14. package/dist/cjs/ui/components/GridStyles.js +36 -0
  15. package/dist/cjs/ui/components/index.js +12 -0
  16. package/dist/esm/analytics/Pixel/hooks/index.js +3 -0
  17. package/dist/esm/analytics/Pixel/hooks/usePixelFinishOrder.js +22 -0
  18. package/dist/esm/analytics/Pixel/hooks/usePixelProductClick.js +4 -8
  19. package/dist/esm/analytics/Pixel/hooks/usePixelProductsImpression.js +42 -32
  20. package/dist/esm/analytics/Pixel/hooks/usePixelViewBasket.js +19 -0
  21. package/dist/esm/analytics/Pixel/hooks/usePixelViewCategory.js +24 -0
  22. package/dist/esm/analytics/Pixel/mainScript.js +199 -14
  23. package/dist/esm/analytics/Pixel/minifiedPixel.js +1 -1
  24. package/dist/esm/analytics/Pixel/usePixel.js +3 -0
  25. package/dist/esm/analytics/Pixel/utils.js +12 -0
  26. package/dist/esm/hooks/ui-hooks/useAccordion/index.js +0 -1
  27. package/dist/esm/listing/api/queries/useListingQuery.js +4 -2
  28. package/dist/esm/listing/ssr/prefetchListing.js +2 -1
  29. package/dist/esm/ui/components/GridStyles.js +26 -0
  30. package/dist/esm/ui/components/index.js +1 -0
  31. package/dist/types/analytics/Pixel/hooks/index.d.ts +3 -0
  32. package/dist/types/analytics/Pixel/hooks/usePixelFinishOrder.d.ts +4 -0
  33. package/dist/types/analytics/Pixel/hooks/usePixelViewBasket.d.ts +4 -0
  34. package/dist/types/analytics/Pixel/hooks/usePixelViewCategory.d.ts +7 -0
  35. package/dist/types/analytics/Pixel/types.d.ts +9 -0
  36. package/dist/types/analytics/Pixel/utils.d.ts +3 -0
  37. package/dist/types/listing/api/queries/useListingQuery.d.ts +2 -1
  38. package/dist/types/listing/types.d.ts +3 -2
  39. package/dist/types/ui/components/GridStyles.d.ts +10 -0
  40. package/dist/types/ui/components/index.d.ts +1 -0
  41. package/package.json +4 -4
@@ -167,11 +167,11 @@ export function processListingQuery(_) {
167
167
  }
168
168
  function _processListingQuery() {
169
169
  _processListingQuery = _asyncToGenerator(regeneratorRuntime.mark(function _callee(param) {
170
- var predicate, router, limit, sort, postFilter, offset, config, slug, query, type, filter, _sort;
170
+ var predicate, router, limit, sort, postFilter, offset, config, slug, _includeVariants, includeVariants, query, type, filter, _sort;
171
171
  return regeneratorRuntime.wrap(function _callee$(_ctx) {
172
172
  while(1)switch(_ctx.prev = _ctx.next){
173
173
  case 0:
174
- predicate = param.predicate, router = param.router, limit = param.limit, sort = param.sort, postFilter = param.postFilter, offset = param.offset, config = param.config, slug = param.slug;
174
+ predicate = param.predicate, router = param.router, limit = param.limit, sort = param.sort, postFilter = param.postFilter, offset = param.offset, config = param.config, slug = param.slug, _includeVariants = param.includeVariants, includeVariants = _includeVariants === void 0 ? false : _includeVariants;
175
175
  query = router.query;
176
176
  type = getListingPageType(router, slug, config);
177
177
  filter = generateFilter(type, query, slug, predicate);
@@ -189,6 +189,8 @@ function _processListingQuery() {
189
189
  postFilter: postFilter
190
190
  }, (config === null || config === void 0 ? void 0 : config.collapseMode) && type !== ListingTypesEnum.Collection && {
191
191
  collapseMode: config === null || config === void 0 ? void 0 : config.collapseMode
192
+ }, {
193
+ includeVariants: includeVariants
192
194
  })));
193
195
  case 6:
194
196
  case "end":
@@ -69,7 +69,8 @@ function _prefetchListing() {
69
69
  postFilter: postFilter,
70
70
  offset: offset,
71
71
  config: config,
72
- slug: aliasedSlug
72
+ slug: aliasedSlug,
73
+ includeVariants: Boolean(config.includeVariants)
73
74
  });
74
75
  case 12:
75
76
  data = _ctx.sent;
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ export var GridStyles = function(param) {
3
+ var spaceX = param.spaceX, breakpoints = param.breakpoints, _remSize = param.remSize, remSize = _remSize === void 0 ? 10 : _remSize;
4
+ var getSize = function getSize(width) {
5
+ return "min-width: calc(".concat(width, "% - ").concat(spaceX / remSize, "rem);") + "max-width: calc(".concat(width, "% - ").concat(spaceX / remSize, "rem);") + "margin: 0 ".concat(spaceX / 2 / remSize, "rem;");
6
+ };
7
+ var keys = Object.keys(breakpoints || {
8
+ xs: {
9
+ min: null
10
+ }
11
+ });
12
+ var transforms = {
13
+ xs: 'default'
14
+ };
15
+ var queries = keys.reduce(function(str, key, index) {
16
+ var min = ((breakpoints === null || breakpoints === void 0 ? void 0 : breakpoints[key]) || {}).min;
17
+ var k = transforms[key] || key;
18
+ if (index && !min) return str;
19
+ return str += "\n @media(min-width: ".concat(min || '1px', ") {\n .size-").concat(k, "-full-bleed {\n width: 100%;\n }\n\n .size-").concat(k, "-full-bleed .Section--inner {\n width: 100vw;\n position: relative;\n left: 50%;\n right: 50%;\n margin-left: -50vw;\n margin-right: -50vw;\n }\n\n .size-").concat(k, "-100 {\n ").concat(getSize(100), "\n }\n\n .size-").concat(k, "-90 {\n ").concat(getSize(90), "\n }\n\n .size-").concat(k, "-80 {\n ").concat(getSize(80), "\n }\n\n .size-").concat(k, "-75 {\n ").concat(getSize(75), "\n }\n\n .size-").concat(k, "-70 {\n ").concat(getSize(70), "\n }\n \n .size-").concat(k, "-66 {\n ").concat(getSize(66.666666), "\n }\n\n .size-").concat(k, "-60 {\n ").concat(getSize(60), "\n }\n\n .size-").concat(k, "-50 {\n ").concat(getSize(50), "\n }\n\n .size-").concat(k, "-40 {\n ").concat(getSize(40), "\n }\n\n .size-").concat(k, "-33 {\n ").concat(getSize(33.333333), "\n }\n\n .size-").concat(k, "-30 {\n ").concat(getSize(30), "\n }\n\n .size-").concat(k, "-25 {\n ").concat(getSize(25), "\n }\n\n .size-").concat(k, "-20 {\n ").concat(getSize(20), "\n }\n\n .size-").concat(k, "-10 {\n ").concat(getSize(10), "\n }\n }\n");
20
+ }, '');
21
+ return(/*#__PURE__*/ React.createElement("style", {
22
+ dangerouslySetInnerHTML: {
23
+ __html: "\n .Page--row {\n display: flex;\n display: -webkit-flex;\n flex-wrap: wrap;\n -webkit-flex-wrap: wrap;\n margin: 0 -".concat(spaceX / remSize / 2, "rem;\n }\n\n .Page__section {\n padding-bottom: 8rem;\n }\n\n .Page--col {\n display: block;\n width: 100%;\n }\n \n .size-default-inherit {\n width: 100%;\n }\n ").concat(queries, "\n ")
24
+ }
25
+ }));
26
+ };
@@ -1,2 +1,3 @@
1
1
  export * from './RangeSliderInput';
2
2
  export * from './LazyImage';
3
+ export * from './GridStyles';
@@ -1,4 +1,7 @@
1
1
  export * from './usePixelProductDetails';
2
2
  export * from './usePixelProductsImpression';
3
3
  export * from './usePixelProductClick';
4
+ export * from './usePixelViewBasket';
5
+ export * from './usePixelViewCategory';
6
+ export * from './usePixelFinishOrder';
4
7
  export * from './useDistrictMeta';
@@ -0,0 +1,4 @@
1
+ import type { OrderDTO } from '@sentecacommerce/sdk';
2
+ export declare const usePixelFinishOrder: () => {
3
+ sendFinishOrderEvent: (order: OrderDTO) => void;
4
+ };
@@ -0,0 +1,4 @@
1
+ import { LineItemDTO } from '@sentecacommerce/sdk';
2
+ export declare const usePixelViewBasket: () => {
3
+ sendViewBasketEvent: (data: LineItemDTO[]) => void;
4
+ };
@@ -0,0 +1,7 @@
1
+ export declare const usePixelViewCategory: () => {
2
+ sendViewCategoryEvent: (breadcrumbData: {
3
+ name: string;
4
+ id: string;
5
+ link: string;
6
+ }[]) => void;
7
+ };
@@ -7,3 +7,12 @@ export interface ProductsImpressionType {
7
7
  name: string;
8
8
  products?: ProductType[] | SearchResultDTO[];
9
9
  }
10
+ export interface Products {
11
+ id: string;
12
+ price: string;
13
+ quantity: string;
14
+ }
15
+ export interface OrderType {
16
+ orderId: string;
17
+ productsData: Products[];
18
+ }
@@ -0,0 +1,3 @@
1
+ import type { LineItemDTO } from '@sentecacommerce/sdk';
2
+ import type { Products } from './types';
3
+ export declare const mapProducts: (data: LineItemDTO[]) => Products[];
@@ -5,7 +5,7 @@ import { PredicateType } from '..';
5
5
  import { ListingPageMeta } from '../..';
6
6
  import { StringField } from '@sentecacommerce-theme/cms';
7
7
  export declare const useListingQuery: () => QueryResult<CatalogFilterResultDTO, unknown>;
8
- export declare function processListingQuery({ predicate, router, limit, sort, postFilter, offset, config, slug, }: {
8
+ export declare function processListingQuery({ predicate, router, limit, sort, postFilter, offset, config, slug, includeVariants, }: {
9
9
  predicate?: PredicateType;
10
10
  router: NextRouter;
11
11
  limit: number;
@@ -14,5 +14,6 @@ export declare function processListingQuery({ predicate, router, limit, sort, po
14
14
  postFilter?: string;
15
15
  config?: ListingPageMeta;
16
16
  slug?: string;
17
+ includeVariants?: boolean;
17
18
  }): Promise<CatalogFilterResultDTO>;
18
19
  export declare function isListingQueryEnabled(type: StringField, predicate?: PredicateType): boolean;
@@ -80,7 +80,8 @@ export interface ListingPageMeta {
80
80
  titleAliases: {
81
81
  [key: string]: string;
82
82
  };
83
- filterExtension: StringField;
84
- collapseMode: StringField;
83
+ filterExtension?: StringField;
84
+ collapseMode?: StringField;
85
85
  limit: NumberField;
86
+ includeVariants?: BooleanField;
86
87
  }
@@ -0,0 +1,10 @@
1
+ import { StringField } from '@sentecacommerce-theme/cms';
2
+ export declare const GridStyles: ({ spaceX, breakpoints, remSize, }: {
3
+ breakpoints?: {
4
+ [key: string]: {
5
+ min: StringField;
6
+ };
7
+ } | undefined;
8
+ spaceX: number;
9
+ remSize?: number | undefined;
10
+ }) => JSX.Element;
@@ -1,2 +1,3 @@
1
1
  export * from './RangeSliderInput';
2
2
  export * from './LazyImage';
3
+ export * from './GridStyles';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sentecacommerce-theme/lib",
3
3
  "sideEffects": false,
4
- "version": "0.12.89",
4
+ "version": "0.12.93",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
7
7
  "types": "dist/types/index.d.ts",
@@ -31,13 +31,13 @@
31
31
  "watch:cjs": "swc src --out-dir dist/cjs -w",
32
32
  "watch:esm": "swc src --out-dir dist/esm --no-swcrc -w"
33
33
  },
34
- "gitHead": "c33bd6a03d6f288f79cde744a489527bc0d48040",
34
+ "gitHead": "866cb89ec5b095f94032a8043f51d141b38be407",
35
35
  "peerDependencies": {
36
36
  "react-query": "^2.26.2"
37
37
  },
38
38
  "dependencies": {
39
- "@sentecacommerce-theme/base": "^0.12.89",
40
- "@sentecacommerce-theme/cms": "^0.12.89",
39
+ "@sentecacommerce-theme/base": "^0.12.93",
40
+ "@sentecacommerce-theme/cms": "^0.12.93",
41
41
  "@sentecacommerce/sdk": "2.0.161",
42
42
  "body-scroll-lock": "^3.1.5",
43
43
  "copy-to-clipboard": "^3.3.1",