@tapcart/mobile-components 0.8.20 → 0.8.24
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/dist/components/hooks/use-block-conditional-rendering.d.ts +2 -0
- package/dist/components/hooks/use-block-conditional-rendering.d.ts.map +1 -1
- package/dist/components/hooks/use-block-conditional-rendering.js +4 -6
- package/dist/components/hooks/use-recommendations.d.ts.map +1 -1
- package/dist/components/hooks/use-recommendations.js +42 -7
- package/dist/components/libs/cache/RecommendationsLocalStorage.d.ts +30 -0
- package/dist/components/libs/cache/RecommendationsLocalStorage.d.ts.map +1 -0
- package/dist/components/libs/cache/RecommendationsLocalStorage.js +67 -0
- package/dist/components/ui/loading-dots.d.ts +2 -1
- package/dist/components/ui/loading-dots.d.ts.map +1 -1
- package/dist/components/ui/loading-dots.js +5 -2
- package/dist/components/ui/virtual-grid.d.ts.map +1 -1
- package/dist/components/ui/virtual-grid.js +3 -3
- package/dist/lib/utils.d.ts +4 -4
- package/dist/lib/utils.js +1 -1
- package/dist/styles.css +3 -3
- package/package.json +1 -1
|
@@ -2,6 +2,8 @@ import { PhoenixBlock } from "app-studio-types";
|
|
|
2
2
|
export declare const useBlockConditionalRendering: (_props: {
|
|
3
3
|
appId: string;
|
|
4
4
|
apiUrl: string;
|
|
5
|
+
deviceVariables: any;
|
|
6
|
+
customerVariables: any;
|
|
5
7
|
}, _block: PhoenixBlock) => {
|
|
6
8
|
shouldShow: boolean;
|
|
7
9
|
isLoading: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-block-conditional-rendering.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-block-conditional-rendering.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,YAAY,EAGb,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"use-block-conditional-rendering.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-block-conditional-rendering.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,YAAY,EAGb,MAAM,kBAAkB,CAAA;AAczB,eAAO,MAAM,4BAA4B,WAC/B;IACN,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,eAAe,EAAE,GAAG,CAAA;IACpB,iBAAiB,EAAE,GAAG,CAAA;CACvB,UACO,YAAY;;;CA+KrB,CAAA"}
|
|
@@ -14,19 +14,17 @@ import { useMemo } from "react";
|
|
|
14
14
|
import { useProducts } from "./use-products";
|
|
15
15
|
import { useCollection } from "./use-collection";
|
|
16
16
|
import { useSearchParams } from "next/navigation";
|
|
17
|
-
//@ts-expect-error
|
|
18
|
-
import { useVariables } from "@tapcart/webbridge-react";
|
|
19
17
|
import { gidFromId, countNumberOfTagsInState, getEnvState, shouldShowBlock, evaluateConditions, } from "../../lib/utils";
|
|
20
18
|
export const useBlockConditionalRendering = (_props, _block) => {
|
|
21
19
|
var _a, _b, _c, _d, _e;
|
|
22
20
|
const _f = ((_a = _block === null || _block === void 0 ? void 0 : _block.visibilityConditions) === null || _a === void 0 ? void 0 : _a.conditions) || {}, { enabled: conditionalsV1IsEnabled = false, exclude: isInverse = false } = _f, restOfProps = __rest(_f, ["enabled", "exclude"]);
|
|
23
21
|
const { _version = 1, conditions, enabled: conditionalsV2IsEnabled = false, } = (_block === null || _block === void 0 ? void 0 : _block.visibilityConditions) || {};
|
|
22
|
+
if (!conditionalsV1IsEnabled && !conditionalsV2IsEnabled) {
|
|
23
|
+
return { shouldShow: true, isLoading: false };
|
|
24
|
+
}
|
|
24
25
|
const blockState = restOfProps;
|
|
25
|
-
const { appId = "", apiUrl = "" } = _props;
|
|
26
|
+
const { appId = "", apiUrl = "", deviceVariables, customerVariables } = _props;
|
|
26
27
|
const searchParams = useSearchParams();
|
|
27
|
-
const variables = useVariables();
|
|
28
|
-
const deviceVariables = variables === null || variables === void 0 ? void 0 : variables.device;
|
|
29
|
-
const customerVariables = variables === null || variables === void 0 ? void 0 : variables.customer;
|
|
30
28
|
// locale is provided in this form en_US
|
|
31
29
|
const [language, country] = ((_b = deviceVariables === null || deviceVariables === void 0 ? void 0 : deviceVariables.locale) === null || _b === void 0 ? void 0 : _b.split("_")) || [];
|
|
32
30
|
const productId = (_c = searchParams === null || searchParams === void 0 ? void 0 : searchParams.get("productId")) !== null && _c !== void 0 ? _c : undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-recommendations.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-recommendations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"use-recommendations.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-recommendations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAOtD,UAAU,sBAAsB;IAC9B,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACnC,MAAM,EAAE,MAAM,CAAA;CACf;AASD,UAAU,uBAAuB;IAC/B,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,WAAW,EAAE,UAAU,EAAE,CAAA;IACzB,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,SAAS,EAAE,OAAO,CAAA;IAClB,KAAK,EAAE,GAAG,CAAA;CACX;AAiBD,QAAA,MAAM,kBAAkB,gCAGrB,sBAAsB,KAAG,uBA6D3B,CAAA;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAA"}
|
|
@@ -1,18 +1,43 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
import { useSearchParams } from "next/navigation";
|
|
12
|
+
import RecommendationsLocalStorage from "../libs/cache/RecommendationsLocalStorage";
|
|
13
|
+
import React from "react";
|
|
3
14
|
import useSWR from "swr";
|
|
4
15
|
const constructURL = (apiURL) => {
|
|
5
16
|
const url = new URL(apiURL);
|
|
6
17
|
return url.toString();
|
|
7
18
|
};
|
|
19
|
+
const getCollections = (collections) => {
|
|
20
|
+
return collections
|
|
21
|
+
? collections === null || collections === void 0 ? void 0 : collections.filter((obj) => obj.handle !== "empty-collection")
|
|
22
|
+
: [];
|
|
23
|
+
};
|
|
24
|
+
const recommendationsLocalStorage = new RecommendationsLocalStorage();
|
|
8
25
|
const useRecommendations = ({ queryVariables, apiURL, }) => {
|
|
9
|
-
var _a;
|
|
10
26
|
const searchParams = useSearchParams();
|
|
11
27
|
const recommendation = (searchParams === null || searchParams === void 0 ? void 0 : searchParams.get("recommendation")) || "";
|
|
28
|
+
const [cachedRecommendation, setCachedRecommendations] = React.useState(recommendationsLocalStorage.getCacheItem({
|
|
29
|
+
id: `${recommendation}-${queryVariables === null || queryVariables === void 0 ? void 0 : queryVariables.language}`,
|
|
30
|
+
}));
|
|
12
31
|
const fetcher = (body) => fetch(constructURL(apiURL), {
|
|
13
32
|
method: "POST",
|
|
14
33
|
body: JSON.stringify(body),
|
|
15
|
-
}).then((res) =>
|
|
34
|
+
}).then((res) => __awaiter(void 0, void 0, void 0, function* () {
|
|
35
|
+
const data = yield res.json();
|
|
36
|
+
if (recommendation === "") {
|
|
37
|
+
recommendationsLocalStorage.setCacheItem(Object.assign({ id: `${queryVariables === null || queryVariables === void 0 ? void 0 : queryVariables.language}` }, data));
|
|
38
|
+
}
|
|
39
|
+
return data;
|
|
40
|
+
}));
|
|
16
41
|
const { data, error, isLoading } = useSWR({
|
|
17
42
|
appId: queryVariables.appId,
|
|
18
43
|
query: recommendation,
|
|
@@ -21,12 +46,22 @@ const useRecommendations = ({ queryVariables, apiURL, }) => {
|
|
|
21
46
|
revalidateOnFocus: false,
|
|
22
47
|
revalidateOnReconnect: false,
|
|
23
48
|
});
|
|
24
|
-
|
|
49
|
+
React.useEffect(() => {
|
|
50
|
+
if (!data) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
setCachedRecommendations({
|
|
54
|
+
id: `${recommendation}-${queryVariables === null || queryVariables === void 0 ? void 0 : queryVariables.language}`,
|
|
55
|
+
products: data === null || data === void 0 ? void 0 : data.products,
|
|
56
|
+
collections: getCollections(data === null || data === void 0 ? void 0 : data.collections),
|
|
57
|
+
searches: data === null || data === void 0 ? void 0 : data.searches,
|
|
58
|
+
});
|
|
59
|
+
}, [data]);
|
|
25
60
|
return {
|
|
26
|
-
products:
|
|
27
|
-
collections:
|
|
28
|
-
searches:
|
|
29
|
-
isLoading: isLoading,
|
|
61
|
+
products: cachedRecommendation === null || cachedRecommendation === void 0 ? void 0 : cachedRecommendation.products,
|
|
62
|
+
collections: cachedRecommendation === null || cachedRecommendation === void 0 ? void 0 : cachedRecommendation.collections,
|
|
63
|
+
searches: cachedRecommendation === null || cachedRecommendation === void 0 ? void 0 : cachedRecommendation.searches,
|
|
64
|
+
isLoading: !cachedRecommendation && isLoading,
|
|
30
65
|
error: error,
|
|
31
66
|
};
|
|
32
67
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import AppStudioCache from "./AppStudioCache";
|
|
2
|
+
type CachedRecommendation = {
|
|
3
|
+
id: string;
|
|
4
|
+
ct: number;
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
};
|
|
7
|
+
export default class RecommendationsLocalStorage extends AppStudioCache {
|
|
8
|
+
adapter: string;
|
|
9
|
+
cachePrefix: string;
|
|
10
|
+
getQueryCacheKey(id: string): string;
|
|
11
|
+
constructor();
|
|
12
|
+
getCache(): CachedRecommendation[];
|
|
13
|
+
getCacheItem({ id }: {
|
|
14
|
+
id: string;
|
|
15
|
+
}): object | null;
|
|
16
|
+
setCacheItem(recommendation: {
|
|
17
|
+
id: string;
|
|
18
|
+
}, cache?: CachedRecommendation[], shouldExpire?: boolean): {
|
|
19
|
+
id: string;
|
|
20
|
+
} | undefined;
|
|
21
|
+
setCacheItems(items: {
|
|
22
|
+
id: string;
|
|
23
|
+
}[]): ({
|
|
24
|
+
id: string;
|
|
25
|
+
} | undefined)[];
|
|
26
|
+
expireCacheData(numNewItems?: number): void;
|
|
27
|
+
clearCache(): void;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=RecommendationsLocalStorage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecommendationsLocalStorage.d.ts","sourceRoot":"","sources":["../../../../components/libs/cache/RecommendationsLocalStorage.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,kBAAkB,CAAA;AAE7C,KAAK,oBAAoB,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,EAAE,EAAE,MAAM,CAAA;IACV,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACnB,CAAA;AAED,MAAM,CAAC,OAAO,OAAO,2BAA4B,SAAQ,cAAc;IACrE,OAAO,EAAE,MAAM,CAAiC;IAChD,WAAW,EAAE,MAAM,CAAsB;IAEzC,gBAAgB,CAAC,EAAE,EAAE,MAAM;;IAQ3B,QAAQ,IAAI,oBAAoB,EAAE;IAiBlC,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,GAAG,IAAI;IAOnD,YAAY,CACV,cAAc,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,EAC9B,KAAK,CAAC,EAAE,oBAAoB,EAAE,EAC9B,YAAY,GAAE,OAAc;YAFN,MAAM;;IAiB9B,aAAa,CAAC,KAAK,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE;;;IASrC,eAAe,CAAC,WAAW,GAAE,MAAU;IAUvC,UAAU;CAMX"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import AppStudioCache from "./AppStudioCache";
|
|
2
|
+
export default class RecommendationsLocalStorage extends AppStudioCache {
|
|
3
|
+
getQueryCacheKey(id) {
|
|
4
|
+
return `${this.cachePrefix}-data-${id}`;
|
|
5
|
+
}
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.adapter = "local-storage-recommendation";
|
|
9
|
+
this.cachePrefix = "as-recommendation";
|
|
10
|
+
}
|
|
11
|
+
getCache() {
|
|
12
|
+
const items = [];
|
|
13
|
+
for (let i = 0; i < localStorage.length; i++) {
|
|
14
|
+
const key = localStorage.key(i);
|
|
15
|
+
if (key === null || key === void 0 ? void 0 : key.startsWith(this.getQueryCacheKey(""))) {
|
|
16
|
+
const value = localStorage.getItem(key);
|
|
17
|
+
if (value) {
|
|
18
|
+
const parsedValue = JSON.parse(value);
|
|
19
|
+
if (parsedValue === null || parsedValue === void 0 ? void 0 : parsedValue.id) {
|
|
20
|
+
items.push(JSON.parse(value));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return items;
|
|
26
|
+
}
|
|
27
|
+
getCacheItem({ id }) {
|
|
28
|
+
if (!(id === null || id === void 0 ? void 0 : id.length))
|
|
29
|
+
return null;
|
|
30
|
+
const item = localStorage.getItem(this.getQueryCacheKey(id));
|
|
31
|
+
if (!item)
|
|
32
|
+
return null;
|
|
33
|
+
return JSON.parse(item);
|
|
34
|
+
}
|
|
35
|
+
setCacheItem(recommendation, cache, shouldExpire = true) {
|
|
36
|
+
var _a;
|
|
37
|
+
if (!((_a = recommendation.id) === null || _a === void 0 ? void 0 : _a.length))
|
|
38
|
+
return;
|
|
39
|
+
if (shouldExpire) {
|
|
40
|
+
this.expireCacheData();
|
|
41
|
+
}
|
|
42
|
+
localStorage.setItem(this.getQueryCacheKey(recommendation.id), JSON.stringify(Object.assign(Object.assign({}, recommendation), { ct: Date.now() })));
|
|
43
|
+
return recommendation;
|
|
44
|
+
}
|
|
45
|
+
setCacheItems(items) {
|
|
46
|
+
this.expireCacheData(items.length);
|
|
47
|
+
const cache = this.getCache();
|
|
48
|
+
const cachedItems = items.map((item) => this.setCacheItem(item, cache, false));
|
|
49
|
+
return cachedItems;
|
|
50
|
+
}
|
|
51
|
+
expireCacheData(numNewItems = 0) {
|
|
52
|
+
const cacheItems = this.getCache();
|
|
53
|
+
if (cacheItems.length + numNewItems < 20)
|
|
54
|
+
return;
|
|
55
|
+
const numItemsToDelete = Math.max(10, numNewItems);
|
|
56
|
+
cacheItems.sort((a, b) => a.ct - b.ct);
|
|
57
|
+
cacheItems.slice(0, numItemsToDelete).forEach((item) => {
|
|
58
|
+
localStorage.removeItem(this.getQueryCacheKey(item.id));
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
clearCache() {
|
|
62
|
+
const cacheItems = this.getCache();
|
|
63
|
+
cacheItems.forEach((item) => {
|
|
64
|
+
localStorage.removeItem(this.getQueryCacheKey(item.id));
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -4,6 +4,7 @@ export interface LoadingDotsProps {
|
|
|
4
4
|
spacing?: 0 | 1 | 2 | 4;
|
|
5
5
|
opacity?: number;
|
|
6
6
|
show?: boolean;
|
|
7
|
+
showBackground?: boolean;
|
|
7
8
|
}
|
|
8
|
-
export declare const LoadingDots: ({ iconColor, size, spacing, opacity, show, }: LoadingDotsProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
export declare const LoadingDots: ({ iconColor, size, spacing, opacity, show, showBackground, }: LoadingDotsProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
9
10
|
//# sourceMappingURL=loading-dots.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loading-dots.d.ts","sourceRoot":"","sources":["../../../components/ui/loading-dots.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"loading-dots.d.ts","sourceRoot":"","sources":["../../../components/ui/loading-dots.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACvB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;AAED,eAAO,MAAM,WAAW,iEAOrB,gBAAgB,mDA6ClB,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../lib/utils";
|
|
2
3
|
import React from "react";
|
|
3
|
-
export const LoadingDots = ({ iconColor, size = 4, spacing = 1, opacity = 0.8, show = false, }) => {
|
|
4
|
+
export const LoadingDots = ({ iconColor, size = 4, spacing = 1, opacity = 0.8, show = false, showBackground = true, }) => {
|
|
4
5
|
const [showLoadingDots, setShowLoadingDots] = React.useState(show);
|
|
5
6
|
const [isAnimatingOut, setIsAnimatingOut] = React.useState(false);
|
|
6
7
|
React.useEffect(() => {
|
|
@@ -18,5 +19,7 @@ export const LoadingDots = ({ iconColor, size = 4, spacing = 1, opacity = 0.8, s
|
|
|
18
19
|
}, [show]);
|
|
19
20
|
if (!showLoadingDots)
|
|
20
21
|
return null;
|
|
21
|
-
return (_jsx("div", Object.assign({ className:
|
|
22
|
+
return (_jsx("div", Object.assign({ className: cn("absolute inset-0 flex items-center justify-center", isAnimatingOut ? "animate-fadeOut" : "animate-fadeIn", {
|
|
23
|
+
"bg-white bg-opacity-70": showBackground,
|
|
24
|
+
}) }, { children: _jsxs("div", Object.assign({ className: `flex space-x-${spacing}` }, { children: [_jsx("div", { style: { backgroundColor: iconColor, opacity: opacity }, className: `h-${size} w-${size} bg-black rounded-full animate-bounce [animation-delay:-0.3s]` }), _jsx("div", { style: { backgroundColor: iconColor, opacity: opacity }, className: `h-${size} w-${size} bg-black rounded-full animate-bounce [animation-delay:-0.15s]` }), _jsx("div", { style: { backgroundColor: iconColor, opacity: opacity }, className: `h-${size} w-${size} bg-black rounded-full animate-bounce` })] })) })));
|
|
22
25
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-grid.d.ts","sourceRoot":"","sources":["../../../components/ui/virtual-grid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAMjE,UAAU,QAAQ;IAChB,SAAS,EAAE,GAAG,CAAA;IACd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,aAAa,EAAE,OAAO,CAAA;IACtB,aAAa,EAAE,OAAO,CAAA;IACtB,UAAU,EAAE,KAAK,CAAC,iBAAiB,CAAA;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,OAAO,CAAC,EAAE;QACR,aAAa,EAAE,MAAM,CAAA;QACrB,WAAW,EAAE,MAAM,CAAA;KACpB,CAAA;IACD,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAC5B;AAED,QAAA,MAAM,mBAAmB;;mFAYvB,CAAA;AAEF,MAAM,WAAW,gBACf,SAAQ,QAAQ,EACd,YAAY,CAAC,OAAO,mBAAmB,CAAC;CAAG;AAE/C,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,OAAO,EACP,QAAQ,EACR,QAAY,EACZ,eAAqB,EACrB,aAAa,EACb,aAAa,EACb,UAAU,EACV,OAGC,EACD,KAAK,GACN,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"virtual-grid.d.ts","sourceRoot":"","sources":["../../../components/ui/virtual-grid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAMjE,UAAU,QAAQ;IAChB,SAAS,EAAE,GAAG,CAAA;IACd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,aAAa,EAAE,OAAO,CAAA;IACtB,aAAa,EAAE,OAAO,CAAA;IACtB,UAAU,EAAE,KAAK,CAAC,iBAAiB,CAAA;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,OAAO,CAAC,EAAE;QACR,aAAa,EAAE,MAAM,CAAA;QACrB,WAAW,EAAE,MAAM,CAAA;KACpB,CAAA;IACD,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAC5B;AAED,QAAA,MAAM,mBAAmB;;mFAYvB,CAAA;AAEF,MAAM,WAAW,gBACf,SAAQ,QAAQ,EACd,YAAY,CAAC,OAAO,mBAAmB,CAAC;CAAG;AAE/C,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,OAAO,EACP,QAAQ,EACR,QAAY,EACZ,eAAqB,EACrB,aAAa,EACb,aAAa,EACb,UAAU,EACV,OAGC,EACD,KAAK,GACN,EAAE,gBAAgB,2CAqElB;AAED,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAA"}
|
|
@@ -36,8 +36,7 @@ function VirtualGrid({ className, columns, children, overscan = 4, estimatedHeig
|
|
|
36
36
|
});
|
|
37
37
|
return (_jsx(Container, Object.assign({ style: style }, { children: _jsx("div", Object.assign({ style: {
|
|
38
38
|
width: "100%",
|
|
39
|
-
height:
|
|
40
|
-
rowVirtualizer.totalSize,
|
|
39
|
+
height: rowVirtualizer.totalSize,
|
|
41
40
|
position: "relative",
|
|
42
41
|
} }, { children: rowVirtualizer.virtualItems.map((virtualRow) => {
|
|
43
42
|
const rowStartIndex = virtualRow.index * col;
|
|
@@ -46,8 +45,9 @@ function VirtualGrid({ className, columns, children, overscan = 4, estimatedHeig
|
|
|
46
45
|
top: 0,
|
|
47
46
|
left: 0,
|
|
48
47
|
width: "100%",
|
|
49
|
-
transform: `translateY(${virtualRow.start
|
|
48
|
+
transform: `translateY(${virtualRow.start}px)`,
|
|
50
49
|
columnGap: `${spacing === null || spacing === void 0 ? void 0 : spacing.horizontalGap}px`,
|
|
50
|
+
paddingBottom: `${spacing === null || spacing === void 0 ? void 0 : spacing.verticalGap}px`,
|
|
51
51
|
}, ref: virtualRow.measureRef }, { children: Array.from({ length: col }).map((_, colIndex) => {
|
|
52
52
|
const index = rowStartIndex + colIndex;
|
|
53
53
|
if (index >= childrenArray.length && !isReachingEnd)
|
package/dist/lib/utils.d.ts
CHANGED
|
@@ -308,7 +308,7 @@ export declare const getLoyaltyButtonProps: (buttonConfig: TextStyle & Backgroun
|
|
|
308
308
|
};
|
|
309
309
|
style: {
|
|
310
310
|
backgroundColor: string | undefined;
|
|
311
|
-
|
|
311
|
+
borderColor: string | undefined;
|
|
312
312
|
boxShadow: string;
|
|
313
313
|
borderRadius: string | undefined;
|
|
314
314
|
width: string;
|
|
@@ -323,7 +323,7 @@ export declare const getLoyaltyButtonProps: (buttonConfig: TextStyle & Backgroun
|
|
|
323
323
|
paddingRight?: undefined;
|
|
324
324
|
} | {
|
|
325
325
|
backgroundColor: string | undefined;
|
|
326
|
-
|
|
326
|
+
borderColor: string | undefined;
|
|
327
327
|
boxShadow: string;
|
|
328
328
|
borderRadius: string | undefined;
|
|
329
329
|
width: string;
|
|
@@ -338,7 +338,7 @@ export declare const getLoyaltyButtonProps: (buttonConfig: TextStyle & Backgroun
|
|
|
338
338
|
paddingRight?: undefined;
|
|
339
339
|
} | {
|
|
340
340
|
backgroundColor: string | undefined;
|
|
341
|
-
|
|
341
|
+
borderColor: string | undefined;
|
|
342
342
|
boxShadow: string;
|
|
343
343
|
borderRadius: string | undefined;
|
|
344
344
|
width: string;
|
|
@@ -353,7 +353,7 @@ export declare const getLoyaltyButtonProps: (buttonConfig: TextStyle & Backgroun
|
|
|
353
353
|
paddingRight: string | undefined;
|
|
354
354
|
} | {
|
|
355
355
|
backgroundColor: string | undefined;
|
|
356
|
-
|
|
356
|
+
borderColor: string | undefined;
|
|
357
357
|
boxShadow: string;
|
|
358
358
|
borderRadius: string | undefined;
|
|
359
359
|
width: string;
|
package/dist/lib/utils.js
CHANGED
|
@@ -565,7 +565,7 @@ export const getLoyaltyButtonProps = (buttonConfig, state) => {
|
|
|
565
565
|
const borderSides = buttonConfig[`${state}BorderSides`];
|
|
566
566
|
return {
|
|
567
567
|
labelStyle: Object.assign(Object.assign({}, getTextStyle(buttonConfig)), { color: getColor(textColor) }),
|
|
568
|
-
style: Object.assign(Object.assign(Object.assign({}, getPaddingStyle(buttonConfig.padding)), getBorderSidesStyle(borderSides)), { backgroundColor: getColor(backgroundColor),
|
|
568
|
+
style: Object.assign(Object.assign(Object.assign({}, getPaddingStyle(buttonConfig.padding)), getBorderSidesStyle(borderSides)), { backgroundColor: getColor(backgroundColor), borderColor: getColor(borderColor), boxShadow: buttonConfig.backgroundShadow
|
|
569
569
|
? "0px 4px 6px rgba(0,0,0,0.1)"
|
|
570
570
|
: "none", borderRadius: buttonConfig.cornerRadius !== undefined
|
|
571
571
|
? `${buttonConfig.cornerRadius}px`
|
package/dist/styles.css
CHANGED
|
@@ -2115,6 +2115,9 @@ video {
|
|
|
2115
2115
|
.text-textColors-strikethroughPriceText {
|
|
2116
2116
|
color: var(--textColors-strikethroughPriceText);
|
|
2117
2117
|
}
|
|
2118
|
+
.underline {
|
|
2119
|
+
text-decoration-line: underline;
|
|
2120
|
+
}
|
|
2118
2121
|
.line-through {
|
|
2119
2122
|
text-decoration-line: line-through;
|
|
2120
2123
|
}
|
|
@@ -2279,9 +2282,6 @@ video {
|
|
|
2279
2282
|
transform: translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0));
|
|
2280
2283
|
}
|
|
2281
2284
|
}
|
|
2282
|
-
.fade-in {
|
|
2283
|
-
--tw-enter-opacity: 0;
|
|
2284
|
-
}
|
|
2285
2285
|
.duration-150 {
|
|
2286
2286
|
animation-duration: 150ms;
|
|
2287
2287
|
}
|