@gem-sdk/components 2.0.0-staging.154 → 2.0.0-staging.159

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.
Files changed (48) hide show
  1. package/dist/cjs/banner/components/hero-banner/index.liquid.js +1 -1
  2. package/dist/cjs/builder.js +4 -0
  3. package/dist/cjs/index.js +4 -0
  4. package/dist/cjs/index.liquid.js +4 -0
  5. package/dist/cjs/post-purchase/product/components/ProductDiscountTag.js +5 -2
  6. package/dist/cjs/post-purchase/product/components/ProductOffer.js +16 -3
  7. package/dist/cjs/post-purchase/product/components/ProductPrice.js +3 -1
  8. package/dist/cjs/post-purchase/product/components/ProductPriceBreakdown.js +9 -21
  9. package/dist/cjs/post-purchase/product/constants/ProductOfferPlaceholder.js +149 -0
  10. package/dist/cjs/post-purchase/product/hooks/useDynamicProduct.js +28 -0
  11. package/dist/cjs/post-purchase/product/settings/ProductOffer.js +26 -0
  12. package/dist/cjs/product/components/ProductBundleDiscountItem.liquid.js +3 -3
  13. package/dist/cjs/third-party/components/EssentialAnnouncementBar.js +33 -0
  14. package/dist/cjs/third-party/components/EssentialAnnouncementBar.liquid.js +12 -0
  15. package/dist/cjs/third-party/components/EssentialCountdownTimerBar.js +33 -0
  16. package/dist/cjs/third-party/components/EssentialCountdownTimerBar.liquid.js +12 -0
  17. package/dist/cjs/third-party/configs/EssentialAnnouncementBar.js +12 -0
  18. package/dist/cjs/third-party/configs/EssentialCountdownTimerBar.js +12 -0
  19. package/dist/cjs/third-party/helpers/thirdParty.js +1 -1
  20. package/dist/cjs/third-party/next.js +10 -0
  21. package/dist/cjs/third-party/setting/EssentialAnnouncementBar.js +142 -0
  22. package/dist/cjs/third-party/setting/EssentialCountdownTimerBar.js +142 -0
  23. package/dist/cjs/third-party/setting/index.js +4 -0
  24. package/dist/esm/banner/components/hero-banner/index.liquid.js +1 -1
  25. package/dist/esm/builder.js +4 -0
  26. package/dist/esm/index.js +2 -0
  27. package/dist/esm/index.liquid.js +2 -0
  28. package/dist/esm/post-purchase/product/components/ProductDiscountTag.js +5 -2
  29. package/dist/esm/post-purchase/product/components/ProductOffer.js +16 -3
  30. package/dist/esm/post-purchase/product/components/ProductPrice.js +3 -1
  31. package/dist/esm/post-purchase/product/components/ProductPriceBreakdown.js +9 -21
  32. package/dist/esm/post-purchase/product/constants/ProductOfferPlaceholder.js +147 -0
  33. package/dist/esm/post-purchase/product/hooks/useDynamicProduct.js +26 -0
  34. package/dist/esm/post-purchase/product/settings/ProductOffer.js +26 -0
  35. package/dist/esm/product/components/ProductBundleDiscountItem.liquid.js +3 -3
  36. package/dist/esm/third-party/components/EssentialAnnouncementBar.js +29 -0
  37. package/dist/esm/third-party/components/EssentialAnnouncementBar.liquid.js +8 -0
  38. package/dist/esm/third-party/components/EssentialCountdownTimerBar.js +29 -0
  39. package/dist/esm/third-party/components/EssentialCountdownTimerBar.liquid.js +8 -0
  40. package/dist/esm/third-party/configs/EssentialAnnouncementBar.js +8 -0
  41. package/dist/esm/third-party/configs/EssentialCountdownTimerBar.js +8 -0
  42. package/dist/esm/third-party/helpers/thirdParty.js +1 -1
  43. package/dist/esm/third-party/next.js +10 -0
  44. package/dist/esm/third-party/setting/EssentialAnnouncementBar.js +138 -0
  45. package/dist/esm/third-party/setting/EssentialCountdownTimerBar.js +138 -0
  46. package/dist/esm/third-party/setting/index.js +206 -202
  47. package/dist/types/index.d.ts +38 -1
  48. package/package.json +2 -2
