@anker-in/shopify-react 1.2.7 → 1.2.9-beta.1

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.
@@ -1,4 +1,4 @@
1
- import { NormalizedLineItem, MoneyV2, NormalizedProductVariant, NormalizedProduct, BuyerIdentityInput, NormalizedCart } from '@anker-in/shopify-sdk';
1
+ import { NormalizedLineItem, MoneyV2, NormalizedProductVariant, NormalizedProduct, NormalizedCart } from '@anker-in/shopify-sdk';
2
2
  import Decimal from 'decimal.js';
3
3
 
4
4
  /**
@@ -166,7 +166,10 @@ interface AddToCartInput {
166
166
  /** 全量更新 codes,默认是追加 */
167
167
  replaceExistingCodes?: boolean;
168
168
  /** Buyer identity for cart creation */
169
- buyerIdentity?: BuyerIdentityInput;
169
+ buyerIdentity?: {
170
+ email?: string;
171
+ countryCode?: string;
172
+ };
170
173
  /** GTM tracking parameters */
171
174
  gtmParams?: Omit<GtmParams, 'brand'>;
172
175
  /** Force create new cart */
@@ -205,16 +208,6 @@ interface UseAutoRemoveFreeGiftsOptions {
205
208
  * @returns true if line item is a gift that should be removed
206
209
  */
207
210
  isGiftLineItem?: (line: NormalizedLineItem) => boolean;
208
- /**
209
- * Whether to run removal only once after cart initialization
210
- * @default false
211
- */
212
- runOnlyOnceAfterInit?: boolean;
213
- /**
214
- * Initialization delay for one-time mode (ms)
215
- * @default 500
216
- */
217
- initDelay?: number;
218
211
  }
219
212
  interface UseAutoRemoveFreeGiftsResult {
220
213
  /** Whether removal is in progress */
@@ -1,4 +1,4 @@
1
- import { NormalizedLineItem, MoneyV2, NormalizedProductVariant, NormalizedProduct, BuyerIdentityInput, NormalizedCart } from '@anker-in/shopify-sdk';
1
+ import { NormalizedLineItem, MoneyV2, NormalizedProductVariant, NormalizedProduct, NormalizedCart } from '@anker-in/shopify-sdk';
2
2
  import Decimal from 'decimal.js';
3
3
 
4
4
  /**
@@ -166,7 +166,10 @@ interface AddToCartInput {
166
166
  /** 全量更新 codes,默认是追加 */
167
167
  replaceExistingCodes?: boolean;
168
168
  /** Buyer identity for cart creation */
169
- buyerIdentity?: BuyerIdentityInput;
169
+ buyerIdentity?: {
170
+ email?: string;
171
+ countryCode?: string;
172
+ };
170
173
  /** GTM tracking parameters */
171
174
  gtmParams?: Omit<GtmParams, 'brand'>;
172
175
  /** Force create new cart */
@@ -205,16 +208,6 @@ interface UseAutoRemoveFreeGiftsOptions {
205
208
  * @returns true if line item is a gift that should be removed
206
209
  */
207
210
  isGiftLineItem?: (line: NormalizedLineItem) => boolean;
208
- /**
209
- * Whether to run removal only once after cart initialization
210
- * @default false
211
- */
212
- runOnlyOnceAfterInit?: boolean;
213
- /**
214
- * Initialization delay for one-time mode (ms)
215
- * @default 500
216
- */
217
- initDelay?: number;
218
211
  }
219
212
  interface UseAutoRemoveFreeGiftsResult {
220
213
  /** Whether removal is in progress */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anker-in/shopify-react",
3
- "version": "1.2.7",
3
+ "version": "1.2.9-beta.01",
4
4
  "description": "React hooks and components for Shopify SDK",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -26,19 +26,29 @@
26
26
  "dist/**",
27
27
  "README.md"
28
28
  ],
29
+ "scripts": {
30
+ "build": "tsup",
31
+ "build:with-check": "pnpm run check-types && tsup",
32
+ "build:skip-check": "tsup",
33
+ "dev": "tsup --watch",
34
+ "check-types": "tsc --noEmit",
35
+ "lint": "eslint . --max-warnings 0"
36
+ },
29
37
  "dependencies": {
38
+ "@anker-in/shopify-core": "workspace:*",
39
+ "@anker-in/shopify-sdk": "workspace:*",
30
40
  "ahooks": "^3.9.6",
31
41
  "decimal.js": "^10.6.0",
32
42
  "js-cookie": "^3.0.5",
33
- "swr": "^2.2.0",
34
- "@anker-in/shopify-sdk": "1.1.4",
35
- "@anker-in/shopify-core": "1.0.2"
43
+ "swr": "^2.2.0"
36
44
  },
37
45
  "peerDependencies": {
38
46
  "react": ">=18.0.0",
39
47
  "react-dom": ">=18.0.0"
40
48
  },
41
49
  "devDependencies": {
50
+ "@repo/eslint-config": "workspace:*",
51
+ "@repo/typescript-config": "workspace:*",
42
52
  "@types/js-cookie": "^3.0.6",
43
53
  "@types/node": "^22.15.3",
44
54
  "@types/react": "19.1.0",
@@ -46,9 +56,7 @@
46
56
  "react": "^19.1.0",
47
57
  "react-dom": "^19.1.0",
48
58
  "tsup": "^8.0.0",
49
- "typescript": "5.9.2",
50
- "@repo/eslint-config": "0.0.1",
51
- "@repo/typescript-config": "0.0.1"
59
+ "typescript": "5.9.2"
52
60
  },
53
61
  "publishConfig": {
54
62
  "access": "public"
@@ -59,13 +67,5 @@
59
67
  "hooks",
60
68
  "components"
61
69
  ],
62
- "license": "MIT",
63
- "scripts": {
64
- "build": "tsup",
65
- "build:with-check": "pnpm run check-types && tsup",
66
- "build:skip-check": "tsup",
67
- "dev": "tsup --watch",
68
- "check-types": "tsc --noEmit",
69
- "lint": "eslint . --max-warnings 0"
70
- }
71
- }
70
+ "license": "MIT"
71
+ }