@inspirer-dev/crm-dashboard 1.0.85 → 1.0.88

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.
@@ -263,7 +263,10 @@ const ButtonsBuilder = forwardRef<HTMLDivElement, ButtonsBuilderProps>(
263
263
  <SingleSelect
264
264
  value={btn.type || 'url'}
265
265
  onChange={(val: string) =>
266
- updateButton(btn.id, { type: val as 'url' | 'screen' })
266
+ updateButton(btn.id, {
267
+ type: val as 'url' | 'screen',
268
+ ...(val === 'url' ? { screenSlug: '' } : { url: '' }),
269
+ })
267
270
  }
268
271
  disabled={disabled}
269
272
  size="S"
@@ -26,6 +26,8 @@ const ANALYTICS_EVENTS: Record<string, { value: string; label: string }[]> = {
26
26
  { value: 'battle', label: 'Battle Completed' },
27
27
  { value: 'contract', label: 'Contract Completed' },
28
28
  { value: 'withdrawal', label: 'Withdrawal Completed' },
29
+ { value: 'deposit_abandoned', label: 'Deposit Abandoned' },
30
+ { value: 'balance_low', label: 'Balance Low' },
29
31
  ],
30
32
  Case: [
31
33
  { value: 'gg-case-fav', label: 'Case Favorite' },
@@ -43,12 +45,8 @@ const ANALYTICS_EVENTS: Record<string, { value: string; label: string }[]> = {
43
45
  { value: 'gg-profile-skin-sell', label: 'Profile Skin Sell' },
44
46
  { value: 'gg-profile-skin-trade', label: 'Profile Skin Trade' },
45
47
  ],
46
- Upgrade: [
47
- { value: 'gg-upgrade-launch', label: 'Upgrade Launch' },
48
- ],
49
- Contract: [
50
- { value: 'gg-contract-create', label: 'Contract Create' },
51
- ],
48
+ Upgrade: [{ value: 'gg-upgrade-launch', label: 'Upgrade Launch' }],
49
+ Contract: [{ value: 'gg-contract-create', label: 'Contract Create' }],
52
50
  Deposit: [
53
51
  { value: 'gg-deposit-deppage-refill', label: 'Deposit Page Refill' },
54
52
  { value: 'gg-depositbait-banner-herodepbonus-click', label: 'Hero Deposit Bonus Banner' },
@@ -260,11 +258,7 @@ const EventTriggerConfig: React.FC<EventTriggerConfigProps> = ({ data, onUpdate,
260
258
  }}
261
259
  >
262
260
  <Flex direction="column" gap={1}>
263
- <Typography
264
- variant="omega"
265
- fontWeight="semiBold"
266
- style={{ color: theme.text }}
267
- >
261
+ <Typography variant="omega" fontWeight="semiBold" style={{ color: theme.text }}>
268
262
  {getEventLabel(eventValue)}
269
263
  </Typography>
270
264
  <Typography variant="pi" textColor="neutral500">
@@ -389,11 +383,7 @@ const EventTriggerConfig: React.FC<EventTriggerConfigProps> = ({ data, onUpdate,
389
383
  </SingleSelect>
390
384
  </Box>
391
385
  </Flex>
392
- <Typography
393
- variant="pi"
394
- textColor="neutral500"
395
- style={{ marginTop: 8, display: 'block' }}
396
- >
386
+ <Typography variant="pi" textColor="neutral500" style={{ marginTop: 8, display: 'block' }}>
397
387
  {timeout > 0
398
388
  ? `Если событие не произойдёт за ${timeout} ${timeoutUnit}, кампания продолжится автоматически`
399
389
  : 'Установите 0 для бесконечного ожидания события'}
@@ -422,8 +412,8 @@ const EventTriggerConfig: React.FC<EventTriggerConfigProps> = ({ data, onUpdate,
422
412
  <>
423
413
  {logic === 'or' ? (
424
414
  <>
425
- Кампания продолжится, когда пользователь выполнит{' '}
426
- <strong>любое</strong> из выбранных событий
415
+ Кампания продолжится, когда пользователь выполнит <strong>любое</strong> из
416
+ выбранных событий
427
417
  </>
428
418
  ) : (
429
419
  <>
@@ -433,7 +423,11 @@ const EventTriggerConfig: React.FC<EventTriggerConfigProps> = ({ data, onUpdate,
433
423
  )}
434
424
  {timeout > 0 && (
435
425
  <>
436
- {' '}или через <strong>{timeout} {timeoutUnit}</strong>
426
+ {' '}
427
+ или через{' '}
428
+ <strong>
429
+ {timeout} {timeoutUnit}
430
+ </strong>
437
431
  </>
438
432
  )}
439
433
  .
@@ -3,6 +3,7 @@ import {
3
3
  Box,
4
4
  Field,
5
5
  Flex,
6
+ NumberInput,
6
7
  TextInput,
7
8
  Typography,
8
9
  SingleSelect,
@@ -25,6 +26,8 @@ const ANALYTICS_EVENTS: Record<string, { value: string; label: string }[]> = {
25
26
  { value: 'battle', label: 'Battle Completed' },
26
27
  { value: 'contract', label: 'Contract Completed' },
27
28
  { value: 'withdrawal', label: 'Withdrawal Completed' },
29
+ { value: 'deposit_abandoned', label: 'Deposit Abandoned' },
30
+ { value: 'balance_low', label: 'Balance Low' },
28
31
  ],
29
32
  Case: [
30
33
  { value: 'gg-case-fav', label: 'Case Favorite' },
@@ -121,6 +124,8 @@ interface TriggerConfig {
121
124
  scheduleDays?: number[];
122
125
  scheduleCron?: string;
123
126
  scheduleEveryMinutes?: number;
127
+ depositAbandonedTimeoutMinutes?: number;
128
+ balanceLowThreshold?: number;
124
129
  }
125
130
 
126
131
  interface TriggerConfigFieldProps {
@@ -206,6 +211,8 @@ const parseConfig = (value: string | TriggerConfig | null | undefined): TriggerC
206
211
  scheduleDays: Array.isArray(parsed.scheduleDays) ? parsed.scheduleDays : [1, 2, 3, 4, 5],
207
212
  scheduleCron: parsed.scheduleCron || '0 12 * * *',
208
213
  scheduleEveryMinutes: parsed.scheduleEveryMinutes ?? 5,
214
+ depositAbandonedTimeoutMinutes: parsed.depositAbandonedTimeoutMinutes ?? 10,
215
+ balanceLowThreshold: parsed.balanceLowThreshold ?? 5,
209
216
  });
210
217
  if (typeof value === 'string') {
211
218
  try {
@@ -566,6 +573,119 @@ const TriggerConfigField = forwardRef<HTMLDivElement, TriggerConfigFieldProps>(
566
573
  </Typography>
567
574
  </Box>
568
575
 
576
+ {config.eventName === 'deposit_abandoned' && (
577
+ <Box
578
+ padding={4}
579
+ hasRadius
580
+ style={{
581
+ background: colors.event.innerCard,
582
+ border: `1px solid ${colors.event.border}`,
583
+ }}
584
+ >
585
+ <Flex alignItems="center" gap={3}>
586
+ <Box
587
+ style={{
588
+ width: 40,
589
+ height: 40,
590
+ borderRadius: 10,
591
+ background: 'linear-gradient(135deg, #f97316 0%, #ea580c 100%)',
592
+ display: 'flex',
593
+ alignItems: 'center',
594
+ justifyContent: 'center',
595
+ color: '#fff',
596
+ flexShrink: 0,
597
+ }}
598
+ >
599
+ <Clock width={20} height={20} />
600
+ </Box>
601
+ <Box style={{ flex: 1 }}>
602
+ <Typography
603
+ variant="pi"
604
+ fontWeight="bold"
605
+ textColor="neutral700"
606
+ style={{ marginBottom: 4, display: 'block' }}
607
+ >
608
+ Таймаут незавершённого депозита
609
+ </Typography>
610
+ <Typography variant="pi" textColor="neutral500">
611
+ Через сколько минут считать депозит брошенным
612
+ </Typography>
613
+ </Box>
614
+ <Box style={{ width: 100 }}>
615
+ <NumberInput
616
+ value={config.depositAbandonedTimeoutMinutes ?? 10}
617
+ onValueChange={(val: number | undefined) =>
618
+ handleUpdate({ depositAbandonedTimeoutMinutes: val ?? 10 })
619
+ }
620
+ disabled={disabled}
621
+ step={1}
622
+ min={1}
623
+ max={60}
624
+ />
625
+ </Box>
626
+ <Typography variant="pi" textColor="neutral500">
627
+ мин
628
+ </Typography>
629
+ </Flex>
630
+ </Box>
631
+ )}
632
+
633
+ {config.eventName === 'balance_low' && (
634
+ <Box
635
+ padding={4}
636
+ hasRadius
637
+ style={{
638
+ background: colors.event.innerCard,
639
+ border: `1px solid ${colors.event.border}`,
640
+ }}
641
+ >
642
+ <Flex alignItems="center" gap={3}>
643
+ <Box
644
+ style={{
645
+ width: 40,
646
+ height: 40,
647
+ borderRadius: 10,
648
+ background: 'linear-gradient(135deg, #ef4444 0%, #dc2626 100%)',
649
+ display: 'flex',
650
+ alignItems: 'center',
651
+ justifyContent: 'center',
652
+ color: '#fff',
653
+ flexShrink: 0,
654
+ }}
655
+ >
656
+ <Clock width={20} height={20} />
657
+ </Box>
658
+ <Box style={{ flex: 1 }}>
659
+ <Typography
660
+ variant="pi"
661
+ fontWeight="bold"
662
+ textColor="neutral700"
663
+ style={{ marginBottom: 4, display: 'block' }}
664
+ >
665
+ Порог баланса
666
+ </Typography>
667
+ <Typography variant="pi" textColor="neutral500">
668
+ Событие сработает когда баланс упадёт ниже этой суммы
669
+ </Typography>
670
+ </Box>
671
+ <Box style={{ width: 100 }}>
672
+ <NumberInput
673
+ value={config.balanceLowThreshold ?? 5}
674
+ onValueChange={(val: number | undefined) =>
675
+ handleUpdate({ balanceLowThreshold: val ?? 5 })
676
+ }
677
+ disabled={disabled}
678
+ step={0.5}
679
+ min={0}
680
+ />
681
+ </Box>
682
+ <Typography variant="pi" textColor="neutral500">
683
+ $
684
+ </Typography>
685
+ </Flex>
686
+ </Box>
687
+ )}
688
+
569
689
  <Box
570
690
  padding={4}
571
691
  hasRadius