@@ -0,0 +1,26 @@
1
+ import { usePageStore } from '@gem-sdk/core';
2
+ import { useMemo } from 'react';
3
+
4
+ const useDynamicProduct = ()=>{
5
+ const dynamicDiscountOffer = usePageStore((s)=>s.dynamicDiscountOffer);
6
+ const isDynamicProduct = useMemo(()=>{
7
+ return !!dynamicDiscountOffer;
8
+ }, [
9
+ dynamicDiscountOffer
10
+ ]);
11
+ // false = No discount
12
+ const isEnableDynamicDiscount = useMemo(()=>{
13
+ return dynamicDiscountOffer?.isEnabled;
14
+ }, [
15
+ dynamicDiscountOffer
16
+ ]);
17
+ const dynamicPrice = '$???';
18
+ return {
19
+ isDynamicProduct,
20
+ dynamicPrice,
21
+ dynamicDiscount: dynamicDiscountOffer,
22
+ isEnableDynamicDiscount
23
+ };
24
+ };
25
+
26
+ export { useDynamicProduct };
@@ -180,6 +180,14 @@ const config = {
180
180
  }
181
181
  }
182
182
  },
183
+ {
184
+ id: 'dynamicOfferQuantity',
185
+ type: 'dynamic-offer-quantity',
186
+ min: 1,
187
+ max: 4,
188
+ default: 2,
189
+ isOnlyAcceptInteger: true
190
+ },
183
191
  {
184
192
  id: 'discountAndShippingFee',
185
193
  type: 'discount-and-shipping-fee-product-offer',
@@ -373,6 +381,24 @@ const config = {
373
381
  },
374
382
  layout: 'vertical'
375
383
  },
