@gem-sdk/components 2.0.0-dev.274 → 2.0.0-dev.277

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 (148) hide show
  1. package/dist/cjs/article/components/ArticleReadMore.js +2 -4
  2. package/dist/cjs/banner/components/HeroBannerItem.liquid.js +5 -5
  3. package/dist/cjs/builder.js +17 -21
  4. package/dist/cjs/button/components/Button.js +111 -184
  5. package/dist/cjs/button/components/Button.liquid.js +108 -171
  6. package/dist/cjs/button/components/ButtonIcon.js +17 -0
  7. package/dist/cjs/button/components/ButtonIcon.liquid.js +16 -0
  8. package/dist/cjs/button/components/ButtonLabel.js +18 -0
  9. package/dist/cjs/button/components/ButtonLabel.liquid.js +15 -0
  10. package/dist/cjs/button/components/ButtonLoadingIndicator.liquid.js +12 -0
  11. package/dist/cjs/button/components/common/attributes.js +15 -0
  12. package/dist/cjs/button/components/common/classes.js +55 -0
  13. package/dist/cjs/button/components/common/constants.js +26 -0
  14. package/dist/cjs/button/components/common/data.js +76 -0
  15. package/dist/cjs/button/components/common/helpers.js +131 -0
  16. package/dist/cjs/button/components/common/styles.js +157 -0
  17. package/dist/cjs/button/next.js +2 -6
  18. package/dist/cjs/button/setting/configs/settings.js +5 -1
  19. package/dist/cjs/cart/components/CheckoutNow.js +0 -2
  20. package/dist/cjs/cart/components/ShopPayButton/ShopPayButton.js +70 -0
  21. package/dist/cjs/cart/components/ShopPayButton/ShopPayButton.liquid.js +71 -0
  22. package/dist/cjs/cart/components/ShopPayButton/common/classes.js +18 -0
  23. package/dist/cjs/cart/components/ShopPayButton/common/helpers.js +31 -0
  24. package/dist/cjs/cart/components/ShopPayButton/common/styles.js +12 -0
  25. package/dist/cjs/cart/components/ShopPayButton/hooks/useShopPayButton.js +70 -0
  26. package/dist/cjs/cart/next.js +1 -1
  27. package/dist/cjs/coupon/components/Coupon.js +1 -3
  28. package/dist/cjs/dialog/setting/Dialog.js +7 -580
  29. package/dist/cjs/dialog/setting/configs/settings.js +325 -0
  30. package/dist/cjs/dialog/setting/configs/uiV1.js +288 -0
  31. package/dist/cjs/dialog/setting/configs/uiV2.js +258 -0
  32. package/dist/cjs/estimate-delivery/components/EstimateDate.liquid.js +4 -4
  33. package/dist/cjs/form/components/submit-button/SubmitButton.js +0 -4
  34. package/dist/cjs/header/components/kind/basic/index.js +1 -1
  35. package/dist/cjs/header/components/kind/modern/index.js +1 -1
  36. package/dist/cjs/index.js +41 -43
  37. package/dist/cjs/index.liquid.js +10 -12
  38. package/dist/cjs/product/components/DynamicCheckout/DynamicCheckout.js +25 -0
  39. package/dist/cjs/product/components/DynamicCheckout/DynamicCheckout.liquid.js +23 -0
  40. package/dist/cjs/product/components/DynamicCheckout/common/classes.js +32 -0
  41. package/dist/cjs/product/components/DynamicCheckout/common/styles.js +181 -0
  42. package/dist/cjs/product/components/DynamicCheckout/components/Button.liquid.js +58 -0
  43. package/dist/cjs/product/components/DynamicCheckout.js +2 -5
  44. package/dist/cjs/product/components/FileUpload/components/common/index.js +2 -2
  45. package/dist/cjs/product/components/ProductButton.js +2 -3
  46. package/dist/cjs/product/components/ProductButton.liquid.js +3 -3
  47. package/dist/cjs/product/components/ProductDescription/common/const.js +9 -0
  48. package/dist/cjs/product/components/ProductDescription/common/getClasses.js +30 -0
  49. package/dist/cjs/product/components/ProductDescription/common/getStyle.js +81 -0
  50. package/dist/cjs/product/components/ProductDescription/hooks/useGpDescription.js +90 -0
  51. package/dist/cjs/product/components/ProductDescription/index.js +115 -0
  52. package/dist/cjs/product/components/ProductDescription/index.liquid.js +85 -0
  53. package/dist/cjs/product/components/ProductViewMore.js +2 -5
  54. package/dist/cjs/product/components/ProductViewMore.liquid.js +2 -2
  55. package/dist/cjs/product/next.js +1 -1
  56. package/dist/cjs/setting.js +3 -3
  57. package/dist/cjs/text/components/common/getClasses.js +1 -1
  58. package/dist/cjs/third-party/components/PushOwl.js +0 -5
  59. package/dist/esm/article/components/ArticleReadMore.js +1 -3
  60. package/dist/esm/banner/components/HeroBannerItem.liquid.js +5 -5
  61. package/dist/esm/builder.js +4 -8
  62. package/dist/esm/button/components/Button.js +113 -186
  63. package/dist/esm/button/components/Button.liquid.js +109 -172
  64. package/dist/esm/button/components/ButtonIcon.js +13 -0
  65. package/dist/esm/button/components/ButtonIcon.liquid.js +12 -0
  66. package/dist/esm/button/components/ButtonLabel.js +14 -0
  67. package/dist/esm/button/components/ButtonLabel.liquid.js +11 -0
  68. package/dist/esm/button/components/ButtonLoadingIndicator.liquid.js +8 -0
  69. package/dist/esm/button/components/common/attributes.js +13 -0
  70. package/dist/esm/button/components/common/classes.js +49 -0
  71. package/dist/esm/button/components/common/constants.js +24 -0
  72. package/dist/esm/button/components/common/data.js +74 -0
  73. package/dist/esm/button/components/common/helpers.js +118 -0
  74. package/dist/esm/button/components/common/styles.js +148 -0
  75. package/dist/esm/button/next.js +2 -6
  76. package/dist/esm/button/setting/configs/settings.js +5 -1
  77. package/dist/esm/cart/components/CheckoutNow.js +0 -2
  78. package/dist/esm/cart/components/ShopPayButton/ShopPayButton.js +66 -0
  79. package/dist/esm/cart/components/ShopPayButton/ShopPayButton.liquid.js +67 -0
  80. package/dist/esm/cart/components/ShopPayButton/common/classes.js +15 -0
  81. package/dist/esm/cart/components/ShopPayButton/common/helpers.js +27 -0
  82. package/dist/esm/cart/components/ShopPayButton/common/styles.js +10 -0
  83. package/dist/esm/cart/components/ShopPayButton/hooks/useShopPayButton.js +68 -0
  84. package/dist/esm/cart/next.js +1 -1
  85. package/dist/esm/coupon/components/Coupon.js +1 -3
  86. package/dist/esm/dialog/setting/Dialog.js +7 -580
  87. package/dist/esm/dialog/setting/configs/settings.js +323 -0
  88. package/dist/esm/dialog/setting/configs/uiV1.js +286 -0
  89. package/dist/esm/dialog/setting/configs/uiV2.js +256 -0
  90. package/dist/esm/estimate-delivery/components/EstimateDate.liquid.js +4 -4
  91. package/dist/esm/form/components/submit-button/SubmitButton.js +0 -4
  92. package/dist/esm/header/components/kind/basic/index.js +1 -1
  93. package/dist/esm/header/components/kind/modern/index.js +1 -1
  94. package/dist/esm/index.js +4 -5
  95. package/dist/esm/index.liquid.js +4 -5
  96. package/dist/esm/product/components/DynamicCheckout/DynamicCheckout.js +21 -0
  97. package/dist/esm/product/components/DynamicCheckout/DynamicCheckout.liquid.js +19 -0
  98. package/dist/esm/product/components/DynamicCheckout/common/classes.js +30 -0
  99. package/dist/esm/product/components/DynamicCheckout/common/styles.js +179 -0
  100. package/dist/esm/product/components/DynamicCheckout/components/Button.liquid.js +54 -0
  101. package/dist/esm/product/components/DynamicCheckout.js +1 -4
  102. package/dist/esm/product/components/FileUpload/components/common/index.js +2 -2
  103. package/dist/esm/product/components/ProductButton.js +1 -2
  104. package/dist/esm/product/components/ProductButton.liquid.js +1 -1
  105. package/dist/esm/product/components/ProductDescription/common/const.js +6 -0
  106. package/dist/esm/product/components/ProductDescription/common/getClasses.js +27 -0
  107. package/dist/esm/product/components/ProductDescription/common/getStyle.js +77 -0
  108. package/dist/esm/product/components/ProductDescription/hooks/useGpDescription.js +88 -0
  109. package/dist/esm/product/components/ProductDescription/index.js +111 -0
  110. package/dist/esm/product/components/ProductDescription/index.liquid.js +81 -0
  111. package/dist/esm/product/components/ProductViewMore.js +1 -4
  112. package/dist/esm/product/components/ProductViewMore.liquid.js +1 -1
  113. package/dist/esm/product/next.js +1 -1
  114. package/dist/esm/setting.js +3 -3
  115. package/dist/esm/text/components/common/getClasses.js +1 -1
  116. package/dist/esm/third-party/components/PushOwl.js +0 -5
  117. package/dist/types/index.d.ts +200 -360
  118. package/package.json +2 -2
  119. package/dist/cjs/button/components/v2/ButtonIcon.js +0 -18
  120. package/dist/cjs/button/components/v2/ButtonLabel.js +0 -25
  121. package/dist/cjs/button/components/v2/ButtonV2.js +0 -140
  122. package/dist/cjs/button/components/v2/ButtonV2.liquid.js +0 -181
  123. package/dist/cjs/button/hooks/useButtonCustomCss.js +0 -88
  124. package/dist/cjs/button/hooks/useButtonStyles.js +0 -93
  125. package/dist/cjs/cart/components/ShopPayButton/ShopPayButtonCommon.js +0 -20
  126. package/dist/cjs/cart/components/ShopPayButton/index.js +0 -113
  127. package/dist/cjs/cart/components/ShopPayButton/index.liquid.js +0 -51
  128. package/dist/cjs/product/components/DynamicCheckout.liquid.js +0 -250
  129. package/dist/cjs/product/components/ProductDescription/const.js +0 -5
  130. package/dist/cjs/product/components/ProductDescription.js +0 -172
  131. package/dist/cjs/product/components/ProductDescription.liquid.js +0 -120
  132. package/dist/esm/button/components/v2/ButtonIcon.js +0 -14
  133. package/dist/esm/button/components/v2/ButtonLabel.js +0 -21
  134. package/dist/esm/button/components/v2/ButtonV2.js +0 -136
  135. package/dist/esm/button/components/v2/ButtonV2.liquid.js +0 -177
  136. package/dist/esm/button/hooks/useButtonCustomCss.js +0 -84
  137. package/dist/esm/button/hooks/useButtonStyles.js +0 -91
  138. package/dist/esm/cart/components/ShopPayButton/ShopPayButtonCommon.js +0 -17
  139. package/dist/esm/cart/components/ShopPayButton/index.js +0 -109
  140. package/dist/esm/cart/components/ShopPayButton/index.liquid.js +0 -47
  141. package/dist/esm/product/components/DynamicCheckout.liquid.js +0 -246
  142. package/dist/esm/product/components/ProductDescription/const.js +0 -3
  143. package/dist/esm/product/components/ProductDescription.js +0 -168
  144. package/dist/esm/product/components/ProductDescription.liquid.js +0 -116
  145. /package/dist/cjs/button/components/{v2/ButtonLoadingIndicator.js → ButtonLoadingIndicator.js} +0 -0
  146. /package/dist/cjs/product/components/ProductDescription/{common.js → common/getMaxHeight.js} +0 -0
  147. /package/dist/esm/button/components/{v2/ButtonLoadingIndicator.js → ButtonLoadingIndicator.js} +0 -0
  148. /package/dist/esm/product/components/ProductDescription/{common.js → common/getMaxHeight.js} +0 -0
