@gem-sdk/core 1.0.4 → 1.0.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.
@@ -21,7 +21,12 @@ const addToCart = (product) => {
21
21
  if (!window.ga || !product) {
22
22
  return;
23
23
  }
24
- window.ga('ec:addProduct', { ...product, id: product.sku });
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',
@@ -19,7 +19,12 @@ const addToCart = (product) => {
19
19
  if (!window.ga || !product) {
20
20
  return;
21
21
  }
22
- window.ga('ec:addProduct', { ...product, id: product.sku });
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',
@@ -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.4",
3
+ "version": "1.0.5",
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/styles": "*",
28
- "@gem-sdk/adapter-shopify": "*"
27
+ "@gem-sdk/adapter-shopify": "*",
28
+ "@gem-sdk/styles": "*"
29
29
  },
30
30
  "dependencies": {
31
31
  "react-error-boundary": "^3.1.4",