384
+ {
385
+ type: 'group',
386
+ label: {
387
+ en: 'Product offers'
388
+ },
389
+ controls: [
390
+ {
391
+ type: 'control',
392
+ label: {
393
+ en: 'Quantity'
394
+ },
395
+ setting: {
396
+ id: 'dynamicOfferQuantity'
397
+ }
398
+ }
399
+ ],
400
+ condition: 'false'
401
+ },
376
402
  {
377
403
  type: 'control',
378
404
  label: {
@@ -44,9 +44,9 @@ const ProductBundleDiscountItem = ({ children, parentSetting, parentStyles, inde
44
44
  return selected === i;
45
45
  };
46
46
  return template`
47
- <div
47
+ <gp-product-bundle-discount-item
48
48
  ${bundleItem}
49
- class="product-bundle-item cursor-pointer"
49
+ class="product-bundle-item cursor-pointer gp-block"
50
50
  style="${{
51
51
  ...sizeSettings.padding,
52
52
  ...makeStyleState('bg', parentStyles?.backgroundColor),
@@ -92,7 +92,7 @@ const ProductBundleDiscountItem = ({ children, parentSetting, parentStyles, inde
92
92
  ${children}
93
93
  </div>
94
94
  </div>
95
- </div>
95
+ </gp-product-bundle-discount-item>
96
96
  `;
97
97
  };
98
98
 
@@ -0,0 +1,29 @@
1
+ 'use client';
2
+ import { jsx, Fragment } from 'react/jsx-runtime';
3
+ import { makeStyleResponsive } from '@gem-sdk/core';
4
+ import ThirdPartyPreview from './ThirdPartyPreview.js';
5
+ import AppConfig from '../configs/EssentialAnnouncementBar.js';
6
+
7
+ const EssentialAnnouncementBarContent = ()=>{
8
+ return /*#__PURE__*/ jsx(Fragment, {
9
+ children: /*#__PURE__*/ jsx("div", {
10
+ className: "gp-p-2",
11
+ children: /*#__PURE__*/ jsx(ThirdPartyPreview, {
12
+ setting: {
13
+ label: 'Essential Announcement Bar',
14
+ iconSvg: `<img class="gp-w-6 gp-border gp-border-[#494949] gp-rounded-[3px]" src="${AppConfig.logoUrl}">`
15
+ }
16
+ })
17
+ })
18
+ });
19
+ };
20
+ const EssentialAnnouncementBar = ({ setting })=>{
21
+ return /*#__PURE__*/ jsx("div", {
22
+ style: {
23
+ ...makeStyleResponsive('ta', setting?.align)
24
+ },
25
+ children: /*#__PURE__*/ jsx(EssentialAnnouncementBarContent, {})
26
+ });
27
+ };
28
+
29
+ export { EssentialAnnouncementBar as default };
@@ -0,0 +1,8 @@
1
+ import { getLiquidForAppBlock } from '../helpers/thirdParty.js';
2
+
3
+ const EssentialAnnouncementBar = ({ setting, advanced })=>{
4
+ const { align, appBlockId } = setting ?? {};
5
+ return getLiquidForAppBlock(appBlockId, align, `${advanced?.cssClass ?? ''} !gp-block `);
6
+ };
7
+
8
+ export { EssentialAnnouncementBar as default };
@@ -0,0 +1,29 @@
1
+ 'use client';
2
+ import { jsx, Fragment } from 'react/jsx-runtime';
3
+ import { makeStyleResponsive } from '@gem-sdk/core';
4
+ import ThirdPartyPreview from './ThirdPartyPreview.js';
5
+ import AppConfig from '../configs/EssentialCountdownTimerBar.js';
6
+
7
+ const EssentialCountdownTimerBarContent = ()=>{
8
+ return /*#__PURE__*/ jsx(Fragment, {
9
+ children: /*#__PURE__*/ jsx("div", {
10
+ className: "gp-p-2",
11
+ children: /*#__PURE__*/ jsx(ThirdPartyPreview, {
12
+ setting: {
13
+ label: 'Essential Countdown Timer Bar',
14
+ iconSvg: `<img class="gp-w-6 gp-border gp-border-[#494949] gp-rounded-[3px]" src="${AppConfig.logoUrl}">`
15
+ }
16
+ })
17
+ })
18
+ });
19
+ };
20
+ const EssentialCountdownTimerBar = ({ setting })=>{
21
+ return /*#__PURE__*/ jsx("div", {
22
+ style: {
23
+ ...makeStyleResponsive('ta', setting?.align)
24
+ },
25
+ children: /*#__PURE__*/ jsx(EssentialCountdownTimerBarContent, {})
26
+ });
27
+ };
28
+
29
+ export { EssentialCountdownTimerBar as default };
@@ -0,0 +1,8 @@
1
+ import { getLiquidForAppBlock } from '../helpers/thirdParty.js';
2
+
3
+ const EssentialCountdownTimerBar = ({ setting, advanced })=>{
4
+ const { align, appBlockId } = setting ?? {};
5
+ return getLiquidForAppBlock(appBlockId, align, `${advanced?.cssClass ?? ''} !gp-block `);
6
+ };
7
+
8
+ export { EssentialCountdownTimerBar as default };
@@ -0,0 +1,8 @@
1
+ var AppConfig = {
2
+ id: 'essential-announcement-bar',
3
+ label: 'Essential Announcement Bar',
4
+ logoUrl: 'https://cdn.shopify.com/app-store/listing_images/15e8255158a042a1eab34a4c45c72aa5/icon/CMK1jPv9uoADEAE=.png',
5
+ tag: 'EssentialAnnouncementBar'
6
+ };
7
+
8
+ export { AppConfig as default };
@@ -0,0 +1,8 @@
1
+ var AppConfig = {
2
+ id: 'essential-countdown-timer-bar',
3
+ label: 'Essential Countdown Timer Bar',
4
+ logoUrl: 'https://cdn.shopify.com/app-store/listing_images/f84bf9e49eca8bd84c2af7488461363b/icon/CPzKxLTD4_UCEAE=.png',
5
+ tag: 'EssentialCountdownTimerBar'
6
+ };
7
+
8
+ export { AppConfig as default };
@@ -37,7 +37,7 @@ const getLiquidForAppBlock = (appBlockId, align, cssClass)=>{
37
37
  <div
38
38
  class="gp-flex gp-w-full gp-items-center ${cssClass}"
39
39
  style="${{
40
- ...makeStyleResponsive('ta', align)
40
+ ...makeStyleResponsive('jc', align)
41
41
  }}"
42
42
  >
43
43
  {% for block in app_blocks %}
@@ -4,6 +4,14 @@ import 'react/jsx-runtime';
4
4
  import 'react';
5
5
  import '@gem-sdk/core';
6
6
 
7
+ const EssentialAnnouncementBar = dynamic(()=>import('./components/EssentialAnnouncementBar.js'), {
8
+ ssr: false,
9
+ loading: Loading
10
+ });
11
+ const EssentialCountdownTimerBar = dynamic(()=>import('./components/EssentialCountdownTimerBar.js'), {
12
+ ssr: false,
13
+ loading: Loading
14
+ });
7
15
  const StellarDeliveryDatePickup = dynamic(()=>import('./components/StellarDeliveryDatePickup.js'), {
8
16
  ssr: false,
9
17
  loading: Loading
@@ -409,6 +417,8 @@ const Selleasy = dynamic(()=>import('./components/Selleasy.js'), {
409
417
  loading: Loading
410
418
  });
411
419
  var thirdParty = {
420
+ EssentialAnnouncementBar,
421
+ EssentialCountdownTimerBar,
412
422
  StellarDeliveryDatePickup,
413
423
  TrustshopProductReviews,
414
424
  HulkProductOptions,
@@ -0,0 +1,138 @@
1
+ import AppConfig from '../configs/EssentialAnnouncementBar.js';
2
+
3
+ const config = {
4
+ tag: AppConfig.tag,
5
+ label: AppConfig.label,
6
+ icon: '<img class="gp-w-6 gp-border gp-border-[#494949] gp-rounded-[3px]" src="https://cdn.shopify.com/app-store/listing_images/15e8255158a042a1eab34a4c45c72aa5/icon/CMK1jPv9uoADEAE=.png">',
7
+ editorConfigs: {
8
+ component: {
9
+ isThirdParty: true
10
+ }
11
+ },
12
+ presets: [
13
+ {
14
+ id: AppConfig.id,
15
+ name: {
16
+ en: AppConfig.label
17
+ },
18
+ hideTextContent: true,
19
+ icon: {
20
+ desktop: `<div class="w-full flex flex-col items-center">
21
+ <img class="w-24 border border-dark-200 rounded-medium" src="https://cdn.shopify.com/app-store/listing_images/15e8255158a042a1eab34a4c45c72aa5/icon/CMK1jPv9uoADEAE=.png">
22
+ <span class="preset-item-title">Essential Announcement Bar</span>
23
+ </div>`
24
+ },
25
+ components: [
26
+ {
27
+ tag: AppConfig.tag
28
+ }
29
+ ]
30
+ }
31
+ ],
32
+ settings: [
33
+ {
34
+ id: 'setting',
35
+ controls: [
36
+ {
37
+ id: 'appBlockId',
38
+ type: 'input',
39
+ default: ''
40
+ },
41
+ {
42
+ id: 'widgetType',
43
+ label: 'Choose widget',
44
+ type: 'select',
45
+ options: [
46
+ {
47
+ label: 'App Block',
48
+ value: 'app-block'
49
+ }
50
+ ],
51
+ default: 'app-block'
52
+ },
53
+ {
54
+ id: 'install',
55
+ type: 'open-link',
56
+ target: '_blank',
57
+ linkType: 'install',
58
+ href: 'https://apps.shopify.com/essential-announcement-bar?utm_source=gempages',
59
+ appName: AppConfig.label
60
+ },
61
+ {
62
+ id: 'announcementId',
63
+ type: 'input',
64
+ default: ''
65
+ },
66
+ {
67
+ id: 'openApp',
68
+ type: 'open-link',
69
+ target: '_blank',
70
+ linkType: 'openApp',
71
+ href: 'https://admin.shopify.com/?redirect=/apps/essential-announcement-bar',
72
+ appName: AppConfig.label
73
+ },
74
+ {
75
+ id: 'align',
76
+ label: 'Alignment',
77
+ type: 'segment',
78
+ options: [
79
+ {
80
+ label: 'Left',
81
+ value: 'left',
82
+ type: 'align'
83
+ },
84
+ {
85
+ label: 'Center',
86
+ value: 'center',
87
+ type: 'align'
88
+ },
89
+ {
90
+ label: 'Right',
91
+ value: 'right',
92
+ type: 'align'
93
+ }
94
+ ],
95
+ devices: {
96
+ desktop: {
97
+ default: 'left'
98
+ }
99
+ }
100
+ }
101
+ ]
102
+ }
103
+ ],
104
+ ui: [
105
+ {
106
+ type: 'control',
107
+ setting: {
108
+ id: 'install'
109
+ }
110
+ },
111
+ {
112
+ type: 'control',
113
+ label: {
114
+ en: 'Announcement id'
115
+ },
116
+ setting: {
117
+ id: 'announcementId'
118
+ }
119
+ },
120
+ {
121
+ type: 'control',
122
+ setting: {
123
+ id: 'openApp'
124
+ }
125
+ },
126
+ {
127
+ type: 'control',
128
+ label: {
129
+ en: 'Align'
130
+ },
131
+ setting: {
132
+ id: 'align'
133
+ }
134
+ }
135
+ ]
136
+ };
137
+
138
+ export { config as default };
@@ -0,0 +1,138 @@
1
+ import AppConfig from '../configs/EssentialCountdownTimerBar.js';
2
+
3
+ const config = {
4
+ tag: AppConfig.tag,
5
+ label: AppConfig.label,
6
+ icon: '<img class="gp-w-6 gp-border gp-border-[#494949] gp-rounded-[3px]" src="https://cdn.shopify.com/app-store/listing_images/f84bf9e49eca8bd84c2af7488461363b/icon/CPzKxLTD4_UCEAE=.png">',
7
+ editorConfigs: {
8
+ component: {
9
+ isThirdParty: true
10
+ }
11
+ },
12
+ presets: [
13
+ {
14
+ id: AppConfig.id,
15
+ name: {
16
+ en: AppConfig.label
17
+ },
18
+ hideTextContent: true,
19
+ icon: {
20
+ desktop: `<div class="w-full flex flex-col items-center">
21
+ <img class="w-24 border border-dark-200 rounded-medium" src="https://cdn.shopify.com/app-store/listing_images/f84bf9e49eca8bd84c2af7488461363b/icon/CPzKxLTD4_UCEAE=.png">
22
+ <span class="preset-item-title">Essential Countdown Timer Bar</span>
23
+ </div>`
24
+ },
25
+ components: [
26
+ {
27
+ tag: AppConfig.tag
28
+ }
29
+ ]
30
+ }
31
+ ],
32
+ settings: [
33
+ {
34
+ id: 'setting',
35
+ controls: [
36
+ {
37
+ id: 'appBlockId',
38
+ type: 'input',
39
+ default: ''
40
+ },
41
+ {
42
+ id: 'widgetType',
43
+ label: 'Choose widget',
44
+ type: 'select',
45
+ options: [
46
+ {
47
+ label: 'App Block',
48
+ value: 'app-block'
49
+ }
50
+ ],
51
+ default: 'app-block'
52
+ },
53
+ {
54
+ id: 'install',
55
+ type: 'open-link',
56
+ target: '_blank',
57
+ linkType: 'install',
58
+ href: 'https://apps.shopify.com/essential-countdown-timer?utm_source=gempages',
59
+ appName: AppConfig.label
60
+ },
61
+ {
62
+ id: 'timerId',
63
+ type: 'input',
64
+ default: ''
65
+ },
66
+ {
67
+ id: 'openApp',
68
+ type: 'open-link',
69
+ target: '_blank',
70
+ linkType: 'openApp',
71
+ href: 'https://admin.shopify.com/?redirect=/apps/countdown-timer-30',
72
+ appName: AppConfig.label
73
+ },
74
+ {
75
+ id: 'align',
76
+ label: 'Alignment',
77
+ type: 'segment',
78
+ options: [
79
+ {
80
+ label: 'Left',
81
+ value: 'left',
82
+ type: 'align'
83
+ },
84
+ {
85
+ label: 'Center',
86
+ value: 'center',
87
+ type: 'align'
88
+ },
89
+ {
90
+ label: 'Right',
91
+ value: 'right',
92
+ type: 'align'
93
+ }
94
+ ],
95
+ devices: {
96
+ desktop: {
97
+ default: 'left'
98
+ }
99
+ }
100
+ }
101
+ ]
102
+ }
103
+ ],
104
+ ui: [
105
+ {
106
+ type: 'control',
107
+ setting: {
108
+ id: 'install'
109
+ }
110
+ },
111
+ {
112
+ type: 'control',
113
+ label: {
114
+ en: 'Timer id'
115
+ },
116
+ setting: {
117
+ id: 'timerId'
118
+ }
119
+ },
120
+ {
121
+ type: 'control',
122
+ setting: {
123
+ id: 'openApp'
124
+ }
125
+ },
126
+ {
127
+ type: 'control',
128
+ label: {
129
+ en: 'Align'
130
+ },
131
+ setting: {
132
+ id: 'align'
133
+ }
134
+ }
135
+ ]
136
+ };
137
+
138
+ export { config as default };