@@ -0,0 +1,10 @@
1
+ import { makeStyleResponsive } from '@gem-sdk/core';
2
+
3
+ const getButtonWrapperStyles = (style, styles)=>{
4
+ return {
5
+ ...style,
6
+ ...makeStyleResponsive('jc', styles?.align)
7
+ };
8
+ };
9
+
10
+ export { getButtonWrapperStyles };
@@ -0,0 +1,68 @@
1
+ import { useEditorMode, useQuantity, useCartData, useCurrentVariant, useShopStore, useCurrentVariantInStock } from '@gem-sdk/core';
2
+ import { useMemo } from 'react';
3
+ import { getStoreUrl, getIdFromGid } from '../common/helpers.js';
4
+
5
+ const useShopPayButton = (setting)=>{
6
+ const mode = useEditorMode();
7
+ const { quantity } = useQuantity();
8
+ const { data: cartData } = useCartData();
9
+ const currentVariant = useCurrentVariant();
10
+ const storefrontUrl = useShopStore((s)=>s.storefrontUrl);
11
+ const isCurrentVariantInStock = useCurrentVariantInStock();
12
+ const storeUrl = getStoreUrl(storefrontUrl);
13
+ const idsInCart = useMemo(()=>{
14
+ const items = cartData?.lineItems.map((v)=>({
15
+ id: v.variantId,
16
+ quantity: v.quantity
17
+ }))?.reduce((prev, curr)=>{
18
+ const bareId = getIdFromGid(curr?.id);
19
+ if (bareId) {
20
+ prev.push(`${bareId}:${curr?.quantity ?? 1}`);
21
+ }
22
+ return prev;
23
+ }, []);
24
+ return items;
25
+ }, [
26
+ cartData?.lineItems
27
+ ]);
28
+ const variants = useMemo(()=>{
29
+ if (setting?.kind === 'cart-buy') {
30
+ return idsInCart;
31
+ }
32
+ if (currentVariant?.baseID && isCurrentVariantInStock && quantity) {
33
+ return [
34
+ `${getIdFromGid(currentVariant.baseID)}:${quantity}`
35
+ ];
36
+ }
37
+ return undefined;
38
+ }, [
39
+ setting?.kind,
40
+ currentVariant?.baseID,
41
+ isCurrentVariantInStock,
42
+ quantity,
43
+ idsInCart
44
+ ]);
45
+ const payUrl = `${storeUrl}/cart/${variants?.join(',')}?payment=shop_pay`;
46
+ const handleOnPay = ({ inputWidth = 600, inputHeight = 600 })=>{
47
+ if (mode === 'edit') return;
48
+ if (setting?.openMode === 'popup') {
49
+ const dualScreenLeft = window.screenLeft !== undefined ? window.screenLeft : window.screenX;
50
+ const dualScreenTop = window.screenTop !== undefined ? window.screenTop : window.screenY;
51
+ const width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width;
52
+ const height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height;
53
+ const systemZoom = width / window.screen.availWidth;
54
+ const left = (width - inputWidth) / 2 / systemZoom + dualScreenLeft;
55
+ const top = (height - inputHeight) / 2 / systemZoom + dualScreenTop;
56
+ window.open(payUrl, 'shop_pay', `scrollbars=yes, width=${inputWidth / systemZoom}, height=${inputHeight / systemZoom}, top=${top}, left=${left}`);
57
+ } else {
58
+ !!payUrl && window.open(payUrl);
59
+ }
60
+ };
61
+ return {
62
+ storeUrl,
63
+ variants,
64
+ handleOnPay
65
+ };
66
+ };
67
+
68
+ export { useShopPayButton };
@@ -47,7 +47,7 @@ const CouponList = dynamic(()=>import('./components/CouponList.js'), {
47
47
  const CheckoutNow = dynamic(()=>import('./components/CheckoutNow.js'), {
48
48
  loading: Loading
49
49
  });
50
- const ShopPayButton = dynamic(()=>import('./components/ShopPayButton/index.js'), {
50
+ const ShopPayButton = dynamic(()=>import('./components/ShopPayButton/ShopPayButton.js'), {
51
51
  ssr: false,
52
52
  loading: Loading
53
53
  });
@@ -1,10 +1,8 @@
1
1
  'use client';
2
2
  import { jsx, Fragment } from 'react/jsx-runtime';
3
3
  import { useEditorMode } from '@gem-sdk/core';
4
- import 'next/head';
5
- import { useState } from 'react';
6
- import 'next/link';
7
4
  import Button from '../../button/components/Button.js';
5
+ import { useState } from 'react';
8
6
 
9
7
  const Coupon = ({ setting, builderProps, builderAttrs, style, styles, advanced, children })=>{
10
8
  const mode = useEditorMode();
@@ -1,3 +1,7 @@
1
+ import { DialogSettings } from './configs/settings.js';
2
+ import { SettingUIV1 } from './configs/uiV1.js';
3
+ import { SettingUIV2 } from './configs/uiV2.js';
4
+
1
5
  const config = {
2
6
  tag: 'Dialog',
3
7
  label: 'Popup',
@@ -5,586 +9,9 @@ const config = {
5
9
  <path fill-rule="evenodd" clip-rule="evenodd" d="M9.33855 2C7.16052 2 5.39488 3.76561 5.39488 5.94361V22.6611C5.39488 24.8391 7.16052 26.6047 9.33855 26.6047H26.0563C28.2344 26.6047 30 24.8391 30 22.6611V5.94361C30 3.76562 28.2344 2 26.0563 2H9.33855ZM7.36672 5.94361C7.36672 4.85461 8.24954 3.97181 9.33855 3.97181H26.0563C27.1453 3.97181 28.0282 4.85461 28.0282 5.94361V22.6611C28.0282 23.7501 27.1453 24.6329 26.0563 24.6329H9.33855C8.24954 24.6329 7.36672 23.7501 7.36672 22.6611V5.94361ZM14.8586 18.7057C14.6808 18.7945 14.4833 18.8365 14.2848 18.8275C14.0863 18.8186 13.8933 18.7591 13.7243 18.6546C13.5552 18.5502 13.4157 18.4043 13.3188 18.2307C13.222 18.0572 13.1711 17.8618 13.171 17.6631V10.9411C13.1711 10.7424 13.222 10.547 13.3188 10.3735C13.4157 10.2 13.5552 10.0541 13.7243 9.94962C13.8933 9.84517 14.0863 9.78566 14.2848 9.77672C14.4833 9.76778 14.6808 9.80971 14.8586 9.89853L21.5807 13.2595C21.7741 13.3565 21.9368 13.5054 22.0505 13.6895C22.1641 13.8736 22.2243 14.0857 22.2243 14.3021C22.2243 14.5185 22.1641 14.7306 22.0505 14.9148C21.9368 15.0989 21.7741 15.2477 21.5807 15.3447L14.8586 18.7057ZM2.98592 9.92188C3.53043 9.92188 3.97184 10.3633 3.97184 10.9078V27.6213C3.97184 27.6933 4.00246 27.7827 4.09987 27.8693C4.19908 27.9575 4.35638 28.0282 4.55284 28.0282H23.3559C23.9004 28.0282 24.3418 28.4696 24.3418 29.0141C24.3418 29.5586 23.9004 30 23.3559 30H4.55284C3.25532 30 2 29.041 2 27.6213V10.9078C2 10.3633 2.44141 9.92188 2.98592 9.92188Z" fill="white"/>
6
10
  </svg>
7
11
  `,
8
- settings: [
9
- {
10
- id: 'setting',
11
- controls: [
12
- {
13
- id: 'closeButtonPosition',
14
- type: 'segment',
15
- options: [
16
- {
17
- label: 'Inside',
18
- value: 'inside'
19
- },
20
- {
21
- label: 'Outside',
22
- value: 'outside'
23
- }
24
- ],
25
- default: 'inside'
26
- },
27
- {
28
- id: 'position',
29
- type: 'position:square',
30
- default: 'center'
31
- },
32
- {
33
- id: 'effectType',
34
- type: 'select',
35
- options: [
36
- {
37
- label: 'Fade',
38
- value: 'fade'
39
- },
40
- {
41
- label: 'Zoom',
42
- value: 'zoom'
43
- },
44
- {
45
- label: 'Zoom out',
46
- value: 'zoom-out'
47
- },
48
- {
49
- label: 'Horizontal move',
50
- value: 'horizontal'
51
- },
52
- {
53
- label: 'Vertical move',
54
- value: 'vertical'
55
- },
56
- {
57
- label: '3d Unfold',
58
- value: 'unfold'
59
- },
60
- {
61
- label: 'None',
62
- value: 'none'
63
- }
64
- ],
65
- default: 'fade'
66
- },
67
- {
68
- id: 'closeOnClickOutside',
69
- type: 'toggle',
70
- default: true
71
- },
72
- {
73
- id: 'name',
74
- type: 'input',
75
- placeholder: 'E.g. New popup',
76
- emptyOnClear: true
77
- },
78
- {
79
- id: 'width',
80
- type: 'input:unit',
81
- placeholder: 'Auto',
82
- units: [
83
- 'px',
84
- '%'
85
- ],
86
- devices: {
87
- desktop: {
88
- default: '600px'
89
- },
90
- mobile: {
91
- default: '100%'
92
- }
93
- }
94
- },
95
- {
96
- id: 'height',
97
- type: 'input:unit',
98
- placeholder: 'Auto',
99
- units: [
100
- 'px',
101
- '%'
102
- ],
103
- devices: {
104
- desktop: {
105
- default: undefined
106
- }
107
- }
108
- },
109
- {
110
- id: 'fullScreen',
111
- type: 'toggle',
112
- devices: {
113
- desktop: {
114
- default: false
115
- }
116
- }
117
- },
118
- {
119
- id: 'isOverlay',
120
- type: 'toggle',
121
- default: true
122
- },
123
- {
124
- id: 'overlayColor',
125
- type: 'colorpicker',
126
- default: '#121212'
127
- },
128
- {
129
- id: 'overlayOpacity',
130
- type: 'range',
131
- min: 0,
132
- step: 1,
133
- max: 100,
134
- default: 70,
135
- units: [
136
- '%'
137
- ],
138
- useOnlyUnitInit: true
139
- },
140
- {
141
- id: 'triggerTime',
142
- type: 'range',
143
- min: 0,
144
- default: 10,
145
- max: 100,
146
- units: [
147
- 's'
148
- ],
149
- useOnlyUnitInit: true
150
- },
151
- {
152
- id: 'triggerPercentage',
153
- type: 'range',
154
- units: [
155
- '%'
156
- ],
157
- min: 0,
158
- max: 100,
159
- default: 10,
160
- useOnlyUnitInit: true
161
- },
162
- {
163
- id: 'frequency',
164
- type: 'range',
165
- min: 1,
166
- max: 30,
167
- default: 3,
168
- units: [
169
- 'days'
170
- ],
171
- useOnlyUnitInit: true
172
- },
173
- {
174
- id: 'frequencyMode',
175
- type: 'select',
176
- options: [
177
- {
178
- label: 'Once per user',
179
- value: 'once'
180
- },
181
- {
182
- label: 'Each visit time',
183
- value: 'every'
184
- },
185
- {
186
- label: 'After a time',
187
- value: 'after-period-time'
188
- }
189
- ],
190
- default: 'once'
191
- },
192
- {
193
- id: 'btnSize',
194
- type: 'input:number',
195
- default: 32
196
- },
197
- {
198
- id: 'iconSize',
199
- type: 'input:unit',
200
- units: [
201
- 'px'
202
- ],
203
- default: '12px'
204
- },
205
- {
206
- id: 'btnBg',
207
- type: 'colorpicker',
208
- default: '#ffffff'
209
- },
210
- {
211
- id: 'btnColor',
212
- type: 'colorpicker',
213
- default: 'line-3'
214
- },
215
- {
216
- id: 'trigger',
217
- type: 'select',
218
- options: [
219
- {
220
- label: 'None',
221
- value: 'none'
222
- },
223
- {
224
- label: 'After loaded',
225
- value: 'show-on-page-load'
226
- },
227
- {
228
- label: 'After a time',
229
- value: 'show-after-time'
230
- },
231
- {
232
- label: 'Scroll partially',
233
- value: 'show-after-scroll'
234
- },
235
- {
236
- label: 'About to exit',
237
- value: 'show-when-about-exit'
238
- }
239
- ],
240
- default: 'none'
241
- },
242
- {
243
- id: 'mobileTrigger',
244
- type: 'select',
245
- options: [
246
- {
247
- label: 'None',
248
- value: 'none'
249
- },
250
- {
251
- label: 'Timer',
252
- value: 'timer'
253
- }
254
- ],
255
- default: 'none'
256
- },
257
- {
258
- id: 'mobileTriggerTime',
259
- type: 'range',
260
- min: 0,
261
- default: 10,
262
- max: 100,
263
- units: [
264
- 's'
265
- ],
266
- useOnlyUnitInit: true
267
- },
268
- {
269
- id: 'btnRounded',
270
- type: 'radius-preset',
271
- default: {
272
- radiusType: 'none'
273
- }
274
- },
275
- {
276
- id: 'background',
277
- type: 'background',
278
- ignoreReRender: true,
279
- allowBackgroundImageAndVideo: false,
280
- devices: {
281
- desktop: {
282
- default: {
283
- type: 'color',
284
- color: '#FFFFFF',
285
- image: {
286
- src: '',
287
- width: 0,
288
- height: 0
289
- },
290
- size: 'cover',
291
- position: {
292
- x: 50,
293
- y: 50
294
- },
295
- repeat: 'no-repeat',
296
- attachment: 'scroll'
297
- }
298
- }
299
- }
300
- }
301
- ]
302
- }
303
- ],
304
- ui: [
305
- {
306
- type: 'group',
307
- label: {
308
- en: 'Display'
309
- },
310
- controls: [
311
- {
312
- type: 'control',
313
- label: {
314
- en: 'Name'
315
- },
316
- setting: {
317
- id: 'name'
318
- }
319
- },
320
- {
321
- type: 'control',
322
- label: {
323
- en: 'Show when'
324
- },
325
- setting: {
326
- id: 'trigger'
327
- }
328
- },
329
- {
330
- type: 'control',
331
- condition: `trigger === 'show-after-time'`,
332
- label: {
333
- en: 'Time'
334
- },
335
- setting: {
336
- id: 'triggerTime'
337
- }
338
- },
339
- {
340
- type: 'control',
341
- condition: `trigger === 'show-after-scroll'`,
342
- label: {
343
- en: 'Scroll'
344
- },
345
- setting: {
346
- id: 'triggerPercentage'
347
- }
348
- },
349
- {
350
- type: 'control',
351
- condition: `trigger === 'show-when-about-exit'`,
352
- label: {
353
- en: 'On mobile'
354
- },
355
- setting: {
356
- id: 'mobileTrigger'
357
- }
358
- },
359
- {
360
- type: 'control',
361
- condition: `trigger === 'show-when-about-exit' && mobileTrigger === 'timer'`,
362
- label: {
363
- en: 'After load'
364
- },
365
- setting: {
366
- id: 'mobileTriggerTime'
367
- }
368
- }
369
- ]
370
- },
371
- {
372
- type: 'group',
373
- label: {
374
- en: 'Show frequency'
375
- },
376
- controls: [
377
- {
378
- type: 'control',
379
- label: {
380
- en: 'Show mode'
381
- },
382
- setting: {
383
- id: 'frequencyMode'
384
- }
385
- },
386
- {
387
- type: 'control',
388
- condition: `frequencyMode === 'after-period-time'`,
389
- label: {
390
- en: 'Display time'
391
- },
392
- setting: {
393
- id: 'frequency'
394
- }
395
- }
396
- ]
397
- },
398
- {
399
- type: 'group',
400
- label: {
401
- en: 'Button close popup'
402
- },
403
- controls: [
404
- {
405
- type: 'control',
406
- setting: {
407
- id: 'closeButtonPosition'
408
- },
409
- label: {
410
- en: 'Position'
411
- }
412
- },
413
- {
414
- type: 'control',
415
- label: {
416
- en: 'Background'
417
- },
418
- setting: {
419
- id: 'btnBg'
420
- }
421
- },
422
- {
423
- type: 'control',
424
- label: {
425
- en: 'Color'
426
- },
427
- setting: {
428
- id: 'btnColor'
429
- }
430
- },
431
- {
432
- type: 'control',
433
- label: {
434
- en: 'Corner'
435
- },
436
- setting: {
437
- id: 'btnRounded'
438
- }
439
- },
440
- {
441
- type: 'control',
442
- label: {
443
- en: 'Button size'
444
- },
445
- setting: {
446
- id: 'btnSize'
447
- }
448
- },
449
- {
450
- type: 'control',
451
- label: {
452
- en: 'Icon size'
453
- },
454
- setting: {
455
- id: 'iconSize'
456
- }
457
- }
458
- ]
459
- },
460
- {
461
- type: 'group',
462
- label: {
463
- en: 'Size'
464
- },
465
- controls: [
466
- {
467
- type: 'control',
468
- label: {
469
- en: 'Full screen'
470
- },
471
- setting: {
472
- id: 'fullScreen'
473
- }
474
- },
475
- {
476
- type: 'control',
477
- condition: `!fullScreen`,
478
- label: {
479
- en: 'Width'
480
- },
481
- setting: {
482
- id: 'width'
483
- }
484
- },
485
- {
486
- type: 'control',
487
- condition: `!fullScreen`,
488
- label: {
489
- en: 'Height'
490
- },
491
- setting: {
492
- id: 'height'
493
- }
494
- }
495
- ]
496
- },
497
- {
498
- type: 'control',
499
- label: {
500
- en: 'Background'
501
- },
502
- options: {
503
- label: 'large',
504
- styleLabel: {
505
- marginBottom: '4px'
506
- }
507
- },
508
- setting: {
509
- id: 'background'
510
- },
511
- layout: 'vertical'
512
- },
513
- {
514
- type: 'group',
515
- controls: [
516
- {
517
- type: 'control',
518
- label: {
519
- en: 'Overlay'
520
- },
521
- options: {
522
- label: 'large'
523
- },
524
- setting: {
525
- id: 'isOverlay'
526
- }
527
- },
528
- {
529
- type: 'control',
530
- condition: `isOverlay === true`,
531
- label: {
532
- en: 'Color'
533
- },
534
- setting: {
535
- id: 'overlayColor'
536
- }
537
- },
538
- {
539
- type: 'control',
540
- condition: `isOverlay === true`,
541
- label: {
542
- en: 'Opacity'
543
- },
544
- setting: {
545
- id: 'overlayOpacity'
546
- }
547
- },
548
- {
549
- type: 'control',
550
- condition: `isOverlay === true`,
551
- label: {
552
- en: 'Click overlay to close popup'
553
- },
554
- setting: {
555
- id: 'closeOnClickOutside'
556
- },
557
- options: {
558
- styleControl: {
559
- width: 'auto'
560
- }
561
- }
562
- }
563
- ]
564
- },
565
- {
566
- type: 'control',
567
- setting: {
568
- id: 'position'
569
- },
570
- options: {
571
- labelPosition: 'start'
572
- },
573
- label: {
574
- en: 'Position'
575
- },
576
- condition: `!fullScreen`
577
- },
578
- {
579
- type: 'control',
580
- setting: {
581
- id: 'effectType'
582
- },
583
- label: {
584
- en: 'Effect'
585
- }
586
- }
587
- ],
12
+ settings: DialogSettings,
13
+ ui: SettingUIV1,
14
+ uiV2: SettingUIV2,
588
15
  presets: [
589
16
  {
590
17
  id: 'popup',