@selwise/widget 0.0.1 → 0.0.2

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 (101) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +71 -0
  3. package/dist/npm/cjs/modules/contract/recommendation-contract.js +1 -1
  4. package/dist/npm/cjs/modules/contract/search-contract.js +1 -1
  5. package/dist/npm/cjs/modules/contract/tracking-contract.js +1 -1
  6. package/dist/npm/cjs/modules/contract/vendor/recommendation-contract/configs.js +164 -0
  7. package/dist/npm/cjs/modules/contract/vendor/recommendation-contract/configs.js.map +1 -0
  8. package/dist/npm/cjs/modules/contract/vendor/recommendation-contract/index.js +21 -0
  9. package/dist/npm/cjs/modules/contract/vendor/recommendation-contract/index.js.map +1 -0
  10. package/dist/npm/cjs/modules/contract/vendor/recommendation-contract/types.js +3 -0
  11. package/dist/npm/cjs/modules/contract/vendor/recommendation-contract/types.js.map +1 -0
  12. package/dist/npm/cjs/modules/contract/vendor/recommendation-contract/validators.js +107 -0
  13. package/dist/npm/cjs/modules/contract/vendor/recommendation-contract/validators.js.map +1 -0
  14. package/dist/npm/cjs/modules/contract/vendor/search-contract/configs.js +404 -0
  15. package/dist/npm/cjs/modules/contract/vendor/search-contract/configs.js.map +1 -0
  16. package/dist/npm/cjs/modules/contract/vendor/search-contract/index.js +21 -0
  17. package/dist/npm/cjs/modules/contract/vendor/search-contract/index.js.map +1 -0
  18. package/dist/npm/cjs/modules/contract/vendor/search-contract/types.js +8 -0
  19. package/dist/npm/cjs/modules/contract/vendor/search-contract/types.js.map +1 -0
  20. package/dist/npm/cjs/modules/contract/vendor/search-contract/validators.js +126 -0
  21. package/dist/npm/cjs/modules/contract/vendor/search-contract/validators.js.map +1 -0
  22. package/dist/npm/cjs/modules/contract/vendor/tracking-contract/configs.js +133 -0
  23. package/dist/npm/cjs/modules/contract/vendor/tracking-contract/configs.js.map +1 -0
  24. package/dist/npm/cjs/modules/contract/vendor/tracking-contract/index.js +21 -0
  25. package/dist/npm/cjs/modules/contract/vendor/tracking-contract/index.js.map +1 -0
  26. package/dist/npm/cjs/modules/contract/vendor/tracking-contract/types.js +3 -0
  27. package/dist/npm/cjs/modules/contract/vendor/tracking-contract/types.js.map +1 -0
  28. package/dist/npm/cjs/modules/contract/vendor/tracking-contract/validators.js +154 -0
  29. package/dist/npm/cjs/modules/contract/vendor/tracking-contract/validators.js.map +1 -0
  30. package/dist/npm/cjs/modules/contract/vendor/widget-contract/configs.js +1481 -0
  31. package/dist/npm/cjs/modules/contract/vendor/widget-contract/configs.js.map +1 -0
  32. package/dist/npm/cjs/modules/contract/vendor/widget-contract/index.js +22 -0
  33. package/dist/npm/cjs/modules/contract/vendor/widget-contract/index.js.map +1 -0
  34. package/dist/npm/cjs/modules/contract/vendor/widget-contract/layout.js +21 -0
  35. package/dist/npm/cjs/modules/contract/vendor/widget-contract/layout.js.map +1 -0
  36. package/dist/npm/cjs/modules/contract/vendor/widget-contract/types.js +8 -0
  37. package/dist/npm/cjs/modules/contract/vendor/widget-contract/types.js.map +1 -0
  38. package/dist/npm/cjs/modules/contract/vendor/widget-contract/validators.js +139 -0
  39. package/dist/npm/cjs/modules/contract/vendor/widget-contract/validators.js.map +1 -0
  40. package/dist/npm/cjs/modules/contract/widget-contract.js +1 -1
  41. package/dist/npm/esm/modules/contract/recommendation-contract.d.ts +2 -2
  42. package/dist/npm/esm/modules/contract/recommendation-contract.js +1 -1
  43. package/dist/npm/esm/modules/contract/search-contract.d.ts +1 -1
  44. package/dist/npm/esm/modules/contract/search-contract.js +1 -1
  45. package/dist/npm/esm/modules/contract/tracking-contract.d.ts +1 -1
  46. package/dist/npm/esm/modules/contract/tracking-contract.js +1 -1
  47. package/dist/npm/esm/modules/contract/vendor/recommendation-contract/configs.d.ts +8 -0
  48. package/dist/npm/esm/modules/contract/vendor/recommendation-contract/configs.js +160 -0
  49. package/dist/npm/esm/modules/contract/vendor/recommendation-contract/configs.js.map +1 -0
  50. package/dist/npm/esm/modules/contract/vendor/recommendation-contract/index.d.ts +3 -0
  51. package/dist/npm/esm/modules/contract/vendor/recommendation-contract/index.js +5 -0
  52. package/dist/npm/esm/modules/contract/vendor/recommendation-contract/index.js.map +1 -0
  53. package/dist/npm/esm/modules/contract/vendor/recommendation-contract/types.d.ts +56 -0
  54. package/dist/npm/esm/modules/contract/vendor/recommendation-contract/types.js +2 -0
  55. package/dist/npm/esm/modules/contract/vendor/recommendation-contract/types.js.map +1 -0
  56. package/dist/npm/esm/modules/contract/vendor/recommendation-contract/validators.d.ts +3 -0
  57. package/dist/npm/esm/modules/contract/vendor/recommendation-contract/validators.js +103 -0
  58. package/dist/npm/esm/modules/contract/vendor/recommendation-contract/validators.js.map +1 -0
  59. package/dist/npm/esm/modules/contract/vendor/search-contract/configs.d.ts +35 -0
  60. package/dist/npm/esm/modules/contract/vendor/search-contract/configs.js +396 -0
  61. package/dist/npm/esm/modules/contract/vendor/search-contract/configs.js.map +1 -0
  62. package/dist/npm/esm/modules/contract/vendor/search-contract/index.d.ts +3 -0
  63. package/dist/npm/esm/modules/contract/vendor/search-contract/index.js +5 -0
  64. package/dist/npm/esm/modules/contract/vendor/search-contract/index.js.map +1 -0
  65. package/dist/npm/esm/modules/contract/vendor/search-contract/types.d.ts +119 -0
  66. package/dist/npm/esm/modules/contract/vendor/search-contract/types.js +7 -0
  67. package/dist/npm/esm/modules/contract/vendor/search-contract/types.js.map +1 -0
  68. package/dist/npm/esm/modules/contract/vendor/search-contract/validators.d.ts +22 -0
  69. package/dist/npm/esm/modules/contract/vendor/search-contract/validators.js +118 -0
  70. package/dist/npm/esm/modules/contract/vendor/search-contract/validators.js.map +1 -0
  71. package/dist/npm/esm/modules/contract/vendor/tracking-contract/configs.d.ts +7 -0
  72. package/dist/npm/esm/modules/contract/vendor/tracking-contract/configs.js +130 -0
  73. package/dist/npm/esm/modules/contract/vendor/tracking-contract/configs.js.map +1 -0
  74. package/dist/npm/esm/modules/contract/vendor/tracking-contract/index.d.ts +3 -0
  75. package/dist/npm/esm/modules/contract/vendor/tracking-contract/index.js +5 -0
  76. package/dist/npm/esm/modules/contract/vendor/tracking-contract/index.js.map +1 -0
  77. package/dist/npm/esm/modules/contract/vendor/tracking-contract/types.d.ts +37 -0
  78. package/dist/npm/esm/modules/contract/vendor/tracking-contract/types.js +2 -0
  79. package/dist/npm/esm/modules/contract/vendor/tracking-contract/types.js.map +1 -0
  80. package/dist/npm/esm/modules/contract/vendor/tracking-contract/validators.d.ts +6 -0
  81. package/dist/npm/esm/modules/contract/vendor/tracking-contract/validators.js +147 -0
  82. package/dist/npm/esm/modules/contract/vendor/tracking-contract/validators.js.map +1 -0
  83. package/dist/npm/esm/modules/contract/vendor/widget-contract/configs.d.ts +22 -0
  84. package/dist/npm/esm/modules/contract/vendor/widget-contract/configs.js +1472 -0
  85. package/dist/npm/esm/modules/contract/vendor/widget-contract/configs.js.map +1 -0
  86. package/dist/npm/esm/modules/contract/vendor/widget-contract/index.d.ts +4 -0
  87. package/dist/npm/esm/modules/contract/vendor/widget-contract/index.js +6 -0
  88. package/dist/npm/esm/modules/contract/vendor/widget-contract/index.js.map +1 -0
  89. package/dist/npm/esm/modules/contract/vendor/widget-contract/layout.d.ts +14 -0
  90. package/dist/npm/esm/modules/contract/vendor/widget-contract/layout.js +18 -0
  91. package/dist/npm/esm/modules/contract/vendor/widget-contract/layout.js.map +1 -0
  92. package/dist/npm/esm/modules/contract/vendor/widget-contract/types.d.ts +128 -0
  93. package/dist/npm/esm/modules/contract/vendor/widget-contract/types.js +7 -0
  94. package/dist/npm/esm/modules/contract/vendor/widget-contract/types.js.map +1 -0
  95. package/dist/npm/esm/modules/contract/vendor/widget-contract/validators.d.ts +11 -0
  96. package/dist/npm/esm/modules/contract/vendor/widget-contract/validators.js +132 -0
  97. package/dist/npm/esm/modules/contract/vendor/widget-contract/validators.js.map +1 -0
  98. package/dist/npm/esm/modules/contract/widget-contract.d.ts +1 -1
  99. package/dist/npm/esm/modules/contract/widget-contract.js +1 -1
  100. package/dist/npm/esm/selwise.js +2 -2
  101. package/package.json +25 -9
