@tapcart/mobile-components 0.8.34 → 0.8.35

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.
@@ -0,0 +1,22 @@
1
+ import { LoyaltyCustomer, LoyaltyPoints, LoyaltyReward, LoyaltyReferral, LoyaltyTier, LoyaltyActivity } from "../libs/loyalty/LoyaltyAdapter";
2
+ type useLoyaltyOptions = {
3
+ integrationProvider?: "yotpo" | "custom";
4
+ };
5
+ declare function useLoyalty({ integrationProvider }: useLoyaltyOptions): {
6
+ customer: LoyaltyCustomer<Record<string, any>> | null;
7
+ customerTier: LoyaltyTier<Record<string, any>> | null;
8
+ availableActivities: LoyaltyActivity<Record<string, any>>[] | null;
9
+ activityHistory: LoyaltyActivity<Record<string, any>>[] | null;
10
+ points: LoyaltyPoints<Record<string, any>> | null;
11
+ rewards: LoyaltyReward<Record<string, any>>[] | null;
12
+ referrals: LoyaltyReferral<Record<string, any>>[] | null;
13
+ tiers: LoyaltyTier<Record<string, any>>[] | null;
14
+ createCustomer: () => Promise<void>;
15
+ updateCustomer: () => Promise<void>;
16
+ addPoints: () => Promise<void>;
17
+ redeemReward: () => Promise<void>;
18
+ recordActivity: () => Promise<void>;
19
+ createReferral: () => Promise<void>;
20
+ };
21
+ export { useLoyalty };
22
+ //# sourceMappingURL=use-loyalty.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-loyalty.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-loyalty.ts"],"names":[],"mappings":"AAEA,OAAuB,EACrB,eAAe,EACf,aAAa,EACb,aAAa,EACb,eAAe,EACf,WAAW,EACX,eAAe,EAChB,MAAM,gCAAgC,CAAA;AAGvC,KAAK,iBAAiB,GAAG;IACvB,mBAAmB,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;CACzC,CAAA;AAED,iBAAS,UAAU,CAAC,EAAE,mBAA6B,EAAE,EAAE,iBAAiB;;;;;;;;;;;;;;;EAmHvE;AAED,OAAO,EAAE,UAAU,EAAE,CAAA"}
@@ -0,0 +1,117 @@
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 YotpoLoyalty from "../libs/loyalty/YotpoLoyalty";
12
+ import { useState, useEffect, useRef } from "react";
13
+ function useLoyalty({ integrationProvider = "yotpo" }) {
14
+ const loyalty = useRef(null);
15
+ const [customer, setCustomer] = useState(null);
16
+ const [customerTier, setCustomerTier] = useState(null);
17
+ const [availableActivities, setAvailableActivities] = useState(null);
18
+ const [activityHistory, setActivityHistory] = useState(null);
19
+ const [points, setPoints] = useState(null);
20
+ const [rewards, setRewards] = useState(null);
21
+ const [referrals, setReferrals] = useState(null);
22
+ const [tiers, setTiers] = useState(null);
23
+ useEffect(() => {
24
+ if (!loyalty.current) {
25
+ // initialize loyalty adapter
26
+ if (integrationProvider === "yotpo") {
27
+ loyalty.current = new YotpoLoyalty();
28
+ }
29
+ else {
30
+ // TODO: Implement custom loyalty adapter
31
+ throw new Error("Custom loyalty adapter not implemented");
32
+ }
33
+ }
34
+ }, [integrationProvider]);
35
+ useEffect(() => {
36
+ const initData = () => __awaiter(this, void 0, void 0, function* () {
37
+ if (!loyalty.current) {
38
+ console.error("Loyalty adapter not initialized");
39
+ return;
40
+ }
41
+ setCustomer(yield loyalty.current.getCustomer());
42
+ setCustomerTier(yield loyalty.current.getCustomerTier());
43
+ setActivityHistory(yield loyalty.current.getActivityHistory());
44
+ setAvailableActivities(yield loyalty.current.getAvailableActivities());
45
+ setPoints(yield loyalty.current.getPointsBalance());
46
+ setRewards(yield loyalty.current.getRewards());
47
+ setReferrals(yield loyalty.current.getReferrals());
48
+ setTiers(yield loyalty.current.getTiers());
49
+ });
50
+ initData();
51
+ }, [loyalty.current]);
52
+ const createCustomer = () => __awaiter(this, void 0, void 0, function* () {
53
+ if (!loyalty.current) {
54
+ console.error("createCustomer: Loyalty adapter not initialized");
55
+ return;
56
+ }
57
+ const newCustomer = yield loyalty.current.createCustomer();
58
+ setCustomer(newCustomer);
59
+ });
60
+ const updateCustomer = () => __awaiter(this, void 0, void 0, function* () {
61
+ if (!loyalty.current) {
62
+ console.error("updateCustomer: Loyalty adapter not initialized");
63
+ return;
64
+ }
65
+ const updatedCustomer = yield loyalty.current.updateCustomer();
66
+ setCustomer(updatedCustomer);
67
+ });
68
+ const addPoints = () => __awaiter(this, void 0, void 0, function* () {
69
+ if (!loyalty.current) {
70
+ console.error("addPoints: Loyalty adapter not initialized");
71
+ return;
72
+ }
73
+ const updatedPoints = yield loyalty.current.addPoints();
74
+ setPoints(updatedPoints);
75
+ });
76
+ const redeemReward = () => __awaiter(this, void 0, void 0, function* () {
77
+ if (!loyalty.current) {
78
+ console.error("redeemReward: Loyalty adapter not initialized");
79
+ return;
80
+ }
81
+ const updatedRewards = yield loyalty.current.redeemReward();
82
+ setRewards(updatedRewards);
83
+ });
84
+ const recordActivity = () => __awaiter(this, void 0, void 0, function* () {
85
+ if (!loyalty.current) {
86
+ console.error("recordActivity: Loyalty adapter not initialized");
87
+ return;
88
+ }
89
+ const updatedActivities = yield loyalty.current.recordActivity();
90
+ setActivityHistory(updatedActivities);
91
+ });
92
+ const createReferral = () => __awaiter(this, void 0, void 0, function* () {
93
+ if (!loyalty.current) {
94
+ console.error("Loyalty adapter not initialized");
95
+ return;
96
+ }
97
+ const updatedReferrals = yield loyalty.current.createReferral();
98
+ setReferrals(updatedReferrals);
99
+ });
100
+ return {
101
+ customer,
102
+ customerTier,
103
+ availableActivities,
104
+ activityHistory,
105
+ points,
106
+ rewards,
107
+ referrals,
108
+ tiers,
109
+ createCustomer,
110
+ updateCustomer,
111
+ addPoints,
112
+ redeemReward,
113
+ recordActivity,
114
+ createReferral,
115
+ };
116
+ }
117
+ export { useLoyalty };
@@ -0,0 +1,101 @@
1
+ export interface LoyaltyCustomer<T = Record<string, any>> {
2
+ id: string;
3
+ email?: string;
4
+ firstName?: string;
5
+ lastName?: string;
6
+ phoneNumber?: string;
7
+ externalId?: string;
8
+ metadata?: Record<string, any>;
9
+ createdAt?: Date;
10
+ updatedAt?: Date;
11
+ customAttributes?: T;
12
+ }
13
+ export interface LoyaltyPoints<T = Record<string, any>> {
14
+ balance: number;
15
+ lifetimePoints?: number;
16
+ pendingPoints?: number;
17
+ expiringPoints?: {
18
+ amount: number;
19
+ expiryDate: Date;
20
+ }[];
21
+ lastUpdated?: Date;
22
+ customAttributes?: T;
23
+ }
24
+ export interface LoyaltyReward<T = Record<string, any>> {
25
+ id: string;
26
+ name: string;
27
+ description?: string;
28
+ pointsCost: number;
29
+ status: "redeemed" | "notRedeemed";
30
+ type: "discount" | "coupon" | "freeProduct" | "custom";
31
+ value?: number | string;
32
+ expiresAt?: Date;
33
+ isAvailable: boolean;
34
+ metadata?: Record<string, any>;
35
+ customAttributes?: T;
36
+ }
37
+ export interface LoyaltyActivity<T = Record<string, any>> {
38
+ id: string;
39
+ type: string;
40
+ points: number;
41
+ customerId: string;
42
+ status: "pending" | "completed" | "cancelled";
43
+ metadata?: Record<string, any>;
44
+ createdAt: Date;
45
+ customAttributes?: T;
46
+ title?: string;
47
+ details?: string;
48
+ reward_text?: string;
49
+ cta_text?: string;
50
+ icon?: string;
51
+ url?: string;
52
+ }
53
+ export interface LoyaltyTierRequirement {
54
+ type: "orders" | "points" | "referrals" | "amountSpent";
55
+ threshold: number;
56
+ progress: number;
57
+ }
58
+ export interface LoyaltyTier<T = Record<string, any>> {
59
+ id: string;
60
+ name: string;
61
+ level: number;
62
+ requirements: LoyaltyTierRequirement[];
63
+ benefits?: string[];
64
+ isActive: boolean;
65
+ metadata?: Record<string, any>;
66
+ customAttributes?: T;
67
+ }
68
+ export interface LoyaltyReferral<T = Record<string, any>> {
69
+ id: string;
70
+ referrerId: string;
71
+ referredEmail?: string;
72
+ status: "pending" | "completed" | "expired";
73
+ reward?: {
74
+ referrer: number | string;
75
+ referred: number | string;
76
+ };
77
+ createdAt: Date;
78
+ completedAt?: Date;
79
+ customAttributes?: T;
80
+ }
81
+ export default class LoyaltyAdapter {
82
+ adapter: string;
83
+ customer: LoyaltyCustomer | null;
84
+ constructor();
85
+ createCustomer(): Promise<LoyaltyCustomer>;
86
+ getCustomer(): Promise<LoyaltyCustomer | null>;
87
+ setCustomer(customer: LoyaltyCustomer): void;
88
+ updateCustomer(): Promise<LoyaltyCustomer | null>;
89
+ getPointsBalance(): Promise<LoyaltyPoints | null>;
90
+ addPoints(): Promise<LoyaltyPoints | null>;
91
+ getRewards(): Promise<LoyaltyReward[]>;
92
+ redeemReward(): Promise<LoyaltyReward[] | null>;
93
+ getAvailableActivities(): Promise<LoyaltyActivity[]>;
94
+ recordActivity(): Promise<LoyaltyActivity[] | null>;
95
+ getActivityHistory(): Promise<LoyaltyActivity[] | null>;
96
+ getCustomerTier(): Promise<LoyaltyTier | null>;
97
+ getTiers(): Promise<LoyaltyTier[]>;
98
+ createReferral(): Promise<LoyaltyReferral[] | null>;
99
+ getReferrals(): Promise<LoyaltyReferral[] | null>;
100
+ }
101
+ //# sourceMappingURL=LoyaltyAdapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LoyaltyAdapter.d.ts","sourceRoot":"","sources":["../../../../components/libs/loyalty/LoyaltyAdapter.tsx"],"names":[],"mappings":"AAUA,MAAM,WAAW,eAAe,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IACtD,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MA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IAAI,CAAC;IAUnD,YAAY,IAAI,OAAO,CAAC,eAAe,EAAE,GAAG,IAAI,CAAC;CAOxD"}
@@ -0,0 +1,119 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ export default class LoyaltyAdapter {
11
+ constructor() {
12
+ this.adapter = "unset";
13
+ this.customer = null;
14
+ // instantiate loyalty interface, noop
15
+ console.log(`Instantiating loyalty interface:`);
16
+ }
17
+ createCustomer() {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ // create a customer
20
+ console.log(`createCustomer implementation not provided for ${this.adapter}`);
21
+ throw new Error(`createCustomer implementation not provided for ${this.adapter}`);
22
+ });
23
+ }
24
+ getCustomer() {
25
+ return __awaiter(this, void 0, void 0, function* () {
26
+ // get a single customer by key
27
+ console.log(`getCustomer implementation not provided for ${this.adapter}`);
28
+ throw new Error(`getCustomer implementation not provided for ${this.adapter}`);
29
+ });
30
+ }
31
+ setCustomer(customer) {
32
+ // set a customer
33
+ this.customer = customer;
34
+ }
35
+ updateCustomer() {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ // update a customer
38
+ console.log(`updateCustomer implementation not provided for ${this.adapter}`);
39
+ throw new Error(`updateCustomer implementation not provided for ${this.adapter}`);
40
+ });
41
+ }
42
+ getPointsBalance() {
43
+ return __awaiter(this, void 0, void 0, function* () {
44
+ // get points
45
+ console.log(`getPointsBalance implementation not provided for ${this.adapter}`);
46
+ throw new Error(`getPointsBalance implementation not provided for ${this.adapter}`);
47
+ });
48
+ }
49
+ addPoints() {
50
+ return __awaiter(this, void 0, void 0, function* () {
51
+ // add points
52
+ console.log(`addPoints implementation not provided for ${this.adapter}`);
53
+ throw new Error(`addPoints implementation not provided for ${this.adapter}`);
54
+ });
55
+ }
56
+ getRewards() {
57
+ return __awaiter(this, void 0, void 0, function* () {
58
+ // get rewards
59
+ console.log(`getRewards implementation not provided for ${this.adapter}`);
60
+ throw new Error(`getRewards implementation not provided for ${this.adapter}`);
61
+ });
62
+ }
63
+ redeemReward() {
64
+ return __awaiter(this, void 0, void 0, function* () {
65
+ // redeem a reward
66
+ console.log(`redeemReward implementation not provided for ${this.adapter}`);
67
+ throw new Error(`redeemReward implementation not provided for ${this.adapter}`);
68
+ });
69
+ }
70
+ getAvailableActivities() {
71
+ return __awaiter(this, void 0, void 0, function* () {
72
+ // get available activities
73
+ console.log(`getAvailableActivities implementation not provided for ${this.adapter}`);
74
+ throw new Error(`getAvailableActivities implementation not provided for ${this.adapter}`);
75
+ });
76
+ }
77
+ recordActivity() {
78
+ return __awaiter(this, void 0, void 0, function* () {
79
+ // record activity
80
+ console.log(`recordActivity implementation not provided for ${this.adapter}`);
81
+ throw new Error(`recordActivity implementation not provided for ${this.adapter}`);
82
+ });
83
+ }
84
+ getActivityHistory() {
85
+ return __awaiter(this, void 0, void 0, function* () {
86
+ // record activity
87
+ console.log(`getActivityHistory implementation not provided for ${this.adapter}`);
88
+ throw new Error(`getActivityHistory implementation not provided for ${this.adapter}`);
89
+ });
90
+ }
91
+ getCustomerTier() {
92
+ return __awaiter(this, void 0, void 0, function* () {
93
+ // get customer tier
94
+ console.log(`getCustomerTier implementation not provided for ${this.adapter}`);
95
+ throw new Error(`getCustomerTier implementation not provided for ${this.adapter}`);
96
+ });
97
+ }
98
+ getTiers() {
99
+ return __awaiter(this, void 0, void 0, function* () {
100
+ // get tiers
101
+ console.log(`getTiers implementation not provided for ${this.adapter}`);
102
+ throw new Error(`getTiers implementation not provided for ${this.adapter}`);
103
+ });
104
+ }
105
+ createReferral() {
106
+ return __awaiter(this, void 0, void 0, function* () {
107
+ // create a referral
108
+ console.log(`createReferral implementation not provided for ${this.adapter}`);
109
+ throw new Error(`createReferral implementation not provided for ${this.adapter}`);
110
+ });
111
+ }
112
+ getReferrals() {
113
+ return __awaiter(this, void 0, void 0, function* () {
114
+ // get referrals
115
+ console.log(`getReferrals implementation not provided for ${this.adapter}`);
116
+ throw new Error(`getReferrals implementation not provided for ${this.adapter}`);
117
+ });
118
+ }
119
+ }
@@ -0,0 +1,20 @@
1
+ import LoyaltyAdapter, { LoyaltyCustomer, LoyaltyPoints, LoyaltyReward, LoyaltyActivity, LoyaltyTier, LoyaltyReferral } from "./LoyaltyAdapter";
2
+ export default class YotpoLoyalty extends LoyaltyAdapter {
3
+ adapter: string;
4
+ constructor();
5
+ createCustomer(): Promise<LoyaltyCustomer>;
6
+ getCustomer(): Promise<LoyaltyCustomer>;
7
+ updateCustomer(): Promise<LoyaltyCustomer | null>;
8
+ getPointsBalance(): Promise<LoyaltyPoints | null>;
9
+ addPoints(): Promise<LoyaltyPoints | null>;
10
+ getRewards(): Promise<LoyaltyReward[]>;
11
+ redeemReward(): Promise<LoyaltyReward[] | null>;
12
+ getAvailableActivities(): Promise<LoyaltyActivity[]>;
13
+ recordActivity(): Promise<LoyaltyActivity[] | null>;
14
+ getActivityHistory(): Promise<LoyaltyActivity[] | null>;
15
+ getCustomerTier(): Promise<LoyaltyTier | null>;
16
+ getTiers(): Promise<LoyaltyTier[]>;
17
+ createReferral(): Promise<LoyaltyReferral[] | null>;
18
+ getReferrals(): Promise<LoyaltyReferral[] | null>;
19
+ }
20
+ //# sourceMappingURL=YotpoLoyalty.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"YotpoLoyalty.d.ts","sourceRoot":"","sources":["../../../../components/libs/loyalty/YotpoLoyalty.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,EAAE,EACrB,eAAe,EACf,aAAa,EACb,aAAa,EACb,eAAe,EACf,WAAW,EACX,eAAe,EAChB,MAAM,kBAAkB,CAAA;AAEzB,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,cAAc;IACtD,OAAO,EAAE,MAAM,CAAU;;IAOnB,cAAc,IAAI,OAAO,CAAC,eAAe,CAAC;IAa1C,WAAW,IAAI,OAAO,CAAC,eAAe,CAAC;IAQvC,cAAc,IAAI,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;IAajD,gBAAgB,IAAI,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAoBjD,SAAS,IAAI,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAa1C,UAAU,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;IAiEtC,YAAY,IAAI,OAAO,CAAC,aAAa,EAAE,GAAG,IAAI,CAAC;IAsE/C,sBAAsB,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;IAkFpD,cAAc,IAAI,OAAO,CAAC,eAAe,EAAE,GAAG,IAAI,CAAC;IAyBnD,kBAAkB,IAAI,OAAO,CAAC,eAAe,EAAE,GAAG,IAAI,CAAC;IAqCvD,eAAe,IAAI,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;IA2B9C,QAAQ,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;IAsDlC,cAAc,IAAI,OAAO,CAAC,eAAe,EAAE,GAAG,IAAI,CAAC;IAiCnD,YAAY,IAAI,OAAO,CAAC,eAAe,EAAE,GAAG,IAAI,CAAC;CAqBxD"}
@@ -0,0 +1,527 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import LoyaltyAdapter from "./LoyaltyAdapter";
11
+ export default class YotpoLoyalty extends LoyaltyAdapter {
12
+ constructor() {
13
+ super();
14
+ this.adapter = "yotpo";
15
+ console.log("Instantiating yotpo loyalty interface");
16
+ }
17
+ createCustomer() {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ const customer = {
20
+ id: "yotpo-customer-1",
21
+ email: "customer@example.com",
22
+ firstName: "John",
23
+ lastName: "Doe",
24
+ createdAt: new Date(),
25
+ updatedAt: new Date(),
26
+ };
27
+ this.setCustomer(customer);
28
+ return customer;
29
+ });
30
+ }
31
+ getCustomer() {
32
+ return __awaiter(this, void 0, void 0, function* () {
33
+ if (!this.customer) {
34
+ return this.createCustomer();
35
+ }
36
+ else {
37
+ return this.customer;
38
+ }
39
+ });
40
+ }
41
+ updateCustomer() {
42
+ return __awaiter(this, void 0, void 0, function* () {
43
+ if (!this.customer) {
44
+ console.error("No customer found");
45
+ return null;
46
+ }
47
+ else {
48
+ this.customer.email = "updated@example.com";
49
+ this.customer.firstName = "John";
50
+ this.customer.lastName = "Updated";
51
+ this.customer.updatedAt = new Date();
52
+ return this.customer;
53
+ }
54
+ });
55
+ }
56
+ getPointsBalance() {
57
+ return __awaiter(this, void 0, void 0, function* () {
58
+ if (!this.customer) {
59
+ console.error("No customer found");
60
+ return null;
61
+ }
62
+ else {
63
+ return {
64
+ balance: 500,
65
+ lifetimePoints: 1000,
66
+ pendingPoints: 50,
67
+ expiringPoints: [
68
+ {
69
+ amount: 100,
70
+ expiryDate: new Date(Date.now() + 30 * 24 * 60 * 60 * 1000), // 30 days from now
71
+ },
72
+ ],
73
+ lastUpdated: new Date(),
74
+ };
75
+ }
76
+ });
77
+ }
78
+ addPoints() {
79
+ return __awaiter(this, void 0, void 0, function* () {
80
+ if (!this.customer) {
81
+ console.error("No customer found");
82
+ return null;
83
+ }
84
+ else {
85
+ return {
86
+ balance: 600,
87
+ lifetimePoints: 1100,
88
+ lastUpdated: new Date(),
89
+ };
90
+ }
91
+ });
92
+ }
93
+ getRewards() {
94
+ return __awaiter(this, void 0, void 0, function* () {
95
+ return [
96
+ {
97
+ id: "reward-1",
98
+ name: "$5 Off",
99
+ description: "Get $5 off your next purchase",
100
+ pointsCost: 500,
101
+ type: "discount",
102
+ value: "code-5-off",
103
+ isAvailable: true,
104
+ status: "redeemed",
105
+ },
106
+ {
107
+ id: "reward-2",
108
+ name: "15% Off Order",
109
+ description: "Save 15% on your entire order",
110
+ pointsCost: 1000,
111
+ type: "discount",
112
+ value: "code-15-off",
113
+ isAvailable: true,
114
+ status: "notRedeemed",
115
+ },
116
+ {
117
+ id: "reward-3",
118
+ name: "Free Shipping",
119
+ description: "Get free shipping on your next order",
120
+ pointsCost: 300,
121
+ type: "discount",
122
+ value: "code-free-shipping",
123
+ isAvailable: true,
124
+ status: "notRedeemed",
125
+ },
126
+ {
127
+ id: "reward-4",
128
+ name: "Free Product",
129
+ description: "Get a free mystery gift with your next purchase",
130
+ pointsCost: 750,
131
+ type: "freeProduct",
132
+ value: "mystery-gift-001",
133
+ isAvailable: true,
134
+ status: "redeemed",
135
+ },
136
+ {
137
+ id: "reward-5",
138
+ name: "Early Access",
139
+ description: "Get 24-hour early access to our next sale",
140
+ pointsCost: 1500,
141
+ type: "custom",
142
+ value: "code-early-access",
143
+ isAvailable: true,
144
+ status: "redeemed",
145
+ },
146
+ {
147
+ id: "reward-6",
148
+ name: "Birthday Double Points",
149
+ description: "Earn 2x points during your birthday month",
150
+ pointsCost: 2000,
151
+ type: "custom",
152
+ value: "code-birthday-double-points",
153
+ isAvailable: false,
154
+ status: "redeemed",
155
+ },
156
+ ];
157
+ });
158
+ }
159
+ redeemReward() {
160
+ return __awaiter(this, void 0, void 0, function* () {
161
+ if (!this.customer) {
162
+ console.error("No customer found");
163
+ return null;
164
+ }
165
+ else {
166
+ return [
167
+ {
168
+ id: "reward-1",
169
+ name: "$5 Off",
170
+ description: "Get $5 off your next purchase",
171
+ pointsCost: 500,
172
+ type: "discount",
173
+ value: "code-5-off",
174
+ isAvailable: false,
175
+ status: "redeemed",
176
+ },
177
+ {
178
+ id: "reward-2",
179
+ name: "15% Off Order",
180
+ description: "Save 15% on your entire order",
181
+ pointsCost: 1000,
182
+ type: "discount",
183
+ value: "code-15-off",
184
+ isAvailable: true,
185
+ status: "notRedeemed",
186
+ },
187
+ {
188
+ id: "reward-3",
189
+ name: "Free Shipping",
190
+ description: "Get free shipping on your next order",
191
+ pointsCost: 300,
192
+ type: "discount",
193
+ value: "code-free-shipping",
194
+ isAvailable: true,
195
+ status: "notRedeemed",
196
+ },
197
+ {
198
+ id: "reward-4",
199
+ name: "Free Product",
200
+ description: "Get a free mystery gift with your next purchase",
201
+ pointsCost: 750,
202
+ type: "freeProduct",
203
+ value: "mystery-gift-001",
204
+ isAvailable: true,
205
+ status: "redeemed",
206
+ },
207
+ {
208
+ id: "reward-5",
209
+ name: "Early Access",
210
+ description: "Get 24-hour early access to our next sale",
211
+ pointsCost: 1500,
212
+ type: "custom",
213
+ value: "code-early-access",
214
+ isAvailable: true,
215
+ status: "redeemed",
216
+ },
217
+ {
218
+ id: "reward-6",
219
+ name: "Birthday Double Points",
220
+ description: "Earn 2x points during your birthday month",
221
+ pointsCost: 2000,
222
+ type: "custom",
223
+ value: "code-birthday-double-points",
224
+ isAvailable: false,
225
+ status: "redeemed",
226
+ },
227
+ ];
228
+ }
229
+ });
230
+ }
231
+ getAvailableActivities() {
232
+ return __awaiter(this, void 0, void 0, function* () {
233
+ if (!this.customer) {
234
+ console.error("No customer found");
235
+ return [];
236
+ }
237
+ else {
238
+ return [
239
+ {
240
+ id: "act_123456",
241
+ type: "download_app",
242
+ points: 100,
243
+ customerId: "yotpo-customer-1",
244
+ status: "completed",
245
+ title: "Download App",
246
+ details: "Lorem ipsum dolor sit amet.",
247
+ reward_text: "100 Points",
248
+ cta_text: "Download",
249
+ icon: "https://picsum.photos/200",
250
+ url: "https://www.apple.com/app-store/",
251
+ metadata: {
252
+ platform: "ios",
253
+ appVersion: "1.0.0",
254
+ },
255
+ createdAt: new Date("2024-03-15T10:30:00Z"),
256
+ },
257
+ {
258
+ id: "act_234567",
259
+ type: "enable_push_notifications",
260
+ points: 100,
261
+ customerId: "yotpo-customer-1",
262
+ status: "pending",
263
+ title: "Enable Push Notifications",
264
+ details: "Lorem ipsum dolor sit amet.",
265
+ reward_text: "100 Points",
266
+ cta_text: "Enable",
267
+ icon: "https://assets.tapcart.com/default-icon-options/bell-exclamation.svg",
268
+ url: "https://www.apple.com/app-store/",
269
+ metadata: {
270
+ deviceType: "mobile",
271
+ permissionRequested: true,
272
+ },
273
+ createdAt: new Date("2024-03-15T10:31:00Z"),
274
+ },
275
+ {
276
+ id: "act_345678",
277
+ type: "create_account",
278
+ points: 100,
279
+ customerId: "yotpo-customer-1",
280
+ status: "completed",
281
+ title: "Create Account",
282
+ details: "Lorem ipsum dolor sit amet.",
283
+ reward_text: "100 Points",
284
+ cta_text: "Create",
285
+ icon: "https://assets.tapcart.com/default-icon-options/user.svg",
286
+ url: "https://www.yotpo.com",
287
+ metadata: {
288
+ registrationType: "email",
289
+ isVerified: true,
290
+ },
291
+ createdAt: new Date("2024-03-15T10:29:00Z"),
292
+ },
293
+ {
294
+ id: "act_456789",
295
+ type: "follow_tiktok",
296
+ points: 100,
297
+ customerId: "yotpo-customer-1",
298
+ status: "pending",
299
+ title: "Follow Tiktok",
300
+ details: "Lorem ipsum dolor sit amet.",
301
+ reward_text: "100 Points",
302
+ cta_text: "Follow",
303
+ icon: "https://assets.tapcart.com/default-icon-options/heart.svg",
304
+ url: "https://www.tiktok.com",
305
+ metadata: {
306
+ platform: "tiktok",
307
+ socialAction: "follow",
308
+ },
309
+ createdAt: new Date("2024-03-15T10:32:00Z"),
310
+ },
311
+ ];
312
+ }
313
+ });
314
+ }
315
+ recordActivity() {
316
+ var _a;
317
+ return __awaiter(this, void 0, void 0, function* () {
318
+ if (!this.customer) {
319
+ console.error("No customer found");
320
+ return null;
321
+ }
322
+ return [
323
+ {
324
+ id: "activity-1",
325
+ type: "purchase",
326
+ points: 100,
327
+ customerId: this.customer.id,
328
+ status: "completed",
329
+ createdAt: new Date(),
330
+ },
331
+ {
332
+ id: "activity-2",
333
+ type: "purchase",
334
+ points: 100,
335
+ customerId: (_a = this.customer) === null || _a === void 0 ? void 0 : _a.id,
336
+ status: "completed",
337
+ createdAt: new Date(),
338
+ },
339
+ ];
340
+ });
341
+ }
342
+ getActivityHistory() {
343
+ var _a, _b, _c;
344
+ return __awaiter(this, void 0, void 0, function* () {
345
+ if (!this.customer) {
346
+ console.error("No customer found");
347
+ return null;
348
+ }
349
+ else {
350
+ return [
351
+ {
352
+ id: "activity-3",
353
+ title: "Made a purchase",
354
+ type: "purchase",
355
+ points: 100,
356
+ customerId: (_a = this.customer) === null || _a === void 0 ? void 0 : _a.id,
357
+ status: "completed",
358
+ createdAt: new Date(),
359
+ },
360
+ {
361
+ id: "activity-1",
362
+ title: "Free shipping",
363
+ type: "redeem",
364
+ points: -1500,
365
+ customerId: (_b = this.customer) === null || _b === void 0 ? void 0 : _b.id,
366
+ status: "completed",
367
+ createdAt: new Date(),
368
+ },
369
+ {
370
+ id: "activity-2",
371
+ title: "Free product",
372
+ type: "redeem",
373
+ points: -1500,
374
+ customerId: (_c = this.customer) === null || _c === void 0 ? void 0 : _c.id,
375
+ status: "pending",
376
+ createdAt: new Date(),
377
+ },
378
+ ];
379
+ }
380
+ });
381
+ }
382
+ getCustomerTier() {
383
+ return __awaiter(this, void 0, void 0, function* () {
384
+ if (!this.customer) {
385
+ console.error("No customer found");
386
+ return null;
387
+ }
388
+ else {
389
+ return {
390
+ id: "tier-1",
391
+ name: "Bronze",
392
+ level: 1,
393
+ requirements: [
394
+ {
395
+ type: "points",
396
+ threshold: 0,
397
+ progress: 200,
398
+ },
399
+ {
400
+ type: "orders",
401
+ threshold: 1,
402
+ progress: 3,
403
+ },
404
+ ],
405
+ benefits: ["Free Shipping", "Priority Support"],
406
+ isActive: true,
407
+ };
408
+ }
409
+ });
410
+ }
411
+ getTiers() {
412
+ return __awaiter(this, void 0, void 0, function* () {
413
+ return [
414
+ {
415
+ id: "tier-1",
416
+ name: "Bronze",
417
+ level: 1,
418
+ requirements: [
419
+ {
420
+ type: "points",
421
+ threshold: 1000,
422
+ progress: 200,
423
+ },
424
+ ],
425
+ isActive: true,
426
+ },
427
+ {
428
+ id: "tier-2",
429
+ name: "Silver",
430
+ level: 2,
431
+ requirements: [
432
+ {
433
+ type: "orders",
434
+ threshold: 10,
435
+ progress: 3,
436
+ },
437
+ {
438
+ type: "referrals",
439
+ threshold: 5,
440
+ progress: 2,
441
+ },
442
+ {
443
+ type: "amountSpent",
444
+ threshold: 100,
445
+ progress: 50,
446
+ },
447
+ ],
448
+ isActive: false,
449
+ },
450
+ {
451
+ id: "tier-3",
452
+ name: "Gold",
453
+ level: 3,
454
+ requirements: [
455
+ {
456
+ type: "points",
457
+ threshold: 5000,
458
+ progress: 2000,
459
+ },
460
+ ],
461
+ isActive: false,
462
+ },
463
+ ];
464
+ });
465
+ }
466
+ createReferral() {
467
+ var _a, _b;
468
+ return __awaiter(this, void 0, void 0, function* () {
469
+ if (!this.customer) {
470
+ console.error("No customer found");
471
+ return null;
472
+ }
473
+ else {
474
+ return [
475
+ {
476
+ id: "referral-1",
477
+ referrerId: (_a = this.customer) === null || _a === void 0 ? void 0 : _a.id,
478
+ referredEmail: "friend@example.com",
479
+ status: "completed",
480
+ reward: {
481
+ referrer: 100,
482
+ referred: 50,
483
+ },
484
+ createdAt: new Date(),
485
+ completedAt: new Date(),
486
+ },
487
+ {
488
+ id: "referral-2",
489
+ referrerId: (_b = this.customer) === null || _b === void 0 ? void 0 : _b.id,
490
+ referredEmail: "friend@example.com",
491
+ status: "completed",
492
+ reward: {
493
+ referrer: 100,
494
+ referred: 50,
495
+ },
496
+ createdAt: new Date(),
497
+ },
498
+ ];
499
+ }
500
+ });
501
+ }
502
+ getReferrals() {
503
+ var _a;
504
+ return __awaiter(this, void 0, void 0, function* () {
505
+ if (!this.customer) {
506
+ console.error("No customer found");
507
+ return null;
508
+ }
509
+ else {
510
+ return [
511
+ {
512
+ id: "referral-1",
513
+ referrerId: (_a = this.customer) === null || _a === void 0 ? void 0 : _a.id,
514
+ referredEmail: "friend@example.com",
515
+ status: "completed",
516
+ reward: {
517
+ referrer: 100,
518
+ referred: 50,
519
+ },
520
+ createdAt: new Date(),
521
+ completedAt: new Date(),
522
+ },
523
+ ];
524
+ }
525
+ });
526
+ }
527
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../components/ui/image.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,KAAK,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAkC1D,KAAK,aAAa,GAAG;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB,gBAAgB,EAAE,MAAM,CAAA;CACzB,CAAA;AAUD,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CAAA;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,MAAM,GAAG,CAAC,MAAM,EAAE,YAAY,KAAK,MAAM,CAAA;AAKrD,KAAK,IAAI,GAAG,QAAQ,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAA;AAI1D,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,qBAAqB,CAAC,KAAK,CA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;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,6BAA0B,EAC/B,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,MAAM,GACpB,MAAM,EAAE,CAUV;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAIzE;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,WAAW,CAAC,EAAE,MAAM,EAAE,EACtB,WAAW,CAAC,EAAE,MAAM,EACpB,IAAI,GAAE,IAAe,GAEnB;IACE,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,IAAI,EAAE,IAAI,CAAA;CACX,EAAE,GACH,SAAS,CAUZ"}
@@ -174,7 +174,6 @@ export const Image = React.forwardRef((_a, ref) => {
174
174
  }, [ref]);
