@yartsun/chat-widget-types 1.0.15 → 1.0.17
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/README.md +20 -0
- package/dist/config.types.d.ts +46 -9
- package/dist/config.types.d.ts.map +1 -1
- package/dist/default-config.d.ts +1 -1
- package/dist/default-config.d.ts.map +1 -1
- package/dist/default-config.js +2 -319
- package/dist/default-config.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/migration/commands.d.ts +1 -0
- package/dist/migration/commands.d.ts.map +1 -1
- package/dist/migration/commands.js +58 -2
- package/dist/migration/commands.js.map +1 -1
- package/dist/migration/examples.d.ts +1 -1
- package/dist/migration/facade.d.ts +8 -0
- package/dist/migration/facade.d.ts.map +1 -1
- package/dist/migration/facade.js +22 -2
- package/dist/migration/facade.js.map +1 -1
- package/dist/migration/migrator.d.ts +1 -0
- package/dist/migration/migrator.d.ts.map +1 -1
- package/dist/migration/migrator.js +23 -4
- package/dist/migration/migrator.js.map +1 -1
- package/dist/migration/strategies.d.ts +52 -0
- package/dist/migration/strategies.d.ts.map +1 -1
- package/dist/migration/strategies.js +277 -4
- package/dist/migration/strategies.js.map +1 -1
- package/dist/migration/types.d.ts +9 -1
- package/dist/migration/types.d.ts.map +1 -1
- package/dist/migration/types.js +7 -1
- package/dist/migration/types.js.map +1 -1
- package/package.json +25 -2
- package/src/config.types.ts +50 -10
- package/src/default-config.ts +3 -329
- package/src/index.ts +5 -3
- package/src/migration/commands.ts +65 -2
- package/src/migration/facade.ts +23 -2
- package/src/migration/migrator.ts +22 -6
- package/src/migration/strategies.ts +291 -4
- package/src/migration/types.ts +11 -1
- package/themes/configV3-shine.json +369 -0
- package/themes/configV3-soft.json +369 -0
- package/themes/configV3-ultra.json +369 -0
- package/themes/configV3.json +370 -0
package/src/default-config.ts
CHANGED
|
@@ -1,329 +1,3 @@
|
|
|
1
|
-
import type { WidgetConfig } from
|
|
2
|
-
|
|
3
|
-
export const DEFAULT_CONFIG: WidgetConfig =
|
|
4
|
-
schema: { // Схема віджета
|
|
5
|
-
version: '1.0',
|
|
6
|
-
required: ['settings', 'texts', 'sections'],
|
|
7
|
-
},
|
|
8
|
-
settings: { // Настройки
|
|
9
|
-
bgChat: '#434345', // Фон чата
|
|
10
|
-
gapMessageLine: 12, // Відстань між повідомленнями
|
|
11
|
-
fontFamily: 'MacPaw Fixel', // Шрифт
|
|
12
|
-
borderRadius: 12, // Радіус округлості чату
|
|
13
|
-
launchView: 'closed', // Початковий стан чату
|
|
14
|
-
letterSpacing: 0, // Інтервал між літерами
|
|
15
|
-
logo: '<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.22048 12.26L8.71413 11.1293C9.1535 10.1231 9.94426 9.32209 10.9307 8.88424L12.2895 8.28107C12.7215 8.08931 12.7215 7.46082 12.2895 7.26906L10.9731 6.68472C9.9613 6.23561 9.15637 5.40496 8.72453 4.3644L8.22447 3.15941C8.0389 2.71224 7.42105 2.71224 7.23548 3.15941L6.7354 4.36439C6.30357 5.40496 5.49861 6.23561 4.48686 6.68472L3.17045 7.26906C2.73843 7.46082 2.73843 8.08931 3.17045 8.28107L4.5293 8.88424C5.51569 9.32209 6.30646 10.1231 6.7458 11.1293L7.23948 12.26C7.42924 12.6946 8.03069 12.6946 8.22048 12.26ZM13.1632 15.0131L13.302 14.6949C13.5495 14.1275 13.9953 13.6758 14.5515 13.4287L14.9792 13.2386C15.2106 13.1358 15.2106 12.7996 14.9792 12.6969L14.5754 12.5174C14.0049 12.264 13.5511 11.7955 13.3078 11.2089L13.1653 10.865C13.0659 10.6254 12.7346 10.6254 12.6352 10.865L12.4927 11.2089C12.2494 11.7955 11.7957 12.264 11.2251 12.5174L10.8213 12.6969C10.59 12.7996 10.59 13.1358 10.8213 13.2386L11.249 13.4287C11.8053 13.6758 12.251 14.1275 12.4985 14.6949L12.6374 15.0131C12.739 15.246 13.0615 15.246 13.1632 15.0131Z" fill="currentColor"/></svg>',
|
|
16
|
-
fontWeight: 500, // Товщина шрифту
|
|
17
|
-
lineHeight: 1.2, // Висота рядка
|
|
18
|
-
loader: 'dots', // Тип лоадера
|
|
19
|
-
globalRoundingRadius: true, // Радиус округлости чата
|
|
20
|
-
theme: 'light', // Тема
|
|
21
|
-
mode: 'collapsed', // Режим
|
|
22
|
-
position: 'bottomRight', // Положение
|
|
23
|
-
size: {
|
|
24
|
-
width: 435,
|
|
25
|
-
height: 450,
|
|
26
|
-
},
|
|
27
|
-
offset: {
|
|
28
|
-
x: 24,
|
|
29
|
-
y: 36,
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
texts: { // Тексти
|
|
33
|
-
welcomeMessage:
|
|
34
|
-
'🖖 Hi there — I’m your assistant for finding documents, tracking access, and making sense of your files. \n\nHow can I help?', // Привітання
|
|
35
|
-
widgetTitle: 'HyperShadow', // Заголовок чату
|
|
36
|
-
launchIssueTitle: 'There was a glitch', // Заголовок помилки запуску
|
|
37
|
-
launchIssueText: 'Please restart the chat, it should work', // Текст помилки запуску
|
|
38
|
-
issueText: 'Something went wrong, please restart', // Текст помилки в процесі
|
|
39
|
-
reconnectText: 'Connection issue, trying to reconnect', // Текст помилки перепідключення
|
|
40
|
-
inputPlaceholder: 'Type question', // Плейсхолдер для введення тексту
|
|
41
|
-
disableInputText:
|
|
42
|
-
'Can’t send a message while processing the previous request', // Текст заблокованого введення
|
|
43
|
-
disclaimer: 'AI-Copilot makes mistakes, please don’t consider 100% accurate', // Дисклеймер
|
|
44
|
-
typingLoader: 'AI-Co-pilot typing', // Тип лоадера
|
|
45
|
-
sendButton: 'Send', // Текст кнопки відправлення
|
|
46
|
-
},
|
|
47
|
-
sections: { // Секції віджета
|
|
48
|
-
colapsed: { // Коллапс
|
|
49
|
-
color: '#fff', // Колір тексту
|
|
50
|
-
bgColor: '#7D52F4', // Колір фону
|
|
51
|
-
width: 56,
|
|
52
|
-
height: 56,
|
|
53
|
-
borderRadius: 50,
|
|
54
|
-
borderWidth: 8,
|
|
55
|
-
borderColor: 'rgba(29, 29, 31, 0.90)',
|
|
56
|
-
logo: '<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.22048 12.26L8.71413 11.1293C9.1535 10.1231 9.94426 9.32209 10.9307 8.88424L12.2895 8.28107C12.7215 8.08931 12.7215 7.46082 12.2895 7.26906L10.9731 6.68472C9.9613 6.23561 9.15637 5.40496 8.72453 4.3644L8.22447 3.15941C8.0389 2.71224 7.42105 2.71224 7.23548 3.15941L6.7354 4.36439C6.30357 5.40496 5.49861 6.23561 4.48686 6.68472L3.17045 7.26906C2.73843 7.46082 2.73843 8.08931 3.17045 8.28107L4.5293 8.88424C5.51569 9.32209 6.30646 10.1231 6.7458 11.1293L7.23948 12.26C7.42924 12.6946 8.03069 12.6946 8.22048 12.26ZM13.1632 15.0131L13.302 14.6949C13.5495 14.1275 13.9953 13.6758 14.5515 13.4287L14.9792 13.2386C15.2106 13.1358 15.2106 12.7996 14.9792 12.6969L14.5754 12.5174C14.0049 12.264 13.5511 11.7955 13.3078 11.2089L13.1653 10.865C13.0659 10.6254 12.7346 10.6254 12.6352 10.865L12.4927 11.2089C12.2494 11.7955 11.7957 12.264 11.2251 12.5174L10.8213 12.6969C10.59 12.7996 10.59 13.1358 10.8213 13.2386L11.249 13.4287C11.8053 13.6758 12.251 14.1275 12.4985 14.6949L12.6374 15.0131C12.739 15.246 13.0615 15.246 13.1632 15.0131Z" fill="currentColor"/></svg>',
|
|
57
|
-
icon: {
|
|
58
|
-
showIcon: true,
|
|
59
|
-
size: 18,
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
warnings: { // Попередження
|
|
63
|
-
launchIssue: { // Помилка запуску
|
|
64
|
-
warningStyle: 'faded', // Стиль попередження
|
|
65
|
-
content: {
|
|
66
|
-
icon: {
|
|
67
|
-
showIcon: true,
|
|
68
|
-
src: '<svg width="24" height="25" viewBox="0 0 24 25" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M21.76 16.42L15.36 4.9C14.5 3.35 13.31 2.5 12 2.5C10.69 2.5 9.5 3.35 8.64 4.9L2.24 16.42C1.43 17.89 1.34 19.3 1.99 20.41C2.64 21.52 3.92 22.13 5.6 22.13H18.4C20.08 22.13 21.36 21.52 22.01 20.41C22.66 19.3 22.57 17.88 21.76 16.42ZM12.71 18.21C12.66 18.25 12.61 18.29 12.56 18.33C12.5 18.37 12.44 18.4 12.38 18.42C12.32 18.45 12.26 18.47 12.19 18.48C12.13 18.49 12.06 18.5 12 18.5C11.94 18.5 11.87 18.49 11.8 18.48C11.74 18.47 11.68 18.45 11.62 18.42C11.56 18.4 11.5 18.37 11.44 18.33C11.39 18.29 11.34 18.25 11.29 18.21C11.11 18.02 11 17.76 11 17.5C11 17.24 11.11 16.98 11.29 16.79C11.34 16.75 11.39 16.71 11.44 16.67C11.5 16.63 11.56 16.6 11.62 16.58C11.68 16.55 11.74 16.53 11.8 16.52C11.93 16.49 12.07 16.49 12.19 16.52C12.26 16.53 12.32 16.55 12.38 16.58C12.44 16.6 12.5 16.63 12.56 16.67C12.61 16.71 12.66 16.75 12.71 16.79C12.89 16.98 13 17.24 13 17.5C13 17.76 12.89 18.02 12.71 18.21ZM11.25 9.5C11.25 9.09 11.59 8.75 12 8.75C12.41 8.75 12.75 9.09 12.75 9.5V14.5C12.75 14.91 12.41 15.25 12 15.25C11.59 15.25 11.25 14.91 11.25 14.5V9.5Z" fill="currentColor"/></svg>',
|
|
69
|
-
color: '#FFCC77',
|
|
70
|
-
size: 24,
|
|
71
|
-
},
|
|
72
|
-
bgColor: '#8A7045', // Колір фону
|
|
73
|
-
verticalSpacing: 4,
|
|
74
|
-
sidePadding: 8,
|
|
75
|
-
headlineColor: '#f9c97c', // Колір заголовка
|
|
76
|
-
color: '#fff', // Колір тексту
|
|
77
|
-
headlineTextSize: 12, // Размер заголовка
|
|
78
|
-
subTextSize: 12, // Размер текста
|
|
79
|
-
},
|
|
80
|
-
resetButton: { // Кнопка скидання
|
|
81
|
-
bgType: 'filled',
|
|
82
|
-
showType: 'both',
|
|
83
|
-
borderRadius: 12,
|
|
84
|
-
size: 'md',
|
|
85
|
-
color: '#2e2e30', // Колір тексту кнопки
|
|
86
|
-
bgColor: '#e5e1dd', // Колір фону кнопки
|
|
87
|
-
fontSize: 12,
|
|
88
|
-
icon: {
|
|
89
|
-
showIcon: true,
|
|
90
|
-
src: '<svg width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.793 1.83301H5.20634C2.77967 1.83301 1.33301 3.27967 1.33301 5.70634V11.2863C1.33301 13.7197 2.77967 15.1663 5.20634 15.1663H10.7863C13.213 15.1663 14.6597 13.7197 14.6597 11.293V5.70634C14.6663 3.27967 13.2197 1.83301 10.793 1.83301ZM7.99967 12.6663C6.80634 12.6663 5.87301 12.073 5.23967 11.4863V11.9597C5.23967 12.233 5.01301 12.4597 4.73967 12.4597C4.46634 12.4597 4.23967 12.233 4.23967 11.9597V10.1263C4.23967 9.85301 4.46634 9.62634 4.73967 9.62634H6.39301C6.66634 9.62634 6.89301 9.85301 6.89301 10.1263C6.89301 10.3997 6.66634 10.6263 6.39301 10.6263H5.79301C6.28634 11.1197 7.05301 11.6663 7.99967 11.6663C9.74634 11.6663 11.1663 10.2463 11.1663 8.49967C11.1663 8.22634 11.393 7.99967 11.6663 7.99967C11.9397 7.99967 12.1663 8.22634 12.1663 8.49967C12.1663 10.7997 10.2997 12.6663 7.99967 12.6663ZM12.1663 6.85967C12.1663 6.87967 12.1663 6.89967 12.1663 6.91301C12.1597 6.98634 12.1397 7.05301 12.1063 7.11301C12.073 7.17301 12.0263 7.22634 11.9663 7.27301C11.9197 7.30634 11.8663 7.33301 11.8063 7.35301C11.7597 7.36634 11.713 7.37301 11.6663 7.37301H10.0463C9.77301 7.37301 9.54634 7.14634 9.54634 6.87301C9.54634 6.59967 9.77301 6.37301 10.0463 6.37301H10.5997C10.0663 5.87967 9.20634 5.33301 8.01301 5.33301C6.26634 5.33301 4.84634 6.75301 4.84634 8.49967C4.84634 8.77301 4.61967 8.99967 4.34634 8.99967C4.07301 8.99967 3.83301 8.77301 3.83301 8.49967C3.83301 6.19967 5.69967 4.33301 7.99967 4.33301C9.43301 4.33301 10.4863 4.95301 11.1663 5.54634V5.03967C11.1663 4.76634 11.393 4.53967 11.6663 4.53967C11.9397 4.53967 12.1663 4.76634 12.1663 5.03967V6.85967Z" fill="currentColor"/></svg>',
|
|
91
|
-
color: '#2e2e30',
|
|
92
|
-
size: 16,
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
connectionIssue: { // Помилка фатальна в процесі
|
|
97
|
-
warningStyle: 'faded', // Стиль попередження
|
|
98
|
-
content: { // Параметри попередження
|
|
99
|
-
icon: {
|
|
100
|
-
showIcon: true, // Показувати іконку
|
|
101
|
-
src: '<svg width="24" height="25" viewBox="0 0 24 25" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M21.76 16.42L15.36 4.9C14.5 3.35 13.31 2.5 12 2.5C10.69 2.5 9.49998 3.35 8.63998 4.9L2.23998 16.42C1.42998 17.89 1.33998 19.3 1.98998 20.41C2.63998 21.52 3.91998 22.13 5.59998 22.13H18.4C20.08 22.13 21.36 21.52 22.01 20.41C22.66 19.3 22.57 17.88 21.76 16.42ZM11.25 9.5C11.25 9.09 11.59 8.75 12 8.75C12.41 8.75 12.75 9.09 12.75 9.5V14.5C12.75 14.91 12.41 15.25 12 15.25C11.59 15.25 11.25 14.91 11.25 14.5V9.5ZM12.71 18.21C12.66 18.25 12.61 18.29 12.56 18.33C12.5 18.37 12.44 18.4 12.38 18.42C12.32 18.45 12.26 18.47 12.19 18.48C12.13 18.49 12.06 18.5 12 18.5C11.94 18.5 11.87 18.49 11.8 18.48C11.74 18.47 11.68 18.45 11.62 18.42C11.56 18.4 11.5 18.37 11.44 18.33C11.39 18.29 11.34 18.25 11.29 18.21C11.11 18.02 11 17.76 11 17.5C11 17.24 11.11 16.98 11.29 16.79C11.34 16.75 11.39 16.71 11.44 16.67C11.5 16.63 11.56 16.6 11.62 16.58C11.68 16.55 11.74 16.53 11.8 16.52C11.93 16.49 12.07 16.49 12.19 16.52C12.26 16.53 12.32 16.55 12.38 16.58C12.44 16.6 12.5 16.63 12.56 16.67C12.61 16.71 12.66 16.75 12.71 16.79C12.89 16.98 13 17.24 13 17.5C13 17.76 12.89 18.02 12.71 18.21Z" fill="#FFCC77"/>\n</svg>',
|
|
102
|
-
color: '#fff',
|
|
103
|
-
size: 16,
|
|
104
|
-
},
|
|
105
|
-
bgColor: '#8A7045', // Колір фону
|
|
106
|
-
verticalSpacing: 8,
|
|
107
|
-
sidePadding: 8,
|
|
108
|
-
color: '#fff', // Колір тексту
|
|
109
|
-
},
|
|
110
|
-
resetButton: { // Кнопка скидання
|
|
111
|
-
bgType: 'filled',
|
|
112
|
-
showType: 'both',
|
|
113
|
-
borderRadius: 12,
|
|
114
|
-
size: 'md',
|
|
115
|
-
color: '#2e2e30', // Колір тексту кнопки
|
|
116
|
-
bgColor: '#e5e1dd', // Колір фону кнопки
|
|
117
|
-
fontSize: 12,
|
|
118
|
-
icon: {
|
|
119
|
-
showIcon: true,
|
|
120
|
-
src: '<svg width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.793 1.83301H5.20634C2.77967 1.83301 1.33301 3.27967 1.33301 5.70634V11.2863C1.33301 13.7197 2.77967 15.1663 5.20634 15.1663H10.7863C13.213 15.1663 14.6597 13.7197 14.6597 11.293V5.70634C14.6663 3.27967 13.2197 1.83301 10.793 1.83301ZM7.99967 12.6663C6.80634 12.6663 5.87301 12.073 5.23967 11.4863V11.9597C5.23967 12.233 5.01301 12.4597 4.73967 12.4597C4.46634 12.4597 4.23967 12.233 4.23967 11.9597V10.1263C4.23967 9.85301 4.46634 9.62634 4.73967 9.62634H6.39301C6.66634 9.62634 6.89301 9.85301 6.89301 10.1263C6.89301 10.3997 6.66634 10.6263 6.39301 10.6263H5.79301C6.28634 11.1197 7.05301 11.6663 7.99967 11.6663C9.74634 11.6663 11.1663 10.2463 11.1663 8.49967C11.1663 8.22634 11.393 7.99967 11.6663 7.99967C11.9397 7.99967 12.1663 8.22634 12.1663 8.49967C12.1663 10.7997 10.2997 12.6663 7.99967 12.6663ZM12.1663 6.85967C12.1663 6.87967 12.1663 6.89967 12.1663 6.91301C12.1597 6.98634 12.1397 7.05301 12.1063 7.11301C12.073 7.17301 12.0263 7.22634 11.9663 7.27301C11.9197 7.30634 11.8663 7.33301 11.8063 7.35301C11.7597 7.36634 11.713 7.37301 11.6663 7.37301H10.0463C9.77301 7.37301 9.54634 7.14634 9.54634 6.87301C9.54634 6.59967 9.77301 6.37301 10.0463 6.37301H10.5997C10.0663 5.87967 9.20634 5.33301 8.01301 5.33301C6.26634 5.33301 4.84634 6.75301 4.84634 8.49967C4.84634 8.77301 4.61967 8.99967 4.34634 8.99967C4.07301 8.99967 3.83301 8.77301 3.83301 8.49967C3.83301 6.19967 5.69967 4.33301 7.99967 4.33301C9.43301 4.33301 10.4863 4.95301 11.1663 5.54634V5.03967C11.1663 4.76634 11.393 4.53967 11.6663 4.53967C11.9397 4.53967 12.1663 4.76634 12.1663 5.03967V6.85967Z" fill="currentColor"/></svg>',
|
|
121
|
-
color: '#2e2e30',
|
|
122
|
-
size: 16,
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
reconnectIssue: { // Помилка перепідключення
|
|
127
|
-
warningStyle: 'gradient', // Стиль попередження
|
|
128
|
-
content: { // Параметри попередження
|
|
129
|
-
bgColor: '#8A7045', // Колір фону
|
|
130
|
-
color: '#fff', // Колір тексту
|
|
131
|
-
borderRadius: 12,
|
|
132
|
-
verticalSpacing: 8,
|
|
133
|
-
sidePadding: 8,
|
|
134
|
-
margin: 8,
|
|
135
|
-
icon: {
|
|
136
|
-
showIcon: true, // Показувати іконку
|
|
137
|
-
src:
|
|
138
|
-
'<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d=\"M4 4.02667C3.06667 5.08667 2.5 6.48 2.5 8C2.5 11.3133 5.18667 14 8.5 14C11.8133 14 14.5 11.3133 14.5 8C14.5 4.68667 11.8133 2 8.5 2C8.02667 2 7.56667 2.05333 7.12667 2.16\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>',
|
|
139
|
-
color: '#FFF',
|
|
140
|
-
size: 16,
|
|
141
|
-
}
|
|
142
|
-
},
|
|
143
|
-
},
|
|
144
|
-
disableInputIssue: { // Блокування введення
|
|
145
|
-
warningStyle: 'gradient', // Стиль попередження
|
|
146
|
-
content: { // Параметри попередження
|
|
147
|
-
bgColor: '#8A7045', // Колір фону
|
|
148
|
-
color: '#fff', // Колір тексту
|
|
149
|
-
icon: {
|
|
150
|
-
showIcon: true, // Показувати іконку
|
|
151
|
-
src:
|
|
152
|
-
'<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d=\"M4 4.02667C3.06667 5.08667 2.5 6.48 2.5 8C2.5 11.3133 5.18667 14 8.5 14C11.8133 14 14.5 11.3133 14.5 8C14.5 4.68667 11.8133 2 8.5 2C8.02667 2 7.56667 2.05333 7.12667 2.16\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>',
|
|
153
|
-
color: '#FFF',
|
|
154
|
-
}},
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
},
|
|
158
|
-
},
|
|
159
|
-
loader: {
|
|
160
|
-
typingLoader:{
|
|
161
|
-
color: '#8E8E8F',
|
|
162
|
-
bgColor: '#2F2F31',
|
|
163
|
-
},
|
|
164
|
-
completeStep: {
|
|
165
|
-
verticalSpacing: 8,
|
|
166
|
-
fontSize: 12,
|
|
167
|
-
color: '#8E8E8F',
|
|
168
|
-
icon: {
|
|
169
|
-
showIcon: true,
|
|
170
|
-
src: '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path opacity="0.4" d="M7.99967 14.6666C11.6816 14.6666 14.6663 11.6818 14.6663 7.99992C14.6663 4.31802 11.6816 1.33325 7.99967 1.33325C4.31778 1.33325 1.33301 4.31802 1.33301 7.99992C1.33301 11.6818 4.31778 14.6666 7.99967 14.6666Z" fill="currentColor"></path><path d="M7.05297 10.3867C6.91964 10.3867 6.79297 10.3334 6.69964 10.2401L4.81297 8.3534C4.61964 8.16007 4.61964 7.84007 4.81297 7.64673C5.0063 7.4534 5.3263 7.4534 5.51964 7.64673L7.05297 9.18007L10.4796 5.7534C10.673 5.56007 10.993 5.56007 11.1863 5.7534C11.3796 5.94673 11.3796 6.26673 11.1863 6.46006L7.4063 10.2401C7.31297 10.3334 7.1863 10.3867 7.05297 10.3867Z" fill="currentColor"></path></svg>',
|
|
171
|
-
color: '#8E8E8F',
|
|
172
|
-
size: 16,
|
|
173
|
-
}
|
|
174
|
-
},
|
|
175
|
-
activeStep: {
|
|
176
|
-
fontSize: 12,
|
|
177
|
-
color: '#FFF',
|
|
178
|
-
icon: {
|
|
179
|
-
showIcon: true,
|
|
180
|
-
src: '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.5 4.02667C2.56667 5.08667 2 6.48 2 8C2 11.3133 4.68667 14 8 14C11.3133 14 14 11.3133 14 8C14 4.68667 11.3133 2 8 2C7.52667 2 7.06667 2.05333 6.62667 2.16" stroke="currentColor" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/></svg>',
|
|
181
|
-
color: '#fff',
|
|
182
|
-
size: 16,
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
},
|
|
186
|
-
top: { // Верхня частина віджета
|
|
187
|
-
params: { // Параметри верхньої частини
|
|
188
|
-
size: 'md', // Розмір
|
|
189
|
-
bgColor: '#5E4AC6', // Колір фону
|
|
190
|
-
bgStyle: 'gradient', // Стиль фону
|
|
191
|
-
paddingVertical: 8, // Вертикальний відступ
|
|
192
|
-
paddingHorizontal: 8, // Горизонтальний відступ
|
|
193
|
-
chipStyle: 'filled', // Стиль чіпа
|
|
194
|
-
buttonStyle: 'filled', // Стиль кнопки
|
|
195
|
-
},
|
|
196
|
-
chipWidgetTitle: { // Заголовок чипа
|
|
197
|
-
color: '#fff', // Колір тексту
|
|
198
|
-
bgColor: '#5E4AC6', // Колір фону
|
|
199
|
-
borderRadius: 12,
|
|
200
|
-
showType: 'both',
|
|
201
|
-
},
|
|
202
|
-
buttons: { // Кнопки
|
|
203
|
-
color: '#BBBBBD', // Колір тексту
|
|
204
|
-
bgColor: '#2F2F31', // Колір фону
|
|
205
|
-
borderRadius: 12,
|
|
206
|
-
showType: 'both',
|
|
207
|
-
},
|
|
208
|
-
},
|
|
209
|
-
inside: { // Внутрішня частина віджета
|
|
210
|
-
params: { // Параметри внутрішньої частини
|
|
211
|
-
size: 'md', // Розмір
|
|
212
|
-
letterSpacing: 0,
|
|
213
|
-
},
|
|
214
|
-
welcomeMessage: { // Привітання
|
|
215
|
-
color: '#fff', // Колір тексту
|
|
216
|
-
bgType: 'gradient', // Стиль фону
|
|
217
|
-
fontSize: 14,
|
|
218
|
-
size: 'md',
|
|
219
|
-
borderRadius: 12,
|
|
220
|
-
borderWidth: 1,
|
|
221
|
-
bgColor: '#595959',
|
|
222
|
-
},
|
|
223
|
-
messageUser: { // Повідомлення користувача
|
|
224
|
-
color: '#F9F8F8', // Колір тексту
|
|
225
|
-
bgColor: '#F8F8F933', // Колір фону
|
|
226
|
-
bgType: 'bubble', // Тип фону
|
|
227
|
-
borderRadius: 12,
|
|
228
|
-
fontSize: 14,
|
|
229
|
-
size: 'md',
|
|
230
|
-
borderWidth: 1,
|
|
231
|
-
borderColor: '#595959',
|
|
232
|
-
},
|
|
233
|
-
messageBot: { // Повідомлення бота
|
|
234
|
-
color: '#fff', // Колір тексту
|
|
235
|
-
bgColor: '#5E4AC6', // Колір фону
|
|
236
|
-
bgType: 'plain', // Тип фону
|
|
237
|
-
borderRadius: 12,
|
|
238
|
-
fontSize: 14,
|
|
239
|
-
size: 'md',
|
|
240
|
-
borderWidth: 1,
|
|
241
|
-
borderColor: '#595959',
|
|
242
|
-
},
|
|
243
|
-
activeSnippet: { // Сніппет
|
|
244
|
-
params: { // Параметри сніппета
|
|
245
|
-
buttonType: 'both', // Тип кнопки
|
|
246
|
-
buttonStyle: 'filled', // Стиль кнопки
|
|
247
|
-
size: 'md', // Розмір
|
|
248
|
-
},
|
|
249
|
-
element: {
|
|
250
|
-
color: '#fff', // Колір тексту
|
|
251
|
-
bgColor: '#373739', // Колір фону
|
|
252
|
-
borderRadius: 12,
|
|
253
|
-
borderWidth: 1,
|
|
254
|
-
borderColor: '#595959',
|
|
255
|
-
verticalSpacing: 8,
|
|
256
|
-
sidePadding: 8,
|
|
257
|
-
fontSize: 12,
|
|
258
|
-
},
|
|
259
|
-
headerChip: { // Заголовок чипа
|
|
260
|
-
color: '#fff', // Колір тексту
|
|
261
|
-
bgColor: '#69696A', // Колір фону
|
|
262
|
-
borderRadius: 12,
|
|
263
|
-
size: 'md',
|
|
264
|
-
fontSize: 12,
|
|
265
|
-
bgType: 'filled',
|
|
266
|
-
},
|
|
267
|
-
propertyColor: 'rgba(255, 255, 255, 0.30)', // Колір тексту
|
|
268
|
-
valueColor: '#fff', // Колір тексту
|
|
269
|
-
yesButton: { // Кнопка так
|
|
270
|
-
color: '#fff', // Колір тексту
|
|
271
|
-
bgColor: '#12A150', // Колір фону
|
|
272
|
-
borderRadius: 12,
|
|
273
|
-
fontSize: 12,
|
|
274
|
-
},
|
|
275
|
-
noButton: { // Кнопка ні
|
|
276
|
-
color: '#fff', // Колір тексту
|
|
277
|
-
bgColor: '#C20E4D', // Колір фону
|
|
278
|
-
borderRadius: 12,
|
|
279
|
-
fontSize: 12,
|
|
280
|
-
},
|
|
281
|
-
},
|
|
282
|
-
},
|
|
283
|
-
bottom: { // Нижня частина віджета
|
|
284
|
-
params: { // Параметри нижньої частини
|
|
285
|
-
size: 'md', // Розмір
|
|
286
|
-
disclaimerShow: false, // Показувати дисклеймер
|
|
287
|
-
},
|
|
288
|
-
inputSend: { // Кнопка відправлення
|
|
289
|
-
size: 'md',
|
|
290
|
-
color: '#EEECEC', // Колір тексту
|
|
291
|
-
bgColor: '#373739', // Колір фону
|
|
292
|
-
borderColor: '#595959', // Колір бордера
|
|
293
|
-
borderWidth: 1, // Ширина бордера
|
|
294
|
-
inputStyle: 'inside', // Стиль введення
|
|
295
|
-
bgType: 'plain', // Тип фону
|
|
296
|
-
paddingVertical: 8,
|
|
297
|
-
paddingHorizontal: 8,
|
|
298
|
-
sidePadding: 8,
|
|
299
|
-
fontSize: 12,
|
|
300
|
-
borderRadius: 8,
|
|
301
|
-
},
|
|
302
|
-
btnSend: { // Кнопка відправлення
|
|
303
|
-
color: '#1E1E1E', // Колір тексту
|
|
304
|
-
bgColor: 'rgba(255, 255, 255, 0.50)', // Колір фону
|
|
305
|
-
showType: 'both', // Тип кнопки
|
|
306
|
-
borderWidth: 1,
|
|
307
|
-
borderColor: '#595959',
|
|
308
|
-
borderRadius: 50,
|
|
309
|
-
size: 'md',
|
|
310
|
-
fontSize: 12,
|
|
311
|
-
icon: {
|
|
312
|
-
showIcon: true,
|
|
313
|
-
src: '<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 2.56445C9.01973 2.56449 9.03453 2.57164 9.04395 2.58105L13.5967 7.13379C13.606 7.14324 13.6133 7.15811 13.6133 7.17773C13.6132 7.19738 13.606 7.21226 13.5967 7.22168L13.5898 7.22754L13.584 7.23438C13.5865 7.23164 13.5864 7.23284 13.5801 7.23535C13.5732 7.23801 13.5633 7.24018 13.5527 7.24023C13.5431 7.24023 13.5351 7.23862 13.5293 7.23633C13.524 7.23419 13.5171 7.22992 13.5088 7.22168L9 2.71289L4.49121 7.22168C4.48176 7.23107 4.46699 7.23828 4.44727 7.23828C4.42752 7.23826 4.41275 7.23109 4.40332 7.22168C4.3939 7.21226 4.38676 7.19747 4.38672 7.17773C4.38672 7.15801 4.39393 7.14324 4.40332 7.13379L8.95605 2.58105C8.9655 2.57167 8.98027 2.56445 9 2.56445Z" stroke="currentColor"/><path d="M9 2.68994C9.01306 2.68994 9.02868 2.69518 9.04297 2.70947C9.05726 2.72376 9.0625 2.73938 9.0625 2.75244V15.3745C9.0625 15.3875 9.0571 15.4032 9.04297 15.4175C9.02868 15.4318 9.01306 15.437 9 15.437C8.98694 15.437 8.97132 15.4318 8.95703 15.4175C8.9429 15.4032 8.9375 15.3875 8.9375 15.3745V2.75244C8.9375 2.73938 8.94274 2.72376 8.95703 2.70947C8.97132 2.69518 8.98694 2.68994 9 2.68994Z" fill="currentColor" stroke="currentColor"/></svg>',
|
|
314
|
-
color: '#fff',
|
|
315
|
-
size: 18,
|
|
316
|
-
},
|
|
317
|
-
},
|
|
318
|
-
disclaimer: { // Дисклеймер
|
|
319
|
-
color: '#fff', // Колір тексту
|
|
320
|
-
bgColor: '#FF0000', // Колір фону
|
|
321
|
-
height: 20, // Висота
|
|
322
|
-
fontSize: 12, // Розмір тексту
|
|
323
|
-
},
|
|
324
|
-
},
|
|
325
|
-
},
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
1
|
+
import type { WidgetConfig } from "./config.types";
|
|
2
|
+
import configV3 from "../themes/configV3.json";
|
|
3
|
+
export const DEFAULT_CONFIG: WidgetConfig = configV3 as WidgetConfig;
|
package/src/index.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export * from './config.types'
|
|
2
2
|
export * from './utils'
|
|
3
3
|
export { DEFAULT_CONFIG } from './default-config'
|
|
4
|
-
|
|
5
|
-
//
|
|
6
|
-
//
|
|
4
|
+
// Theme presets are exported via package subpath exports (see `package.json#exports`):
|
|
5
|
+
// - `@yartsun/chat-widget-types/themes/<file>.json`
|
|
6
|
+
// - `@yartsun/chat-widget-types/THEME_V3_*`
|
|
7
|
+
// Config migration system
|
|
8
|
+
// Explicit re-export with an alias for the conflicting name `ConfigSchema`
|
|
7
9
|
export {
|
|
8
10
|
ConfigVersion,
|
|
9
11
|
MigrationResult,
|
|
@@ -161,7 +161,31 @@ export class DefaultVersionDetector implements VersionDetector {
|
|
|
161
161
|
return null
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
//
|
|
164
|
+
// Explicit schema version hint (helps distinguish 3.1 configs).
|
|
165
|
+
if ((config as any)?.schema?.version === '3.1') {
|
|
166
|
+
return '3.1'
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// V3 signals: presence of enhanced fields
|
|
170
|
+
const hasV3Features = [
|
|
171
|
+
config.settings.theme !== undefined,
|
|
172
|
+
config.settings.container !== undefined,
|
|
173
|
+
config.sections.top.params?.border !== undefined,
|
|
174
|
+
config.sections.top.params?.sideMargin !== undefined,
|
|
175
|
+
config.sections.top.params?.borderRadius !== undefined,
|
|
176
|
+
config.sections.inside.dataAction !== undefined,
|
|
177
|
+
config.sections.bottom.btnVoice !== undefined,
|
|
178
|
+
config.sections.inside.welcomeMessage?.borderColor !== undefined,
|
|
179
|
+
]
|
|
180
|
+
|
|
181
|
+
// If there are at least 3 V3 signals, treat it as V3 family (3.0/3.1)
|
|
182
|
+
const v3FeaturesCount = hasV3Features.filter(Boolean).length
|
|
183
|
+
if (v3FeaturesCount >= 3) {
|
|
184
|
+
// Default to 3.0 when schema version is not explicitly set to 3.1.
|
|
185
|
+
return (config as any)?.schema?.version === '3.1' ? '3.1' : '3.0'
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// V2 signals: presence of newer fields
|
|
165
189
|
const hasV2Features = [
|
|
166
190
|
config.settings.loader !== undefined,
|
|
167
191
|
config.settings.buttonStyle !== undefined,
|
|
@@ -174,7 +198,7 @@ export class DefaultVersionDetector implements VersionDetector {
|
|
|
174
198
|
config.sections.bottom.disclaimer !== undefined
|
|
175
199
|
]
|
|
176
200
|
|
|
177
|
-
//
|
|
201
|
+
// If there are at least 3 V2 signals, treat it as V2
|
|
178
202
|
const v2FeaturesCount = hasV2Features.filter(Boolean).length
|
|
179
203
|
if (v2FeaturesCount >= 3) {
|
|
180
204
|
return '2.0'
|
|
@@ -236,6 +260,10 @@ export class DefaultConfigValidator implements ConfigValidator {
|
|
|
236
260
|
case '2.0':
|
|
237
261
|
this.validateV2(config, errors, warnings)
|
|
238
262
|
break
|
|
263
|
+
case '3.0':
|
|
264
|
+
case '3.1':
|
|
265
|
+
this.validateV3(config, errors, warnings)
|
|
266
|
+
break
|
|
239
267
|
default:
|
|
240
268
|
warnings.push(`Валидация для версии ${version} не реализована`)
|
|
241
269
|
}
|
|
@@ -285,6 +313,41 @@ export class DefaultConfigValidator implements ConfigValidator {
|
|
|
285
313
|
}
|
|
286
314
|
}
|
|
287
315
|
|
|
316
|
+
private validateV3(config: any, errors: string[], warnings: string[]): void {
|
|
317
|
+
// Сначала валидируем как V2
|
|
318
|
+
this.validateV2(config, errors, warnings)
|
|
319
|
+
|
|
320
|
+
// Дополнительные проверки для V3
|
|
321
|
+
const expectedV3Fields = [
|
|
322
|
+
'settings.theme',
|
|
323
|
+
'settings.container',
|
|
324
|
+
'sections.top.params.border',
|
|
325
|
+
'sections.top.params.sideMargin',
|
|
326
|
+
'sections.top.params.borderRadius',
|
|
327
|
+
'sections.inside.dataAction',
|
|
328
|
+
'sections.bottom.btnVoice'
|
|
329
|
+
]
|
|
330
|
+
|
|
331
|
+
for (const field of expectedV3Fields) {
|
|
332
|
+
if (!this.getNestedValue(config, field)) {
|
|
333
|
+
warnings.push(`Рекомендуется добавить поле V3: ${field}`)
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
// Проверяем структуру container если он есть
|
|
338
|
+
if (config.settings?.container) {
|
|
339
|
+
if (!config.settings.container.innerBorder) {
|
|
340
|
+
warnings.push('settings.container.innerBorder рекомендуется добавить')
|
|
341
|
+
}
|
|
342
|
+
if (!config.settings.container.outerBorder) {
|
|
343
|
+
warnings.push('settings.container.outerBorder рекомендуется добавить')
|
|
344
|
+
}
|
|
345
|
+
if (!config.settings.container.gradient) {
|
|
346
|
+
warnings.push('settings.container.gradient is recommended to add')
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
288
351
|
private getNestedValue(obj: any, path: string): any {
|
|
289
352
|
return path.split('.').reduce((current, key) => current?.[key], obj)
|
|
290
353
|
}
|
package/src/migration/facade.ts
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
MigrationResult,
|
|
8
8
|
MigrationOptions,
|
|
9
9
|
MigrationReport,
|
|
10
|
+
LATEST_CONFIG_VERSION,
|
|
10
11
|
ConfigV1,
|
|
11
12
|
ConfigV2
|
|
12
13
|
} from './types'
|
|
@@ -17,7 +18,7 @@ import { WidgetConfig } from '../config.types'
|
|
|
17
18
|
export class MigrationFacade {
|
|
18
19
|
private migrator: ConfigMigrator
|
|
19
20
|
|
|
20
|
-
constructor(verbose: boolean =
|
|
21
|
+
constructor(verbose: boolean = true) {
|
|
21
22
|
const logger = new DefaultMigrationLogger(verbose)
|
|
22
23
|
this.migrator = new ConfigMigrator(logger)
|
|
23
24
|
}
|
|
@@ -29,11 +30,19 @@ export class MigrationFacade {
|
|
|
29
30
|
return this.migrator.migrate<ConfigV2>(config, '2.0', options)
|
|
30
31
|
}
|
|
31
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Мигрировать конфигурацию V2 в V3 (enhanced)
|
|
35
|
+
*/
|
|
36
|
+
async migrateV2toV3(config: ConfigV2, options?: MigrationOptions): Promise<MigrationResult<WidgetConfig>> {
|
|
37
|
+
return this.migrator.migrate<WidgetConfig>(config, '3.0', options)
|
|
38
|
+
}
|
|
39
|
+
|
|
32
40
|
/**
|
|
33
41
|
* Мигрировать конфигурацию в последнюю версию
|
|
34
42
|
*/
|
|
35
43
|
async migrateToLatest(config: any, options?: MigrationOptions): Promise<MigrationResult<WidgetConfig>> {
|
|
36
|
-
|
|
44
|
+
// Use the latest supported version from the shared version list.
|
|
45
|
+
return this.migrator.migrate<WidgetConfig>(config, LATEST_CONFIG_VERSION, options)
|
|
37
46
|
}
|
|
38
47
|
|
|
39
48
|
/**
|
|
@@ -80,6 +89,18 @@ export async function quickMigrateV1toV2(config: ConfigV1, options?: MigrationOp
|
|
|
80
89
|
}
|
|
81
90
|
}
|
|
82
91
|
|
|
92
|
+
/**
|
|
93
|
+
* Quick migration V2 -> V3 (enhanced)
|
|
94
|
+
*/
|
|
95
|
+
export async function quickMigrateV2toV3(config: ConfigV2, options?: MigrationOptions): Promise<WidgetConfig | null> {
|
|
96
|
+
try {
|
|
97
|
+
const result = await migrationFacade.migrateV2toV3(config, options)
|
|
98
|
+
return result.success ? result.data! : null
|
|
99
|
+
} catch {
|
|
100
|
+
return null
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
83
104
|
/**
|
|
84
105
|
* Быстрая миграция в последнюю версию
|
|
85
106
|
*/
|
|
@@ -8,7 +8,8 @@ import {
|
|
|
8
8
|
MigrationOptions,
|
|
9
9
|
MigrationReport,
|
|
10
10
|
MigrationLogger,
|
|
11
|
-
ConfigVersion
|
|
11
|
+
ConfigVersion,
|
|
12
|
+
CONFIG_VERSIONS
|
|
12
13
|
} from './types'
|
|
13
14
|
import { WidgetConfig } from '../config.types'
|
|
14
15
|
import { getStrategiesForMigration } from './strategies'
|
|
@@ -49,6 +50,20 @@ export class ConfigMigrator {
|
|
|
49
50
|
this.versionDetector = new DefaultVersionDetector()
|
|
50
51
|
}
|
|
51
52
|
|
|
53
|
+
private setSchemaVersion(config: any, version: ConfigVersion): void {
|
|
54
|
+
if (!config || typeof config !== 'object') return
|
|
55
|
+
const schema = (config as any).schema
|
|
56
|
+
if (!schema || typeof schema !== 'object') {
|
|
57
|
+
// Keep shape compatible with ConfigSchema from config.types.ts
|
|
58
|
+
;(config as any).schema = { version, required: [] }
|
|
59
|
+
return
|
|
60
|
+
}
|
|
61
|
+
;(schema as any).version = version
|
|
62
|
+
if (!Array.isArray((schema as any).required)) {
|
|
63
|
+
;(schema as any).required = []
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
52
67
|
/**
|
|
53
68
|
* Выполнить миграцию конфигурации
|
|
54
69
|
*/
|
|
@@ -59,7 +74,6 @@ export class ConfigMigrator {
|
|
|
59
74
|
): Promise<MigrationResult<T>> {
|
|
60
75
|
const startTime = Date.now()
|
|
61
76
|
this.logger.info(`Начинаем миграцию к версии ${targetVersion}`)
|
|
62
|
-
|
|
63
77
|
try {
|
|
64
78
|
// Детекция текущей версии
|
|
65
79
|
const currentVersion = this.versionDetector.detect(config)
|
|
@@ -107,6 +121,9 @@ export class ConfigMigrator {
|
|
|
107
121
|
allWarnings.push(...stepResult.warnings)
|
|
108
122
|
}
|
|
109
123
|
|
|
124
|
+
// Ensure schema version matches the target after successful migration steps.
|
|
125
|
+
this.setSchemaVersion(currentConfig, targetVersion)
|
|
126
|
+
|
|
110
127
|
// Финальная валидация
|
|
111
128
|
const validateCommand = CommandFactory.createCommand('ValidateConfig')
|
|
112
129
|
if (validateCommand) {
|
|
@@ -272,9 +289,8 @@ export class ConfigMigrator {
|
|
|
272
289
|
// Простая логика для последовательной миграции
|
|
273
290
|
// В будущем можно расширить для более сложных сценариев
|
|
274
291
|
|
|
275
|
-
const
|
|
276
|
-
const
|
|
277
|
-
const toIndex = versions.indexOf(to)
|
|
292
|
+
const fromIndex = CONFIG_VERSIONS.indexOf(from)
|
|
293
|
+
const toIndex = CONFIG_VERSIONS.indexOf(to)
|
|
278
294
|
|
|
279
295
|
if (fromIndex === -1 || toIndex === -1) {
|
|
280
296
|
return []
|
|
@@ -285,7 +301,7 @@ export class ConfigMigrator {
|
|
|
285
301
|
if (fromIndex < toIndex) {
|
|
286
302
|
// Прямая миграция (вперед)
|
|
287
303
|
for (let i = fromIndex; i < toIndex; i++) {
|
|
288
|
-
path.push({ from:
|
|
304
|
+
path.push({ from: CONFIG_VERSIONS[i], to: CONFIG_VERSIONS[i + 1] })
|
|
289
305
|
}
|
|
290
306
|
} else if (fromIndex > toIndex) {
|
|
291
307
|
// Обратная миграция (назад) - пока не поддерживается
|