@inspirer-dev/crm-dashboard 1.0.86 → 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.
- package/admin/src/components/StepFlowBuilder/panels/EventTriggerConfig.tsx +13 -19
- package/admin/src/components/TriggerConfigField/index.tsx +120 -0
- package/dist/_chunks/{index-BQcRoIJr.js → index-C6cSKRAH.js} +115 -2
- package/dist/_chunks/{index-354YMebI.js → index-DitYBTyj.js} +10 -28
- package/dist/_chunks/{index-gR86Z3uh.mjs → index-P8pE6Zbx.mjs} +10 -28
- package/dist/_chunks/{index-Dhj0KzCX.mjs → index-o12Z75S3.mjs} +116 -3
- package/dist/admin/index.js +2 -2
- package/dist/admin/index.mjs +2 -2
- package/package.json +1 -1
- package/admin/playground/dist/assets/index-9hS_dqwV.css +0 -1
- package/admin/playground/dist/assets/index-BfQ5hqOR.js +0 -2588
- package/admin/playground/dist/index.html +0 -14
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
{' '}
|
|
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
|
|
@@ -15,7 +15,9 @@ const ANALYTICS_EVENTS = {
|
|
|
15
15
|
{ value: "upgrade", label: "Upgrade Completed" },
|
|
16
16
|
{ value: "battle", label: "Battle Completed" },
|
|
17
17
|
{ value: "contract", label: "Contract Completed" },
|
|
18
|
-
{ value: "withdrawal", label: "Withdrawal Completed" }
|
|
18
|
+
{ value: "withdrawal", label: "Withdrawal Completed" },
|
|
19
|
+
{ value: "deposit_abandoned", label: "Deposit Abandoned" },
|
|
20
|
+
{ value: "balance_low", label: "Balance Low" }
|
|
19
21
|
],
|
|
20
22
|
Case: [
|
|
21
23
|
{ value: "gg-case-fav", label: "Case Favorite" },
|
|
@@ -154,7 +156,9 @@ const parseConfig = (value) => {
|
|
|
154
156
|
scheduleTime: parsed.scheduleTime || "12:00",
|
|
155
157
|
scheduleDays: Array.isArray(parsed.scheduleDays) ? parsed.scheduleDays : [1, 2, 3, 4, 5],
|
|
156
158
|
scheduleCron: parsed.scheduleCron || "0 12 * * *",
|
|
157
|
-
scheduleEveryMinutes: parsed.scheduleEveryMinutes ?? 5
|
|
159
|
+
scheduleEveryMinutes: parsed.scheduleEveryMinutes ?? 5,
|
|
160
|
+
depositAbandonedTimeoutMinutes: parsed.depositAbandonedTimeoutMinutes ?? 10,
|
|
161
|
+
balanceLowThreshold: parsed.balanceLowThreshold ?? 5
|
|
158
162
|
});
|
|
159
163
|
if (typeof value === "string") {
|
|
160
164
|
try {
|
|
@@ -465,6 +469,115 @@ const TriggerConfigField = React.forwardRef(
|
|
|
465
469
|
}
|
|
466
470
|
)
|
|
467
471
|
] }),
|
|
472
|
+
config.eventName === "deposit_abandoned" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
473
|
+
designSystem.Box,
|
|
474
|
+
{
|
|
475
|
+
padding: 4,
|
|
476
|
+
hasRadius: true,
|
|
477
|
+
style: {
|
|
478
|
+
background: colors.event.innerCard,
|
|
479
|
+
border: `1px solid ${colors.event.border}`
|
|
480
|
+
},
|
|
481
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "center", gap: 3, children: [
|
|
482
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
483
|
+
designSystem.Box,
|
|
484
|
+
{
|
|
485
|
+
style: {
|
|
486
|
+
width: 40,
|
|
487
|
+
height: 40,
|
|
488
|
+
borderRadius: 10,
|
|
489
|
+
background: "linear-gradient(135deg, #f97316 0%, #ea580c 100%)",
|
|
490
|
+
display: "flex",
|
|
491
|
+
alignItems: "center",
|
|
492
|
+
justifyContent: "center",
|
|
493
|
+
color: "#fff",
|
|
494
|
+
flexShrink: 0
|
|
495
|
+
},
|
|
496
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons.Clock, { width: 20, height: 20 })
|
|
497
|
+
}
|
|
498
|
+
),
|
|
499
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { style: { flex: 1 }, children: [
|
|
500
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
501
|
+
designSystem.Typography,
|
|
502
|
+
{
|
|
503
|
+
variant: "pi",
|
|
504
|
+
fontWeight: "bold",
|
|
505
|
+
textColor: "neutral700",
|
|
506
|
+
style: { marginBottom: 4, display: "block" },
|
|
507
|
+
children: "Таймаут незавершённого депозита"
|
|
508
|
+
}
|
|
509
|
+
),
|
|
510
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral500", children: "Через сколько минут считать депозит брошенным" })
|
|
511
|
+
] }),
|
|
512
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { width: 100 }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
513
|
+
designSystem.NumberInput,
|
|
514
|
+
{
|
|
515
|
+
value: config.depositAbandonedTimeoutMinutes ?? 10,
|
|
516
|
+
onValueChange: (val) => handleUpdate({ depositAbandonedTimeoutMinutes: val ?? 10 }),
|
|
517
|
+
disabled,
|
|
518
|
+
step: 1,
|
|
519
|
+
min: 1,
|
|
520
|
+
max: 60
|
|
521
|
+
}
|
|
522
|
+
) }),
|
|
523
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral500", children: "мин" })
|
|
524
|
+
] })
|
|
525
|
+
}
|
|
526
|
+
),
|
|
527
|
+
config.eventName === "balance_low" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
528
|
+
designSystem.Box,
|
|
529
|
+
{
|
|
530
|
+
padding: 4,
|
|
531
|
+
hasRadius: true,
|
|
532
|
+
style: {
|
|
533
|
+
background: colors.event.innerCard,
|
|
534
|
+
border: `1px solid ${colors.event.border}`
|
|
535
|
+
},
|
|
536
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "center", gap: 3, children: [
|
|
537
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
538
|
+
designSystem.Box,
|
|
539
|
+
{
|
|
540
|
+
style: {
|
|
541
|
+
width: 40,
|
|
542
|
+
height: 40,
|
|
543
|
+
borderRadius: 10,
|
|
544
|
+
background: "linear-gradient(135deg, #ef4444 0%, #dc2626 100%)",
|
|
545
|
+
display: "flex",
|
|
546
|
+
alignItems: "center",
|
|
547
|
+
justifyContent: "center",
|
|
548
|
+
color: "#fff",
|
|
549
|
+
flexShrink: 0
|
|
550
|
+
},
|
|
551
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons.Clock, { width: 20, height: 20 })
|
|
552
|
+
}
|
|
553
|
+
),
|
|
554
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { style: { flex: 1 }, children: [
|
|
555
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
556
|
+
designSystem.Typography,
|
|
557
|
+
{
|
|
558
|
+
variant: "pi",
|
|
559
|
+
fontWeight: "bold",
|
|
560
|
+
textColor: "neutral700",
|
|
561
|
+
style: { marginBottom: 4, display: "block" },
|
|
562
|
+
children: "Порог баланса"
|
|
563
|
+
}
|
|
564
|
+
),
|
|
565
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral500", children: "Событие сработает когда баланс упадёт ниже этой суммы" })
|
|
566
|
+
] }),
|
|
567
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { width: 100 }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
568
|
+
designSystem.NumberInput,
|
|
569
|
+
{
|
|
570
|
+
value: config.balanceLowThreshold ?? 5,
|
|
571
|
+
onValueChange: (val) => handleUpdate({ balanceLowThreshold: val ?? 5 }),
|
|
572
|
+
disabled,
|
|
573
|
+
step: 0.5,
|
|
574
|
+
min: 0
|
|
575
|
+
}
|
|
576
|
+
) }),
|
|
577
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral500", children: "$" })
|
|
578
|
+
] })
|
|
579
|
+
}
|
|
580
|
+
),
|
|
468
581
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
469
582
|
designSystem.Box,
|
|
470
583
|
{
|
|
@@ -2365,7 +2365,9 @@ const ANALYTICS_EVENTS = {
|
|
|
2365
2365
|
{ value: "upgrade", label: "Upgrade Completed" },
|
|
2366
2366
|
{ value: "battle", label: "Battle Completed" },
|
|
2367
2367
|
{ value: "contract", label: "Contract Completed" },
|
|
2368
|
-
{ value: "withdrawal", label: "Withdrawal Completed" }
|
|
2368
|
+
{ value: "withdrawal", label: "Withdrawal Completed" },
|
|
2369
|
+
{ value: "deposit_abandoned", label: "Deposit Abandoned" },
|
|
2370
|
+
{ value: "balance_low", label: "Balance Low" }
|
|
2369
2371
|
],
|
|
2370
2372
|
Case: [
|
|
2371
2373
|
{ value: "gg-case-fav", label: "Case Favorite" },
|
|
@@ -2383,12 +2385,8 @@ const ANALYTICS_EVENTS = {
|
|
|
2383
2385
|
{ value: "gg-profile-skin-sell", label: "Profile Skin Sell" },
|
|
2384
2386
|
{ value: "gg-profile-skin-trade", label: "Profile Skin Trade" }
|
|
2385
2387
|
],
|
|
2386
|
-
Upgrade: [
|
|
2387
|
-
|
|
2388
|
-
],
|
|
2389
|
-
Contract: [
|
|
2390
|
-
{ value: "gg-contract-create", label: "Contract Create" }
|
|
2391
|
-
],
|
|
2388
|
+
Upgrade: [{ value: "gg-upgrade-launch", label: "Upgrade Launch" }],
|
|
2389
|
+
Contract: [{ value: "gg-contract-create", label: "Contract Create" }],
|
|
2392
2390
|
Deposit: [
|
|
2393
2391
|
{ value: "gg-deposit-deppage-refill", label: "Deposit Page Refill" },
|
|
2394
2392
|
{ value: "gg-depositbait-banner-herodepbonus-click", label: "Hero Deposit Bonus Banner" }
|
|
@@ -2571,15 +2569,7 @@ const EventTriggerConfig = ({ data, onUpdate, disabled }) => {
|
|
|
2571
2569
|
},
|
|
2572
2570
|
children: [
|
|
2573
2571
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 1, children: [
|
|
2574
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2575
|
-
designSystem.Typography,
|
|
2576
|
-
{
|
|
2577
|
-
variant: "omega",
|
|
2578
|
-
fontWeight: "semiBold",
|
|
2579
|
-
style: { color: theme.text },
|
|
2580
|
-
children: getEventLabel(eventValue)
|
|
2581
|
-
}
|
|
2582
|
-
),
|
|
2572
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", fontWeight: "semiBold", style: { color: theme.text }, children: getEventLabel(eventValue) }),
|
|
2583
2573
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral500", children: eventValue })
|
|
2584
2574
|
] }),
|
|
2585
2575
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2698,15 +2688,7 @@ const EventTriggerConfig = ({ data, onUpdate, disabled }) => {
|
|
|
2698
2688
|
}
|
|
2699
2689
|
) })
|
|
2700
2690
|
] }),
|
|
2701
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2702
|
-
designSystem.Typography,
|
|
2703
|
-
{
|
|
2704
|
-
variant: "pi",
|
|
2705
|
-
textColor: "neutral500",
|
|
2706
|
-
style: { marginTop: 8, display: "block" },
|
|
2707
|
-
children: timeout > 0 ? `Если событие не произойдёт за ${timeout} ${timeoutUnit}, кампания продолжится автоматически` : "Установите 0 для бесконечного ожидания события"
|
|
2708
|
-
}
|
|
2709
|
-
)
|
|
2691
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral500", style: { marginTop: 8, display: "block" }, children: timeout > 0 ? `Если событие не произойдёт за ${timeout} ${timeoutUnit}, кампания продолжится автоматически` : "Установите 0 для бесконечного ожидания события" })
|
|
2710
2692
|
] }),
|
|
2711
2693
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2712
2694
|
"div",
|
|
@@ -2728,8 +2710,7 @@ const EventTriggerConfig = ({ data, onUpdate, disabled }) => {
|
|
|
2728
2710
|
},
|
|
2729
2711
|
children: events.length === 0 ? "Выберите события, которые должен совершить пользователь для продолжения кампании." : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2730
2712
|
logic === "or" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2731
|
-
"Кампания продолжится, когда пользователь выполнит",
|
|
2732
|
-
" ",
|
|
2713
|
+
"Кампания продолжится, когда пользователь выполнит ",
|
|
2733
2714
|
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: "любое" }),
|
|
2734
2715
|
" из выбранных событий"
|
|
2735
2716
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -2743,7 +2724,8 @@ const EventTriggerConfig = ({ data, onUpdate, disabled }) => {
|
|
|
2743
2724
|
] }),
|
|
2744
2725
|
timeout > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2745
2726
|
" ",
|
|
2746
|
-
"или через
|
|
2727
|
+
"или через",
|
|
2728
|
+
" ",
|
|
2747
2729
|
/* @__PURE__ */ jsxRuntime.jsxs("strong", { children: [
|
|
2748
2730
|
timeout,
|
|
2749
2731
|
" ",
|
|
@@ -2360,7 +2360,9 @@ const ANALYTICS_EVENTS = {
|
|
|
2360
2360
|
{ value: "upgrade", label: "Upgrade Completed" },
|
|
2361
2361
|
{ value: "battle", label: "Battle Completed" },
|
|
2362
2362
|
{ value: "contract", label: "Contract Completed" },
|
|
2363
|
-
{ value: "withdrawal", label: "Withdrawal Completed" }
|
|
2363
|
+
{ value: "withdrawal", label: "Withdrawal Completed" },
|
|
2364
|
+
{ value: "deposit_abandoned", label: "Deposit Abandoned" },
|
|
2365
|
+
{ value: "balance_low", label: "Balance Low" }
|
|
2364
2366
|
],
|
|
2365
2367
|
Case: [
|
|
2366
2368
|
{ value: "gg-case-fav", label: "Case Favorite" },
|
|
@@ -2378,12 +2380,8 @@ const ANALYTICS_EVENTS = {
|
|
|
2378
2380
|
{ value: "gg-profile-skin-sell", label: "Profile Skin Sell" },
|
|
2379
2381
|
{ value: "gg-profile-skin-trade", label: "Profile Skin Trade" }
|
|
2380
2382
|
],
|
|
2381
|
-
Upgrade: [
|
|
2382
|
-
|
|
2383
|
-
],
|
|
2384
|
-
Contract: [
|
|
2385
|
-
{ value: "gg-contract-create", label: "Contract Create" }
|
|
2386
|
-
],
|
|
2383
|
+
Upgrade: [{ value: "gg-upgrade-launch", label: "Upgrade Launch" }],
|
|
2384
|
+
Contract: [{ value: "gg-contract-create", label: "Contract Create" }],
|
|
2387
2385
|
Deposit: [
|
|
2388
2386
|
{ value: "gg-deposit-deppage-refill", label: "Deposit Page Refill" },
|
|
2389
2387
|
{ value: "gg-depositbait-banner-herodepbonus-click", label: "Hero Deposit Bonus Banner" }
|
|
@@ -2566,15 +2564,7 @@ const EventTriggerConfig = ({ data, onUpdate, disabled }) => {
|
|
|
2566
2564
|
},
|
|
2567
2565
|
children: [
|
|
2568
2566
|
/* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 1, children: [
|
|
2569
|
-
/* @__PURE__ */ jsx(
|
|
2570
|
-
Typography,
|
|
2571
|
-
{
|
|
2572
|
-
variant: "omega",
|
|
2573
|
-
fontWeight: "semiBold",
|
|
2574
|
-
style: { color: theme.text },
|
|
2575
|
-
children: getEventLabel(eventValue)
|
|
2576
|
-
}
|
|
2577
|
-
),
|
|
2567
|
+
/* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "semiBold", style: { color: theme.text }, children: getEventLabel(eventValue) }),
|
|
2578
2568
|
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral500", children: eventValue })
|
|
2579
2569
|
] }),
|
|
2580
2570
|
/* @__PURE__ */ jsx(
|
|
@@ -2693,15 +2683,7 @@ const EventTriggerConfig = ({ data, onUpdate, disabled }) => {
|
|
|
2693
2683
|
}
|
|
2694
2684
|
) })
|
|
2695
2685
|
] }),
|
|
2696
|
-
/* @__PURE__ */ jsx(
|
|
2697
|
-
Typography,
|
|
2698
|
-
{
|
|
2699
|
-
variant: "pi",
|
|
2700
|
-
textColor: "neutral500",
|
|
2701
|
-
style: { marginTop: 8, display: "block" },
|
|
2702
|
-
children: timeout > 0 ? `Если событие не произойдёт за ${timeout} ${timeoutUnit}, кампания продолжится автоматически` : "Установите 0 для бесконечного ожидания события"
|
|
2703
|
-
}
|
|
2704
|
-
)
|
|
2686
|
+
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral500", style: { marginTop: 8, display: "block" }, children: timeout > 0 ? `Если событие не произойдёт за ${timeout} ${timeoutUnit}, кампания продолжится автоматически` : "Установите 0 для бесконечного ожидания события" })
|
|
2705
2687
|
] }),
|
|
2706
2688
|
/* @__PURE__ */ jsx(
|
|
2707
2689
|
"div",
|
|
@@ -2723,8 +2705,7 @@ const EventTriggerConfig = ({ data, onUpdate, disabled }) => {
|
|
|
2723
2705
|
},
|
|
2724
2706
|
children: events.length === 0 ? "Выберите события, которые должен совершить пользователь для продолжения кампании." : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2725
2707
|
logic === "or" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2726
|
-
"Кампания продолжится, когда пользователь выполнит",
|
|
2727
|
-
" ",
|
|
2708
|
+
"Кампания продолжится, когда пользователь выполнит ",
|
|
2728
2709
|
/* @__PURE__ */ jsx("strong", { children: "любое" }),
|
|
2729
2710
|
" из выбранных событий"
|
|
2730
2711
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -2738,7 +2719,8 @@ const EventTriggerConfig = ({ data, onUpdate, disabled }) => {
|
|
|
2738
2719
|
] }),
|
|
2739
2720
|
timeout > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2740
2721
|
" ",
|
|
2741
|
-
"или через
|
|
2722
|
+
"или через",
|
|
2723
|
+
" ",
|
|
2742
2724
|
/* @__PURE__ */ jsxs("strong", { children: [
|
|
2743
2725
|
timeout,
|
|
2744
2726
|
" ",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useState, useEffect, useMemo } from "react";
|
|
3
|
-
import { Field, Flex, Box, Typography, Combobox, ComboboxOption, Badge, TextInput, SingleSelect, SingleSelectOption } from "@strapi/design-system";
|
|
3
|
+
import { Field, Flex, Box, Typography, Combobox, ComboboxOption, Badge, NumberInput, TextInput, SingleSelect, SingleSelectOption } from "@strapi/design-system";
|
|
4
4
|
import { Magic, Calendar, Clock, Code } from "@strapi/icons";
|
|
5
5
|
import { useTheme } from "styled-components";
|
|
6
6
|
const ANALYTICS_EVENTS = {
|
|
@@ -13,7 +13,9 @@ const ANALYTICS_EVENTS = {
|
|
|
13
13
|
{ value: "upgrade", label: "Upgrade Completed" },
|
|
14
14
|
{ value: "battle", label: "Battle Completed" },
|
|
15
15
|
{ value: "contract", label: "Contract Completed" },
|
|
16
|
-
{ value: "withdrawal", label: "Withdrawal Completed" }
|
|
16
|
+
{ value: "withdrawal", label: "Withdrawal Completed" },
|
|
17
|
+
{ value: "deposit_abandoned", label: "Deposit Abandoned" },
|
|
18
|
+
{ value: "balance_low", label: "Balance Low" }
|
|
17
19
|
],
|
|
18
20
|
Case: [
|
|
19
21
|
{ value: "gg-case-fav", label: "Case Favorite" },
|
|
@@ -152,7 +154,9 @@ const parseConfig = (value) => {
|
|
|
152
154
|
scheduleTime: parsed.scheduleTime || "12:00",
|
|
153
155
|
scheduleDays: Array.isArray(parsed.scheduleDays) ? parsed.scheduleDays : [1, 2, 3, 4, 5],
|
|
154
156
|
scheduleCron: parsed.scheduleCron || "0 12 * * *",
|
|
155
|
-
scheduleEveryMinutes: parsed.scheduleEveryMinutes ?? 5
|
|
157
|
+
scheduleEveryMinutes: parsed.scheduleEveryMinutes ?? 5,
|
|
158
|
+
depositAbandonedTimeoutMinutes: parsed.depositAbandonedTimeoutMinutes ?? 10,
|
|
159
|
+
balanceLowThreshold: parsed.balanceLowThreshold ?? 5
|
|
156
160
|
});
|
|
157
161
|
if (typeof value === "string") {
|
|
158
162
|
try {
|
|
@@ -463,6 +467,115 @@ const TriggerConfigField = forwardRef(
|
|
|
463
467
|
}
|
|
464
468
|
)
|
|
465
469
|
] }),
|
|
470
|
+
config.eventName === "deposit_abandoned" && /* @__PURE__ */ jsx(
|
|
471
|
+
Box,
|
|
472
|
+
{
|
|
473
|
+
padding: 4,
|
|
474
|
+
hasRadius: true,
|
|
475
|
+
style: {
|
|
476
|
+
background: colors.event.innerCard,
|
|
477
|
+
border: `1px solid ${colors.event.border}`
|
|
478
|
+
},
|
|
479
|
+
children: /* @__PURE__ */ jsxs(Flex, { alignItems: "center", gap: 3, children: [
|
|
480
|
+
/* @__PURE__ */ jsx(
|
|
481
|
+
Box,
|
|
482
|
+
{
|
|
483
|
+
style: {
|
|
484
|
+
width: 40,
|
|
485
|
+
height: 40,
|
|
486
|
+
borderRadius: 10,
|
|
487
|
+
background: "linear-gradient(135deg, #f97316 0%, #ea580c 100%)",
|
|
488
|
+
display: "flex",
|
|
489
|
+
alignItems: "center",
|
|
490
|
+
justifyContent: "center",
|
|
491
|
+
color: "#fff",
|
|
492
|
+
flexShrink: 0
|
|
493
|
+
},
|
|
494
|
+
children: /* @__PURE__ */ jsx(Clock, { width: 20, height: 20 })
|
|
495
|
+
}
|
|
496
|
+
),
|
|
497
|
+
/* @__PURE__ */ jsxs(Box, { style: { flex: 1 }, children: [
|
|
498
|
+
/* @__PURE__ */ jsx(
|
|
499
|
+
Typography,
|
|
500
|
+
{
|
|
501
|
+
variant: "pi",
|
|
502
|
+
fontWeight: "bold",
|
|
503
|
+
textColor: "neutral700",
|
|
504
|
+
style: { marginBottom: 4, display: "block" },
|
|
505
|
+
children: "Таймаут незавершённого депозита"
|
|
506
|
+
}
|
|
507
|
+
),
|
|
508
|
+
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral500", children: "Через сколько минут считать депозит брошенным" })
|
|
509
|
+
] }),
|
|
510
|
+
/* @__PURE__ */ jsx(Box, { style: { width: 100 }, children: /* @__PURE__ */ jsx(
|
|
511
|
+
NumberInput,
|
|
512
|
+
{
|
|
513
|
+
value: config.depositAbandonedTimeoutMinutes ?? 10,
|
|
514
|
+
onValueChange: (val) => handleUpdate({ depositAbandonedTimeoutMinutes: val ?? 10 }),
|
|
515
|
+
disabled,
|
|
516
|
+
step: 1,
|
|
517
|
+
min: 1,
|
|
518
|
+
max: 60
|
|
519
|
+
}
|
|
520
|
+
) }),
|
|
521
|
+
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral500", children: "мин" })
|
|
522
|
+
] })
|
|
523
|
+
}
|
|
524
|
+
),
|
|
525
|
+
config.eventName === "balance_low" && /* @__PURE__ */ jsx(
|
|
526
|
+
Box,
|
|
527
|
+
{
|
|
528
|
+
padding: 4,
|
|
529
|
+
hasRadius: true,
|
|
530
|
+
style: {
|
|
531
|
+
background: colors.event.innerCard,
|
|
532
|
+
border: `1px solid ${colors.event.border}`
|
|
533
|
+
},
|
|
534
|
+
children: /* @__PURE__ */ jsxs(Flex, { alignItems: "center", gap: 3, children: [
|
|
535
|
+
/* @__PURE__ */ jsx(
|
|
536
|
+
Box,
|
|
537
|
+
{
|
|
538
|
+
style: {
|
|
539
|
+
width: 40,
|
|
540
|
+
height: 40,
|
|
541
|
+
borderRadius: 10,
|
|
542
|
+
background: "linear-gradient(135deg, #ef4444 0%, #dc2626 100%)",
|
|
543
|
+
display: "flex",
|
|
544
|
+
alignItems: "center",
|
|
545
|
+
justifyContent: "center",
|
|
546
|
+
color: "#fff",
|
|
547
|
+
flexShrink: 0
|
|
548
|
+
},
|
|
549
|
+
children: /* @__PURE__ */ jsx(Clock, { width: 20, height: 20 })
|
|
550
|
+
}
|
|
551
|
+
),
|
|
552
|
+
/* @__PURE__ */ jsxs(Box, { style: { flex: 1 }, children: [
|
|
553
|
+
/* @__PURE__ */ jsx(
|
|
554
|
+
Typography,
|
|
555
|
+
{
|
|
556
|
+
variant: "pi",
|
|
557
|
+
fontWeight: "bold",
|
|
558
|
+
textColor: "neutral700",
|
|
559
|
+
style: { marginBottom: 4, display: "block" },
|
|
560
|
+
children: "Порог баланса"
|
|
561
|
+
}
|
|
562
|
+
),
|
|
563
|
+
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral500", children: "Событие сработает когда баланс упадёт ниже этой суммы" })
|
|
564
|
+
] }),
|
|
565
|
+
/* @__PURE__ */ jsx(Box, { style: { width: 100 }, children: /* @__PURE__ */ jsx(
|
|
566
|
+
NumberInput,
|
|
567
|
+
{
|
|
568
|
+
value: config.balanceLowThreshold ?? 5,
|
|
569
|
+
onValueChange: (val) => handleUpdate({ balanceLowThreshold: val ?? 5 }),
|
|
570
|
+
disabled,
|
|
571
|
+
step: 0.5,
|
|
572
|
+
min: 0
|
|
573
|
+
}
|
|
574
|
+
) }),
|
|
575
|
+
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral500", children: "$" })
|
|
576
|
+
] })
|
|
577
|
+
}
|
|
578
|
+
),
|
|
466
579
|
/* @__PURE__ */ jsx(
|
|
467
580
|
Box,
|
|
468
581
|
{
|