@anker-in/shopify-react 1.2.4-beta.0 → 1.2.5

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, NormalizedCart } from '@anker-in/shopify-sdk';
1
+ import { NormalizedLineItem, MoneyV2, NormalizedProductVariant, NormalizedProduct, BuyerIdentityInput, NormalizedCart } from '@anker-in/shopify-sdk';
2
2
  import Decimal from 'decimal.js';
3
3
 
4
4
  /**
@@ -166,10 +166,7 @@ interface AddToCartInput {
166
166
  /** 全量更新 codes,默认是追加 */
167
167
  replaceExistingCodes?: boolean;
168
168
  /** Buyer identity for cart creation */
169
- buyerIdentity?: {
170
- email?: string;
171
- countryCode?: string;
172
- };
169
+ buyerIdentity?: BuyerIdentityInput;
173
170
  /** GTM tracking parameters */
174
171
  gtmParams?: Omit<GtmParams, 'brand'>;
175
172
  /** Force create new cart */
@@ -208,6 +205,16 @@ interface UseAutoRemoveFreeGiftsOptions {
208
205
  * @returns true if line item is a gift that should be removed
209
206
  */
210
207
  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;
211
218
  }
212
219
  interface UseAutoRemoveFreeGiftsResult {
213
220
  /** Whether removal is in progress */
@@ -1,4 +1,4 @@
1
- import { NormalizedLineItem, MoneyV2, NormalizedProductVariant, NormalizedProduct, NormalizedCart } from '@anker-in/shopify-sdk';
1
+ import { NormalizedLineItem, MoneyV2, NormalizedProductVariant, NormalizedProduct, BuyerIdentityInput, NormalizedCart } from '@anker-in/shopify-sdk';
2
2
  import Decimal from 'decimal.js';
3
3
 
4
4
  /**
@@ -166,10 +166,7 @@ interface AddToCartInput {
166
166
  /** 全量更新 codes,默认是追加 */
167
167
  replaceExistingCodes?: boolean;
168
168
  /** Buyer identity for cart creation */
169
- buyerIdentity?: {
170
- email?: string;
171
- countryCode?: string;
172
- };
169
+ buyerIdentity?: BuyerIdentityInput;
173
170
  /** GTM tracking parameters */
174
171
  gtmParams?: Omit<GtmParams, 'brand'>;
175
172
  /** Force create new cart */
@@ -208,6 +205,16 @@ interface UseAutoRemoveFreeGiftsOptions {
208
205
  * @returns true if line item is a gift that should be removed
209
206
  */
210
207
  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;
211
218
  }
212
219
  interface UseAutoRemoveFreeGiftsResult {
213
220
  /** 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.4-beta.0",
3
+ "version": "1.2.5",
4
4
  "description": "React hooks and components for Shopify SDK",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -31,8 +31,8 @@
31
31
  "decimal.js": "^10.6.0",
32
32
  "js-cookie": "^3.0.5",
33
33
  "swr": "^2.2.0",
34
- "@anker-in/shopify-core": "1.0.1",
35
- "@anker-in/shopify-sdk": "1.1.3"
34
+ "@anker-in/shopify-sdk": "1.1.4",
35
+ "@anker-in/shopify-core": "1.0.1"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "react": ">=18.0.0",