@yartsun/chat-widget-types 1.0.12 → 1.0.14

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.
@@ -9,6 +9,7 @@ import {
9
9
  ConfigHelpers
10
10
  } from './facade'
11
11
  import { ConfigV1, ConfigV2 } from './types'
12
+ import { DEFAULT_CONFIG } from '../default-config'
12
13
 
13
14
  /** Пример простой миграции V1 -> V2 */
14
15
  export async function exampleSimpleMigration() {
@@ -57,7 +58,6 @@ export async function exampleSimpleMigration() {
57
58
  console.log('📋 Добавленные поля V2:')
58
59
  console.log('- settings.loader:', migratedConfig.settings.loader)
59
60
  console.log('- sections.top.params.buttonStyle:', migratedConfig.sections.top.params.buttonStyle)
60
- console.log('- sections.top.params.buttonType:', migratedConfig.sections.top.params.buttonType)
61
61
  console.log('- sections.top.params.chipStyle:', migratedConfig.sections.top.params.chipStyle)
62
62
  console.log('- texts.disclaimer:', migratedConfig.texts.disclaimer)
63
63
  } else {
@@ -375,181 +375,5 @@ export const SAMPLE_CONFIGS = {
375
375
  }
376
376
  } as ConfigV1,
377
377
 
378
- V2_COMPLETE: {
379
- schema: {
380
- version: '1.0',
381
- required: ['settings', 'texts', 'sections'],
382
- },
383
- settings: {
384
- bgChat: 'rgba(47, 47, 49, 0.90)',
385
- gapMessageLine: 12,
386
- fontFamily: 'MacPaw Fixel',
387
- borderRadius: 'md',
388
- launchView: 'closed',
389
- letterSpacing: 0,
390
- 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>',
391
- fontWeight: 500,
392
- lineHeight: 1.2,
393
- loader: 'dots',
394
- },
395
- texts: {
396
- welcomeMessage:
397
- '🖖 Hi there — I’m your assistant for finding documents, tracking access, and making sense of your files. \n\nHow can I help?',
398
- widgetTitle: 'HyperShadow',
399
- launchIssueTitle: 'There was a glitch',
400
- launchIssueText: 'Please restart the chat, it should work',
401
- issueText: 'Something went wrong, please restart',
402
- reconnectText: 'Connection issue, trying to reconnect',
403
- inputPlaceholder: 'Type question',
404
- disableInputText:
405
- 'Can’t send a message while processing the previous request',
406
- disclaimer: 'AI-Copilot makes mistakes, please don’t consider 100% accurate',
407
- },
408
- sections: {
409
- warnings: {
410
- launchIssue: {
411
- params: {
412
- warningStyle: 'faded',
413
- showIcon: true,
414
- icon:
415
- '<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>',
416
- },
417
- iconColor: '#FFCC77',
418
- bgColor: '#8A7045',
419
- headlineColor: '#f9c97c',
420
- color: '#fff',
421
- resetButton: {
422
- color: '#2e2e30',
423
- bgColor: '#e5e1dd',
424
- },
425
- },
426
- connectionIssue: {
427
- params: {
428
- warningStyle: 'faded',
429
- showIcon: true,
430
- icon:
431
- '<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>',
432
- },
433
- iconColor: '#fff',
434
- bgColor: '#8A7045',
435
- color: '#fff',
436
- resetButton: {
437
- color: '#2F2F31',
438
- bgColor: '#E5E1DD',
439
- },
440
- },
441
- reconnectIssue: {
442
- params: {
443
- warningStyle: 'gradient',
444
- showIcon: true,
445
- icon:
446
- '<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>',
447
- },
448
- iconColor: '#FFF',
449
- bgColor: '#8A7045',
450
- color: '#fff',
451
- },
452
- disableInputIssue: {
453
- params: {
454
- warningStyle: 'gradient',
455
- showIcon: true,
456
- icon:
457
- '<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>',
458
- },
459
- iconColor: '#fff',
460
- bgColor: '#8A7045',
461
- color: '#fff',
462
- },
463
- },
464
- loader: {
465
- completeStep: {
466
- icon: '<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 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"/></svg>',
467
- color: '#8E8E8F',
468
- },
469
- activeStep: {
470
- icon: '<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>',
471
- color: '#fff',
472
- },
473
- },
474
- top: {
475
- params: {
476
- size: 'md',
477
- chipStyle: 'filled',
478
- chipType: 'both',
479
- buttonStyle: 'filled',
480
- buttonType: 'both',
481
- },
482
- chipWidgetTitle: {
483
- color: '#fff',
484
- bgColor: '#5E4AC6',
485
- },
486
- buttons: {
487
- color: '#BBBBBD',
488
- bgColor: '#2F2F31',
489
- },
490
- },
491
- inside: {
492
- params: {
493
- size: 'md',
494
- },
495
- messageUser: {
496
- color: '#F9F8F8',
497
- bgColor: '#F8F8F933',
498
- bgType: 'bubble',
499
- },
500
- messageBot: {
501
- color: '#fff',
502
- bgColor: '#5E4AC6',
503
- bgType: 'plain',
504
- },
505
- activeSnippet: {
506
- params: {
507
- buttonType: 'both',
508
- buttonStyle: 'filled',
509
- size: 'sm',
510
- },
511
- color: '#fff',
512
- bgColor: '#373739',
513
- headerChip: {
514
- color: '#fff',
515
- bgColor: '#69696A',
516
- },
517
- propertyColor: 'rgba(255, 255, 255, 0.30)',
518
- valueColor: '#fff',
519
- yesButton: {
520
- color: '#fff',
521
- bgColor: '#12A150',
522
- },
523
- noButton: {
524
- color: '#fff',
525
- bgColor: '#C20E4D',
526
- },
527
- },
528
- welcomeMessage: {
529
- color: '#fff',
530
- },
531
- },
532
- bottom: {
533
- params: {
534
- size: 'md',
535
- disclaimerShow: false,
536
- },
537
- inputSend: {
538
- color: '#EEECEC',
539
- bgColor: '#373739',
540
- borderStyle: {
541
- borderColor: '#595959',
542
- borderWidth: 1,
543
- },
544
- inputStyle: 'inside',
545
- bgType: 'plain',
546
- },
547
- btnSend: {
548
- color: '#1E1E1E',
549
- bgColor: 'rgba(255, 255, 255, 0.50)',
550
- type: 'both',
551
- },
552
- },
553
- },
554
- } as ConfigV2
378
+ V2_COMPLETE: DEFAULT_CONFIG as ConfigV2
555
379
  }
@@ -178,7 +178,10 @@ export class EnhanceInputSendV1toV2Strategy extends BaseMigrationStrategy {
178
178
  // Расширяем inputSend
179
179
  config.sections.bottom.inputSend = {
180
180
  ...config.sections.bottom.inputSend,
181
- borderStyle: DEFAULT_CONFIG.sections.bottom.inputSend.borderStyle,
181
+ borderStyle: {
182
+ borderColor: DEFAULT_CONFIG.sections.bottom.inputSend.borderColor,
183
+ borderWidth: DEFAULT_CONFIG.sections.bottom.inputSend.borderWidth,
184
+ },
182
185
  inputStyle: DEFAULT_CONFIG.sections.bottom.inputSend.inputStyle, // 'inside'
183
186
  bgType: DEFAULT_CONFIG.sections.bottom.inputSend.bgType // 'plain'
184
187
  }