@fast-simon/shopify-hydrogen 1.0.4 → 1.0.6
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/README.md +186 -179
- package/dist/esnext/@types/Tab.d.ts +9 -9
- package/dist/esnext/@types/Tab.js +5 -5
- package/dist/esnext/@types/appServerProps.d.ts +12 -12
- package/dist/esnext/@types/appServerProps.js +1 -1
- package/dist/esnext/@types/articles.d.ts +12 -12
- package/dist/esnext/@types/articles.js +1 -1
- package/dist/esnext/@types/categories.d.ts +10 -10
- package/dist/esnext/@types/categories.js +1 -1
- package/dist/esnext/@types/currency.d.ts +1 -1
- package/dist/esnext/@types/currency.js +1 -1
- package/dist/esnext/@types/device.d.ts +1 -1
- package/dist/esnext/@types/device.js +1 -1
- package/dist/esnext/@types/editor.d.ts +418 -416
- package/dist/esnext/@types/editor.js +6 -6
- package/dist/esnext/@types/facets.d.ts +37 -37
- package/dist/esnext/@types/facets.js +16 -16
- package/dist/esnext/@types/ispOptions.d.ts +6 -6
- package/dist/esnext/@types/ispOptions.js +1 -1
- package/dist/esnext/@types/narrow.d.ts +7 -7
- package/dist/esnext/@types/narrow.js +1 -1
- package/dist/esnext/@types/product.d.ts +134 -134
- package/dist/esnext/@types/product.js +7 -7
- package/dist/esnext/@types/promoTile.d.ts +11 -11
- package/dist/esnext/@types/promoTile.js +1 -1
- package/dist/esnext/@types/results.d.ts +38 -36
- package/dist/esnext/@types/results.js +1 -1
- package/dist/esnext/@types/routing.d.ts +11 -11
- package/dist/esnext/@types/routing.js +1 -1
- package/dist/esnext/@types/siteSetup.d.ts +52 -52
- package/dist/esnext/@types/siteSetup.js +1 -1
- package/dist/esnext/@types/siteStatus.d.ts +5 -5
- package/dist/esnext/@types/siteStatus.js +1 -1
- package/dist/esnext/@types/sortBy.d.ts +12 -12
- package/dist/esnext/@types/sortBy.js +1 -1
- package/dist/esnext/@types/translations.d.ts +12 -12
- package/dist/esnext/@types/translations.js +6 -6
- package/dist/esnext/components/FastSimonApp.server.d.ts +9 -9
- package/dist/esnext/components/FastSimonApp.server.js +45 -45
- package/dist/esnext/components/FastSimonProvider.server.d.ts +10 -10
- package/dist/esnext/components/FastSimonProvider.server.js +9 -9
- package/dist/esnext/components/Filters/DesktopFilters/DesktopFilters.server.d.ts +8 -8
- package/dist/esnext/components/Filters/DesktopFilters/DesktopFilters.server.js +5 -5
- package/dist/esnext/components/Filters/FacetOption.client.d.ts +9 -9
- package/dist/esnext/components/Filters/FacetOption.client.js +39 -39
- package/dist/esnext/components/Filters/Filters.server.d.ts +12 -12
- package/dist/esnext/components/Filters/Filters.server.js +11 -11
- package/dist/esnext/components/Filters/FiltersList.server.d.ts +8 -8
- package/dist/esnext/components/Filters/FiltersList.server.js +11 -11
- package/dist/esnext/components/Filters/FiltersSkeleton.d.ts +3 -3
- package/dist/esnext/components/Filters/FiltersSkeleton.js +32 -32
- package/dist/esnext/components/Filters/MobileFilters/MobileFilters.client.d.ts +6 -6
- package/dist/esnext/components/Filters/MobileFilters/MobileFilters.client.js +20 -20
- package/dist/esnext/components/Filters/RemovableTags/RemovableTag.client.d.ts +8 -8
- package/dist/esnext/components/Filters/RemovableTags/RemovableTag.client.js +11 -11
- package/dist/esnext/components/Filters/RemovableTags/RemovableTags.client.d.ts +8 -8
- package/dist/esnext/components/Filters/RemovableTags/RemovableTags.client.js +51 -51
- package/dist/esnext/components/PageTitle/PageTitle.server.d.ts +7 -7
- package/dist/esnext/components/PageTitle/PageTitle.server.js +4 -4
- package/dist/esnext/components/Pagination/Pagination.client.d.ts +9 -9
- package/dist/esnext/components/Pagination/Pagination.client.js +43 -43
- package/dist/esnext/components/Pagination/utils.d.ts +1 -1
- package/dist/esnext/components/Pagination/utils.js +4 -4
- package/dist/esnext/components/ProductCard/ProductCard.d.ts +10 -10
- package/dist/esnext/components/ProductCard/ProductCard.js +31 -31
- package/dist/esnext/components/ProductCard/components/AddToCart/AddToCart.client.d.ts +10 -10
- package/dist/esnext/components/ProductCard/components/AddToCart/AddToCart.client.js +23 -23
- package/dist/esnext/components/ProductCard/components/Compare/Compare.d.ts +6 -6
- package/dist/esnext/components/ProductCard/components/Compare/Compare.js +6 -6
- package/dist/esnext/components/ProductCard/components/Info/ProductInfo.d.ts +9 -9
- package/dist/esnext/components/ProductCard/components/Info/ProductInfo.js +11 -11
- package/dist/esnext/components/ProductCard/components/Price/Price.d.ts +7 -7
- package/dist/esnext/components/ProductCard/components/Price/Price.js +6 -6
- package/dist/esnext/components/ProductCard/components/ProductImage/ProductImage.d.ts +8 -8
- package/dist/esnext/components/ProductCard/components/ProductImage/ProductImage.js +7 -7
- package/dist/esnext/components/ProductCard/components/Title/Title.d.ts +7 -7
- package/dist/esnext/components/ProductCard/components/Title/Title.js +4 -4
- package/dist/esnext/components/ProductGrid/ProductGrid.server.d.ts +10 -10
- package/dist/esnext/components/ProductGrid/ProductGrid.server.js +10 -10
- package/dist/esnext/components/ProductGrid/stylesUtil.d.ts +138 -138
- package/dist/esnext/components/ProductGrid/stylesUtil.js +122 -122
- package/dist/esnext/components/ResultsSummary/ResultsSummary.server.d.ts +7 -7
- package/dist/esnext/components/ResultsSummary/ResultsSummary.server.js +8 -8
- package/dist/esnext/components/SortBy/SortBy.client.d.ts +10 -10
- package/dist/esnext/components/SortBy/SortBy.client.js +8 -8
- package/dist/esnext/components/SortBy/components/DesktopSortBy.client.d.ts +8 -8
- package/dist/esnext/components/SortBy/components/DesktopSortBy.client.js +30 -30
- package/dist/esnext/components/SortBy/utils.d.ts +8 -8
- package/dist/esnext/components/SortBy/utils.js +28 -28
- package/dist/esnext/components/index.d.ts +2 -2
- package/dist/esnext/components/index.js +2 -2
- package/dist/esnext/context/setRoutingContext.d.ts +2 -2
- package/dist/esnext/context/setRoutingContext.js +14 -14
- package/dist/esnext/context/setSiteContext.d.ts +6 -6
- package/dist/esnext/context/setSiteContext.js +18 -18
- package/dist/esnext/hooks/ResizeDetect.client.d.ts +2 -2
- package/dist/esnext/hooks/ResizeDetect.client.js +6 -6
- package/dist/esnext/hooks/useClickOutside.d.ts +1 -1
- package/dist/esnext/hooks/useClickOutside.js +12 -12
- package/dist/esnext/hooks/useScreenSize.d.ts +1 -1
- package/dist/esnext/hooks/useScreenSize.js +19 -19
- package/dist/esnext/icons/DownArrowIcon.d.ts +9 -9
- package/dist/esnext/icons/DownArrowIcon.js +5 -5
- package/dist/esnext/icons/LeftArrowIcon.d.ts +8 -8
- package/dist/esnext/icons/LeftArrowIcon.js +5 -5
- package/dist/esnext/icons/RejectIcon.d.ts +8 -8
- package/dist/esnext/icons/RejectIcon.js +5 -5
- package/dist/esnext/icons/RightArrowIcon.d.ts +8 -8
- package/dist/esnext/icons/RightArrowIcon.js +5 -5
- package/dist/esnext/icons/Spinner.d.ts +11 -11
- package/dist/esnext/icons/Spinner.js +6 -6
- package/dist/esnext/index.d.ts +1 -1
- package/dist/esnext/index.js +1 -1
- package/dist/esnext/services/__tests__/categories_navigation.test.d.ts +1 -0
- package/dist/esnext/services/__tests__/categories_navigation.test.js +90 -0
- package/dist/esnext/services/categories_navigation.d.ts +69 -48
- package/dist/esnext/services/categories_navigation.js +53 -51
- package/dist/esnext/services/search.d.ts +47 -47
- package/dist/esnext/services/search.js +51 -51
- package/dist/esnext/services/site_setup.d.ts +7 -7
- package/dist/esnext/services/site_setup.js +69 -69
- package/dist/esnext/utils/DynamicStyle.d.ts +7 -7
- package/dist/esnext/utils/DynamicStyle.js +5 -5
- package/dist/esnext/utils/defaults.d.ts +8 -8
- package/dist/esnext/utils/defaults.js +9 -9
- package/dist/esnext/utils/getDynamicStylesVar.d.ts +1 -1
- package/dist/esnext/utils/getDynamicStylesVar.js +5 -5
- package/dist/esnext/utils/getRoutingState.d.ts +9 -9
- package/dist/esnext/utils/getRoutingState.js +13 -13
- package/dist/esnext/utils/makeServingRequests.d.ts +6 -6
- package/dist/esnext/utils/makeServingRequests.js +32 -32
- package/dist/node/plugin/extendOptimizeDeps.d.ts +2 -2
- package/dist/node/plugin/extendOptimizeDeps.js +14 -14
- package/dist/node/plugin/index.d.ts +3 -3
- package/dist/node/plugin/index.js +13 -13
- package/dist/node/plugin/injectCSS.d.ts +2 -2
- package/dist/node/plugin/injectCSS.js +25 -25
- package/dist/node/plugin/suppressWarnings.d.ts +2 -2
- package/dist/node/plugin/suppressWarnings.js +21 -21
- package/package.json +37 -34
- package/dist/esnext/styles/fast-simon.css +0 -622
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ServerProduct } from "../../../../@types/product";
|
|
3
|
-
import { ProductSettings } from "../../../../@types/editor";
|
|
4
|
-
interface Props {
|
|
5
|
-
productData: ServerProduct;
|
|
6
|
-
productSettings: ProductSettings;
|
|
7
|
-
}
|
|
8
|
-
export declare function ProductInfo({ productData, productSettings }: Props): React.JSX.Element;
|
|
9
|
-
export {};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ServerProduct } from "../../../../@types/product";
|
|
3
|
+
import { ProductSettings } from "../../../../@types/editor";
|
|
4
|
+
interface Props {
|
|
5
|
+
productData: ServerProduct;
|
|
6
|
+
productSettings: ProductSettings;
|
|
7
|
+
}
|
|
8
|
+
export declare function ProductInfo({ productData, productSettings }: Props): React.JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Title } from "../Title/Title";
|
|
3
|
-
import { Price } from "../Price/Price";
|
|
4
|
-
import { Compare } from "../Compare/Compare";
|
|
5
|
-
export function ProductInfo({ productData, productSettings }) {
|
|
6
|
-
const isCompare = productSettings.compare.isActive && Number(productData?.p_c) !== 0;
|
|
7
|
-
return (React.createElement("div", { className: `fs-product-card-info ${isCompare ? 'fs-info-areas-compare' : 'fs-info-areas'}` },
|
|
8
|
-
React.createElement(Title, { title: productData.l, redirectURL: productData.u }),
|
|
9
|
-
React.createElement(Price, { price: productData.p, isCompare: isCompare }),
|
|
10
|
-
isCompare ? React.createElement(Compare, { compare: productData.p_c }) : null));
|
|
11
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Title } from "../Title/Title";
|
|
3
|
+
import { Price } from "../Price/Price";
|
|
4
|
+
import { Compare } from "../Compare/Compare";
|
|
5
|
+
export function ProductInfo({ productData, productSettings }) {
|
|
6
|
+
const isCompare = productSettings.compare.isActive && Number(productData?.p_c) !== 0;
|
|
7
|
+
return (React.createElement("div", { className: `fs-product-card-info ${isCompare ? 'fs-info-areas-compare' : 'fs-info-areas'}` },
|
|
8
|
+
React.createElement(Title, { title: productData.l, redirectURL: productData.u }),
|
|
9
|
+
React.createElement(Price, { price: productData.p, isCompare: isCompare }),
|
|
10
|
+
isCompare ? React.createElement(Compare, { compare: productData.p_c }) : null));
|
|
11
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface Props {
|
|
3
|
-
price: string;
|
|
4
|
-
isCompare: boolean;
|
|
5
|
-
}
|
|
6
|
-
export declare function Price({ price, isCompare }: Props): React.JSX.Element;
|
|
7
|
-
export {};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
price: string;
|
|
4
|
+
isCompare: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function Price({ price, isCompare }: Props): React.JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export function Price({ price, isCompare }) {
|
|
3
|
-
return (React.createElement("div", { className: `fs-product-card-price ${isCompare ? 'fs-price-with-compare' : 'fs-price-without-compare'}` },
|
|
4
|
-
"$",
|
|
5
|
-
price));
|
|
6
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export function Price({ price, isCompare }) {
|
|
3
|
+
return (React.createElement("div", { className: `fs-product-card-price ${isCompare ? 'fs-price-with-compare' : 'fs-price-without-compare'}` },
|
|
4
|
+
"$",
|
|
5
|
+
price));
|
|
6
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface Props {
|
|
3
|
-
imageURL: string;
|
|
4
|
-
redirectURL: string;
|
|
5
|
-
index: number;
|
|
6
|
-
}
|
|
7
|
-
export declare function ProductImage({ imageURL, redirectURL, index }: Props): React.JSX.Element;
|
|
8
|
-
export {};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
imageURL: string;
|
|
4
|
+
redirectURL: string;
|
|
5
|
+
index: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function ProductImage({ imageURL, redirectURL, index }: Props): React.JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Image, Link } from "@shopify/hydrogen";
|
|
3
|
-
const MISSING_IMAGE_SRC = 'https://acp-magento.appspot.com/images/missing.gif';
|
|
4
|
-
export function ProductImage({ imageURL, redirectURL, index }) {
|
|
5
|
-
return (React.createElement(Link, { to: redirectURL },
|
|
6
|
-
React.createElement(Image, { alt: "product image", src: imageURL || MISSING_IMAGE_SRC, width: 500, height: 500, className: 'fs-product-card-img', loading: index < 4 ? 'eager' : 'lazy' })));
|
|
7
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Image, Link } from "@shopify/hydrogen";
|
|
3
|
+
const MISSING_IMAGE_SRC = 'https://acp-magento.appspot.com/images/missing.gif';
|
|
4
|
+
export function ProductImage({ imageURL, redirectURL, index }) {
|
|
5
|
+
return (React.createElement(Link, { to: redirectURL },
|
|
6
|
+
React.createElement(Image, { alt: "product image", src: imageURL || MISSING_IMAGE_SRC, width: 500, height: 500, className: 'fs-product-card-img', loading: index < 4 ? 'eager' : 'lazy' })));
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface Props {
|
|
3
|
-
title: string;
|
|
4
|
-
redirectURL: string;
|
|
5
|
-
}
|
|
6
|
-
export declare function Title({ title, redirectURL }: Props): React.JSX.Element;
|
|
7
|
-
export {};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
title: string;
|
|
4
|
+
redirectURL: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function Title({ title, redirectURL }: Props): React.JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export function Title({ title, redirectURL }) {
|
|
3
|
-
return (React.createElement("a", { href: redirectURL, className: "fs-product-card-title" }, title));
|
|
4
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export function Title({ title, redirectURL }) {
|
|
3
|
+
return (React.createElement("a", { href: redirectURL, className: "fs-product-card-title" }, title));
|
|
4
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { FullTextServerResponseAll } from "../../services/search";
|
|
3
|
-
import { CategoryNavigationServerResponseAll } from "../../services/categories_navigation";
|
|
4
|
-
import { ProductsGridSettings } from "../../@types/editor";
|
|
5
|
-
interface Props {
|
|
6
|
-
data?: FullTextServerResponseAll | CategoryNavigationServerResponseAll;
|
|
7
|
-
gridSettings: ProductsGridSettings;
|
|
8
|
-
}
|
|
9
|
-
export declare function ProductGridServer({ data, gridSettings }: Props): React.JSX.Element;
|
|
10
|
-
export {};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FullTextServerResponseAll } from "../../services/search";
|
|
3
|
+
import { CategoryNavigationServerResponseAll } from "../../services/categories_navigation";
|
|
4
|
+
import { ProductsGridSettings } from "../../@types/editor";
|
|
5
|
+
interface Props {
|
|
6
|
+
data?: FullTextServerResponseAll | CategoryNavigationServerResponseAll;
|
|
7
|
+
gridSettings: ProductsGridSettings;
|
|
8
|
+
}
|
|
9
|
+
export declare function ProductGridServer({ data, gridSettings }: Props): React.JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ProductCard } from "../ProductCard/ProductCard";
|
|
3
|
-
import { DynamicStyle } from "../../utils/DynamicStyle";
|
|
4
|
-
import { StylesUtil } from "./stylesUtil";
|
|
5
|
-
export function ProductGridServer({ data, gridSettings }) {
|
|
6
|
-
const dynamicStyles = StylesUtil.getDynamicStylesObject(gridSettings);
|
|
7
|
-
return (React.createElement(React.Fragment, null,
|
|
8
|
-
dynamicStyles.map(item => React.createElement(DynamicStyle, { key: item.className, styles: item.styles, className: item.className })),
|
|
9
|
-
React.createElement("div", { className: "fs-grid" }, data?.items?.map((product, index) => React.createElement(ProductCard, { key: product.id, productData: product, productSettings: gridSettings.product, index: index })))));
|
|
10
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ProductCard } from "../ProductCard/ProductCard";
|
|
3
|
+
import { DynamicStyle } from "../../utils/DynamicStyle";
|
|
4
|
+
import { StylesUtil } from "./stylesUtil";
|
|
5
|
+
export function ProductGridServer({ data, gridSettings }) {
|
|
6
|
+
const dynamicStyles = StylesUtil.getDynamicStylesObject(gridSettings);
|
|
7
|
+
return (React.createElement(React.Fragment, null,
|
|
8
|
+
dynamicStyles.map(item => React.createElement(DynamicStyle, { key: item.className, styles: item.styles, className: item.className })),
|
|
9
|
+
React.createElement("div", { className: "fs-grid" }, data?.items?.map((product, index) => React.createElement(ProductCard, { key: product.id, productData: product, productSettings: gridSettings.product, index: index })))));
|
|
10
|
+
}
|
|
@@ -1,138 +1,138 @@
|
|
|
1
|
-
import { ProductAddToCartSettings, ProductComparePriceSettings, ProductPriceSettings, ProductSettings, ProductsGridSettings, ProductTitleSettings } from "../../@types/editor";
|
|
2
|
-
export declare class StylesUtil {
|
|
3
|
-
static getDynamicStylesObject: (gridSettings: ProductsGridSettings) => ({
|
|
4
|
-
className: string;
|
|
5
|
-
styles: {
|
|
6
|
-
"grid-template-columns": string;
|
|
7
|
-
"grid-row-gap": string;
|
|
8
|
-
"grid-column-gap": string;
|
|
9
|
-
"margin-left": string;
|
|
10
|
-
};
|
|
11
|
-
} | {
|
|
12
|
-
className: string;
|
|
13
|
-
styles: {
|
|
14
|
-
'aspect-ratio': number;
|
|
15
|
-
'object-fit': string;
|
|
16
|
-
};
|
|
17
|
-
} | {
|
|
18
|
-
className: string;
|
|
19
|
-
styles: {
|
|
20
|
-
'background-color': string;
|
|
21
|
-
color: string;
|
|
22
|
-
};
|
|
23
|
-
} | {
|
|
24
|
-
className: string;
|
|
25
|
-
styles: {
|
|
26
|
-
'font-weight': string;
|
|
27
|
-
'font-family': string;
|
|
28
|
-
'font-size': string;
|
|
29
|
-
'letter-spacing': string;
|
|
30
|
-
'line-height': string;
|
|
31
|
-
};
|
|
32
|
-
} | {
|
|
33
|
-
className: string;
|
|
34
|
-
styles: {
|
|
35
|
-
'text-align': string;
|
|
36
|
-
color: string;
|
|
37
|
-
};
|
|
38
|
-
} | {
|
|
39
|
-
className: string;
|
|
40
|
-
styles: {
|
|
41
|
-
border: string | undefined;
|
|
42
|
-
};
|
|
43
|
-
} | {
|
|
44
|
-
className: string;
|
|
45
|
-
styles: {
|
|
46
|
-
padding: string;
|
|
47
|
-
};
|
|
48
|
-
} | {
|
|
49
|
-
className: string;
|
|
50
|
-
styles: {
|
|
51
|
-
'grid-template-areas': string | undefined;
|
|
52
|
-
};
|
|
53
|
-
})[];
|
|
54
|
-
static getGridCustomStyles: (gridSettings: ProductsGridSettings) => {
|
|
55
|
-
"grid-template-columns": string;
|
|
56
|
-
"grid-row-gap": string;
|
|
57
|
-
"grid-column-gap": string;
|
|
58
|
-
"margin-left": string;
|
|
59
|
-
};
|
|
60
|
-
static getProductImageCustomStyles: (productSettings: ProductSettings) => {
|
|
61
|
-
'aspect-ratio': number;
|
|
62
|
-
'object-fit': string;
|
|
63
|
-
};
|
|
64
|
-
static getAddToCartCustomStyles: (addToCart: ProductAddToCartSettings) => {
|
|
65
|
-
base: {
|
|
66
|
-
'font-weight': string;
|
|
67
|
-
'font-family': string;
|
|
68
|
-
'font-size': string;
|
|
69
|
-
'letter-spacing': string;
|
|
70
|
-
color: string;
|
|
71
|
-
'background-color': string;
|
|
72
|
-
border: string;
|
|
73
|
-
'border-radius': string;
|
|
74
|
-
opacity: number;
|
|
75
|
-
};
|
|
76
|
-
hover: {
|
|
77
|
-
'background-color': string;
|
|
78
|
-
color: string;
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
static getPriceCustomStyles: (priceSettings: ProductPriceSettings, comparePrice?: boolean) => {
|
|
82
|
-
base: {
|
|
83
|
-
'font-weight': string;
|
|
84
|
-
'font-family': string;
|
|
85
|
-
'font-size': string;
|
|
86
|
-
'letter-spacing': string;
|
|
87
|
-
'line-height': string;
|
|
88
|
-
};
|
|
89
|
-
withCompare: {
|
|
90
|
-
'text-align': "
|
|
91
|
-
color: string;
|
|
92
|
-
};
|
|
93
|
-
withoutCompare: {
|
|
94
|
-
'text-align': string;
|
|
95
|
-
color: string;
|
|
96
|
-
};
|
|
97
|
-
};
|
|
98
|
-
static getProductTitleCustomStyles: (titleSettings: ProductTitleSettings) => {
|
|
99
|
-
'-webkit-line-clamp': string;
|
|
100
|
-
'font-weight': string;
|
|
101
|
-
'text-align': string;
|
|
102
|
-
'font-family': string;
|
|
103
|
-
'font-size': string;
|
|
104
|
-
'letter-spacing': string;
|
|
105
|
-
'line-height': string;
|
|
106
|
-
color: string;
|
|
107
|
-
};
|
|
108
|
-
static getProductCardCustomStyles: (productSettings: ProductSettings) => {
|
|
109
|
-
base: {
|
|
110
|
-
padding: string;
|
|
111
|
-
border: string | undefined;
|
|
112
|
-
'border-radius': string;
|
|
113
|
-
shadow: string;
|
|
114
|
-
'justify-content': string;
|
|
115
|
-
};
|
|
116
|
-
hover: {
|
|
117
|
-
border: string | undefined;
|
|
118
|
-
};
|
|
119
|
-
gridAreasWithCompare: {
|
|
120
|
-
'grid-template-areas': string | undefined;
|
|
121
|
-
};
|
|
122
|
-
gridAreasWithoutCompare: {
|
|
123
|
-
'grid-template-areas': string | undefined;
|
|
124
|
-
};
|
|
125
|
-
productInfo: {
|
|
126
|
-
padding: string;
|
|
127
|
-
};
|
|
128
|
-
};
|
|
129
|
-
static getCompareStyles: (compareSettings: ProductComparePriceSettings) => {
|
|
130
|
-
'font-weight': string;
|
|
131
|
-
'text-align': string;
|
|
132
|
-
'font-family': string;
|
|
133
|
-
'font-size': string;
|
|
134
|
-
'letter-spacing': string;
|
|
135
|
-
'line-height': string;
|
|
136
|
-
color: string;
|
|
137
|
-
};
|
|
138
|
-
}
|
|
1
|
+
import { ProductAddToCartSettings, ProductComparePriceSettings, ProductPriceSettings, ProductSettings, ProductsGridSettings, ProductTitleSettings } from "../../@types/editor";
|
|
2
|
+
export declare class StylesUtil {
|
|
3
|
+
static getDynamicStylesObject: (gridSettings: ProductsGridSettings) => ({
|
|
4
|
+
className: string;
|
|
5
|
+
styles: {
|
|
6
|
+
"grid-template-columns": string;
|
|
7
|
+
"grid-row-gap": string;
|
|
8
|
+
"grid-column-gap": string;
|
|
9
|
+
"margin-left": string;
|
|
10
|
+
};
|
|
11
|
+
} | {
|
|
12
|
+
className: string;
|
|
13
|
+
styles: {
|
|
14
|
+
'aspect-ratio': number;
|
|
15
|
+
'object-fit': string;
|
|
16
|
+
};
|
|
17
|
+
} | {
|
|
18
|
+
className: string;
|
|
19
|
+
styles: {
|
|
20
|
+
'background-color': string;
|
|
21
|
+
color: string;
|
|
22
|
+
};
|
|
23
|
+
} | {
|
|
24
|
+
className: string;
|
|
25
|
+
styles: {
|
|
26
|
+
'font-weight': string;
|
|
27
|
+
'font-family': string;
|
|
28
|
+
'font-size': string;
|
|
29
|
+
'letter-spacing': string;
|
|
30
|
+
'line-height': string;
|
|
31
|
+
};
|
|
32
|
+
} | {
|
|
33
|
+
className: string;
|
|
34
|
+
styles: {
|
|
35
|
+
'text-align': string;
|
|
36
|
+
color: string;
|
|
37
|
+
};
|
|
38
|
+
} | {
|
|
39
|
+
className: string;
|
|
40
|
+
styles: {
|
|
41
|
+
border: string | undefined;
|
|
42
|
+
};
|
|
43
|
+
} | {
|
|
44
|
+
className: string;
|
|
45
|
+
styles: {
|
|
46
|
+
padding: string;
|
|
47
|
+
};
|
|
48
|
+
} | {
|
|
49
|
+
className: string;
|
|
50
|
+
styles: {
|
|
51
|
+
'grid-template-areas': string | undefined;
|
|
52
|
+
};
|
|
53
|
+
})[];
|
|
54
|
+
static getGridCustomStyles: (gridSettings: ProductsGridSettings) => {
|
|
55
|
+
"grid-template-columns": string;
|
|
56
|
+
"grid-row-gap": string;
|
|
57
|
+
"grid-column-gap": string;
|
|
58
|
+
"margin-left": string;
|
|
59
|
+
};
|
|
60
|
+
static getProductImageCustomStyles: (productSettings: ProductSettings) => {
|
|
61
|
+
'aspect-ratio': number;
|
|
62
|
+
'object-fit': string;
|
|
63
|
+
};
|
|
64
|
+
static getAddToCartCustomStyles: (addToCart: ProductAddToCartSettings) => {
|
|
65
|
+
base: {
|
|
66
|
+
'font-weight': string;
|
|
67
|
+
'font-family': string;
|
|
68
|
+
'font-size': string;
|
|
69
|
+
'letter-spacing': string;
|
|
70
|
+
color: string;
|
|
71
|
+
'background-color': string;
|
|
72
|
+
border: string;
|
|
73
|
+
'border-radius': string;
|
|
74
|
+
opacity: number;
|
|
75
|
+
};
|
|
76
|
+
hover: {
|
|
77
|
+
'background-color': string;
|
|
78
|
+
color: string;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
static getPriceCustomStyles: (priceSettings: ProductPriceSettings, comparePrice?: boolean) => {
|
|
82
|
+
base: {
|
|
83
|
+
'font-weight': string;
|
|
84
|
+
'font-family': string;
|
|
85
|
+
'font-size': string;
|
|
86
|
+
'letter-spacing': string;
|
|
87
|
+
'line-height': string;
|
|
88
|
+
};
|
|
89
|
+
withCompare: {
|
|
90
|
+
'text-align': "left" | "center" | "right";
|
|
91
|
+
color: string;
|
|
92
|
+
};
|
|
93
|
+
withoutCompare: {
|
|
94
|
+
'text-align': string;
|
|
95
|
+
color: string;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
static getProductTitleCustomStyles: (titleSettings: ProductTitleSettings) => {
|
|
99
|
+
'-webkit-line-clamp': string;
|
|
100
|
+
'font-weight': string;
|
|
101
|
+
'text-align': string;
|
|
102
|
+
'font-family': string;
|
|
103
|
+
'font-size': string;
|
|
104
|
+
'letter-spacing': string;
|
|
105
|
+
'line-height': string;
|
|
106
|
+
color: string;
|
|
107
|
+
};
|
|
108
|
+
static getProductCardCustomStyles: (productSettings: ProductSettings) => {
|
|
109
|
+
base: {
|
|
110
|
+
padding: string;
|
|
111
|
+
border: string | undefined;
|
|
112
|
+
'border-radius': string;
|
|
113
|
+
shadow: string;
|
|
114
|
+
'justify-content': string;
|
|
115
|
+
};
|
|
116
|
+
hover: {
|
|
117
|
+
border: string | undefined;
|
|
118
|
+
};
|
|
119
|
+
gridAreasWithCompare: {
|
|
120
|
+
'grid-template-areas': string | undefined;
|
|
121
|
+
};
|
|
122
|
+
gridAreasWithoutCompare: {
|
|
123
|
+
'grid-template-areas': string | undefined;
|
|
124
|
+
};
|
|
125
|
+
productInfo: {
|
|
126
|
+
padding: string;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
static getCompareStyles: (compareSettings: ProductComparePriceSettings) => {
|
|
130
|
+
'font-weight': string;
|
|
131
|
+
'text-align': string;
|
|
132
|
+
'font-family': string;
|
|
133
|
+
'font-size': string;
|
|
134
|
+
'letter-spacing': string;
|
|
135
|
+
'line-height': string;
|
|
136
|
+
color: string;
|
|
137
|
+
};
|
|
138
|
+
}
|