@tapcart/mobile-components 0.6.5 → 0.6.7
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-products.d.ts +5 -0
- package/dist/components/hooks/use-products.d.ts.map +1 -1
- package/dist/components/hooks/use-products.js +9 -3
- package/dist/components/hooks/use-scroll-direction.d.ts.map +1 -1
- package/dist/components/hooks/use-scroll-direction.js +1 -1
- package/dist/components/hooks/use-sort-filter.d.ts +26 -0
- package/dist/components/hooks/use-sort-filter.d.ts.map +1 -0
- package/dist/components/hooks/use-sort-filter.js +31 -0
- package/dist/components/libs/sort-filter/beyond-search.d.ts +15 -0
- package/dist/components/libs/sort-filter/beyond-search.d.ts.map +1 -0
- package/dist/components/libs/sort-filter/beyond-search.js +78 -0
- package/dist/components/libs/sort-filter/kmp.d.ts +15 -0
- package/dist/components/libs/sort-filter/kmp.d.ts.map +1 -0
- package/dist/components/libs/sort-filter/kmp.js +55 -0
- package/dist/components/libs/sort-filter/nosto-search.d.ts +9 -0
- package/dist/components/libs/sort-filter/nosto-search.d.ts.map +1 -0
- package/dist/components/libs/sort-filter/nosto-search.js +8 -0
- package/dist/components/libs/sort-filter/search-integration.d.ts +50 -0
- package/dist/components/libs/sort-filter/search-integration.d.ts.map +1 -0
- package/dist/components/libs/sort-filter/search-integration.js +38 -0
- package/dist/components/libs/sort-filter/search-spring.d.ts +9 -0
- package/dist/components/libs/sort-filter/search-spring.d.ts.map +1 -0
- package/dist/components/libs/sort-filter/search-spring.js +8 -0
- package/dist/components/libs/sort-filter/shopify-search-and-discovery.d.ts +64 -0
- package/dist/components/libs/sort-filter/shopify-search-and-discovery.d.ts.map +1 -0
- package/dist/components/libs/sort-filter/shopify-search-and-discovery.js +172 -0
- package/dist/components/ui/empty-message.d.ts.map +1 -1
- package/dist/components/ui/empty-message.js +47 -1
- package/dist/components/ui/favorite.js +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/styles.css +17 -0
- package/package.json +1 -1
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { Product } from "app-studio-types";
|
|
2
2
|
type URL = string;
|
|
3
|
+
type MetafieldInput = {
|
|
4
|
+
namespace: string;
|
|
5
|
+
key: string;
|
|
6
|
+
};
|
|
3
7
|
type UseProductsProps = {
|
|
4
8
|
productIds: string[];
|
|
5
9
|
productHandles: string[];
|
|
6
10
|
baseURL: URL;
|
|
7
11
|
fetcher?: (url: string) => Promise<any>;
|
|
12
|
+
metafields?: MetafieldInput[];
|
|
8
13
|
};
|
|
9
14
|
type UseProductsReturn = {
|
|
10
15
|
products: Product[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-products.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-products.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAE1C,KAAK,GAAG,GAAG,MAAM,CAAA;AACjB,KAAK,gBAAgB,GAAG;IACtB,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,cAAc,EAAE,MAAM,EAAE,CAAA;IACxB,OAAO,EAAE,GAAG,CAAA;IACZ,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"use-products.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-products.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAE1C,KAAK,GAAG,GAAG,MAAM,CAAA;AACjB,KAAK,cAAc,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAA;AACxD,KAAK,gBAAgB,GAAG;IACtB,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,cAAc,EAAE,MAAM,EAAE,CAAA;IACxB,OAAO,EAAE,GAAG,CAAA;IACZ,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;IACvC,UAAU,CAAC,EAAE,cAAc,EAAE,CAAA;CAC9B,CAAA;AACD,KAAK,iBAAiB,GAAG;IACvB,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,KAAK,EAAE,GAAG,CAAA;IACV,SAAS,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,GAAG,iBAAiB,CA8B7E"}
|
|
@@ -2,13 +2,19 @@ import useSWR from "swr";
|
|
|
2
2
|
export function useProducts(props) {
|
|
3
3
|
let url = null;
|
|
4
4
|
if (props) {
|
|
5
|
-
const { baseURL, productIds, productHandles } = props;
|
|
5
|
+
const { baseURL, productIds, productHandles, metafields } = props;
|
|
6
|
+
let queryParams = new URLSearchParams();
|
|
6
7
|
if ((productIds === null || productIds === void 0 ? void 0 : productIds.length) > 0) {
|
|
7
|
-
|
|
8
|
+
queryParams.set("ids", productIds.join(","));
|
|
8
9
|
}
|
|
9
10
|
else if ((productHandles === null || productHandles === void 0 ? void 0 : productHandles.length) > 0) {
|
|
10
|
-
|
|
11
|
+
queryParams.set("handles", productHandles.join(","));
|
|
11
12
|
}
|
|
13
|
+
if (metafields && metafields.length > 0) {
|
|
14
|
+
const metafieldStrings = metafields.map((m) => `${m.namespace}.${m.key}`);
|
|
15
|
+
queryParams.set("metafields", metafieldStrings.join(","));
|
|
16
|
+
}
|
|
17
|
+
url = `${baseURL}/products/by-ids?${queryParams.toString()}`;
|
|
12
18
|
}
|
|
13
19
|
const fetcher = (props === null || props === void 0 ? void 0 : props.fetcher) || ((url) => fetch(url).then((res) => res.json()));
|
|
14
20
|
const { data, error } = useSWR(url, fetcher);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-scroll-direction.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-scroll-direction.ts"],"names":[],"mappings":"AAGA,KAAK,eAAe,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;AAE3C,UAAU,UAAU;IAClB,SAAS,EAAE,eAAe,CAAA;IAC1B,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,iBAAS,kBAAkB,CAAC,SAAS,GAAE,
|
|
1
|
+
{"version":3,"file":"use-scroll-direction.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-scroll-direction.ts"],"names":[],"mappings":"AAGA,KAAK,eAAe,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;AAE3C,UAAU,UAAU;IAClB,SAAS,EAAE,eAAe,CAAA;IAC1B,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,iBAAS,kBAAkB,CAAC,SAAS,GAAE,MAAY,GAAG,UAAU,CAqD/D;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Collection } from "app-studio-types";
|
|
2
|
+
import { FilterCategory, Integration, IntegrationSortItem } from "../libs/sort-filter/search-integration";
|
|
3
|
+
interface UseSortFilterProps {
|
|
4
|
+
initialData: PageData;
|
|
5
|
+
queryVariables: Record<string, any>;
|
|
6
|
+
}
|
|
7
|
+
interface PageData {
|
|
8
|
+
filtersURL: string;
|
|
9
|
+
sortFilterURL: string;
|
|
10
|
+
}
|
|
11
|
+
interface UseSortFilterReturn {
|
|
12
|
+
sortFilterData: SortFilterData;
|
|
13
|
+
data: any[];
|
|
14
|
+
mutate: () => Promise<any>;
|
|
15
|
+
isLoading: boolean;
|
|
16
|
+
}
|
|
17
|
+
interface SortFilterData {
|
|
18
|
+
collection: Collection;
|
|
19
|
+
filtersAndRelatedCategories: FilterCategory[];
|
|
20
|
+
sortOptions: IntegrationSortItem[];
|
|
21
|
+
dynamicFiltersEnabled: boolean;
|
|
22
|
+
integrations: Integration[];
|
|
23
|
+
}
|
|
24
|
+
declare const useSortFilter: ({ initialData, queryVariables, }: UseSortFilterProps) => UseSortFilterReturn;
|
|
25
|
+
export { useSortFilter };
|
|
26
|
+
//# sourceMappingURL=use-sort-filter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-sort-filter.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-sort-filter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,mBAAmB,EAAqB,MAAM,wCAAwC,CAAA;AAG5H,UAAU,kBAAkB;IAC1B,WAAW,EAAE,QAAQ,CAAA;IACrB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CACpC;AAED,UAAU,QAAQ;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,UAAU,mBAAmB;IAC3B,cAAc,EAAE,cAAc,CAAC;IAC/B,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,MAAM,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;IAC3B,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,UAAU,cAAc;IACtB,UAAU,EAAE,UAAU,CAAA;IACtB,2BAA2B,EAAE,cAAc,EAAE,CAAA;IAC7C,WAAW,EAAE,mBAAmB,EAAE,CAAA;IAClC,qBAAqB,EAAE,OAAO,CAAA;IAC9B,YAAY,EAAE,WAAW,EAAE,CAAA;CAC5B;AAaD,QAAA,MAAM,aAAa,qCAGhB,kBAAkB,KAAG,mBAiCvB,CAAA;AAED,OAAO,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import useSWRInfinite from "swr/infinite";
|
|
3
|
+
import useSWR from "swr";
|
|
4
|
+
const constructURL = (apiURL) => {
|
|
5
|
+
const url = new URL(apiURL);
|
|
6
|
+
return url.toString();
|
|
7
|
+
};
|
|
8
|
+
const fetcher = ({ apiURL, body }) => fetch(constructURL(apiURL), {
|
|
9
|
+
method: "POST",
|
|
10
|
+
body: JSON.stringify(body),
|
|
11
|
+
}).then((res) => res.json());
|
|
12
|
+
const useSortFilter = ({ initialData, queryVariables, }) => {
|
|
13
|
+
const shouldFetch = queryVariables && Object.keys(queryVariables).length > 0;
|
|
14
|
+
const { data: sortFilterData, isLoading } = useSWR(shouldFetch ? { apiUrl: initialData.sortFilterURL, body: Object.assign({}, queryVariables) } : null, ({ apiUrl, body }) => fetcher({ apiURL: apiUrl, body }));
|
|
15
|
+
const getKey = () => {
|
|
16
|
+
if (!sortFilterData || !sortFilterData.dynamicFiltersEnabled)
|
|
17
|
+
return null;
|
|
18
|
+
return Object.assign(Object.assign(Object.assign({}, queryVariables), (sortFilterData.searchQuery && { searchQuery: sortFilterData.searchQuery })), { filterCategories: sortFilterData === null || sortFilterData === void 0 ? void 0 : sortFilterData.filtersAndRelatedCategories.filterCategories, sortOption: sortFilterData === null || sortFilterData === void 0 ? void 0 : sortFilterData.sortOption, limit: 10 });
|
|
19
|
+
};
|
|
20
|
+
const { data, mutate } = useSWRInfinite(getKey, (body) => fetcher({ apiURL: initialData.filtersURL, body }), {
|
|
21
|
+
revalidateFirstPage: true,
|
|
22
|
+
initialSize: 1,
|
|
23
|
+
});
|
|
24
|
+
return {
|
|
25
|
+
sortFilterData,
|
|
26
|
+
data: data !== null && data !== void 0 ? data : [],
|
|
27
|
+
mutate,
|
|
28
|
+
isLoading,
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export { useSortFilter };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FilterCategory, IntegrationSortItem, SearchIntegration } from "./search-integration";
|
|
2
|
+
import { ReadonlyURLSearchParams } from "next/navigation";
|
|
3
|
+
export declare class BeyondSearch implements SearchIntegration {
|
|
4
|
+
getSortSearchParamKey: () => string;
|
|
5
|
+
convertFilterCategoriesToSearchParams: (filters: FilterCategory[], searchParams: ReadonlyURLSearchParams) => string;
|
|
6
|
+
convertSortToSearchParams({ sortOption, existingParams, }: {
|
|
7
|
+
sortOption: IntegrationSortItem | undefined;
|
|
8
|
+
existingParams: ReadonlyURLSearchParams;
|
|
9
|
+
}): URLSearchParams;
|
|
10
|
+
getActiveSortFromSearchParams({ searchParams, sortOptions, }: {
|
|
11
|
+
searchParams: ReadonlyURLSearchParams;
|
|
12
|
+
sortOptions: IntegrationSortItem[];
|
|
13
|
+
}): IntegrationSortItem | null;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=beyond-search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"beyond-search.d.ts","sourceRoot":"","sources":["../../../../components/libs/sort-filter/beyond-search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,cAAc,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACrG,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AAEzD,qBAAa,YAAa,YAAW,iBAAiB;IAEpD,qBAAqB,QAAO,MAAM,CAEjC;IAED,qCAAqC,YAC1B,cAAc,EAAE,gBACX,uBAAuB,KACpC,MAAM,CAoDR;IAED,yBAAyB,CAAC,EACxB,UAAU,EACV,cAAc,GACf,EAAE;QACD,UAAU,EAAE,mBAAmB,GAAG,SAAS,CAAA;QAC3C,cAAc,EAAE,uBAAuB,CAAA;KACxC,GAAG,eAAe;IAcnB,6BAA6B,CAAC,EAC5B,YAAY,EACZ,WAAW,GACZ,EAAE;QACD,YAAY,EAAE,uBAAuB,CAAA;QACrC,WAAW,EAAE,mBAAmB,EAAE,CAAA;KACnC,GAAG,mBAAmB,GAAG,IAAI;CAI/B"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export class BeyondSearch {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.getSortSearchParamKey = () => {
|
|
4
|
+
return "selectedSort";
|
|
5
|
+
};
|
|
6
|
+
this.convertFilterCategoriesToSearchParams = (filters, searchParams) => {
|
|
7
|
+
const filtersToApply = filters
|
|
8
|
+
.flatMap((category) => {
|
|
9
|
+
var _a;
|
|
10
|
+
let key = (_a = category.id) === null || _a === void 0 ? void 0 : _a.toLowerCase();
|
|
11
|
+
let values = [];
|
|
12
|
+
if (key == "price") {
|
|
13
|
+
values = category.filters
|
|
14
|
+
.filter((filter) => filter.isSelected)
|
|
15
|
+
.map((filter) => {
|
|
16
|
+
var _a;
|
|
17
|
+
return `(${filter.min},${(_a = filter.max) !== null && _a !== void 0 ? _a : 10000})`;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
else if (key == "rating") {
|
|
21
|
+
values = category.filters
|
|
22
|
+
.filter((filter) => filter.isSelected)
|
|
23
|
+
.map((filter) => {
|
|
24
|
+
return `${filter.min}`;
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
values = category.filters
|
|
29
|
+
.filter((filter) => filter.isSelected)
|
|
30
|
+
.map((filter) => {
|
|
31
|
+
return filter.tag;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
if (values.length) {
|
|
35
|
+
return `${key}=${JSON.stringify(values)}`;
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
.filter((it) => it !== undefined);
|
|
39
|
+
const filterKeysToRemove = filters.flatMap((it) => { var _a; return (_a = it.id) === null || _a === void 0 ? void 0 : _a.toLowerCase(); });
|
|
40
|
+
const oldParams = new URLSearchParams(searchParams.toString());
|
|
41
|
+
const newParams = new URLSearchParams();
|
|
42
|
+
//remove old filters
|
|
43
|
+
oldParams.forEach((value, key) => {
|
|
44
|
+
if (!filterKeysToRemove.some((it) => it == key)) {
|
|
45
|
+
newParams.append(key, value);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
//build new filters
|
|
49
|
+
filtersToApply.forEach((param) => {
|
|
50
|
+
if (param) {
|
|
51
|
+
const [key, value] = param.split("=");
|
|
52
|
+
if (key && value) {
|
|
53
|
+
newParams.append(key, value);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
return newParams.toString();
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
convertSortToSearchParams({ sortOption, existingParams, }) {
|
|
61
|
+
const input = sortOption.sortType;
|
|
62
|
+
const newParams = new URLSearchParams();
|
|
63
|
+
existingParams.forEach((value, key) => {
|
|
64
|
+
if (!key.startsWith(this.getSortSearchParamKey())) {
|
|
65
|
+
newParams.append(key, value);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
if (input && input.length) {
|
|
69
|
+
newParams.append(this.getSortSearchParamKey(), input);
|
|
70
|
+
}
|
|
71
|
+
return newParams;
|
|
72
|
+
}
|
|
73
|
+
getActiveSortFromSearchParams({ searchParams, sortOptions, }) {
|
|
74
|
+
var _a;
|
|
75
|
+
const name = searchParams.get(this.getSortSearchParamKey());
|
|
76
|
+
return (_a = sortOptions.find((it) => (it === null || it === void 0 ? void 0 : it.sortType) == name)) !== null && _a !== void 0 ? _a : null;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FilterCategory, SearchIntegration, IntegrationSortItem } from "./search-integration";
|
|
2
|
+
import { ReadonlyURLSearchParams } from "next/navigation";
|
|
3
|
+
export declare class KMP implements SearchIntegration {
|
|
4
|
+
getSortSearchParamKey: () => string;
|
|
5
|
+
convertFilterCategoriesToSearchParams: (filters: FilterCategory[], searchParams: ReadonlyURLSearchParams) => string;
|
|
6
|
+
convertSortToSearchParams({ sortOption, existingParams, }: {
|
|
7
|
+
sortOption: IntegrationSortItem | undefined;
|
|
8
|
+
existingParams: ReadonlyURLSearchParams;
|
|
9
|
+
}): URLSearchParams;
|
|
10
|
+
getActiveSortFromSearchParams({ searchParams, sortOptions, }: {
|
|
11
|
+
searchParams: ReadonlyURLSearchParams;
|
|
12
|
+
sortOptions: IntegrationSortItem[];
|
|
13
|
+
}): IntegrationSortItem | null;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=kmp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kmp.d.ts","sourceRoot":"","sources":["../../../../components/libs/sort-filter/kmp.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AAGzD,qBAAa,GAAI,YAAW,iBAAiB;IAG3C,qBAAqB,QAAO,MAAM,CAEjC;IAED,qCAAqC,YAC1B,cAAc,EAAE,gBACX,uBAAuB,KACpC,MAAM,CA4BR;IAED,yBAAyB,CAAC,EACxB,UAAU,EACV,cAAc,GACf,EAAE;QACD,UAAU,EAAE,mBAAmB,GAAG,SAAS,CAAA;QAC3C,cAAc,EAAE,uBAAuB,CAAA;KACxC,GAAG,eAAe;IAcnB,6BAA6B,CAAC,EAC5B,YAAY,EACZ,WAAW,GACZ,EAAE;QACD,YAAY,EAAE,uBAAuB,CAAA;QACrC,WAAW,EAAE,mBAAmB,EAAE,CAAA;KACnC,GAAG,mBAAmB,GAAG,IAAI;CAS/B"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export class KMP {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.getSortSearchParamKey = () => {
|
|
4
|
+
return "sort_by";
|
|
5
|
+
};
|
|
6
|
+
this.convertFilterCategoriesToSearchParams = (filters, searchParams) => {
|
|
7
|
+
const filtersToApply = filters.reduce((acc, it) => {
|
|
8
|
+
const inner = it.filters.reduce((innerAcc, f) => {
|
|
9
|
+
if (f.isSelected) {
|
|
10
|
+
innerAcc.push(`${it.title}-${f.tag}`);
|
|
11
|
+
}
|
|
12
|
+
return innerAcc;
|
|
13
|
+
}, []);
|
|
14
|
+
return acc.concat(inner);
|
|
15
|
+
}, []);
|
|
16
|
+
const oldParams = new URLSearchParams(searchParams.toString());
|
|
17
|
+
const newParams = new URLSearchParams();
|
|
18
|
+
//remove old filters
|
|
19
|
+
oldParams.forEach((value, key) => {
|
|
20
|
+
if (!key.startsWith("filter")) {
|
|
21
|
+
newParams.append(key, value);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
//build new filters
|
|
25
|
+
if (filtersToApply.length) {
|
|
26
|
+
newParams.append("filter", JSON.stringify(filtersToApply));
|
|
27
|
+
}
|
|
28
|
+
return newParams.toString();
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
convertSortToSearchParams({ sortOption, existingParams, }) {
|
|
32
|
+
const input = JSON.stringify(sortOption);
|
|
33
|
+
const newParams = new URLSearchParams();
|
|
34
|
+
existingParams.forEach((value, key) => {
|
|
35
|
+
if (!key.startsWith(this.getSortSearchParamKey())) {
|
|
36
|
+
newParams.append(key, value);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
if (input && input.length) {
|
|
40
|
+
newParams.append(this.getSortSearchParamKey(), input);
|
|
41
|
+
}
|
|
42
|
+
return newParams;
|
|
43
|
+
}
|
|
44
|
+
getActiveSortFromSearchParams({ searchParams, sortOptions, }) {
|
|
45
|
+
var _a;
|
|
46
|
+
const json = searchParams.get(this.getSortSearchParamKey());
|
|
47
|
+
try {
|
|
48
|
+
const option = JSON.parse(json !== null && json !== void 0 ? json : "{}");
|
|
49
|
+
return (_a = sortOptions.find((it) => (it === null || it === void 0 ? void 0 : it.sortName) == option.sortName)) !== null && _a !== void 0 ? _a : null;
|
|
50
|
+
}
|
|
51
|
+
catch (e) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { KMP } from "./kmp";
|
|
2
|
+
import { Integration } from "./search-integration";
|
|
3
|
+
export declare class NostoSearch extends KMP {
|
|
4
|
+
private readonly sendFirstSort;
|
|
5
|
+
constructor({ integration }: {
|
|
6
|
+
integration: Integration | undefined;
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=nosto-search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nosto-search.d.ts","sourceRoot":"","sources":["../../../../components/libs/sort-filter/nosto-search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,qBAAa,WAAY,SAAQ,GAAG;IAClC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;gBAE3B,EAAE,WAAW,EAAE,EAAE;QAAE,WAAW,EAAE,WAAW,GAAG,SAAS,CAAA;KAAE;CAItE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { KMP } from "./kmp";
|
|
2
|
+
export class NostoSearch extends KMP {
|
|
3
|
+
constructor({ integration }) {
|
|
4
|
+
var _a;
|
|
5
|
+
super();
|
|
6
|
+
this.sendFirstSort = (_a = integration === null || integration === void 0 ? void 0 : integration.sendFirstSort) !== null && _a !== void 0 ? _a : false;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ReadonlyURLSearchParams } from "next/navigation";
|
|
2
|
+
export type Integration = {
|
|
3
|
+
name: string;
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
key?: string;
|
|
6
|
+
version?: string;
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
};
|
|
9
|
+
export type IntegrationSortItem = {
|
|
10
|
+
type: string;
|
|
11
|
+
name: string;
|
|
12
|
+
sortName: string;
|
|
13
|
+
sortKey: string;
|
|
14
|
+
isReverse: boolean;
|
|
15
|
+
};
|
|
16
|
+
export type Filter = {
|
|
17
|
+
title: string;
|
|
18
|
+
image?: string | null;
|
|
19
|
+
tag: any;
|
|
20
|
+
amount?: number | null;
|
|
21
|
+
isSelected: boolean;
|
|
22
|
+
collectionId?: string | null;
|
|
23
|
+
min: number | null;
|
|
24
|
+
max: number | null;
|
|
25
|
+
};
|
|
26
|
+
export type FilterCategory = {
|
|
27
|
+
title: string;
|
|
28
|
+
type: string;
|
|
29
|
+
filters: Filter[];
|
|
30
|
+
field?: string | null;
|
|
31
|
+
id: string | null;
|
|
32
|
+
multiSelect?: boolean | undefined;
|
|
33
|
+
};
|
|
34
|
+
export interface SearchIntegration {
|
|
35
|
+
getSortSearchParamKey(): string;
|
|
36
|
+
getActiveSortFromSearchParams({ searchParams, sortOptions, }: {
|
|
37
|
+
searchParams: ReadonlyURLSearchParams;
|
|
38
|
+
sortOptions: IntegrationSortItem[];
|
|
39
|
+
}): IntegrationSortItem | null;
|
|
40
|
+
convertSortToSearchParams({ sortOption, existingParams, }: {
|
|
41
|
+
sortOption: IntegrationSortItem | undefined;
|
|
42
|
+
existingParams: ReadonlyURLSearchParams;
|
|
43
|
+
}): URLSearchParams;
|
|
44
|
+
convertFilterCategoriesToSearchParams(filters: FilterCategory[], searchParams: ReadonlyURLSearchParams): string;
|
|
45
|
+
}
|
|
46
|
+
export declare const createIntegrationLookup: (integrations: Integration[]) => Record<string, Integration>;
|
|
47
|
+
export declare const isSearchProvider: (integrationLookup: Record<string, Integration>, searchIntegrationNames: string[]) => boolean;
|
|
48
|
+
export declare const searchIntegrationProvider: (integrations: Integration[]) => SearchIntegration;
|
|
49
|
+
export declare const isDynamicFiltersSupported: (searchIntegration: SearchIntegration | null) => boolean;
|
|
50
|
+
//# sourceMappingURL=search-integration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-integration.d.ts","sourceRoot":"","sources":["../../../../components/libs/sort-filter/search-integration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AAOzD,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,OAAO,CAAA;IAChB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,MAAM,GAAG;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,GAAG,EAAE,GAAG,CAAA;IACR,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,UAAU,EAAE,OAAO,CAAA;IACnB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAClB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,EAAE,EAAE,MAAM,GAAG,IAAI,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAClC,CAAA;AAED,MAAM,WAAW,iBAAiB;IAIhC,qBAAqB,IAAI,MAAM,CAAA;IAE/B,6BAA6B,CAAC,EAC5B,YAAY,EACZ,WAAW,GACZ,EAAE;QACD,YAAY,EAAE,uBAAuB,CAAA;QACrC,WAAW,EAAE,mBAAmB,EAAE,CAAA;KACnC,GAAG,mBAAmB,GAAG,IAAI,CAAA;IAK9B,yBAAyB,CAAC,EACxB,UAAU,EACV,cAAc,GACf,EAAE;QACD,UAAU,EAAE,mBAAmB,GAAG,SAAS,CAAA;QAC3C,cAAc,EAAE,uBAAuB,CAAA;KACxC,GAAG,eAAe,CAAA;IAKnB,qCAAqC,CACnC,OAAO,EAAE,cAAc,EAAE,EACzB,YAAY,EAAE,uBAAuB,GACpC,MAAM,CAAA;CACV;AAED,eAAO,MAAM,uBAAuB,iBAAkB,WAAW,EAAE,gCAKlE,CAAC;AAEF,eAAO,MAAM,gBAAgB,sBACR,OAAO,MAAM,EAAE,WAAW,CAAC,0BACtB,MAAM,EAAE,KAC/B,OAIF,CAAC;AAEF,eAAO,MAAM,yBAAyB,iBACtB,WAAW,EAAE,KAC1B,iBA2BF,CAAA;AAED,eAAO,MAAM,yBAAyB,sBACjB,iBAAiB,GAAG,IAAI,YACc,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { KMP } from "./kmp";
|
|
2
|
+
import { BeyondSearch } from "./beyond-search";
|
|
3
|
+
import { SearchSpring } from "./search-spring";
|
|
4
|
+
import { NostoSearch } from "./nosto-search";
|
|
5
|
+
import { ShopifySearchAndDiscovery } from "./shopify-search-and-discovery";
|
|
6
|
+
export const createIntegrationLookup = (integrations) => {
|
|
7
|
+
return integrations.reduce((lookup, integration) => {
|
|
8
|
+
lookup[integration.name] = integration;
|
|
9
|
+
return lookup;
|
|
10
|
+
}, {});
|
|
11
|
+
};
|
|
12
|
+
export const isSearchProvider = (integrationLookup, searchIntegrationNames) => {
|
|
13
|
+
return searchIntegrationNames.some((name) => { var _a; return (_a = integrationLookup[name]) === null || _a === void 0 ? void 0 : _a.enabled; });
|
|
14
|
+
};
|
|
15
|
+
export const searchIntegrationProvider = (integrations) => {
|
|
16
|
+
const integrationLookup = createIntegrationLookup(integrations);
|
|
17
|
+
switch (true) {
|
|
18
|
+
case isSearchProvider(integrationLookup, ["beyond-search"]):
|
|
19
|
+
return new BeyondSearch();
|
|
20
|
+
case isSearchProvider(integrationLookup, ["search-spring"]):
|
|
21
|
+
return new SearchSpring({
|
|
22
|
+
integration: integrationLookup["search-spring"],
|
|
23
|
+
});
|
|
24
|
+
case isSearchProvider(integrationLookup, ["nosto-search"]):
|
|
25
|
+
return new NostoSearch({
|
|
26
|
+
integration: integrationLookup["nosto-search"],
|
|
27
|
+
});
|
|
28
|
+
case isSearchProvider(integrationLookup, [
|
|
29
|
+
"algolia",
|
|
30
|
+
"instant-search-plus",
|
|
31
|
+
"searchanise",
|
|
32
|
+
]):
|
|
33
|
+
return new KMP();
|
|
34
|
+
default:
|
|
35
|
+
return new ShopifySearchAndDiscovery();
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
export const isDynamicFiltersSupported = (searchIntegration) => searchIntegration instanceof ShopifySearchAndDiscovery;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { KMP } from "./kmp";
|
|
2
|
+
import { Integration } from "./search-integration";
|
|
3
|
+
export declare class SearchSpring extends KMP {
|
|
4
|
+
private readonly sendFirstSort;
|
|
5
|
+
constructor({ integration }: {
|
|
6
|
+
integration: Integration | undefined;
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=search-spring.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-spring.d.ts","sourceRoot":"","sources":["../../../../components/libs/sort-filter/search-spring.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAElD,qBAAa,YAAa,SAAQ,GAAG;IACnC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;gBAE3B,EAAE,WAAW,EAAE,EAAE;QAAE,WAAW,EAAE,WAAW,GAAG,SAAS,CAAA;KAAE;CAItE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { KMP } from "./kmp";
|
|
2
|
+
export class SearchSpring extends KMP {
|
|
3
|
+
constructor({ integration }) {
|
|
4
|
+
var _a;
|
|
5
|
+
super();
|
|
6
|
+
this.sendFirstSort = (_a = integration === null || integration === void 0 ? void 0 : integration.sendFirstSort) !== null && _a !== void 0 ? _a : false;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { FilterCategory, IntegrationSortItem, SearchIntegration } from "./search-integration";
|
|
2
|
+
import { ReadonlyURLSearchParams } from "next/navigation";
|
|
3
|
+
export declare class ShopifySearchAndDiscovery implements SearchIntegration {
|
|
4
|
+
private collectionSortOptions;
|
|
5
|
+
getSortSearchParamKey: () => string;
|
|
6
|
+
convertFilterCategoriesToSearchParams: (filters: FilterCategory[], searchParams: ReadonlyURLSearchParams) => string;
|
|
7
|
+
convertSortToSearchParams({ sortOption, existingParams, }: {
|
|
8
|
+
sortOption: IntegrationSortItem | undefined;
|
|
9
|
+
existingParams: ReadonlyURLSearchParams;
|
|
10
|
+
}): URLSearchParams;
|
|
11
|
+
getActiveSortFromSearchParams({ searchParams, sortOptions, }: {
|
|
12
|
+
searchParams: ReadonlyURLSearchParams;
|
|
13
|
+
sortOptions: IntegrationSortItem[];
|
|
14
|
+
}): IntegrationSortItem | null;
|
|
15
|
+
}
|
|
16
|
+
export declare enum SearchSortKeys {
|
|
17
|
+
/**
|
|
18
|
+
* Sort by the price value.
|
|
19
|
+
*/
|
|
20
|
+
PRICE = "PRICE",
|
|
21
|
+
RELEVANCE = "RELEVANCE"
|
|
22
|
+
}
|
|
23
|
+
export declare enum SearchUnavailableProductsType {
|
|
24
|
+
SHOW = "SHOW",
|
|
25
|
+
HIDE = "HIDE"
|
|
26
|
+
}
|
|
27
|
+
export declare enum ProductCollectionSortKeys {
|
|
28
|
+
/**
|
|
29
|
+
* Sort by the `title` value.
|
|
30
|
+
*/
|
|
31
|
+
TITLE = "TITLE",
|
|
32
|
+
/**
|
|
33
|
+
* Sort by the `price` value.
|
|
34
|
+
*/
|
|
35
|
+
PRICE = "PRICE",
|
|
36
|
+
/**
|
|
37
|
+
* Sort by the `best-selling` value.
|
|
38
|
+
*/
|
|
39
|
+
BEST_SELLING = "BEST_SELLING",
|
|
40
|
+
/**
|
|
41
|
+
* Sort by the `created` value.
|
|
42
|
+
*/
|
|
43
|
+
CREATED = "CREATED",
|
|
44
|
+
/**
|
|
45
|
+
* Sort by the `id` value.
|
|
46
|
+
*/
|
|
47
|
+
ID = "ID",
|
|
48
|
+
/**
|
|
49
|
+
* Sort by the `manual` value.
|
|
50
|
+
*/
|
|
51
|
+
MANUAL = "MANUAL",
|
|
52
|
+
/**
|
|
53
|
+
* Sort by the `collection-default` value.
|
|
54
|
+
*/
|
|
55
|
+
COLLECTION_DEFAULT = "COLLECTION_DEFAULT",
|
|
56
|
+
/**
|
|
57
|
+
* During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the
|
|
58
|
+
* results by relevance to the search term(s). When no search query is specified, this sort key is not
|
|
59
|
+
* deterministic and should not be used.
|
|
60
|
+
*
|
|
61
|
+
*/
|
|
62
|
+
RELEVANCE = "RELEVANCE"
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=shopify-search-and-discovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shopify-search-and-discovery.d.ts","sourceRoot":"","sources":["../../../../components/libs/sort-filter/shopify-search-and-discovery.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AAEzD,qBAAa,yBAA0B,YAAW,iBAAiB;IAEjE,OAAO,CAAC,qBAAqB,CA+BH;IAE1B,qBAAqB,QAAO,MAAM,CAEjC;IACD,qCAAqC,YAC1B,cAAc,EAAE,gBACX,uBAAuB,KACpC,MAAM,CAmDR;IAED,yBAAyB,CAAC,EACxB,UAAU,EACV,cAAc,GACf,EAAE;QACD,UAAU,EAAE,mBAAmB,GAAG,SAAS,CAAA;QAC3C,cAAc,EAAE,uBAAuB,CAAA;KACxC,GAAG,eAAe;IAgBnB,6BAA6B,CAAC,EAC5B,YAAY,EACZ,WAAW,GACZ,EAAE;QACD,YAAY,EAAE,uBAAuB,CAAA;QACrC,WAAW,EAAE,mBAAmB,EAAE,CAAA;KACnC,GAAG,mBAAmB,GAAG,IAAI;CAO/B;AAED,oBAAY,cAAc;IACxB;;OAEG;IACH,KAAK,UAAU;IAIf,SAAS,cAAc;CACxB;AAED,oBAAY,6BAA6B;IAIvC,IAAI,SAAS;IAKb,IAAI,SAAS;CACd;AAED,oBAAY,yBAAyB;IACnC;;OAEG;IACH,KAAK,UAAU;IAEf;;OAEG;IACH,KAAK,UAAU;IAEf;;OAEG;IACH,YAAY,iBAAiB;IAE7B;;OAEG;IACH,OAAO,YAAY;IAEnB;;OAEG;IACH,EAAE,OAAO;IAET;;OAEG;IACH,MAAM,WAAW;IAEjB;;OAEG;IACH,kBAAkB,uBAAuB;IAEzC;;;;;OAKG;IACH,SAAS,cAAc;CACxB"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
export class ShopifySearchAndDiscovery {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.collectionSortOptions = [
|
|
4
|
+
{
|
|
5
|
+
sortName: "manual",
|
|
6
|
+
name: "collection-sort-recommended",
|
|
7
|
+
sortKey: ProductCollectionSortKeys.COLLECTION_DEFAULT,
|
|
8
|
+
isReverse: false,
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
sortName: "created-descending",
|
|
12
|
+
name: "collection-sort-new",
|
|
13
|
+
sortKey: ProductCollectionSortKeys.CREATED,
|
|
14
|
+
isReverse: true,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
sortName: "best-selling",
|
|
18
|
+
name: "collection-sort-best",
|
|
19
|
+
sortKey: ProductCollectionSortKeys.BEST_SELLING,
|
|
20
|
+
isReverse: false,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
sortName: "price-ascending",
|
|
24
|
+
name: "collection-sort-ascending-price",
|
|
25
|
+
sortKey: ProductCollectionSortKeys.PRICE,
|
|
26
|
+
isReverse: false,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
sortName: "price-descending",
|
|
30
|
+
name: "collection-sort-descending-price",
|
|
31
|
+
sortKey: ProductCollectionSortKeys.PRICE,
|
|
32
|
+
isReverse: true,
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
this.getSortSearchParamKey = () => {
|
|
36
|
+
return "sort_by";
|
|
37
|
+
};
|
|
38
|
+
this.convertFilterCategoriesToSearchParams = (filters, searchParams) => {
|
|
39
|
+
const filtersToApply = filters.flatMap((it) => it.filters
|
|
40
|
+
.filter((it) => it.isSelected)
|
|
41
|
+
.map((it) => {
|
|
42
|
+
const input = JSON.parse(it.tag);
|
|
43
|
+
const key = it.collectionId;
|
|
44
|
+
if (input.hasOwnProperty("available")) {
|
|
45
|
+
//ex {title: 'In stock', amount: 38, isSelected: true, tag: '{"available":true}', collectionId: 'filter.v.availability'}
|
|
46
|
+
return `filter.v.availability=${input.available ? 1 : 0}`;
|
|
47
|
+
}
|
|
48
|
+
else if (input.productVendor) {
|
|
49
|
+
//ex {title: 'vendor', amount: 12, isSelected: true, tag: '{"productVendor":"vendor"}', collectionId: 'filter.p.vendor'}
|
|
50
|
+
return `${key}=${input.productVendor}`;
|
|
51
|
+
}
|
|
52
|
+
else if (input.tag) {
|
|
53
|
+
//ex {title: 'Accessory', amount: 1, isSelected: true, tag: '{"tag":"Accessory"}', collectionId: 'filter.p.tag'}
|
|
54
|
+
return `${key}=${input.tag}`;
|
|
55
|
+
}
|
|
56
|
+
else if (input.productType) {
|
|
57
|
+
//ex {title: 'Bag', amount: 1, isSelected: true, tag: '{"productType":"Bag"}', collectionId: 'filter.p.product_type'}
|
|
58
|
+
return `${key}=${input.productType}`;
|
|
59
|
+
}
|
|
60
|
+
else if (key) {
|
|
61
|
+
//ex {title: 'Optimistic', amount: 1, isSelected: true, tag: '{"productMetafield":{"namespace":"test_data","key":"binding_mount","value":"Optimistic"}}', collectionId: 'filter.p.m.test_data.binding_mount'}
|
|
62
|
+
//ex {title: 'Velour', amount: 1, isSelected: true, tag: '{"variantOption":{"name":"fabric","value":"Velour"}}', collectionId: 'filter.v.option.fabric'}
|
|
63
|
+
const child = Object.keys(input)[0];
|
|
64
|
+
if (!child)
|
|
65
|
+
return "";
|
|
66
|
+
return `${key}=${input[child].value}`;
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
return "";
|
|
70
|
+
}
|
|
71
|
+
})
|
|
72
|
+
.filter((it) => it !== ""));
|
|
73
|
+
const oldParams = new URLSearchParams(searchParams.toString());
|
|
74
|
+
const newParams = new URLSearchParams();
|
|
75
|
+
//remove old filters
|
|
76
|
+
oldParams.forEach((value, key) => {
|
|
77
|
+
if (!key.startsWith("filter.")) {
|
|
78
|
+
newParams.append(key, value);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
//build new filters
|
|
82
|
+
filtersToApply.forEach((param) => {
|
|
83
|
+
const [key, value] = param.split("=");
|
|
84
|
+
if (key && value) {
|
|
85
|
+
newParams.append(key, value);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
return newParams.toString();
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
convertSortToSearchParams({ sortOption, existingParams, }) {
|
|
92
|
+
var _a;
|
|
93
|
+
const name = sortOption === null || sortOption === void 0 ? void 0 : sortOption.name;
|
|
94
|
+
const input = (_a = this.collectionSortOptions.find((it) => it.name == name)) === null || _a === void 0 ? void 0 : _a.sortName;
|
|
95
|
+
const newParams = new URLSearchParams();
|
|
96
|
+
existingParams.forEach((value, key) => {
|
|
97
|
+
if (!key.startsWith(this.getSortSearchParamKey())) {
|
|
98
|
+
newParams.append(key, value);
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
if (input && input.length) {
|
|
102
|
+
newParams.append(this.getSortSearchParamKey(), input);
|
|
103
|
+
}
|
|
104
|
+
return newParams;
|
|
105
|
+
}
|
|
106
|
+
getActiveSortFromSearchParams({ searchParams, sortOptions, }) {
|
|
107
|
+
var _a, _b;
|
|
108
|
+
const sortInput = searchParams.get(this.getSortSearchParamKey());
|
|
109
|
+
const name = (_a = this.collectionSortOptions.find((it) => it.sortName == sortInput)) === null || _a === void 0 ? void 0 : _a.name;
|
|
110
|
+
return (_b = sortOptions.find((it) => (it === null || it === void 0 ? void 0 : it.name) == name)) !== null && _b !== void 0 ? _b : null;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
export var SearchSortKeys;
|
|
114
|
+
(function (SearchSortKeys) {
|
|
115
|
+
/**
|
|
116
|
+
* Sort by the price value.
|
|
117
|
+
*/
|
|
118
|
+
SearchSortKeys["PRICE"] = "PRICE";
|
|
119
|
+
/*
|
|
120
|
+
* Sort by relevance to the search terms.
|
|
121
|
+
*/
|
|
122
|
+
SearchSortKeys["RELEVANCE"] = "RELEVANCE";
|
|
123
|
+
})(SearchSortKeys || (SearchSortKeys = {}));
|
|
124
|
+
export var SearchUnavailableProductsType;
|
|
125
|
+
(function (SearchUnavailableProductsType) {
|
|
126
|
+
/*
|
|
127
|
+
*Show unavailable products in the order that they're found.
|
|
128
|
+
*/
|
|
129
|
+
SearchUnavailableProductsType["SHOW"] = "SHOW";
|
|
130
|
+
/*
|
|
131
|
+
* Exclude unavailable products.
|
|
132
|
+
*/
|
|
133
|
+
SearchUnavailableProductsType["HIDE"] = "HIDE";
|
|
134
|
+
})(SearchUnavailableProductsType || (SearchUnavailableProductsType = {}));
|
|
135
|
+
export var ProductCollectionSortKeys;
|
|
136
|
+
(function (ProductCollectionSortKeys) {
|
|
137
|
+
/**
|
|
138
|
+
* Sort by the `title` value.
|
|
139
|
+
*/
|
|
140
|
+
ProductCollectionSortKeys["TITLE"] = "TITLE";
|
|
141
|
+
/**
|
|
142
|
+
* Sort by the `price` value.
|
|
143
|
+
*/
|
|
144
|
+
ProductCollectionSortKeys["PRICE"] = "PRICE";
|
|
145
|
+
/**
|
|
146
|
+
* Sort by the `best-selling` value.
|
|
147
|
+
*/
|
|
148
|
+
ProductCollectionSortKeys["BEST_SELLING"] = "BEST_SELLING";
|
|
149
|
+
/**
|
|
150
|
+
* Sort by the `created` value.
|
|
151
|
+
*/
|
|
152
|
+
ProductCollectionSortKeys["CREATED"] = "CREATED";
|
|
153
|
+
/**
|
|
154
|
+
* Sort by the `id` value.
|
|
155
|
+
*/
|
|
156
|
+
ProductCollectionSortKeys["ID"] = "ID";
|
|
157
|
+
/**
|
|
158
|
+
* Sort by the `manual` value.
|
|
159
|
+
*/
|
|
160
|
+
ProductCollectionSortKeys["MANUAL"] = "MANUAL";
|
|
161
|
+
/**
|
|
162
|
+
* Sort by the `collection-default` value.
|
|
163
|
+
*/
|
|
164
|
+
ProductCollectionSortKeys["COLLECTION_DEFAULT"] = "COLLECTION_DEFAULT";
|
|
165
|
+
/**
|
|
166
|
+
* During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the
|
|
167
|
+
* results by relevance to the search term(s). When no search query is specified, this sort key is not
|
|
168
|
+
* deterministic and should not be used.
|
|
169
|
+
*
|
|
170
|
+
*/
|
|
171
|
+
ProductCollectionSortKeys["RELEVANCE"] = "RELEVANCE";
|
|
172
|
+
})(ProductCollectionSortKeys || (ProductCollectionSortKeys = {}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"empty-message.d.ts","sourceRoot":"","sources":["../../../components/ui/empty-message.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"empty-message.d.ts","sourceRoot":"","sources":["../../../components/ui/empty-message.tsx"],"names":[],"mappings":"AAOA,UAAU,iBAAiB;IACzB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAA;IAC9C,WAAW,EAAE,MAAM,MAAM,CAAA;IACzB,SAAS,EAAE,MAAM,MAAM,EAAE,CAAA;IACzB,eAAe,EAAE,MAAM,MAAM,CAAA;CAC9B;AAED,UAAU,WAAW;IACnB,IAAI,EAAE,UAAU,GAAG,UAAU,CAAA;IAC7B,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,UAAU,gBAAgB;IACxB,WAAW,EAAE,WAAW,CAAA;CACzB;AAED,iBAAS,YAAY,CAAC,EACpB,QAAQ,EACR,KAAK,EACL,WAAW,EACX,SAAS,EACT,WAAW,EACX,UAAU,EACV,WAAsB,EACtB,SAAoB,EACpB,eAA0B,GAC3B,EAAE,iBAAiB,2CAmGnB;AAED,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -4,10 +4,56 @@ import { Button } from "./button";
|
|
|
4
4
|
import { Icon } from "./icon";
|
|
5
5
|
import { Text } from "./text";
|
|
6
6
|
import { cn } from "../../lib/utils";
|
|
7
|
+
import { useState, useEffect } from "react";
|
|
7
8
|
function EmptyMessage({ iconName, title, description, className, buttonLabel, openScreen, usePathname = () => "", useRouter = () => [], useSearchParams = () => "", }) {
|
|
9
|
+
const [clickCount, setClickCount] = useState(0);
|
|
8
10
|
const router = useRouter();
|
|
9
11
|
const pathname = usePathname();
|
|
10
12
|
const searchParams = useSearchParams();
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
const timer = setTimeout(() => {
|
|
15
|
+
setClickCount(0);
|
|
16
|
+
}, 2000);
|
|
17
|
+
return () => clearTimeout(timer);
|
|
18
|
+
}, [clickCount]);
|
|
19
|
+
const handlePageClick = () => {
|
|
20
|
+
setClickCount((prevCount) => {
|
|
21
|
+
const newCount = prevCount + 1;
|
|
22
|
+
if (newCount === 10) {
|
|
23
|
+
const fullUrl = `${window.location.origin}${pathname}?${searchParams.toString()}`;
|
|
24
|
+
if (navigator.clipboard && navigator.clipboard.writeText) {
|
|
25
|
+
navigator.clipboard
|
|
26
|
+
.writeText(fullUrl)
|
|
27
|
+
.then(() => alert("Full URL copied to clipboard!"))
|
|
28
|
+
.catch(() => fallbackCopyTextToClipboard(fullUrl));
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
fallbackCopyTextToClipboard(fullUrl);
|
|
32
|
+
}
|
|
33
|
+
return 0;
|
|
34
|
+
}
|
|
35
|
+
return newCount;
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
const fallbackCopyTextToClipboard = (text) => {
|
|
39
|
+
const textArea = document.createElement("textarea");
|
|
40
|
+
textArea.value = text;
|
|
41
|
+
textArea.style.position = "fixed"; // Avoid scrolling to bottom
|
|
42
|
+
document.body.appendChild(textArea);
|
|
43
|
+
textArea.focus();
|
|
44
|
+
textArea.select();
|
|
45
|
+
try {
|
|
46
|
+
const successful = document.execCommand("copy");
|
|
47
|
+
const msg = successful
|
|
48
|
+
? "Full URL copied to clipboard!"
|
|
49
|
+
: "Unable to copy URL";
|
|
50
|
+
alert(msg);
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
alert("Failed to copy URL");
|
|
54
|
+
}
|
|
55
|
+
document.body.removeChild(textArea);
|
|
56
|
+
};
|
|
11
57
|
const onClick = () => {
|
|
12
58
|
const newParams = new URLSearchParams(searchParams.toString());
|
|
13
59
|
const filters = newParams.get("filters");
|
|
@@ -24,6 +70,6 @@ function EmptyMessage({ iconName, title, description, className, buttonLabel, op
|
|
|
24
70
|
});
|
|
25
71
|
}
|
|
26
72
|
};
|
|
27
|
-
return (_jsxs("div", Object.assign({ className: cn("flex-grow flex flex-col justify-center items-center gap-4 h-full", className) }, { children: [_jsxs("div", Object.assign({ className: "flex flex-col justify-center items-center gap-2" }, { children: [_jsx(Icon, { name: iconName, size: "md", color: "coreColors-secondaryIcon" }), _jsx(Text, Object.assign({ type: "h2", className: "text-textColors-primaryColor text-center" }, { children: title })), _jsx(Text, Object.assign({ type: "body-primary", className: "text-textColors-secondaryColor text-center" }, { children: description }))] })), buttonLabel ? (_jsx(Button, Object.assign({ variant: "default", onClick: onClick, className: "w-auto" }, { children: buttonLabel }))) : null] })));
|
|
73
|
+
return (_jsxs("div", Object.assign({ className: cn("flex-grow flex flex-col justify-center items-center gap-4 h-full", className), onClick: handlePageClick }, { children: [_jsxs("div", Object.assign({ className: "flex flex-col justify-center items-center gap-2" }, { children: [_jsx(Icon, { name: iconName, size: "md", color: "coreColors-secondaryIcon" }), _jsx(Text, Object.assign({ type: "h2", className: "text-textColors-primaryColor text-center" }, { children: title })), _jsx(Text, Object.assign({ type: "body-primary", className: "text-textColors-secondaryColor text-center" }, { children: description }))] })), buttonLabel ? (_jsx(Button, Object.assign({ variant: "default", onClick: onClick, className: "w-auto" }, { children: buttonLabel }))) : null] })));
|
|
28
74
|
}
|
|
29
75
|
export { EmptyMessage };
|
|
@@ -39,14 +39,14 @@ const favoriteVariants = cva("flex p-2 gap-2 rounded-[4px] shadow-buttonColors-p
|
|
|
39
39
|
},
|
|
40
40
|
});
|
|
41
41
|
const Favorite = React.forwardRef((_a, ref) => {
|
|
42
|
-
var { className, size = "small", selected = false, onClick, iconUrl = "", showBackground = false, cornerRadius = 4, layoutType = "below-image-on-right", favoriteFillColor = "#D91E18FF" } = _a, props = __rest(_a, ["className", "size", "selected", "onClick", "iconUrl", "showBackground", "cornerRadius", "layoutType", "favoriteFillColor"]);
|
|
42
|
+
var { className, size = "small", selected = false, onClick, iconUrl = "https://storage.googleapis.com/tapcart-asset-uploads-prod/default-icon-options/Heart_1.svg", showBackground = false, cornerRadius = 4, layoutType = "below-image-on-right", favoriteFillColor = "#D91E18FF" } = _a, props = __rest(_a, ["className", "size", "selected", "onClick", "iconUrl", "showBackground", "cornerRadius", "layoutType", "favoriteFillColor"]);
|
|
43
43
|
return (_jsx("button", Object.assign({ onClick: onClick, ref: ref, className: cn(favoriteVariants({
|
|
44
44
|
size,
|
|
45
45
|
showBackground,
|
|
46
46
|
layoutType,
|
|
47
47
|
}), className), style: {
|
|
48
48
|
borderRadius: `${cornerRadius}px`,
|
|
49
|
-
} }, props, { children: _jsx(Icon, { url: iconUrl, color: selected ? "stateColors-favorites" : "stateColors-disabled", size: size === "small" ? "xs" : "sm", fillColor: selected ? favoriteFillColor :
|
|
49
|
+
} }, props, { children: _jsx(Icon, { url: iconUrl, color: selected ? "stateColors-favorites" : "stateColors-disabled", size: size === "small" ? "xs" : "sm", fillColor: selected ? favoriteFillColor : "" }) })));
|
|
50
50
|
});
|
|
51
51
|
Favorite.displayName = "Favorite";
|
|
52
52
|
export { Favorite, favoriteVariants };
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export * from "./components/hooks/use-recommendations";
|
|
|
5
5
|
export * from "./components/hooks/use-products";
|
|
6
6
|
export * from "./components/hooks/use-products";
|
|
7
7
|
export * from "./components/hooks/use-scroll-direction";
|
|
8
|
+
export * from "./components/hooks/use-sort-filter";
|
|
8
9
|
export * from "./components/ui/accordion";
|
|
9
10
|
export * from "./components/ui/aspect-ratio";
|
|
10
11
|
export * from "./components/ui/badge";
|
|
@@ -48,4 +49,5 @@ export * from "./components/ui/video";
|
|
|
48
49
|
export * from "./components/ui/wishlist";
|
|
49
50
|
export * from "./components/hooks/use-product-options";
|
|
50
51
|
export * from "./components/ui/wishlist-select";
|
|
52
|
+
export * from "./components/libs/sort-filter/search-integration";
|
|
51
53
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,EAAE,EACF,GAAG,EACH,QAAQ,EACR,4BAA4B,EAC5B,mBAAmB,EACnB,YAAY,EACZ,yBAAyB,EACzB,4BAA4B,GAC7B,MAAM,aAAa,CAAA;AACpB,cAAc,mCAAmC,CAAA;AACjD,cAAc,wCAAwC,CAAA;AACtD,cAAc,wCAAwC,CAAA;AACtD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,yCAAyC,CAAA;AACvD,cAAc,2BAA2B,CAAA;AACzC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,uBAAuB,CAAA;AACrC,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,sBAAsB,CAAA;AACpC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,2BAA2B,CAAA;AACzC,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,0BAA0B,CAAA;AACxC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,uBAAuB,CAAA;AACrC,cAAc,sCAAsC,CAAA;AACpD,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,2BAA2B,CAAA;AACzC,cAAc,2BAA2B,CAAA;AACzC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,wBAAwB,CAAA;AACtC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA;AACrC,cAAc,yBAAyB,CAAA;AACvC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,wBAAwB,CAAA;AACtC,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wCAAwC,CAAA;AACtD,cAAc,iCAAiC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,EAAE,EACF,GAAG,EACH,QAAQ,EACR,4BAA4B,EAC5B,mBAAmB,EACnB,YAAY,EACZ,yBAAyB,EACzB,4BAA4B,GAC7B,MAAM,aAAa,CAAA;AACpB,cAAc,mCAAmC,CAAA;AACjD,cAAc,wCAAwC,CAAA;AACtD,cAAc,wCAAwC,CAAA;AACtD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,yCAAyC,CAAA;AACvD,cAAc,oCAAoC,CAAA;AAClD,cAAc,2BAA2B,CAAA;AACzC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,uBAAuB,CAAA;AACrC,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,sBAAsB,CAAA;AACpC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,2BAA2B,CAAA;AACzC,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,0BAA0B,CAAA;AACxC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,uBAAuB,CAAA;AACrC,cAAc,sCAAsC,CAAA;AACpD,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,2BAA2B,CAAA;AACzC,cAAc,2BAA2B,CAAA;AACzC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,wBAAwB,CAAA;AACtC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA;AACrC,cAAc,yBAAyB,CAAA;AACvC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,wBAAwB,CAAA;AACtC,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wCAAwC,CAAA;AACtD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,kDAAkD,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export * from "./components/hooks/use-recommendations";
|
|
|
6
6
|
export * from "./components/hooks/use-products";
|
|
7
7
|
export * from "./components/hooks/use-products";
|
|
8
8
|
export * from "./components/hooks/use-scroll-direction";
|
|
9
|
+
export * from "./components/hooks/use-sort-filter";
|
|
9
10
|
export * from "./components/ui/accordion";
|
|
10
11
|
export * from "./components/ui/aspect-ratio";
|
|
11
12
|
export * from "./components/ui/badge";
|
|
@@ -49,3 +50,4 @@ export * from "./components/ui/video";
|
|
|
49
50
|
export * from "./components/ui/wishlist";
|
|
50
51
|
export * from "./components/hooks/use-product-options";
|
|
51
52
|
export * from "./components/ui/wishlist-select";
|
|
53
|
+
export * from "./components/libs/sort-filter/search-integration";
|
package/dist/styles.css
CHANGED
|
@@ -782,6 +782,9 @@ video {
|
|
|
782
782
|
.z-10 {
|
|
783
783
|
z-index: 10;
|
|
784
784
|
}
|
|
785
|
+
.z-20 {
|
|
786
|
+
z-index: 20;
|
|
787
|
+
}
|
|
785
788
|
.z-50 {
|
|
786
789
|
z-index: 50;
|
|
787
790
|
}
|
|
@@ -1057,6 +1060,10 @@ video {
|
|
|
1057
1060
|
.w-auto {
|
|
1058
1061
|
width: auto;
|
|
1059
1062
|
}
|
|
1063
|
+
.w-fit {
|
|
1064
|
+
width: -moz-fit-content;
|
|
1065
|
+
width: fit-content;
|
|
1066
|
+
}
|
|
1060
1067
|
.w-full {
|
|
1061
1068
|
width: 100%;
|
|
1062
1069
|
}
|
|
@@ -1785,6 +1792,9 @@ video {
|
|
|
1785
1792
|
.capitalize {
|
|
1786
1793
|
text-transform: capitalize;
|
|
1787
1794
|
}
|
|
1795
|
+
.leading-6 {
|
|
1796
|
+
line-height: 1.5rem;
|
|
1797
|
+
}
|
|
1788
1798
|
.leading-\[130\%\] {
|
|
1789
1799
|
line-height: 130%;
|
|
1790
1800
|
}
|
|
@@ -2039,6 +2049,9 @@ video {
|
|
|
2039
2049
|
.outline-stateColors-skeleton {
|
|
2040
2050
|
outline-color: var(--stateColors-skeleton);
|
|
2041
2051
|
}
|
|
2052
|
+
.outline-transparent {
|
|
2053
|
+
outline-color: transparent;
|
|
2054
|
+
}
|
|
2042
2055
|
.ring-0 {
|
|
2043
2056
|
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
|
2044
2057
|
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
|
@@ -2355,6 +2368,10 @@ body::-webkit-scrollbar {
|
|
|
2355
2368
|
outline-color: var(--coreColors-brandColorPrimary);
|
|
2356
2369
|
}
|
|
2357
2370
|
|
|
2371
|
+
.active\:outline-transparent:active {
|
|
2372
|
+
outline-color: transparent;
|
|
2373
|
+
}
|
|
2374
|
+
|
|
2358
2375
|
.disabled\:pointer-events-none:disabled {
|
|
2359
2376
|
pointer-events: none;
|
|
2360
2377
|
}
|