@gem-sdk/core 1.0.4 → 1.0.7
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.
|
@@ -61,7 +61,7 @@ const loopFetchCollection = async (fetcher, arg) => {
|
|
|
61
61
|
},
|
|
62
62
|
firstProduct: calculateFirstProduct(arg.numberOfProducts, currentPage, productsPerPage),
|
|
63
63
|
...(!arg.id || arg.id.toLowerCase() === 'latest'
|
|
64
|
-
? { where: { hasCollectionProducts: true } }
|
|
64
|
+
? { where: { hasCollectionProducts: true, isSample: arg.isSample } }
|
|
65
65
|
: { where: { baseID: arg.id } }),
|
|
66
66
|
orderByProduct: productSortedByOrder(arg.orderBy),
|
|
67
67
|
whereProduct: {
|
|
@@ -21,7 +21,12 @@ const addToCart = (product) => {
|
|
|
21
21
|
if (!window.ga || !product) {
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
|
-
window.ga('ec:addProduct', {
|
|
24
|
+
window.ga('ec:addProduct', {
|
|
25
|
+
...product,
|
|
26
|
+
id: product.sku,
|
|
27
|
+
name: product.variant === 'Default Title' ? product.name : `${product.name} - ${product.variant}`,
|
|
28
|
+
variant: product.variant === 'Default Title' ? product.name : product.variant,
|
|
29
|
+
});
|
|
25
30
|
window.ga('ec:setAction', 'add');
|
|
26
31
|
window.ga('send', 'event', {
|
|
27
32
|
eventCategory: 'EnhancedEcommerce',
|
|
@@ -59,7 +59,7 @@ const loopFetchCollection = async (fetcher, arg) => {
|
|
|
59
59
|
},
|
|
60
60
|
firstProduct: calculateFirstProduct(arg.numberOfProducts, currentPage, productsPerPage),
|
|
61
61
|
...(!arg.id || arg.id.toLowerCase() === 'latest'
|
|
62
|
-
? { where: { hasCollectionProducts: true } }
|
|
62
|
+
? { where: { hasCollectionProducts: true, isSample: arg.isSample } }
|
|
63
63
|
: { where: { baseID: arg.id } }),
|
|
64
64
|
orderByProduct: productSortedByOrder(arg.orderBy),
|
|
65
65
|
whereProduct: {
|
|
@@ -19,7 +19,12 @@ const addToCart = (product) => {
|
|
|
19
19
|
if (!window.ga || !product) {
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
|
-
window.ga('ec:addProduct', {
|
|
22
|
+
window.ga('ec:addProduct', {
|
|
23
|
+
...product,
|
|
24
|
+
id: product.sku,
|
|
25
|
+
name: product.variant === 'Default Title' ? product.name : `${product.name} - ${product.variant}`,
|
|
26
|
+
variant: product.variant === 'Default Title' ? product.name : product.variant,
|
|
27
|
+
});
|
|
23
28
|
window.ga('ec:setAction', 'add');
|
|
24
29
|
window.ga('send', 'event', {
|
|
25
30
|
eventCategory: 'EnhancedEcommerce',
|
package/dist/types/index.d.ts
CHANGED
|
@@ -653,6 +653,13 @@ type CountdownEvergreenType = {
|
|
|
653
653
|
startTime: number;
|
|
654
654
|
};
|
|
655
655
|
};
|
|
656
|
+
type Timezone<T> = SharedControlType<T> & {
|
|
657
|
+
type: 'timezone';
|
|
658
|
+
placeholder?: string;
|
|
659
|
+
datalist?: {
|
|
660
|
+
value: any;
|
|
661
|
+
}[];
|
|
662
|
+
};
|
|
656
663
|
|
|
657
664
|
type KlaviyoCodes = {
|
|
658
665
|
type: 'klaviyoCodes';
|
|
@@ -664,7 +671,7 @@ type YotpoLoyaltyCodes = {
|
|
|
664
671
|
id: string;
|
|
665
672
|
};
|
|
666
673
|
|
|
667
|
-
type ControlProp<T> = AngleControlType<T> | CheckboxControlType<T> | ColorPickerControlType<T> | GroupControlType<T> | IconControlType<T> | InputFixContentControlType<T> | InputNumberControlType<T> | InputUnitControlType<T> | InputControlType<T> | MarginControlType<T> | PaddingControlType<T> | PositionControlType<T> | RadioGroupControlType | RangeControlType<T> | SegmentControlType<T> | SelectControlType<T> | TextareaControlType<T> | ToggleControlType<T> | ImageControlType<T> | ChildrensControlType | GridControlType<T> | FlexControlType<T> | TextEditorControlType<T> | ProductControlType<T> | TypographyControlType<T> | MenuControlType<T> | BehaviorStateControlType<T> | PickLinkControlType<T> | BoxShadowControlType<T> | TextShadowControlType<T> | BorderControlType<T> | BorderRadiusControlType<T> | RadiusPresetControlType<T> | SizeControlType<T> | ChildItemType<T> | PickMultiProductControlType<T> | CollectionControlType<T> | BackgroundControlType<T> | VisibilityControlType<T> | SelectVariantControlType | CountdownEvergreenType | DateTimePickerControlType | CountdownDailyType | KlaviyoCodes | YotpoLoyaltyCodes;
|
|
674
|
+
type ControlProp<T> = AngleControlType<T> | CheckboxControlType<T> | ColorPickerControlType<T> | GroupControlType<T> | IconControlType<T> | InputFixContentControlType<T> | InputNumberControlType<T> | InputUnitControlType<T> | InputControlType<T> | MarginControlType<T> | PaddingControlType<T> | PositionControlType<T> | RadioGroupControlType | RangeControlType<T> | SegmentControlType<T> | SelectControlType<T> | TextareaControlType<T> | ToggleControlType<T> | ImageControlType<T> | ChildrensControlType | GridControlType<T> | FlexControlType<T> | TextEditorControlType<T> | ProductControlType<T> | TypographyControlType<T> | MenuControlType<T> | BehaviorStateControlType<T> | PickLinkControlType<T> | BoxShadowControlType<T> | TextShadowControlType<T> | BorderControlType<T> | BorderRadiusControlType<T> | RadiusPresetControlType<T> | SizeControlType<T> | ChildItemType<T> | PickMultiProductControlType<T> | CollectionControlType<T> | BackgroundControlType<T> | VisibilityControlType<T> | SelectVariantControlType | CountdownEvergreenType | Timezone<T> | DateTimePickerControlType | CountdownDailyType | KlaviyoCodes | YotpoLoyaltyCodes;
|
|
668
675
|
type Setting<P extends BaseProps> = {
|
|
669
676
|
id: 'setting';
|
|
670
677
|
controls?: ControlProp<NonNullable<P['setting']>>[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"type-check": "yarn tsc --noEmit"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@gem-sdk/
|
|
28
|
-
"@gem-sdk/
|
|
27
|
+
"@gem-sdk/adapter-shopify": "*",
|
|
28
|
+
"@gem-sdk/styles": "*"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"react-error-boundary": "^3.1.4",
|