175
175
  const wrapperStyle = Object.assign({ aspectRatio: (_b = normalizedProps === null || normalizedProps === void 0 ? void 0 : normalizedProps.aspectRatio) === null || _b === void 0 ? void 0 : _b.replace(":", "/") }, imageWrapperStyles);
176
176
  const srcSet = generateSrcSet(normalizedProps.src, generateSizes(imageWidths, normalizedProps.aspectRatio, crop), loader, normalizedProps.objectFit === "contain");
177
- console.log("Image alt value:", normalizedProps.alt);
178
177
  return (_jsxs(_Fragment, { children: [loading === "eager" && (_jsx(ImagePreload, { imgAttributes: {
179
178
  srcSet,
180
179
  sizes,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tapcart/mobile-components",
3
- "version": "0.8.34",
3
+ "version": "0.8.35",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "style": "dist/styles.css",
@@ -81,9 +81,8 @@
81
81
  "embla-carousel-autoplay": "8.5.2",
82
82
  "embla-carousel-fade": "8.5.2",
83
83
  "embla-carousel-react": "^8.3.0",
84
- "eslint-config-next": "^15.3.0",
85
84
  "lucide-react": "^0.488.0",
86
- "next": "^15.3.0",
85
+ "next": "^14.2.28",
87
86
  "next-themes": "^0.2.1",
88
87
  "phone": "^3.1.58",
89
88
  "pluralize": "^8.0.0",