@tapcart/mobile-components 0.7.52 → 0.7.54
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.map +1 -1
- package/dist/components/hooks/use-block-conditional-rendering.js +46 -38
- package/dist/components/hooks/use-click-outside.d.ts +6 -0
- package/dist/components/hooks/use-click-outside.d.ts.map +1 -0
- package/dist/components/hooks/use-click-outside.js +15 -0
- package/dist/components/hooks/use-nosto-recommendation.test.js +118 -25
- package/dist/components/hooks/use-outside-click.d.ts +7 -0
- package/dist/components/hooks/use-outside-click.d.ts.map +1 -0
- package/dist/components/hooks/use-outside-click.js +16 -0
- package/dist/components/hooks/use-tap.d.ts +8 -0
- package/dist/components/hooks/use-tap.d.ts.map +1 -0
- package/dist/components/hooks/use-tap.js +100 -0
- package/dist/components/ui/text.d.ts +9 -1
- package/dist/components/ui/text.d.ts.map +1 -1
- package/dist/components/ui/text.js +39 -2
- package/dist/components/ui/virtual-grid.d.ts +14 -0
- package/dist/components/ui/virtual-grid.d.ts.map +1 -0
- package/dist/components/ui/virtual-grid.js +55 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +50 -0
- package/dist/styles.css +182 -162
- package/package.json +26 -23
- package/dist/components/hooks/use-debug-dependencies.d.ts +0 -10
- package/dist/components/hooks/use-debug-dependencies.d.ts.map +0 -1
- package/dist/components/hooks/use-debug-dependencies.js +0 -18
- package/dist/components/hooks/use-layout.d.ts +0 -13
- package/dist/components/hooks/use-layout.d.ts.map +0 -1
- package/dist/components/hooks/use-layout.js +0 -23
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tapcart/mobile-components",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.54",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"style": "dist/styles.css",
|
|
@@ -11,44 +11,32 @@
|
|
|
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:silent": "jest --silent",
|
|
25
|
-
"test:watch": "jest --watch"
|
|
26
|
-
},
|
|
27
14
|
"peerDependencies": {
|
|
28
|
-
"react": "^
|
|
29
|
-
"react-dom": "^
|
|
15
|
+
"react": "^18.0.0",
|
|
16
|
+
"react-dom": "^18.0.0"
|
|
30
17
|
},
|
|
31
18
|
"devDependencies": {
|
|
19
|
+
"@testing-library/react": "^14.3.1",
|
|
32
20
|
"@types/applepayjs": "^14.0.9",
|
|
33
21
|
"@types/jest": "^29.5.14",
|
|
34
22
|
"@types/lodash": "4.17.5",
|
|
23
|
+
"@types/pluralize": "^0.0.33",
|
|
35
24
|
"@types/react": "^18.2.0",
|
|
36
25
|
"@types/react-dom": "^18.2.0",
|
|
37
|
-
"app-studio-types": "workspace:*",
|
|
38
26
|
"autoprefixer": "^10.4.14",
|
|
39
27
|
"chokidar-cli": "^3.0.0",
|
|
40
28
|
"concurrently": "^8.2.2",
|
|
41
29
|
"eslint": "^7.32.0",
|
|
42
|
-
"eslint-config-custom": "workspace:*",
|
|
43
30
|
"jest": "^29.7.0",
|
|
44
31
|
"jest-environment-jsdom": "^29.7.0",
|
|
45
32
|
"postcss": "^8.4.24",
|
|
46
33
|
"tailwindcss": "^3.3.2",
|
|
47
34
|
"ts-jest": "^29.2.5",
|
|
48
35
|
"tsc-alias": "^1.8.10",
|
|
49
|
-
"tsconfig": "workspace:*",
|
|
50
36
|
"typescript": "^4.5.2",
|
|
51
|
-
"
|
|
37
|
+
"app-studio-types": "0.0.6",
|
|
38
|
+
"tsconfig": "0.0.0",
|
|
39
|
+
"eslint-config-custom": "0.0.0"
|
|
52
40
|
},
|
|
53
41
|
"dependencies": {
|
|
54
42
|
"@radix-ui/react-accordion": "^1.1.2",
|
|
@@ -69,7 +57,7 @@
|
|
|
69
57
|
"@radix-ui/react-toggle": "^1.0.3",
|
|
70
58
|
"@radix-ui/react-toggle-group": "^1.0.4",
|
|
71
59
|
"@tabler/icons-react": "^3.2.0",
|
|
72
|
-
"@tapcart/webbridge-react": "^1.
|
|
60
|
+
"@tapcart/webbridge-react": "^1.14.2",
|
|
73
61
|
"apple-pay-button": "^1.1.7",
|
|
74
62
|
"class-variance-authority": "^0.6.0",
|
|
75
63
|
"clsx": "^1.2.1",
|
|
@@ -79,13 +67,28 @@
|
|
|
79
67
|
"lucide-react": "^0.248.0",
|
|
80
68
|
"next": "^14.2.5",
|
|
81
69
|
"next-themes": "^0.2.1",
|
|
82
|
-
"postcss-cli": "^11.0.0",
|
|
83
70
|
"pluralize": "^8.0.0",
|
|
71
|
+
"postcss-cli": "^11.0.0",
|
|
84
72
|
"react-intersection-observer": "^9.10.2",
|
|
85
73
|
"react-svg": "^16.1.34",
|
|
74
|
+
"react-virtual": "^2.10.4",
|
|
86
75
|
"swr": "^2.2.5",
|
|
87
76
|
"tailwind-merge": "^1.13.2",
|
|
88
77
|
"tailwindcss-animate": "^1.0.6",
|
|
89
78
|
"vaul": "0.9.1"
|
|
79
|
+
},
|
|
80
|
+
"scripts": {
|
|
81
|
+
"clean": "rm -rf dist node_modules",
|
|
82
|
+
"lint": "eslint \"**/*.ts*\"",
|
|
83
|
+
"ui:add": "pnpm dlx shadcn-ui@latest add",
|
|
84
|
+
"build:styles": "postcss styles/globals.css -o dist/styles.css",
|
|
85
|
+
"build:ts": "tsc -p tsconfig.json && tsc-alias",
|
|
86
|
+
"build": "pnpm run build:ts && pnpm run build:styles",
|
|
87
|
+
"dev:ts": "tsc -w -p tsconfig.json",
|
|
88
|
+
"dev:styles": "npx tailwindcss -i styles/globals.css -o dist/styles.css --watch",
|
|
89
|
+
"dev": "concurrently \"pnpm run dev:ts\" \"pnpm run dev:styles\"",
|
|
90
|
+
"test": "jest",
|
|
91
|
+
"test:silent": "jest --silent",
|
|
92
|
+
"test:watch": "jest --watch"
|
|
90
93
|
}
|
|
91
|
-
}
|
|
94
|
+
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Custom hook to debug dependency changes.
|
|
3
|
-
*
|
|
4
|
-
* Usage:
|
|
5
|
-
* useDebugDependencies([dependencyA, dependencyB]);
|
|
6
|
-
*
|
|
7
|
-
* @param {Array} deps - Array of dependencies to monitor for changes.
|
|
8
|
-
*/
|
|
9
|
-
export declare function useDebugDependencies(deps: any[]): void;
|
|
10
|
-
//# sourceMappingURL=use-debug-dependencies.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-debug-dependencies.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-debug-dependencies.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,GAAG,EAAE,QAU/C"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useRef, useEffect } from "react";
|
|
3
|
-
/**
|
|
4
|
-
* Custom hook to debug dependency changes.
|
|
5
|
-
*
|
|
6
|
-
* Usage:
|
|
7
|
-
* useDebugDependencies([dependencyA, dependencyB]);
|
|
8
|
-
*
|
|
9
|
-
* @param {Array} deps - Array of dependencies to monitor for changes.
|
|
10
|
-
*/
|
|
11
|
-
export function useDebugDependencies(deps) {
|
|
12
|
-
const prevDeps = useRef(deps);
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
const changedDeps = deps.map((dep, i) => dep !== prevDeps.current[i] ? dep : null);
|
|
15
|
-
console.log("Changed dependencies:", changedDeps);
|
|
16
|
-
prevDeps.current = deps;
|
|
17
|
-
}, [deps]);
|
|
18
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { PhoenixLayout } from "lib/tapcart/types";
|
|
2
|
-
type UseLayoutProps = {
|
|
3
|
-
appId: string;
|
|
4
|
-
layoutId: string;
|
|
5
|
-
};
|
|
6
|
-
type UseLayoutReturn = {
|
|
7
|
-
layout: PhoenixLayout | null;
|
|
8
|
-
error: any;
|
|
9
|
-
isLoading: boolean;
|
|
10
|
-
};
|
|
11
|
-
export declare function useLayout({ appId, layoutId, }: UseLayoutProps): UseLayoutReturn;
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=use-layout.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-layout.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-layout.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAGjD,KAAK,cAAc,GAAG;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,KAAK,eAAe,GAAG;IACrB,MAAM,EAAE,aAAa,GAAG,IAAI,CAAA;IAC5B,KAAK,EAAE,GAAG,CAAA;IACV,SAAS,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,QAAQ,GACT,EAAE,cAAc,GAAG,eAAe,CAYlC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
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
|
-
};
|
|
11
|
-
import useSWR from "swr";
|
|
12
|
-
import { fetchLayoutById } from "apps/tapcart-ssr-app/lib/tapcart/index";
|
|
13
|
-
export function useLayout({ appId, layoutId, }) {
|
|
14
|
-
const fetcher = (appId, layoutId) => __awaiter(this, void 0, void 0, function* () {
|
|
15
|
-
return fetchLayoutById(appId, layoutId);
|
|
16
|
-
});
|
|
17
|
-
const { data, error } = useSWR([appId, layoutId], fetcher);
|
|
18
|
-
return {
|
|
19
|
-
layout: data || null,
|
|
20
|
-
error,
|
|
21
|
-
isLoading: !data && !error,
|
|
22
|
-
};
|
|
23
|
-
}
|