@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.
- package/dist/hooks/index.d.mts +23 -6
- package/dist/hooks/index.d.ts +23 -6
- package/dist/hooks/index.js +139 -171
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +141 -173
- 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 +5 -61
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -63
- package/dist/index.mjs.map +1 -1
- package/dist/provider/index.d.mts +1 -3
- package/dist/provider/index.d.ts +1 -3
- package/dist/provider/index.js +7 -173
- package/dist/provider/index.js.map +1 -1
- package/dist/provider/index.mjs +9 -175
- package/dist/provider/index.mjs.map +1 -1
- package/dist/{types-C0UyuPrG.d.mts → types-DfR13pDe.d.mts} +5 -12
- package/dist/{types-C0UyuPrG.d.ts → types-DfR13pDe.d.ts} +5 -12
- package/package.json +17 -17
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NormalizedLineItem, MoneyV2, NormalizedProductVariant, NormalizedProduct,
|
|
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?:
|
|
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,
|
|
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?:
|
|
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.
|
|
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
|
-
|
|
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
|
+
}
|