@tapcart/mobile-components 0.7.24 → 0.7.26
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-infinite-scroll.d.ts +3 -0
- package/dist/components/hooks/use-infinite-scroll.d.ts.map +1 -1
- package/dist/components/hooks/use-sort-filter.d.ts +3 -0
- package/dist/components/hooks/use-sort-filter.d.ts.map +1 -1
- package/dist/components/libs/sort-filter/custom-search.d.ts +7 -0
- package/dist/components/libs/sort-filter/custom-search.d.ts.map +1 -0
- package/dist/components/libs/sort-filter/custom-search.js +30 -0
- package/dist/components/libs/sort-filter/search-integration.d.ts +1 -0
- package/dist/components/libs/sort-filter/search-integration.d.ts.map +1 -1
- package/dist/components/libs/sort-filter/search-integration.js +3 -0
- package/dist/jest.config.d.ts +1 -0
- package/dist/jest.config.d.ts.map +1 -0
- package/dist/jest.config.js +1 -0
- package/dist/lib/__tests__/utils.test.d.ts +1 -0
- package/dist/lib/__tests__/utils.test.d.ts.map +1 -0
- package/dist/lib/__tests__/utils.test.js +1 -0
- package/dist/styles.css +3 -8
- package/package.json +18 -18
- package/dist/components/hooks/use-click-outside.d.ts +0 -3
- package/dist/components/hooks/use-click-outside.d.ts.map +0 -1
- package/dist/components/hooks/use-click-outside.js +0 -16
- package/dist/components/hooks/use-outside-click.d.ts +0 -4
- package/dist/components/hooks/use-outside-click.d.ts.map +0 -1
- package/dist/components/hooks/use-outside-click.js +0 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-infinite-scroll.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-infinite-scroll.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,uBAAuB,EAAmB,MAAM,iBAAiB,CAAA;AAE1E,UAAU,OAAO;IACf,MAAM,EAAE,MAAM,CAAA;CAEf;AAED,UAAU,QAAQ;IAChB,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,GAAG,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"use-infinite-scroll.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-infinite-scroll.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,uBAAuB,EAAmB,MAAM,iBAAiB,CAAA;AAE1E,UAAU,OAAO;IACf,MAAM,EAAE,MAAM,CAAA;CAEf;AAED,UAAU,QAAQ;IAChB,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,GAAG,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAA;CACxC;AAOD,UAAU,sBAAsB;IAC9B,WAAW,EAAE,QAAQ,CAAA;IACrB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACnC,SAAS,EAAE,UAAU,GAAG,YAAY,CAAA;IACpC,YAAY,EAAE,MAAM,CAAA;CACrB;AAED,UAAU,uBAAuB;IAC/B,IAAI,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAA;IAC5B,KAAK,EAAE,GAAG,CAAA;IACV,oBAAoB,EAAE,OAAO,CAAA;IAC7B,aAAa,EAAE,OAAO,GAAG,SAAS,CAAA;IAClC,OAAO,EAAE,OAAO,CAAA;IAChB,aAAa,EAAE,OAAO,CAAA;IACtB,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,KAAK,IAAI,CAAA;IAChD,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,SAAS,EAAE,OAAO,CAAA;IAClB,YAAY,EAAE,OAAO,CAAA;CACtB;AAED,eAAO,MAAM,sCAAsC,iBACnC,uBAAuB,OAsBtC,CAAA;AAED,QAAA,MAAM,YAAY,WAAY,MAAM,WAGnC,CAAA;AAED,QAAA,MAAM,iBAAiB,kFAKpB,sBAAsB,KAAG,uBAuG3B,CAAA;AAED,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -1 +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,EACL,cAAc,EACd,2BAA2B,EAC3B,WAAW,EACX,mBAAmB,EACpB,MAAM,wCAAwC,CAAA;AAI/C,UAAU,kBAAkB;IAC1B,WAAW,EAAE,QAAQ,CAAA;IACrB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACnC,UAAU,CAAC,EAAE,CAAC,cAAc,EAAE,GAAG,KAAK,MAAM,GAAG,CAAA;CAChD;AAED,UAAU,QAAQ;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,EAAE,cAAc,EAAE,CAAA;
|
|
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,EACL,cAAc,EACd,2BAA2B,EAC3B,WAAW,EACX,mBAAmB,EACpB,MAAM,wCAAwC,CAAA;AAI/C,UAAU,kBAAkB;IAC1B,WAAW,EAAE,QAAQ,CAAA;IACrB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACnC,UAAU,CAAC,EAAE,CAAC,cAAc,EAAE,GAAG,KAAK,MAAM,GAAG,CAAA;CAChD;AAED,UAAU,QAAQ;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,EAAE,cAAc,EAAE,CAAA;IAC/B,cAAc,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAA;CACxC;AAED,UAAU,mBAAmB;IAC3B,cAAc,EAAE,cAAc,CAAA;IAC9B,IAAI,EAAE,GAAG,EAAE,CAAA;IACX,MAAM,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,CAAA;IAC1B,SAAS,EAAE,OAAO,CAAA;IAClB,eAAe,EAAE,OAAO,CAAA;CACzB;AAED,UAAU,cAAc;IACtB,UAAU,EAAE,UAAU,CAAA;IACtB,2BAA2B,EAAE,2BAA2B,CAAA;IACxD,WAAW,EAAE,mBAAmB,EAAE,CAAA;IAClC,qBAAqB,EAAE,OAAO,CAAA;IAC9B,YAAY,EAAE,WAAW,EAAE,CAAA;CAC5B;AAeD,QAAA,MAAM,aAAa,iDAIhB,kBAAkB,KAAG,mBAgDvB,CAAA;AAED,OAAO,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { KMP } from "./kmp";
|
|
2
|
+
import { FilterCategory } from "../../../components/libs/sort-filter/search-integration";
|
|
3
|
+
import { ReadonlyURLSearchParams } from "next/navigation";
|
|
4
|
+
export declare class CustomSearch extends KMP {
|
|
5
|
+
convertFilterCategoriesToSearchParams: (filters: FilterCategory[], searchParams: ReadonlyURLSearchParams) => string;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=custom-search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-search.d.ts","sourceRoot":"","sources":["../../../../components/libs/sort-filter/custom-search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAC3B,OAAO,EAEL,cAAc,EACf,MAAM,kDAAkD,CAAA;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AAEzD,qBAAa,YAAa,SAAQ,GAAG;IACnC,qCAAqC,YAC1B,cAAc,EAAE,gBACX,uBAAuB,KACpC,MAAM,CA2BR;CACF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { KMP } from "./kmp";
|
|
2
|
+
export class CustomSearch extends KMP {
|
|
3
|
+
constructor() {
|
|
4
|
+
super(...arguments);
|
|
5
|
+
this.convertFilterCategoriesToSearchParams = (filters, searchParams) => {
|
|
6
|
+
const filtersToApply = filters.reduce((acc, it) => {
|
|
7
|
+
const inner = it.filters.reduce((innerAcc, f) => {
|
|
8
|
+
if (f.isSelected) {
|
|
9
|
+
innerAcc.push(`${it.id}-${f.tag}`);
|
|
10
|
+
}
|
|
11
|
+
return innerAcc;
|
|
12
|
+
}, []);
|
|
13
|
+
return acc.concat(inner);
|
|
14
|
+
}, []);
|
|
15
|
+
const oldParams = new URLSearchParams(searchParams.toString());
|
|
16
|
+
const newParams = new URLSearchParams();
|
|
17
|
+
//remove old filters
|
|
18
|
+
oldParams.forEach((value, key) => {
|
|
19
|
+
if (!key.startsWith("filter")) {
|
|
20
|
+
newParams.append(key, value);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
//build new filters
|
|
24
|
+
if (filtersToApply.length) {
|
|
25
|
+
newParams.append("filter", JSON.stringify(filtersToApply));
|
|
26
|
+
}
|
|
27
|
+
return newParams.toString();
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -39,6 +39,7 @@ export type RelatedCategory = {
|
|
|
39
39
|
export type FiltersAndRelatedCategories = {
|
|
40
40
|
filterCategories: FilterCategory[] | undefined | null;
|
|
41
41
|
relatedCategories: RelatedCategory[] | undefined | null;
|
|
42
|
+
pageData?: any;
|
|
42
43
|
};
|
|
43
44
|
export interface SearchIntegration {
|
|
44
45
|
getSortSearchParamKey(): string;
|
|
@@ -1 +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;
|
|
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;AAUzD,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,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,2BAA2B,GAAG;IACxC,gBAAgB,EAAE,cAAc,EAAE,GAAG,SAAS,GAAG,IAAI,CAAA;IACrD,iBAAiB,EAAE,eAAe,EAAE,GAAG,SAAS,GAAG,IAAI,CAAA;IACvD,QAAQ,CAAC,EAAE,GAAG,CAAA;CACf,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,CAAA;AAED,eAAO,MAAM,gBAAgB,sBACR,OAAO,MAAM,EAAE,WAAW,CAAC,0BACtB,MAAM,EAAE,KAC/B,OAEF,CAAA;AAED,eAAO,MAAM,yBAAyB,iBACtB,WAAW,EAAE,KAC1B,iBA+BF,CAAA;AAED,eAAO,MAAM,yBAAyB,sBACjB,iBAAiB,GAAG,IAAI,YAKC,CAAA"}
|
|
@@ -5,6 +5,7 @@ import { NostoSearch } from "./nosto-search";
|
|
|
5
5
|
import { ShopifySearchAndDiscovery } from "./shopify-search-and-discovery";
|
|
6
6
|
import { AlgoliaSearch } from "./algolia-search";
|
|
7
7
|
import { FastSimonSearch } from "./fast-simon-search";
|
|
8
|
+
import { CustomSearch } from "./custom-search";
|
|
8
9
|
export const createIntegrationLookup = (integrations) => {
|
|
9
10
|
return integrations.reduce((lookup, integration) => {
|
|
10
11
|
lookup[integration.name] = integration;
|
|
@@ -33,6 +34,8 @@ export const searchIntegrationProvider = (integrations) => {
|
|
|
33
34
|
return new FastSimonSearch();
|
|
34
35
|
case isSearchProvider(integrationLookup, ["searchanise"]):
|
|
35
36
|
return new KMP();
|
|
37
|
+
case isSearchProvider(integrationLookup, ["constructor-io"]):
|
|
38
|
+
return new CustomSearch();
|
|
36
39
|
default:
|
|
37
40
|
return new ShopifySearchAndDiscovery();
|
|
38
41
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=jest.config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jest.config.d.ts","sourceRoot":"","sources":["../jest.config.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=utils.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.test.d.ts","sourceRoot":"","sources":["../../../lib/__tests__/utils.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
package/dist/styles.css
CHANGED
|
@@ -812,10 +812,6 @@ video {
|
|
|
812
812
|
margin-top: 0.75rem;
|
|
813
813
|
margin-bottom: 0.75rem;
|
|
814
814
|
}
|
|
815
|
-
.my-4 {
|
|
816
|
-
margin-top: 1rem;
|
|
817
|
-
margin-bottom: 1rem;
|
|
818
|
-
}
|
|
819
815
|
.my-auto {
|
|
820
816
|
margin-top: auto;
|
|
821
817
|
margin-bottom: auto;
|
|
@@ -1006,6 +1002,9 @@ video {
|
|
|
1006
1002
|
.min-h-\[24px\] {
|
|
1007
1003
|
min-height: 24px;
|
|
1008
1004
|
}
|
|
1005
|
+
.min-h-\[315px\] {
|
|
1006
|
+
min-height: 315px;
|
|
1007
|
+
}
|
|
1009
1008
|
.w-0 {
|
|
1010
1009
|
width: 0px;
|
|
1011
1010
|
}
|
|
@@ -1466,10 +1465,6 @@ video {
|
|
|
1466
1465
|
.\!border-stateColors-error {
|
|
1467
1466
|
border-color: var(--stateColors-error) !important;
|
|
1468
1467
|
}
|
|
1469
|
-
.border-\[\#E3E3E3\] {
|
|
1470
|
-
--tw-border-opacity: 1;
|
|
1471
|
-
border-color: rgb(227 227 227 / var(--tw-border-opacity));
|
|
1472
|
-
}
|
|
1473
1468
|
.border-black {
|
|
1474
1469
|
--tw-border-opacity: 1;
|
|
1475
1470
|
border-color: rgb(0 0 0 / var(--tw-border-opacity));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tapcart/mobile-components",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.26",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"style": "dist/styles.css",
|
|
@@ -11,6 +11,18 @@
|
|
|
11
11
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
12
12
|
"author": "Tapcart Inc.",
|
|
13
13
|
"homepage": "https://tapcart.com",
|
|
14
|
+
"scripts": {
|
|
15
|
+
"lint": "eslint \"**/*.ts*\"",
|
|
16
|
+
"ui:add": "pnpm dlx shadcn-ui@latest add",
|
|
17
|
+
"build:styles": "postcss styles/globals.css -o dist/styles.css",
|
|
18
|
+
"build:ts": "tsc -p tsconfig.json && tsc-alias",
|
|
19
|
+
"build": "pnpm run build:ts && pnpm run build:styles",
|
|
20
|
+
"dev:ts": "tsc -w -p tsconfig.json",
|
|
21
|
+
"dev:styles": "npx tailwindcss -i styles/globals.css -o dist/styles.css --watch",
|
|
22
|
+
"dev": "concurrently \"pnpm run dev:ts\" \"pnpm run dev:styles\"",
|
|
23
|
+
"test": "jest",
|
|
24
|
+
"test:watch": "jest --watch"
|
|
25
|
+
},
|
|
14
26
|
"peerDependencies": {
|
|
15
27
|
"react": "^17.0.2 || ^18.0.0",
|
|
16
28
|
"react-dom": "^17.0.2 || ^18.0.0"
|
|
@@ -20,19 +32,19 @@
|
|
|
20
32
|
"@types/lodash": "4.17.5",
|
|
21
33
|
"@types/react": "^18.2.0",
|
|
22
34
|
"@types/react-dom": "^18.2.0",
|
|
35
|
+
"app-studio-types": "workspace:*",
|
|
23
36
|
"autoprefixer": "^10.4.14",
|
|
24
37
|
"chokidar-cli": "^3.0.0",
|
|
25
38
|
"concurrently": "^8.2.2",
|
|
26
39
|
"eslint": "^7.32.0",
|
|
40
|
+
"eslint-config-custom": "workspace:*",
|
|
27
41
|
"jest": "^29.7.0",
|
|
28
42
|
"postcss": "^8.4.24",
|
|
29
43
|
"tailwindcss": "^3.3.2",
|
|
30
44
|
"ts-jest": "^29.2.5",
|
|
31
45
|
"tsc-alias": "^1.8.10",
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"eslint-config-custom": "0.0.0",
|
|
35
|
-
"tsconfig": "0.0.0"
|
|
46
|
+
"tsconfig": "workspace:*",
|
|
47
|
+
"typescript": "^4.5.2"
|
|
36
48
|
},
|
|
37
49
|
"dependencies": {
|
|
38
50
|
"@radix-ui/react-accordion": "^1.1.2",
|
|
@@ -69,17 +81,5 @@
|
|
|
69
81
|
"tailwind-merge": "^1.13.2",
|
|
70
82
|
"tailwindcss-animate": "^1.0.6",
|
|
71
83
|
"vaul": "0.9.1"
|
|
72
|
-
},
|
|
73
|
-
"scripts": {
|
|
74
|
-
"lint": "eslint \"**/*.ts*\"",
|
|
75
|
-
"ui:add": "pnpm dlx shadcn-ui@latest add",
|
|
76
|
-
"build:styles": "postcss styles/globals.css -o dist/styles.css",
|
|
77
|
-
"build:ts": "tsc -p tsconfig.json && tsc-alias",
|
|
78
|
-
"build": "pnpm run build:ts && pnpm run build:styles",
|
|
79
|
-
"dev:ts": "tsc -w -p tsconfig.json",
|
|
80
|
-
"dev:styles": "npx tailwindcss -i styles/globals.css -o dist/styles.css --watch",
|
|
81
|
-
"dev": "concurrently \"pnpm run dev:ts\" \"pnpm run dev:styles\"",
|
|
82
|
-
"test": "jest",
|
|
83
|
-
"test:watch": "jest --watch"
|
|
84
84
|
}
|
|
85
|
-
}
|
|
85
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-click-outside.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-click-outside.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,wBAAgB,eAAe,CAAC,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAE,IAAI,CAa5F"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
export function useClickOutside(ref, callback) {
|
|
4
|
-
React.useEffect(() => {
|
|
5
|
-
const handleClickOutside = (event) => {
|
|
6
|
-
if (ref.current && !ref.current.contains(event.target)) {
|
|
7
|
-
callback();
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
document.addEventListener('mousedown', handleClickOutside);
|
|
11
|
-
return () => {
|
|
12
|
-
document.removeEventListener('mousedown', handleClickOutside);
|
|
13
|
-
};
|
|
14
|
-
}, [ref, callback]);
|
|
15
|
-
}
|
|
16
|
-
;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-outside-click.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-outside-click.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,QAAA,MAAM,eAAe,QAAS,MAAM,SAAS,CAAC,WAAW,CAAC,YAAY,MAAM,IAAI,SAa/E,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
const useClickOutside = (ref, callback) => {
|
|
4
|
-
React.useEffect(() => {
|
|
5
|
-
const handleClickOutside = (event) => {
|
|
6
|
-
if (ref.current && !ref.current.contains(event.target)) {
|
|
7
|
-
callback();
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
document.addEventListener('mousedown', handleClickOutside);
|
|
11
|
-
return () => {
|
|
12
|
-
document.removeEventListener('mousedown', handleClickOutside);
|
|
13
|
-
};
|
|
14
|
-
}, [ref, callback]);
|
|
15
|
-
};
|
|
16
|
-
export default useClickOutside;
|