@gem-sdk/core 1.48.0-dev.0 → 1.48.0-dev.14

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.
@@ -454,6 +454,7 @@ const ComponentToolbarPreview = (props)=>{
454
454
  }
455
455
  return /*#__PURE__*/ jsxRuntime.jsxs("div", {
456
456
  "data-toolbar-parent": true,
457
+ "data-component-tag": parent.tag,
457
458
  "data-parent-uid": parent.uid,
458
459
  "data-toolbar-theme-section": isThemeSectionEditor,
459
460
  "data-toolbar-parent-revert": isShowParentRevert,
@@ -36,7 +36,7 @@ const getProduct = async (fetcher, { id, isSample, isStorefront })=>{
36
36
  };
37
37
  };
38
38
  const orderBy = {
39
- field: 'CREATED_AT',
39
+ field: 'PLATFORM_CREATED_AT',
40
40
  direction: 'DESC'
41
41
  };
42
42
  const fetchProduct = async (fetcher, { id, isSample, isStorefront })=>{
@@ -13,7 +13,7 @@ const addAppBlockId = (component)=>{
13
13
  };
14
14
  const handleSetBlockId = (component)=>{
15
15
  const { tag, uid } = component;
16
- if (component.settings.appBlockId === undefined) return component;
16
+ if (component.settings?.appBlockId === undefined) return component;
17
17
  component.settings.appBlockId = composeAppBlockId.composeAppBlockId(tag, uid);
18
18
  };
19
19
 
@@ -54,13 +54,41 @@ const PumperBundlesVolumeDiscountConfig = {
54
54
  appId: '0856870d-2aca-4b1e-a662-cf1797f61270'
55
55
  }
56
56
  };
57
+ const UnlimitedBundlesDiscountsConfig = {
58
+ UnlimitedBundlesDiscounts: {
59
+ appName: 'unlimited-bundles',
60
+ appId: 'd33d0f48-dee0-42a0-b156-2a5dce91814a'
61
+ }
62
+ };
63
+ const KiteFreeGiftDiscountConfig = {
64
+ KiteFreeGiftDiscount: {
65
+ appName: 'kite-free-gift-discounts',
66
+ appId: '2c7302c4-455d-4078-a829-48563ba26089'
67
+ }
68
+ };
69
+ const FastBundleBundlesDiscountsConfig = {
70
+ FastBundleBundlesDiscounts: {
71
+ appName: 'fast-bundle',
72
+ appId: '9e87fbe2-9041-4c23-acf5-322413994cef'
73
+ }
74
+ };
75
+ const SimpleBundlesKitsConfig = {
76
+ SimpleBundlesKits: {
77
+ appName: 'simple-bundles-kits',
78
+ appId: 'e553276b-36b2-446d-b80a-aa47fe5f96ac'
79
+ }
80
+ };
57
81
 
58
82
  exports.BonLoyaltyRewardsReferralsConfig = BonLoyaltyRewardsReferralsConfig;
83
+ exports.FastBundleBundlesDiscountsConfig = FastBundleBundlesDiscountsConfig;
84
+ exports.KiteFreeGiftDiscountConfig = KiteFreeGiftDiscountConfig;
59
85
  exports.LoopSubscriptionsConfig = LoopSubscriptionsConfig;
60
86
  exports.PumperBundlesVolumeDiscountConfig = PumperBundlesVolumeDiscountConfig;
61
87
  exports.RechargeSubscriptionsConfig = RechargeSubscriptionsConfig;
62
88
  exports.ReviewxpoProductReviewsAppConfig = ReviewxpoProductReviewsAppConfig;
63
89
  exports.SelleasyConfig = SelleasyConfig;
64
90
  exports.ShopifyFormsConfig = ShopifyFormsConfig;
91
+ exports.SimpleBundlesKitsConfig = SimpleBundlesKitsConfig;
65
92
  exports.SkioSubscriptionsYcS20Config = SkioSubscriptionsYcS20Config;
66
93
  exports.SubifySubscriptionsConfig = SubifySubscriptionsConfig;
94
+ exports.UnlimitedBundlesDiscountsConfig = UnlimitedBundlesDiscountsConfig;
@@ -105,7 +105,35 @@ const PumperBundlesVolumeDiscount = {
105
105
  }
106
106
  }
