@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.
- package/dist/hooks/index.d.mts +6 -23
- package/dist/hooks/index.d.ts +6 -23
- package/dist/hooks/index.js +171 -139
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +173 -141
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +61 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +63 -7
- package/dist/index.mjs.map +1 -1
- package/dist/provider/index.d.mts +3 -1
- package/dist/provider/index.d.ts +3 -1
- package/dist/provider/index.js +173 -7
- package/dist/provider/index.js.map +1 -1
- package/dist/provider/index.mjs +175 -9
- package/dist/provider/index.mjs.map +1 -1
- package/dist/{types-DfR13pDe.d.mts → types-C0UyuPrG.d.mts} +12 -5
- package/dist/{types-DfR13pDe.d.ts → types-C0UyuPrG.d.ts} +12 -5
- package/package.json +3 -3
|
@@ -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.
|
|
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-
|
|
35
|
-
"@anker-in/shopify-
|
|
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",
|