@@ -0,0 +1,1472 @@
1
+ // AUTO-GENERATED FROM packages/widget-contract/src/configs.ts. DO NOT EDIT DIRECTLY.
2
+ /**
3
+ * Unified Widget & Campaign Configurations
4
+ * Single source of truth for all widget/campaign configurations
5
+ *
6
+ * When adding a new widget type:
7
+ * 1. Add to WidgetType in types.ts
8
+ * 2. Add to WIDGET_TYPES below
9
+ * 3. Add content fields to TYPE_CONTENT_FIELDS
10
+ * 4. Add style sections to TYPE_STYLE_CONFIGS
11
+ * 5. Add to Prisma enum WidgetType (if DB storage needed)
12
+ */
13
+ // ===========================================
14
+ // WIDGET TYPES - Core type definitions
15
+ // ===========================================
16
+ export const WIDGET_TYPES = [
17
+ {
18
+ value: 'announcement_bar',
19
+ label: 'Announcement Bar',
20
+ description: 'Top or bottom bar for announcements',
21
+ icon: 'MessageSquare',
22
+ placementType: 'fixed',
23
+ placementOptions: ['top', 'bottom'],
24
+ },
25
+ {
26
+ value: 'inline_banner',
27
+ label: 'Inline Banner',
28
+ description: 'Banner inserted into page content',
29
+ icon: 'Layout',
30
+ placementType: 'selector',
31
+ },
32
+ {
33
+ value: 'floating_button',
34
+ label: 'Floating Button',
35
+ description: 'Fixed position floating action button',
36
+ icon: 'MousePointerClick',
37
+ placementType: 'fixed',
38
+ placementOptions: ['bottom-right', 'bottom-left', 'top-right', 'top-left'],
39
+ },
40
+ {
41
+ value: 'exit_intent_popup',
42
+ label: 'Exit Intent Popup',
43
+ description: 'Popup triggered when user tries to leave',
44
+ icon: 'LogOut',
45
+ placementType: 'fixed',
46
+ placementOptions: ['center'],
47
+ },
48
+ {
49
+ value: 'slide_in',
50
+ label: 'Slide In',
51
+ description: 'Panel that slides in from side or bottom',
52
+ icon: 'PanelRight',
53
+ placementType: 'fixed',
54
+ placementOptions: ['right', 'left', 'bottom'],
55
+ },
56
+ {
57
+ value: 'embedded_card',
58
+ label: 'Embedded Card',
59
+ description: 'Card inserted into page content',
60
+ icon: 'LayoutGrid',
61
+ placementType: 'selector',
62
+ },
63
+ {
64
+ value: 'sticky_footer',
65
+ label: 'Sticky Footer',
66
+ description: 'Fixed footer bar at bottom of page',
67
+ icon: 'PanelBottom',
68
+ placementType: 'fixed',
69
+ placementOptions: ['bottom'],
70
+ },
71
+ {
72
+ value: 'countdown_timer',
73
+ label: 'Countdown Timer',
74
+ description: 'Timer with countdown to end date',
75
+ icon: 'Timer',
76
+ placementType: 'fixed',
77
+ placementOptions: ['top', 'bottom'],
78
+ },
79
+ {
80
+ value: 'cookie_consent',
81
+ label: 'Cookie Consent',
82
+ description: 'GDPR compliant cookie consent banner',
83
+ icon: 'Shield',
84
+ placementType: 'fixed',
85
+ placementOptions: ['top', 'bottom', 'center-modal', 'bottom-left', 'bottom-right'],
86
+ },
87
+ {
88
+ value: 'custom',
89
+ label: 'Custom Widget',
90
+ description: 'Custom HTML/CSS widget',
91
+ icon: 'Code',
92
+ placementType: 'both',
93
+ placementOptions: ['top', 'bottom'],
94
+ },
95
+ {
96
+ value: 'product_view_count',
97
+ label: 'Product View Count',
98
+ description: 'Shows how many people viewed a product',
99
+ icon: 'Eye',
100
+ placementType: 'selector',
101
+ },
102
+ {
103
+ value: 'cart_count',
104
+ label: 'Cart Count',
105
+ description: 'Shows how many have product in cart',
106
+ icon: 'ShoppingCart',
107
+ placementType: 'selector',
108
+ },
109
+ {
110
+ value: 'newsletter',
111
+ label: 'Newsletter',
112
+ description: 'Email capture widget with consent-aware newsletter signup flow',
113
+ icon: 'Mail',
114
+ placementType: 'both',
115
+ placementOptions: ['bottom-right', 'bottom-left', 'center'],
116
+ },
117
+ ];
118
+ // Helper to get type config by value
119
+ export function getWidgetTypeConfig(type) {
120
+ return WIDGET_TYPES.find((t) => t.value === type);
121
+ }
122
+ // ===========================================
123
+ // CONTENT FIELDS - Fields per widget type
124
+ // ===========================================
125
+ export const TYPE_CONTENT_FIELDS = {
126
+ announcement_bar: [
127
+ {
128
+ field: 'text',
129
+ label: 'Announcement Text',
130
+ type: 'text',
131
+ placeholder: 'Free shipping on orders over $50!',
132
+ },
133
+ ...commonCtaFields(),
134
+ commonImageField({ label: 'Icon / Logo' }),
135
+ ],
136
+ inline_banner: [
137
+ ...commonTitleTextFields({
138
+ titlePlaceholder: 'Special Offer',
139
+ textPlaceholder: 'Limited time offer...',
140
+ }),
141
+ ...commonCtaFields({ buttonTextPlaceholder: 'Learn More' }),
142
+ commonImageField(),
143
+ ],
144
+ floating_button: [
145
+ { field: 'text', label: 'Button Text/Icon', type: 'text', placeholder: '💬' },
146
+ { field: 'tooltip', label: 'Tooltip', type: 'text', placeholder: 'Chat with us' },
147
+ { field: 'buttonUrl', label: 'Link URL', type: 'url', placeholder: 'https://...' },
148
+ ],
149
+ exit_intent_popup: [
150
+ ...commonTitleTextFields({
151
+ titlePlaceholder: 'Wait! Before you go...',
152
+ textLabel: 'Message',
153
+ textPlaceholder: 'Get 10% off your first order!',
154
+ }),
155
+ ...commonCtaFields({ buttonTextPlaceholder: 'Get Discount' }),
156
+ commonImageField(),
157
+ ],
158
+ slide_in: [
159
+ ...commonTitleTextFields({
160
+ titlePlaceholder: 'Special Offer',
161
+ textLabel: 'Message',
162
+ textPlaceholder: 'Subscribe to our newsletter...',
163
+ }),
164
+ ...commonCtaFields({ buttonTextPlaceholder: 'Subscribe' }),
165
+ commonImageField(),
166
+ ],
167
+ embedded_card: [
168
+ ...commonTitleTextFields({
169
+ titlePlaceholder: 'Featured Product',
170
+ textPlaceholder: 'Amazing product...',
171
+ }),
172
+ ...commonCtaFields({ buttonTextPlaceholder: 'View Details' }),
173
+ commonImageField(),
174
+ ],
175
+ sticky_footer: [
176
+ { field: 'text', label: 'Message', type: 'text', placeholder: 'Free shipping on all orders!' },
177
+ { field: 'subtext', label: 'Sub-text', type: 'text', placeholder: 'Limited time only' },
178
+ ...commonCtaFields(),
179
+ ],
180
+ countdown_timer: [
181
+ { field: 'title', label: 'Title', type: 'text', placeholder: 'Sale ends in:' },
182
+ { field: 'text', label: 'Sub-text', type: 'text', placeholder: 'Hurry! Limited stock' },
183
+ { field: 'endDate', label: 'End Date', type: 'datetime-local' },
184
+ ...commonCtaFields({ buttonTextPlaceholder: 'Shop Sale' }),
185
+ ],
186
+ cookie_consent: [
187
+ { field: 'headline', label: 'Headline', type: 'text', placeholder: 'We use cookies' },
188
+ {
189
+ field: 'text',
190
+ label: 'Description',
191
+ type: 'textarea',
192
+ placeholder: 'To improve your experience, we use cookies...',
193
+ },
194
+ { field: 'buttonText', label: 'Accept Button Text', type: 'text', placeholder: 'Accept All' },
195
+ {
196
+ field: 'declineButtonText',
197
+ label: 'Decline Button Text',
198
+ type: 'text',
199
+ placeholder: 'Decline',
200
+ },
201
+ {
202
+ field: 'customizeButtonText',
203
+ label: 'Customize Button Text',
204
+ type: 'text',
205
+ placeholder: 'Customize',
206
+ },
207
+ ],
208
+ custom: [
209
+ {
210
+ field: 'html',
211
+ label: 'Custom HTML',
212
+ type: 'textarea',
213
+ placeholder: '<div>Your custom HTML here...</div>',
214
+ },
215
+ { field: 'css', label: 'Custom CSS', type: 'textarea', placeholder: '.my-widget { ... }' },
216
+ ],
217
+ product_view_count: [
218
+ {
219
+ field: 'template',
220
+ label: 'Metin Şablonu',
221
+ type: 'select',
222
+ options: [
223
+ 'Bu ürünü son {timePeriod} içinde {count} kişi görüntüledi',
224
+ '{count} kişi bu ürünü görüntüledi',
225
+ 'Popüler! {count} görüntülenme',
226
+ 'Son {timePeriod}: {count} görüntüleme',
227
+ ],
228
+ placeholder: 'Select a template or customize below',
229
+ },
230
+ {
231
+ field: 'customText',
232
+ label: 'Özel Metin (şablonu geçersiz kılar)',
233
+ type: 'text',
234
+ placeholder: '{count}, {timePeriod} kullanın',
235
+ },
236
+ {
237
+ field: 'timePeriod',
238
+ label: 'Zaman Periyodu',
239
+ type: 'select',
240
+ options: ['1h', '24h', '7d', '30d'],
241
+ default: '24h',
242
+ },
243
+ {
244
+ field: 'showIcon',
245
+ label: 'İkon Göster',
246
+ type: 'checkbox',
247
+ default: true,
248
+ },
249
+ {
250
+ field: 'iconType',
251
+ label: 'İkon',
252
+ type: 'select',
253
+ options: ['eye', 'users', 'trending-up', 'flame'],
254
+ default: 'eye',
255
+ },
256
+ {
257
+ field: 'productId',
258
+ label: 'Ürün ID (SKU)',
259
+ type: 'text',
260
+ placeholder: 'Otomatik algılanır veya manuel girin',
261
+ required: false,
262
+ },
263
+ ],
264
+ cart_count: [
265
+ {
266
+ field: 'template',
267
+ label: 'Metin Şablonu',
268
+ type: 'select',
269
+ options: [
270
+ 'Bu ürün şu an {count} kişinin sepetinde',
271
+ '{count} kişi sepete ekledi',
272
+ 'Tükeniyor! Sadece {count} adet kaldı',
273
+ 'Şu an {count} kişi bunu istiyor',
274
+ ],
275
+ placeholder: 'Select a template or customize below',
276
+ },
277
+ {
278
+ field: 'customText',
279
+ label: 'Özel Metin (şablonu geçersiz kılar)',
280
+ type: 'text',
281
+ placeholder: '{count} kullanın',
282
+ },
283
+ {
284
+ field: 'metricType',
285
+ label: 'Metrik Türü',
286
+ type: 'select',
287
+ options: ['active_carts'],
288
+ default: 'active_carts',
289
+ },
290
+ {
291
+ field: 'showIcon',
292
+ label: 'İkon Göster',
293
+ type: 'checkbox',
294
+ default: true,
295
+ },
296
+ {
297
+ field: 'iconType',
298
+ label: 'İkon',
299
+ type: 'select',
300
+ options: ['shopping-cart', 'shopping-bag', 'users', 'fire'],
301
+ default: 'shopping-cart',
302
+ },
303
+ {
304
+ field: 'productId',
305
+ label: 'Ürün ID (SKU)',
306
+ type: 'text',
307
+ placeholder: 'Otomatik algılanır veya manuel girin',
308
+ required: false,
309
+ },
310
+ ],
311
+ newsletter: [
312
+ {
313
+ field: 'headline',
314
+ label: 'Headline',
315
+ type: 'text',
316
+ placeholder: 'Join our newsletter',
317
+ },
318
+ {
319
+ field: 'text',
320
+ label: 'Description',
321
+ type: 'textarea',
322
+ placeholder: 'Get product updates, launches, and growth tips.',
323
+ },
324
+ {
325
+ field: 'emailPlaceholder',
326
+ label: 'Email Placeholder',
327
+ type: 'text',
328
+ placeholder: 'you@example.com',
329
+ },
330
+ {
331
+ field: 'buttonText',
332
+ label: 'Button Text',
333
+ type: 'text',
334
+ placeholder: 'Subscribe',
335
+ },
336
+ {
337
+ field: 'successMessage',
338
+ label: 'Success Message',
339
+ type: 'text',
340
+ placeholder: 'Thanks! Please check your inbox to confirm.',
341
+ },
342
+ {
343
+ field: 'errorMessage',
344
+ label: 'Error Message',
345
+ type: 'text',
346
+ placeholder: 'Unable to subscribe right now. Please try again.',
347
+ },
348
+ ],
349
+ };
350
+ // ===========================================
351
+ // CONTENT FIELD FACTORIES
352
+ // ===========================================
353
+ /**
354
+ * Creates CTA (Call-to-Action) fields: buttonText + buttonUrl
355
+ */
356
+ function commonCtaFields(config) {
357
+ return [
358
+ {
359
+ field: 'buttonText',
360
+ label: config?.buttonTextLabel || 'Button Text',
361
+ type: 'text',
362
+ placeholder: config?.buttonTextPlaceholder || 'Shop Now',
363
+ },
364
+ {
365
+ field: 'buttonUrl',
366
+ label: config?.buttonUrlLabel || 'Button URL',
367
+ type: 'url',
368
+ placeholder: 'https://...',
369
+ },
370
+ ];
371
+ }
372
+ /**
373
+ * Creates a single image URL field
374
+ */
375
+ function commonImageField(config) {
376
+ return {
377
+ field: 'imageUrl',
378
+ label: config?.label || 'Image',
379
+ type: 'image-upload',
380
+ placeholder: config?.placeholder || 'https://...',
381
+ };
382
+ }
383
+ /**
384
+ * Creates title + text/description fields
385
+ */
386
+ function commonTitleTextFields(config) {
387
+ return [
388
+ {
389
+ field: 'title',
390
+ label: config?.titleLabel || 'Title',
391
+ type: 'text',
392
+ placeholder: config?.titlePlaceholder || 'Special Offer',
393
+ },
394
+ {
395
+ field: 'text',
396
+ label: config?.textLabel || 'Description',
397
+ type: 'textarea',
398
+ placeholder: config?.textPlaceholder || 'Limited time offer...',
399
+ },
400
+ ];
401
+ }
402
+ // ===========================================
403
+ // STYLE SECTION FACTORIES
404
+ // ===========================================
405
+ /**
406
+ * Creates a Colors section with standard color fields
407
+ */
408
+ function makeColorSection(config) {
409
+ const fields = [
410
+ {
411
+ key: 'backgroundColor',
412
+ label: 'Background Color',
413
+ type: 'color',
414
+ default: config.backgroundColor || '#1a1a1a',
415
+ },
416
+ {
417
+ key: 'textColor',
418
+ label: 'Text Color',
419
+ type: 'color',
420
+ default: config.textColor || '#ffffff',
421
+ },
422
+ {
423
+ key: 'buttonColor',
424
+ label: 'Button Color',
425
+ type: 'color',
426
+ default: config.buttonColor || '#ffffff',
427
+ },
428
+ {
429
+ key: 'buttonTextColor',
430
+ label: 'Button Text Color',
431
+ type: 'color',
432
+ default: config.buttonTextColor || '#1a1a1a',
433
+ },
434
+ ];
435
+ // Add extra colors if provided (e.g., declineButtonColor for cookie_consent)
436
+ if (config.extraColors) {
437
+ Object.entries(config.extraColors).forEach(([key, cfg]) => {
438
+ fields.push({ key, label: cfg.label, type: 'color', default: cfg.default });
439
+ });
440
+ }
441
+ return { title: 'Colors', fields };
442
+ }
443
+ /**
444
+ * Creates a Layout section with border radius and padding
445
+ */
446
+ function makeLayoutSection(config = {}) {
447
+ const fields = [];
448
+ if (config.includeRadius !== false) {
449
+ fields.push({
450
+ key: 'borderRadius',
451
+ label: 'Border Radius',
452
+ type: 'select',
453
+ options: config.borderRadiusOptions || ['0px', '4px', '8px', '12px', '16px'],
454
+ default: config.borderRadiusDefault || '8px',
455
+ });
456
+ }
457
+ fields.push({
458
+ key: 'padding',
459
+ label: 'Padding',
460
+ type: 'select',
461
+ options: config.paddingOptions || ['0px', '4px', '8px', '12px', '16px', '20px', '24px'],
462
+ default: config.paddingDefault || '16px',
463
+ });
464
+ if (config.extraFields) {
465
+ fields.push(...config.extraFields);
466
+ }
467
+ return { title: 'Layout', fields };
468
+ }
469
+ /**
470
+ * Creates an Effects section with shadow and border
471
+ */
472
+ function makeEffectsSection(config = {}) {
473
+ const fields = [];
474
+ if (config.includeShadow !== false) {
475
+ fields.push({
476
+ key: 'shadow',
477
+ label: 'Shadow',
478
+ type: 'select',
479
+ options: config.shadowOptions || ['none', 'sm', 'md', 'lg', 'xl'],
480
+ default: config.shadowDefault || 'md',
481
+ });
482
+ }
483
+ if (config.includeBorder !== false) {
484
+ fields.push({
485
+ key: config.borderKey || 'border',
486
+ label: config.borderLabel || 'Border',
487
+ type: 'text',
488
+ default: config.borderDefault || 'none',
489
+ placeholder: '1px solid #e5e7eb',
490
+ });
491
+ }
492
+ if (config.extraFields) {
493
+ fields.push(...config.extraFields);
494
+ }
495
+ return { title: 'Effects', fields };
496
+ }
497
+ /**
498
+ * Creates a Typography section with font size and weight
499
+ */
500
+ function makeTypographySection(config = {}) {
501
+ const fields = [
502
+ {
503
+ key: 'fontSize',
504
+ label: 'Font Size',
505
+ type: 'select',
506
+ options: config.fontSizeOptions || ['12px', '14px', '16px', '18px'],
507
+ default: config.fontSizeDefault || '14px',
508
+ },
509
+ {
510
+ key: 'fontWeight',
511
+ label: 'Font Weight',
512
+ type: 'select',
513
+ options: config.fontWeightOptions || ['normal', 'medium', 'semibold', 'bold'],
514
+ default: config.fontWeightDefault || 'medium',
515
+ },
516
+ ];
517
+ if (config.extraFields) {
518
+ fields.push(...config.extraFields);
519
+ }
520
+ return { title: 'Typography', fields };
521
+ }
522
+ /**
523
+ * Creates a Close Button section with toggle and color
524
+ */
525
+ function makeCloseButtonSection(config = {}) {
526
+ return {
527
+ title: 'Close Button',
528
+ fields: [
529
+ {
530
+ key: 'showCloseButton',
531
+ label: 'Show Close Button',
532
+ type: 'toggle',
533
+ default: config.showDefault ?? true,
534
+ },
535
+ {
536
+ key: 'closeButtonColor',
537
+ label: 'Close Button Color',
538
+ type: 'color',
539
+ default: config.colorDefault || '#ffffff',
540
+ },
541
+ ],
542
+ };
543
+ }
544
+ // ===========================================
545
+ // STYLE CONFIGS - Style sections per type
546
+ // ===========================================
547
+ export const TYPE_STYLE_CONFIGS = {
548
+ announcement_bar: [
549
+ makeColorSection({
550
+ backgroundColor: '#1a1a1a',
551
+ textColor: '#ffffff',
552
+ buttonColor: '#ffffff',
553
+ buttonTextColor: '#1a1a1a',
554
+ }),
555
+ makeTypographySection({ fontSizeDefault: '14px' }),
556
+ {
557
+ title: 'Layout',
558
+ fields: [
559
+ {
560
+ key: 'padding',
561
+ label: 'Padding',
562
+ type: 'select',
563
+ options: ['8px', '12px', '16px', '20px'],
564
+ default: '12px',
565
+ },
566
+ {
567
+ key: 'borderBottom',
568
+ label: 'Border Bottom',
569
+ type: 'text',
570
+ default: 'none',
571
+ placeholder: '1px solid #333',
572
+ },
573
+ ],
574
+ },
575
+ {
576
+ title: 'Image',
577
+ fields: [
578
+ {
579
+ key: 'imageSize',
580
+ label: 'Icon Size',
581
+ type: 'select',
582
+ options: ['20px', '24px', '28px', '32px', '40px'],
583
+ default: '24px',
584
+ },
585
+ {
586
+ key: 'imageBorderRadius',
587
+ label: 'Icon Radius',
588
+ type: 'select',
589
+ options: ['0px', '4px', '8px', '50%'],
590
+ default: '4px',
591
+ },
592
+ {
593
+ key: 'imageSpacing',
594
+ label: 'Icon Spacing',
595
+ type: 'select',
596
+ options: ['4px', '8px', '12px', '16px'],
597
+ default: '8px',
598
+ },
599
+ ],
600
+ },
601
+ makeCloseButtonSection(),
602
+ ],
603
+ inline_banner: [
604
+ makeColorSection({
605
+ backgroundColor: '#6366f1',
606
+ textColor: '#ffffff',
607
+ buttonColor: '#ffffff',
608
+ buttonTextColor: '#6366f1',
609
+ }),
610
+ makeLayoutSection({ paddingDefault: '16px' }),
611
+ makeEffectsSection({ shadowDefault: 'md' }),
612
+ {
613
+ title: 'Image',
614
+ fields: [
615
+ {
616
+ key: 'imageMode',
617
+ label: 'Image Mode',
618
+ type: 'select',
619
+ options: ['thumbnail', 'cover', 'fullWidth'],
620
+ default: 'thumbnail',
621
+ },
622
+ {
623
+ key: 'imageSize',
624
+ label: 'Thumbnail Size',
625
+ type: 'select',
626
+ options: ['40px', '48px', '60px', '80px', '128px'],
627
+ default: '60px',
628
+ condition: (styles) => styles.imageMode === 'thumbnail',
629
+ },
630
+ {
631
+ key: 'imageAspectRatio',
632
+ label: 'Aspect Ratio',
633
+ type: 'select',
634
+ options: ['auto', '16/9', '4/3', '1/1'],
635
+ default: 'auto',
636
+ condition: (styles) => styles.imageMode !== 'thumbnail',
637
+ },
638
+ {
639
+ key: 'imageObjectFit',
640
+ label: 'Object Fit',
641
+ type: 'select',
642
+ options: ['cover', 'contain', 'fill'],
643
+ default: 'cover',
644
+ },
645
+ {
646
+ key: 'imageBorderRadius',
647
+ label: 'Image Radius',
648
+ type: 'select',
649
+ options: ['0px', '4px', '8px', '50%'],
650
+ default: '8px',
651
+ },
652
+ ],
653
+ },
654
+ {
655
+ title: 'Content Layout',
656
+ fields: [
657
+ {
658
+ key: 'contentDirection',
659
+ label: 'Direction',
660
+ type: 'select',
661
+ options: ['row', 'column'],
662
+ default: 'row',
663
+ },
664
+ {
665
+ key: 'contentAlignment',
666
+ label: 'Alignment',
667
+ type: 'select',
668
+ options: ['left', 'center', 'right'],
669
+ default: 'left',
670
+ },
671
+ {
672
+ key: 'imageSpacing',
673
+ label: 'Image Spacing',
674
+ type: 'select',
675
+ options: ['0px', '8px', '12px', '16px', '24px'],
676
+ default: '16px',
677
+ },
678
+ ],
679
+ },
680
+ ],
681
+ floating_button: [
682
+ {
683
+ title: 'Colors',
684
+ fields: [
685
+ { key: 'backgroundColor', label: 'Background Color', type: 'color', default: '#6366f1' },
686
+ { key: 'textColor', label: 'Icon/Text Color', type: 'color', default: '#ffffff' },
687
+ ],
688
+ },
689
+ {
690
+ title: 'Size & Shape',
691
+ fields: [
692
+ {
693
+ key: 'size',
694
+ label: 'Button Size',
695
+ type: 'select',
696
+ options: ['48px', '56px', '64px', '72px'],
697
+ default: '56px',
698
+ },
699
+ {
700
+ key: 'borderRadius',
701
+ label: 'Border Radius',
702
+ type: 'select',
703
+ options: ['8px', '12px', '16px', '50%'],
704
+ default: '50%',
705
+ },
706
+ ],
707
+ },
708
+ makeEffectsSection({
709
+ shadowDefault: 'lg',
710
+ includeBorder: false,
711
+ extraFields: [
712
+ { key: 'pulseAnimation', label: 'Pulse Animation', type: 'toggle', default: false },
713
+ ],
714
+ }),
715
+ {
716
+ title: 'Tooltip',
717
+ fields: [
718
+ { key: 'tooltipBgColor', label: 'Tooltip Background', type: 'color', default: '#1a1a1a' },
719
+ { key: 'tooltipTextColor', label: 'Tooltip Text', type: 'color', default: '#ffffff' },
720
+ ],
721
+ },
722
+ ],
723
+ exit_intent_popup: [
724
+ makeColorSection({
725
+ backgroundColor: '#ffffff',
726
+ textColor: '#1a1a1a',
727
+ buttonColor: '#6366f1',
728
+ buttonTextColor: '#ffffff',
729
+ }),
730
+ {
731
+ title: 'Overlay',
732
+ fields: [
733
+ { key: 'overlayColor', label: 'Overlay Color', type: 'color', default: '#000000' },
734
+ {
735
+ key: 'overlayOpacity',
736
+ label: 'Overlay Opacity',
737
+ type: 'range',
738
+ min: 0,
739
+ max: 100,
740
+ step: 5,
741
+ default: 50,
742
+ },
743
+ {
744
+ key: 'overlayBlur',
745
+ label: 'Overlay Blur',
746
+ type: 'select',
747
+ options: ['none', '2px', '4px', '8px'],
748
+ default: 'none',
749
+ },
750
+ ],
751
+ },
752
+ {
753
+ title: 'Layout',
754
+ fields: [
755
+ {
756
+ key: 'maxWidth',
757
+ label: 'Max Width',
758
+ type: 'select',
759
+ options: ['320px', '400px', '480px', '560px'],
760
+ default: '400px',
761
+ },
762
+ {
763
+ key: 'padding',
764
+ label: 'Padding',
765
+ type: 'select',
766
+ options: ['16px', '20px', '24px', '32px'],
767
+ default: '24px',
768
+ },
769
+ {
770
+ key: 'borderRadius',
771
+ label: 'Border Radius',
772
+ type: 'select',
773
+ options: ['0px', '8px', '12px', '16px', '24px'],
774
+ default: '12px',
775
+ },
776
+ ],
777
+ },
778
+ {
779
+ title: 'Image',
780
+ fields: [
781
+ {
782
+ key: 'imageMode',
783
+ label: 'Image Mode',
784
+ type: 'select',
785
+ options: ['thumbnail', 'cover', 'fullWidth'],
786
+ default: 'cover',
787
+ },
788
+ {
789
+ key: 'imageSize',
790
+ label: 'Thumbnail Size',
791
+ type: 'select',
792
+ options: ['48px', '60px', '80px', '120px'],
793
+ default: '80px',
794
+ condition: (styles) => styles.imageMode === 'thumbnail',
795
+ },
796
+ {
797
+ key: 'imagePosition',
798
+ label: 'Image Position',
799
+ type: 'select',
800
+ options: ['top', 'bottom', 'left', 'right'],
801
+ default: 'top',
802
+ },
803
+ {
804
+ key: 'imageAspectRatio',
805
+ label: 'Aspect Ratio',
806
+ type: 'select',
807
+ options: ['auto', '16/9', '4/3', '1/1'],
808
+ default: 'auto',
809
+ },
810
+ {
811
+ key: 'imageObjectFit',
812
+ label: 'Object Fit',
813
+ type: 'select',
814
+ options: ['cover', 'contain', 'fill'],
815
+ default: 'cover',
816
+ },
817
+ {
818
+ key: 'imageBorderRadius',
819
+ label: 'Image Radius',
820
+ type: 'select',
821
+ options: ['0px', '4px', '8px', '12px'],
822
+ default: '8px',
823
+ condition: (styles) => styles.imageMode !== 'fullWidth',
824
+ },
825
+ ],
826
+ },
827
+ {
828
+ title: 'Animation',
829
+ fields: [
830
+ {
831
+ key: 'animation',
832
+ label: 'Animation',
833
+ type: 'select',
834
+ options: ['none', 'fade', 'scale', 'slide'],
835
+ default: 'scale',
836
+ },
837
+ {
838
+ key: 'shadow',
839
+ label: 'Shadow',
840
+ type: 'select',
841
+ options: ['none', 'lg', 'xl', '2xl'],
842
+ default: '2xl',
843
+ },
844
+ ],
845
+ },
846
+ ],
847
+ slide_in: [
848
+ makeColorSection({
849
+ backgroundColor: '#ffffff',
850
+ textColor: '#1a1a1a',
851
+ buttonColor: '#6366f1',
852
+ buttonTextColor: '#ffffff',
853
+ }),
854
+ {
855
+ title: 'Layout',
856
+ fields: [
857
+ {
858
+ key: 'width',
859
+ label: 'Width',
860
+ type: 'select',
861
+ options: ['280px', '320px', '360px', '400px'],
862
+ default: '320px',
863
+ },
864
+ {
865
+ key: 'padding',
866
+ label: 'Padding',
867
+ type: 'select',
868
+ options: ['12px', '16px', '20px', '24px'],
869
+ default: '16px',
870
+ },
871
+ {
872
+ key: 'borderRadius',
873
+ label: 'Border Radius',
874
+ type: 'select',
875
+ options: ['0px', '8px', '12px', '16px'],
876
+ default: '12px',
877
+ },
878
+ ],
879
+ },
880
+ {
881
+ title: 'Image',
882
+ fields: [
883
+ {
884
+ key: 'imageMode',
885
+ label: 'Image Mode',
886
+ type: 'select',
887
+ options: ['cover', 'contain', 'fullWidth'],
888
+ default: 'cover',
889
+ },
890
+ {
891
+ key: 'imageAspectRatio',
892
+ label: 'Aspect Ratio',
893
+ type: 'select',
894
+ options: ['auto', '16/9', '4/3', '1/1', '3/4'],
895
+ default: 'auto',
896
+ },
897
+ {
898
+ key: 'imageObjectFit',
899
+ label: 'Object Fit',
900
+ type: 'select',
901
+ options: ['cover', 'contain', 'fill'],
902
+ default: 'cover',
903
+ },
904
+ {
905
+ key: 'imageBorderRadius',
906
+ label: 'Image Radius',
907
+ type: 'select',
908
+ options: ['0px', '4px', '8px', '12px'],
909
+ default: '8px',
910
+ condition: (styles) => styles.imageMode !== 'fullWidth',
911
+ },
912
+ ],
913
+ },
914
+ makeEffectsSection({ shadowDefault: 'xl', shadowOptions: ['none', 'lg', 'xl', '2xl'] }),
915
+ {
916
+ title: 'Position',
917
+ fields: [
918
+ {
919
+ key: 'offsetX',
920
+ label: 'Horizontal Offset',
921
+ type: 'select',
922
+ options: ['8px', '12px', '16px', '24px'],
923
+ default: '16px',
924
+ },
925
+ {
926
+ key: 'offsetY',
927
+ label: 'Vertical Offset',
928
+ type: 'select',
929
+ options: ['8px', '12px', '16px', '24px'],
930
+ default: '16px',
931
+ },
932
+ ],
933
+ },
934
+ ],
935
+ embedded_card: [
936
+ makeColorSection({
937
+ backgroundColor: '#ffffff',
938
+ textColor: '#1a1a1a',
939
+ buttonColor: '#6366f1',
940
+ buttonTextColor: '#ffffff',
941
+ }),
942
+ makeLayoutSection({ borderRadiusDefault: '12px', paddingDefault: '16px' }),
943
+ makeEffectsSection({ shadowDefault: 'md', borderDefault: '1px solid #e5e7eb' }),
944
+ {
945
+ title: 'Image',
946
+ fields: [
947
+ {
948
+ key: 'imageMode',
949
+ label: 'Image Mode',
950
+ type: 'select',
951
+ options: ['cover', 'contain', 'fullWidth'],
952
+ default: 'cover',
953
+ },
954
+ {
955
+ key: 'imageAspectRatio',
956
+ label: 'Aspect Ratio',
957
+ type: 'select',
958
+ options: ['auto', '16/9', '4/3', '1/1', '3/4'],
959
+ default: '16/9',
960
+ },
961
+ {
962
+ key: 'imageObjectFit',
963
+ label: 'Object Fit',
964
+ type: 'select',
965
+ options: ['cover', 'contain', 'fill'],
966
+ default: 'cover',
967
+ },
968
+ {
969
+ key: 'imagePosition',
970
+ label: 'Image Position',
971
+ type: 'select',
972
+ options: ['top', 'bottom'],
973
+ default: 'top',
974
+ },
975
+ {
976
+ key: 'imageBorderRadius',
977
+ label: 'Image Radius',
978
+ type: 'select',
979
+ options: ['0px', '8px', '12px'],
980
+ default: '8px',
981
+ condition: (styles) => styles.imageMode !== 'fullWidth',
982
+ },
983
+ ],
984
+ },
985
+ {
986
+ title: 'Content Layout',
987
+ fields: [
988
+ {
989
+ key: 'contentAlignment',
990
+ label: 'Alignment',
991
+ type: 'select',
992
+ options: ['left', 'center', 'right'],
993
+ default: 'left',
994
+ },
995
+ ],
996
+ },
997
+ ],
998
+ sticky_footer: [
999
+ makeColorSection({
1000
+ backgroundColor: '#1a1a1a',
1001
+ textColor: '#ffffff',
1002
+ buttonColor: '#ffffff',
1003
+ buttonTextColor: '#1a1a1a',
1004
+ }),
1005
+ {
1006
+ title: 'Layout',
1007
+ fields: [
1008
+ {
1009
+ key: 'padding',
1010
+ label: 'Padding',
1011
+ type: 'select',
1012
+ options: ['8px', '12px', '16px', '20px'],
1013
+ default: '12px',
1014
+ },
1015
+ {
1016
+ key: 'fontSize',
1017
+ label: 'Font Size',
1018
+ type: 'select',
1019
+ options: ['12px', '14px', '16px'],
1020
+ default: '14px',
1021
+ },
1022
+ ],
1023
+ },
1024
+ makeEffectsSection({
1025
+ shadowDefault: 'lg',
1026
+ shadowOptions: ['none', 'sm', 'md', 'lg'],
1027
+ borderKey: 'borderTop',
1028
+ borderLabel: 'Border Top',
1029
+ borderDefault: 'none',
1030
+ }),
1031
+ makeCloseButtonSection(),
1032
+ ],
1033
+ countdown_timer: [
1034
+ makeColorSection({
1035
+ backgroundColor: '#dc2626',
1036
+ textColor: '#ffffff',
1037
+ buttonColor: '#ffffff',
1038
+ buttonTextColor: '#dc2626',
1039
+ }),
1040
+ {
1041
+ title: 'Timer Style',
1042
+ fields: [
1043
+ {
1044
+ key: 'timerBgColor',
1045
+ label: 'Timer Background',
1046
+ type: 'color',
1047
+ default: 'rgba(255,255,255,0.2)',
1048
+ },
1049
+ {
1050
+ key: 'timerFontSize',
1051
+ label: 'Timer Font Size',
1052
+ type: 'select',
1053
+ options: ['14px', '16px', '18px', '20px'],
1054
+ default: '16px',
1055
+ },
1056
+ {
1057
+ key: 'timerFontWeight',
1058
+ label: 'Timer Font Weight',
1059
+ type: 'select',
1060
+ options: ['normal', 'medium', 'semibold', 'bold'],
1061
+ default: 'bold',
1062
+ },
1063
+ ],
1064
+ },
1065
+ {
1066
+ title: 'Layout',
1067
+ fields: [
1068
+ {
1069
+ key: 'padding',
1070
+ label: 'Padding',
1071
+ type: 'select',
1072
+ options: ['8px', '12px', '16px'],
1073
+ default: '12px',
1074
+ },
1075
+ {
1076
+ key: 'separatorStyle',
1077
+ label: 'Separator Style',
1078
+ type: 'select',
1079
+ options: ['colon', 'dot', 'slash', 'none'],
1080
+ default: 'colon',
1081
+ },
1082
+ ],
1083
+ },
1084
+ ],
1085
+ cookie_consent: [
1086
+ makeColorSection({
1087
+ backgroundColor: '#1f2937',
1088
+ textColor: '#f3f4f6',
1089
+ buttonColor: '#3b82f6',
1090
+ buttonTextColor: '#ffffff',
1091
+ extraColors: {
1092
+ declineButtonColor: { label: 'Decline Button Color', default: '#6b7280' },
1093
+ declineButtonTextColor: { label: 'Decline Button Text Color', default: '#ffffff' },
1094
+ customizeButtonColor: { label: 'Customize Button Color', default: '#4b5563' },
1095
+ customizeButtonTextColor: { label: 'Customize Button Text Color', default: '#ffffff' },
1096
+ linkColor: { label: 'Link Color', default: '#60a5fa' },
1097
+ },
1098
+ }),
1099
+ {
1100
+ title: 'Layout',
1101
+ fields: [
1102
+ {
1103
+ key: 'padding',
1104
+ label: 'Padding',
1105
+ type: 'select',
1106
+ options: ['12px', '16px', '20px', '24px'],
1107
+ default: '16px',
1108
+ },
1109
+ {
1110
+ key: 'borderRadius',
1111
+ label: 'Border Radius',
1112
+ type: 'select',
1113
+ options: ['0px', '4px', '8px', '12px', '16px'],
1114
+ default: '8px',
1115
+ },
1116
+ {
1117
+ key: 'shadow',
1118
+ label: 'Shadow',
1119
+ type: 'select',
1120
+ options: ['none', 'sm', 'md', 'lg'],
1121
+ default: 'lg',
1122
+ },
1123
+ {
1124
+ key: 'maxWidth',
1125
+ label: 'Max Width',
1126
+ type: 'select',
1127
+ options: ['400px', '600px', '800px', '1200px', 'none'],
1128
+ default: 'none',
1129
+ },
1130
+ ],
1131
+ },
1132
+ {
1133
+ title: 'Typography',
1134
+ fields: [
1135
+ {
1136
+ key: 'headlineFontSize',
1137
+ label: 'Headline Font Size',
1138
+ type: 'select',
1139
+ options: ['14px', '16px', '18px', '20px', '24px'],
1140
+ default: '18px',
1141
+ },
1142
+ {
1143
+ key: 'headlineFontWeight',
1144
+ label: 'Headline Font Weight',
1145
+ type: 'select',
1146
+ options: ['normal', 'medium', 'semibold', 'bold'],
1147
+ default: 'semibold',
1148
+ },
1149
+ {
1150
+ key: 'textFontSize',
1151
+ label: 'Text Font Size',
1152
+ type: 'select',
1153
+ options: ['12px', '14px', '16px'],
1154
+ default: '14px',
1155
+ },
1156
+ {
1157
+ key: 'buttonFontSize',
1158
+ label: 'Button Font Size',
1159
+ type: 'select',
1160
+ options: ['12px', '14px', '16px'],
1161
+ default: '14px',
1162
+ },
1163
+ {
1164
+ key: 'buttonFontWeight',
1165
+ label: 'Button Font Weight',
1166
+ type: 'select',
1167
+ options: ['normal', 'medium', 'semibold', 'bold'],
1168
+ default: 'medium',
1169
+ },
1170
+ ],
1171
+ },
1172
+ {
1173
+ title: 'Behavior',
1174
+ fields: [
1175
+ { key: 'showDeclineButton', label: 'Show Decline Button', type: 'toggle', default: true },
1176
+ {
1177
+ key: 'showCustomizeButton',
1178
+ label: 'Show Customize Button',
1179
+ type: 'toggle',
1180
+ default: true,
1181
+ },
1182
+ { key: 'showCloseButton', label: 'Show Close Button', type: 'toggle', default: false },
1183
+ {
1184
+ key: 'autoHideAfterMs',
1185
+ label: 'Auto Hide After (ms)',
1186
+ type: 'number',
1187
+ default: 0,
1188
+ min: 0,
1189
+ max: 60000,
1190
+ step: 1000,
1191
+ },
1192
+ ],
1193
+ },
1194
+ {
1195
+ title: 'Consent Settings',
1196
+ fields: [
1197
+ { key: 'granularEnabled', label: 'Enable Granular Consent', type: 'toggle', default: true },
1198
+ {
1199
+ key: 'requiredCategories',
1200
+ label: 'Required Categories',
1201
+ type: 'text',
1202
+ default: 'necessary',
1203
+ placeholder: 'necessary,analytics',
1204
+ },
1205
+ {
1206
+ key: 'timeoutMs',
1207
+ label: 'Decision Timeout (ms)',
1208
+ type: 'number',
1209
+ default: 0,
1210
+ min: 0,
1211
+ max: 300000,
1212
+ step: 1000,
1213
+ },
1214
+ ],
1215
+ },
1216
+ ],
1217
+ custom: [
1218
+ {
1219
+ title: 'Container',
1220
+ fields: [
1221
+ {
1222
+ key: 'containerPadding',
1223
+ label: 'Container Padding',
1224
+ type: 'select',
1225
+ options: ['0px', '8px', '16px', '24px'],
1226
+ default: '0px',
1227
+ },
1228
+ {
1229
+ key: 'containerBackground',
1230
+ label: 'Container Background',
1231
+ type: 'color',
1232
+ default: 'transparent',
1233
+ },
1234
+ ],
1235
+ },
1236
+ ],
1237
+ product_view_count: [
1238
+ {
1239
+ title: 'Renkler',
1240
+ fields: [
1241
+ { key: 'backgroundColor', label: 'Arkaplan Rengi', type: 'color', default: '#f0fdf4' },
1242
+ { key: 'textColor', label: 'Metin Rengi', type: 'color', default: '#166534' },
1243
+ { key: 'iconColor', label: 'İkon Rengi', type: 'color', default: '#22c55e' },
1244
+ { key: 'counterColor', label: 'Sayaç Rengi', type: 'color', default: '#16a34a' },
1245
+ ],
1246
+ },
1247
+ {
1248
+ title: 'Düzen',
1249
+ fields: [
1250
+ {
1251
+ key: 'borderRadius',
1252
+ label: 'Köşe Yuvarlama',
1253
+ type: 'select',
1254
+ options: ['0px', '4px', '8px', '12px', '16px', '50px'],
1255
+ default: '8px',
1256
+ },
1257
+ {
1258
+ key: 'padding',
1259
+ label: 'İç Boşluk',
1260
+ type: 'select',
1261
+ options: ['8px', '12px', '16px', '20px'],
1262
+ default: '12px',
1263
+ },
1264
+ {
1265
+ key: 'display',
1266
+ label: 'Görünüm',
1267
+ type: 'select',
1268
+ options: ['inline', 'block', 'flex'],
1269
+ default: 'inline',
1270
+ },
1271
+ {
1272
+ key: 'fontSize',
1273
+ label: 'Font Boyutu',
1274
+ type: 'select',
1275
+ options: ['12px', '14px', '16px', '18px'],
1276
+ default: '14px',
1277
+ },
1278
+ ],
1279
+ },
1280
+ {
1281
+ title: 'Animasyon',
1282
+ fields: [
1283
+ { key: 'animateCounter', label: 'Animasyonlu Sayaç', type: 'toggle', default: true },
1284
+ {
1285
+ key: 'animationDuration',
1286
+ label: 'Animasyon Süresi (ms)',
1287
+ type: 'select',
1288
+ options: ['500', '1000', '1500', '2000'],
1289
+ default: '1000',
1290
+ },
1291
+ {
1292
+ key: 'separator',
1293
+ label: 'Ayıraç',
1294
+ type: 'select',
1295
+ options: ['comma', 'dot', 'space', 'none'],
1296
+ default: 'comma',
1297
+ },
1298
+ ],
1299
+ },
1300
+ ],
1301
+ cart_count: [
1302
+ {
1303
+ title: 'Renkler',
1304
+ fields: [
1305
+ { key: 'backgroundColor', label: 'Arkaplan Rengi', type: 'color', default: '#fef3c7' },
1306
+ { key: 'textColor', label: 'Metin Rengi', type: 'color', default: '#92400e' },
1307
+ { key: 'iconColor', label: 'İkon Rengi', type: 'color', default: '#f59e0b' },
1308
+ { key: 'counterColor', label: 'Sayaç Rengi', type: 'color', default: '#ea580c' },
1309
+ ],
1310
+ },
1311
+ {
1312
+ title: 'Düzen',
1313
+ fields: [
1314
+ {
1315
+ key: 'borderRadius',
1316
+ label: 'Köşe Yuvarlama',
1317
+ type: 'select',
1318
+ options: ['0px', '4px', '8px', '12px', '16px', '50px'],
1319
+ default: '8px',
1320
+ },
1321
+ {
1322
+ key: 'padding',
1323
+ label: 'İç Boşluk',
1324
+ type: 'select',
1325
+ options: ['8px', '12px', '16px', '20px'],
1326
+ default: '12px',
1327
+ },
1328
+ {
1329
+ key: 'display',
1330
+ label: 'Görünüm',
1331
+ type: 'select',
1332
+ options: ['inline', 'block', 'flex'],
1333
+ default: 'inline',
1334
+ },
1335
+ {
1336
+ key: 'fontSize',
1337
+ label: 'Font Boyutu',
1338
+ type: 'select',
1339
+ options: ['12px', '14px', '16px', '18px'],
1340
+ default: '14px',
1341
+ },
1342
+ ],
1343
+ },
1344
+ {
1345
+ title: 'Animasyon',
1346
+ fields: [
1347
+ { key: 'animateCounter', label: 'Animasyonlu Sayaç', type: 'toggle', default: true },
1348
+ {
1349
+ key: 'animationDuration',
1350
+ label: 'Animasyon Süresi (ms)',
1351
+ type: 'select',
1352
+ options: ['500', '1000', '1500', '2000'],
1353
+ default: '1000',
1354
+ },
1355
+ {
1356
+ key: 'separator',
1357
+ label: 'Ayıraç',
1358
+ type: 'select',
1359
+ options: ['comma', 'dot', 'space', 'none'],
1360
+ default: 'comma',
1361
+ },
1362
+ ],
1363
+ },
1364
+ {
1365
+ title: 'Aciliyet Rozeti',
1366
+ fields: [
1367
+ { key: 'showBadge', label: 'Rozet Göster', type: 'toggle', default: false },
1368
+ { key: 'badgeText', label: 'Rozet Metni', type: 'text', default: 'HOT' },
1369
+ { key: 'badgeColor', label: 'Rozet Rengi', type: 'color', default: '#dc2626' },
1370
+ { key: 'badgeTextColor', label: 'Rozet Metin Rengi', type: 'color', default: '#ffffff' },
1371
+ ],
1372
+ },
1373
+ ],
1374
+ newsletter: [
1375
+ makeColorSection({
1376
+ backgroundColor: '#ffffff',
1377
+ textColor: '#111827',
1378
+ buttonColor: '#111827',
1379
+ buttonTextColor: '#ffffff',
1380
+ extraColors: {
1381
+ inputBackgroundColor: {
1382
+ label: 'Input Background',
1383
+ default: '#f9fafb',
1384
+ },
1385
+ inputTextColor: {
1386
+ label: 'Input Text',
1387
+ default: '#111827',
1388
+ },
1389
+ inputBorderColor: {
1390
+ label: 'Input Border',
1391
+ default: '#d1d5db',
1392
+ },
1393
+ },
1394
+ }),
1395
+ makeTypographySection({
1396
+ fontSizeDefault: '14px',
1397
+ extraFields: [
1398
+ {
1399
+ key: 'headlineFontSize',
1400
+ label: 'Headline Size',
1401
+ type: 'select',
1402
+ options: ['16px', '18px', '20px', '24px'],
1403
+ default: '20px',
1404
+ },
1405
+ ],
1406
+ }),
1407
+ makeLayoutSection({
1408
+ paddingDefault: '16px',
1409
+ borderRadiusDefault: '12px',
1410
+ extraFields: [
1411
+ {
1412
+ key: 'maxWidth',
1413
+ label: 'Max Width',
1414
+ type: 'select',
1415
+ options: ['280px', '320px', '360px', '420px', '100%'],
1416
+ default: '360px',
1417
+ },
1418
+ ],
1419
+ }),
1420
+ makeEffectsSection({
1421
+ shadowDefault: 'lg',
1422
+ extraFields: [
1423
+ {
1424
+ key: 'showCloseButton',
1425
+ label: 'Show Close Button',
1426
+ type: 'toggle',
1427
+ default: true,
1428
+ },
1429
+ ],
1430
+ }),
1431
+ ],
1432
+ };
1433
+ // ===========================================
1434
+ // HELPER FUNCTIONS
1435
+ // ===========================================
1436
+ // Shadow value mapping
1437
+ export const SHADOW_VALUES = {
1438
+ none: 'none',
1439
+ sm: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
1440
+ md: '0 4px 6px -1px rgba(0, 0, 0, 0.1)',
1441
+ lg: '0 10px 15px -3px rgba(0, 0, 0, 0.1)',
1442
+ xl: '0 20px 25px -5px rgba(0, 0, 0, 0.1)',
1443
+ '2xl': '0 25px 50px -12px rgba(0, 0, 0, 0.25)',
1444
+ };
1445
+ // Get default styles for a widget type
1446
+ export function getDefaultStyles(type) {
1447
+ const sections = TYPE_STYLE_CONFIGS[type] || TYPE_STYLE_CONFIGS.custom;
1448
+ const defaults = {};
1449
+ sections.forEach((section) => {
1450
+ section.fields.forEach((field) => {
1451
+ defaults[field.key] = field.default;
1452
+ });
1453
+ });
1454
+ return defaults;
1455
+ }
1456
+ // Get content fields for a widget type
1457
+ export function getContentFields(type) {
1458
+ return TYPE_CONTENT_FIELDS[type] || TYPE_CONTENT_FIELDS.custom;
1459
+ }
1460
+ // Get style sections for a widget type
1461
+ export function getStyleSections(type) {
1462
+ return TYPE_STYLE_CONFIGS[type] || TYPE_STYLE_CONFIGS.custom;
1463
+ }
1464
+ // Convert shadow name to CSS value
1465
+ export function getShadowValue(shadow) {
1466
+ return SHADOW_VALUES[shadow] || 'none';
1467
+ }
1468
+ export function getAllowedStyleKeys(type) {
1469
+ const sections = getStyleSections(type);
1470
+ return sections.flatMap((section) => section.fields.map((field) => field.key));
1471
+ }
1472
+ //# sourceMappingURL=configs.js.map