107
107
  };
108
+ const UnlimitedBundlesDiscounts = {
109
+ UnlimitedBundlesDiscounts: {
110
+ 'product-page-placeholder': null
111
+ }
112
+ };
113
+ const KiteFreeGiftDiscount = {
114
+ KiteFreeGiftDiscount: {
115
+ 'app-block': null
116
+ }
117
+ };
118
+ const FastBundleBundlesDiscounts = {
119
+ FastBundleBundlesDiscounts: {
120
+ all_bundles: null,
121
+ fbt_position: null,
122
+ product_bundles: null,
123
+ product_bundle_with_ids: null,
124
+ volume_position: null
125
+ }
126
+ };
127
+ const SimpleBundlesKits = {
128
+ SimpleBundlesKits: {
129
+ 'infinite-options-selector': null
130
+ }
131
+ };
108
132
  const composeSettingsByWidgetType = {
133
+ ...FastBundleBundlesDiscounts,
134
+ ...KiteFreeGiftDiscount,
135
+ ...UnlimitedBundlesDiscounts,
136
+ ...SimpleBundlesKits,
109
137
  ...PumperBundlesVolumeDiscount,
110
138
  ...ReviewxpoProductReviewsApp,
111
139
  ...ShopifyForms,
@@ -11,7 +11,11 @@ const mapShopifyAppMeta = {
11
11
  ...appConfig.SkioSubscriptionsYcS20Config,
12
12
  ...appConfig.ShopifyFormsConfig,
13
13
  ...appConfig.ReviewxpoProductReviewsAppConfig,
14
- ...appConfig.PumperBundlesVolumeDiscountConfig
14
+ ...appConfig.PumperBundlesVolumeDiscountConfig,
15
+ ...appConfig.UnlimitedBundlesDiscountsConfig,
16
+ ...appConfig.KiteFreeGiftDiscountConfig,
17
+ ...appConfig.FastBundleBundlesDiscountsConfig,
18
+ ...appConfig.SimpleBundlesKitsConfig
15
19
  };
16
20
  const THIRD_PARTY_APP_BLOCK_ID_PREFIX = 'gp_app';
17
21
 
@@ -116,7 +116,7 @@ const composeTypographyAttr = (attrs)=>{
116
116
  });
117
117
  };
118
118
  const composeTypographyClassName = (typo, typography)=>{
119
- return typo ? typo?.type && !typo.custom ? genTypoClass(typo.type) : '' : typography?.type && genTypoClass(typography?.type);
119
+ return typo ? typo?.type && !isCustomTypo(typo.custom) ? genTypoClass(typo.type) : '' : typography?.type && genTypoClass(typography?.type);
120
120
  };
121
121
  const composeFallbackTypographyStyle = (tag)=>{
122
122
  if ([
@@ -148,6 +148,9 @@ const composeTypographyStyle = (typo, typography, disableAttr)=>{
148
148
  ...!typography?.type ? composeTypography(typography?.custom) : {}
149
149
  };
150
150
  };
151
+ const isCustomTypo = (typoProps)=>{
152
+ return typoProps && Object.keys(typoProps).length > 1 || typoProps && Object.keys(typoProps).length === 1 && !typoProps.fontSize;
153
+ };
151
154
 
152
155
  exports.composeFallbackTypographyStyle = composeFallbackTypographyStyle;
153
156
  exports.composeFontFamilyTypographyV2 = composeFontFamilyTypographyV2;
@@ -450,6 +450,7 @@ const ComponentToolbarPreview = (props)=>{
450
450
  }
451
451
  return /*#__PURE__*/ jsxs("div", {
452
452
  "data-toolbar-parent": true,
453
+ "data-component-tag": parent.tag,
453
454
  "data-parent-uid": parent.uid,
454
455
  "data-toolbar-theme-section": isThemeSectionEditor,
455
456
  "data-toolbar-parent-revert": isShowParentRevert,
@@ -34,7 +34,7 @@ const getProduct = async (fetcher, { id, isSample, isStorefront })=>{
34
34
  };
35
35
  };
36
36
  const orderBy = {
37
- field: 'CREATED_AT',
37
+ field: 'PLATFORM_CREATED_AT',
38
38
  direction: 'DESC'
39
39
  };
40
40
  const fetchProduct = async (fetcher, { id, isSample, isStorefront })=>{
@@ -11,7 +11,7 @@ const addAppBlockId = (component)=>{
11
11
  };
12
12
  const handleSetBlockId = (component)=>{
13
13
  const { tag, uid } = component;
14
- if (component.settings.appBlockId === undefined) return component;
14
+ if (component.settings?.appBlockId === undefined) return component;
15
15
  component.settings.appBlockId = composeAppBlockId(tag, uid);
16
16
  };
17
17
 
@@ -52,5 +52,29 @@ const PumperBundlesVolumeDiscountConfig = {
52
52
  appId: '0856870d-2aca-4b1e-a662-cf1797f61270'
53
53
  }
54
54
  };
55
+ const UnlimitedBundlesDiscountsConfig = {
56
+ UnlimitedBundlesDiscounts: {
57
+ appName: 'unlimited-bundles',
58
+ appId: 'd33d0f48-dee0-42a0-b156-2a5dce91814a'
59
+ }
60
+ };
61
+ const KiteFreeGiftDiscountConfig = {
62
+ KiteFreeGiftDiscount: {
63
+ appName: 'kite-free-gift-discounts',
64
+ appId: '2c7302c4-455d-4078-a829-48563ba26089'
65
+ }
66
+ };
67
+ const FastBundleBundlesDiscountsConfig = {
68
+ FastBundleBundlesDiscounts: {
69
+ appName: 'fast-bundle',
70
+ appId: '9e87fbe2-9041-4c23-acf5-322413994cef'
71
+ }
72
+ };
73
+ const SimpleBundlesKitsConfig = {
74
+ SimpleBundlesKits: {
75
+ appName: 'simple-bundles-kits',
76
+ appId: 'e553276b-36b2-446d-b80a-aa47fe5f96ac'
77
+ }
78
+ };
55
79
 
56
- export { BonLoyaltyRewardsReferralsConfig, LoopSubscriptionsConfig, PumperBundlesVolumeDiscountConfig, RechargeSubscriptionsConfig, ReviewxpoProductReviewsAppConfig, SelleasyConfig, ShopifyFormsConfig, SkioSubscriptionsYcS20Config, SubifySubscriptionsConfig };
80
+ export { BonLoyaltyRewardsReferralsConfig, FastBundleBundlesDiscountsConfig, KiteFreeGiftDiscountConfig, LoopSubscriptionsConfig, PumperBundlesVolumeDiscountConfig, RechargeSubscriptionsConfig, ReviewxpoProductReviewsAppConfig, SelleasyConfig, ShopifyFormsConfig, SimpleBundlesKitsConfig, SkioSubscriptionsYcS20Config, SubifySubscriptionsConfig, UnlimitedBundlesDiscountsConfig };
@@ -103,7 +103,35 @@ const PumperBundlesVolumeDiscount = {
103
103
  }
104
104
  }
105
105
  };
106
+ const UnlimitedBundlesDiscounts = {
107
+ UnlimitedBundlesDiscounts: {
108
+ 'product-page-placeholder': null
109
+ }
110
+ };
111
+ const KiteFreeGiftDiscount = {
112
+ KiteFreeGiftDiscount: {
113
+ 'app-block': null
114
+ }
115
+ };
116
+ const FastBundleBundlesDiscounts = {
117
+ FastBundleBundlesDiscounts: {
118
+ all_bundles: null,
119
+ fbt_position: null,
120
+ product_bundles: null,
121
+ product_bundle_with_ids: null,
122
+ volume_position: null
123
+ }
124
+ };
125
+ const SimpleBundlesKits = {
126
+ SimpleBundlesKits: {
127
+ 'infinite-options-selector': null
128
+ }
129
+ };
106
130
  const composeSettingsByWidgetType = {
131
+ ...FastBundleBundlesDiscounts,
132
+ ...KiteFreeGiftDiscount,
133
+ ...UnlimitedBundlesDiscounts,
134
+ ...SimpleBundlesKits,
107
135
  ...PumperBundlesVolumeDiscount,
108
136
  ...ReviewxpoProductReviewsApp,
109
137
  ...ShopifyForms,
@@ -1,4 +1,4 @@
1
- import { RechargeSubscriptionsConfig, BonLoyaltyRewardsReferralsConfig, SubifySubscriptionsConfig, SelleasyConfig, LoopSubscriptionsConfig, SkioSubscriptionsYcS20Config, ShopifyFormsConfig, ReviewxpoProductReviewsAppConfig, PumperBundlesVolumeDiscountConfig } from './appConfig.js';
1
+ import { RechargeSubscriptionsConfig, BonLoyaltyRewardsReferralsConfig, SubifySubscriptionsConfig, SelleasyConfig, LoopSubscriptionsConfig, SkioSubscriptionsYcS20Config, ShopifyFormsConfig, ReviewxpoProductReviewsAppConfig, PumperBundlesVolumeDiscountConfig, UnlimitedBundlesDiscountsConfig, KiteFreeGiftDiscountConfig, FastBundleBundlesDiscountsConfig, SimpleBundlesKitsConfig } from './appConfig.js';
2
2
 
3
3
  const mapShopifyAppMeta = {
4
4
  ...RechargeSubscriptionsConfig,
@@ -9,7 +9,11 @@ const mapShopifyAppMeta = {
9
9
  ...SkioSubscriptionsYcS20Config,
10
10
  ...ShopifyFormsConfig,
11
11
  ...ReviewxpoProductReviewsAppConfig,
12
- ...PumperBundlesVolumeDiscountConfig
12
+ ...PumperBundlesVolumeDiscountConfig,
13
+ ...UnlimitedBundlesDiscountsConfig,
14
+ ...KiteFreeGiftDiscountConfig,
15
+ ...FastBundleBundlesDiscountsConfig,
16
+ ...SimpleBundlesKitsConfig
13
17
  };
14
18
  const THIRD_PARTY_APP_BLOCK_ID_PREFIX = 'gp_app';
15
19
 
@@ -114,7 +114,7 @@ const composeTypographyAttr = (attrs)=>{
114
114
  });
115
115
  };
116
116
  const composeTypographyClassName = (typo, typography)=>{
117
- return typo ? typo?.type && !typo.custom ? genTypoClass(typo.type) : '' : typography?.type && genTypoClass(typography?.type);
117
+ return typo ? typo?.type && !isCustomTypo(typo.custom) ? genTypoClass(typo.type) : '' : typography?.type && genTypoClass(typography?.type);
118
118
  };
119
119
  const composeFallbackTypographyStyle = (tag)=>{
120
120
  if ([
@@ -146,5 +146,8 @@ const composeTypographyStyle = (typo, typography, disableAttr)=>{
146
146
  ...!typography?.type ? composeTypography(typography?.custom) : {}
147
147
  };
148
148
  };
149
+ const isCustomTypo = (typoProps)=>{
150
+ return typoProps && Object.keys(typoProps).length > 1 || typoProps && Object.keys(typoProps).length === 1 && !typoProps.fontSize;
151
+ };
149
152
 
150
153
  export { composeFallbackTypographyStyle, composeFontFamilyTypographyV2, composeTypography, composeTypographyAttr, composeTypographyClassName, composeTypographyCss, composeTypographyStyle, composeTypographyV2, composeTypographyV2Css, genTypoClass };
@@ -7187,6 +7187,11 @@ type InputControlType<T> = SharedControlType<T> & {
7187
7187
  action?: {
7188
7188
  clear?: boolean;
7189
7189
  };
7190
+ actionChangeControls?: {
7191
+ controlID: string;
7192
+ condition?: string;
7193
+ newValue: any;
7194
+ }[];
7190
7195
  };
7191
7196
 
7192
7197
  type InputFixContentControlType<T> = SharedControlType<T> & {
@@ -7383,6 +7388,7 @@ type TextareaControlType<T> = SharedControlType<T> & {
7383
7388
  readonly?: boolean;
7384
7389
  minHeight?: number;
7385
7390
  maxWidth?: number;
7391
+ inputClass?: string;
7386
7392
  autoHeight?: boolean;
7387
7393
  defaultRows?: number;
7388
7394
  showPlusBtn?: boolean;
@@ -7741,6 +7747,7 @@ type TypographyV2ControlType<T> = SharedControlType<T> & {
7741
7747
  hiddenSetting?: {
7742
7748
  color?: boolean;
7743
7749
  transform?: boolean;
7750
+ fontWeight?: boolean;
7744
7751
  };
7745
7752
  disableCollapse?: boolean;
7746
7753
  };
@@ -8053,6 +8060,78 @@ type SelectProductBundleControlType<T> = SharedControlType<T> & {
8053
8060
  hide?: boolean;
8054
8061
  };
8055
8062
 
8063
+ type SettingStateType = 'normal' | 'hover' | 'focus' | 'active' | 'price' | 'compareAtPrice';
8064
+ type LangKey = 'en' | 'vi';
8065
+ type LabelWithLang = {
8066
+ [P in keyof Record<LangKey, ''>]?: string;
8067
+ };
8068
+ type SettingMediaType = 'image' | 'youtubeVideoID';
8069
+ type SettingUIHelpType = {
8070
+ content: string;
8071
+ buttonLink?: string;
8072
+ media?: {
8073
+ value: string;
8074
+ type: SettingMediaType;
8075
+ };
8076
+ };
8077
+ type SettingUIControl = {
8078
+ id?: string;
8079
+ isCompo?: boolean;
8080
+ layout?: 'vertical' | 'horizontal';
8081
+ toggleGroupId?: string;
8082
+ label?: LabelWithLang;
8083
+ conditionDisplay?: string;
8084
+ conditionEnable?: string;
8085
+ options?: {
8086
+ hideOnDevices?: Record<NameDevices$1, boolean>;
8087
+ fullWidth?: boolean;
8088
+ disableMessage?: string;
8089
+ };
8090
+ setting?: {
8091
+ id: string;
8092
+ state?: SettingStateType;
8093
+ };
8094
+ searchKeyword?: string;
8095
+ } & SettingUICompo;
8096
+ type SettingUICompo = {
8097
+ controls?: SettingUIControl[];
8098
+ iconName?: string;
8099
+ getValueFromSettingID?: string;
8100
+ fixedValue?: string;
8101
+ placeholder?: string;
8102
+ help?: SettingUIHelpType;
8103
+ };
8104
+ type SettingUIMoreSetting = {
8105
+ label?: LabelWithLang;
8106
+ labelAction?: LabelWithLang;
8107
+ controls?: SettingUIControl[];
8108
+ help?: SettingUIHelpType;
8109
+ };
8110
+ type SettingUIToggleGroup = {
8111
+ label?: LabelWithLang;
8112
+ id?: string;
8113
+ controls?: SettingUIControl[];
8114
+ };
8115
+ type SettingUIToggleSettings = {
8116
+ type: 'control' | 'toggleGroup';
8117
+ controls?: SettingUIControl[];
8118
+ isActiveDefault?: boolean;
8119
+ } & SettingUIControl & SettingUIToggleGroup;
8120
+ type SettingUIGroup = {
8121
+ label?: LabelWithLang;
8122
+ message?: string;
8123
+ disableToggle?: boolean;
8124
+ conditionDisplay?: string;
8125
+ conditionEnable?: string;
8126
+ controls?: SettingUIControl[];
8127
+ moreSettings?: SettingUIMoreSetting;
8128
+ toggleSettings?: SettingUIToggleSettings[];
8129
+ help?: SettingUIHelpType;
8130
+ options?: {
8131
+ disableMessage?: string;
8132
+ };
8133
+ };
8134
+
8056
8135
  type ControlProp<T> = ProductBundleChildControlType<T> | SelectProductBundleControlType<T> | AngleControlType<T> | CheckboxControlType<T> | ColorPickerControlType<T> | GroupControlType<T> | IconControlType<T> | InputFixContentControlType<T> | InputNumberControlType<T> | InputUnitControlType<T> | InputUnitSpacingControlType<T> | InputUnitWidthControlType<T> | InputControlType<T> | MarginControlType<T> | PaddingControlType<T> | PositionControlType<T> | RadioGroupControlType | RangeControlType<T> | SegmentControlType<T> | OpenLinkControlType<T> | SelectControlType<T> | TextareaControlType<T> | ToggleControlType<T> | ImageControlType<T> | ChildrensControlType | GridControlType<T> | FlexControlType<T> | TextEditorControlType<T> | ProductControlType<T> | TypographyControlType<T> | TypographyV2ControlType<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> | CustomContentControlType<T> | DateTimePickerControlType | CountdownDailyType | KlaviyoCodes | YotpoLoyaltyCodes | InputWidthControlType<T> | LayoutSegmentControlType<T> | InputSpacing<T> | UniqueIdControlType<T> | PositionSquareControlType<T> | CustomCodeEditor | LayoutControlType<T> | LayoutBannerControlType<T> | SwatchesLinkControlType<T> | VariantSwatchesPresetControlType<T> | VariantSwatchesOnlyDefaultVariantControlType<T> | ProductListControlType<T> | ArticleListControlType<T> | CollectionBannerControlType<T> | Ratio<T> | StickyDisplayControlType<T> | SyncProductPropertiesControlType<T> | StepsGuide<T> | ImageShape<T> | GridArrange<T> | SizeSetting$1<T> | ChildIconType<T> | DropdownInput<T> | Dropdown<T> | AliPickSectionControlType<T> | ParallaxScrollingType<T> | BackgroundColorPickerType<T> | PlayPauseControlType<T> | LayoutCustomSegmentControlType<T> | SneakPeakRange<T> | SneakPeakTypeControlType<T> | SneakPeakControlType<T> | ProductInputCurrencyUnitControlType<T> | TypographyPostPurchaseControlType<T> | ProductOffersControlType<T> | DiscountAndShippingFee<T> | PostPurchaseTextareaControlType<T> | NotesControlType<T> | ButtonLayoutType<T> | ShapeSelectorControlType<T> | CustomPositionControlType<T> | SneakPeakControlType<T> | PostPurchaseTextareaControlType<T> | DealControlType<T> | DisplayTriggerControlType<T>;
8057
8136
  type ControlTriggerAction = {
8058
8137
  controlId: string;
@@ -8124,6 +8203,7 @@ type ComponentSetting<P extends BaseProps> = {
8124
8203
  };
8125
8204
  };
8126
8205
  ui?: ControlUI[];
8206
+ uiV2?: SettingUIGroup[];
8127
8207
  presets?: ComponentPreset[];
8128
8208
  locales?: Record<string, any>;
8129
8209
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "1.48.0-dev.0",
3
+ "version": "1.48.0-dev.14",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -27,8 +27,8 @@
27
27
  "type-check": "yarn tsc --noEmit"
28
28
  },
29
29
  "devDependencies": {
30
- "@gem-sdk/adapter-shopify": "1.48.0-dev.0",
31
- "@gem-sdk/styles": "1.48.0-dev.0",
30
+ "@gem-sdk/adapter-shopify": "1.48.0-dev.3",
31
+ "@gem-sdk/styles": "1.48.0-dev.3",
32
32
  "@types/classnames": "^2.3.1"
33
33
  },
34
34
  "dependencies": {