@bavard/agent-config
Advanced tools
Comparing version 0.0.45 to 0.0.46
@@ -8,3 +8,4 @@ export interface ColorItem { | ||
export interface IWidgetSettings { | ||
icon?: string; | ||
logo?: string; | ||
avatar?: string; | ||
title?: string; | ||
@@ -11,0 +12,0 @@ subtitle?: string; |
import { ColorItem, IWidgetSettings } from './types'; | ||
export declare const DEFAULT_WIDGET_SETTINGS: IWidgetSettings; | ||
export declare class WidgetSettings implements IWidgetSettings { | ||
icon?: string; | ||
logo?: string; | ||
avatar?: string; | ||
title?: string; | ||
@@ -6,0 +7,0 @@ subtitle?: string; |
@@ -20,3 +20,4 @@ "use strict"; | ||
}); | ||
const DEFAULT_ICON = 'default'; | ||
const DEFAULT_LOGO = 'default-logo'; | ||
const DEFAULT_AVATAR = 'default-avatar'; | ||
const DEFAULT_PRIMARY_COLOR = { | ||
@@ -37,3 +38,4 @@ r: 10, | ||
name: '', | ||
icon: DEFAULT_ICON, | ||
logo: DEFAULT_LOGO, | ||
avatar: DEFAULT_AVATAR, | ||
primaryColor: DEFAULT_PRIMARY_COLOR, | ||
@@ -45,7 +47,9 @@ primaryBg: DEFAULT_PRIMARY_BG, | ||
constructor(settings) { | ||
this.icon = DEFAULT_ICON; | ||
this.logo = DEFAULT_LOGO; | ||
this.avatar = DEFAULT_AVATAR; | ||
this.primaryColor = DEFAULT_PRIMARY_COLOR; | ||
this.primaryBg = DEFAULT_PRIMARY_BG; | ||
this.widgetBg = DEFAULT_WIDGET_BG; | ||
this.icon = settings.icon; | ||
this.logo = settings.logo; | ||
this.avatar = settings.avatar; | ||
this.title = settings.title; | ||
@@ -66,3 +70,4 @@ this.subtitle = settings.subtitle; | ||
WidgetSettings.schema = yup_1.object().shape({ | ||
icon: yup_1.string().nullable(), | ||
logo: yup_1.string().nullable(), | ||
avatar: yup_1.string().nullable(), | ||
title: yup_1.string().nullable(), | ||
@@ -69,0 +74,0 @@ subtitle: yup_1.string().nullable(), |
{ | ||
"name": "@bavard/agent-config", | ||
"version": "0.0.45", | ||
"version": "0.0.46", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -9,3 +9,4 @@ export interface ColorItem { | ||
export interface IWidgetSettings { | ||
icon?: string; | ||
logo?: string; | ||
avatar?: string; | ||
title?: string; | ||
@@ -12,0 +13,0 @@ subtitle?: string; |
@@ -11,3 +11,4 @@ import { ColorItem, IWidgetSettings} from './types'; | ||
const DEFAULT_ICON = 'default'; | ||
const DEFAULT_LOGO = 'default-logo'; | ||
const DEFAULT_AVATAR = 'default-avatar'; | ||
@@ -32,3 +33,4 @@ const DEFAULT_PRIMARY_COLOR: ColorItem = { | ||
name: '', | ||
icon: DEFAULT_ICON, | ||
logo: DEFAULT_LOGO, | ||
avatar: DEFAULT_AVATAR, | ||
primaryColor: DEFAULT_PRIMARY_COLOR, | ||
@@ -40,3 +42,4 @@ primaryBg: DEFAULT_PRIMARY_BG, | ||
export class WidgetSettings implements IWidgetSettings { | ||
icon?: string = DEFAULT_ICON; | ||
logo?: string = DEFAULT_LOGO; | ||
avatar?: string = DEFAULT_AVATAR; | ||
title?: string; | ||
@@ -50,3 +53,4 @@ subtitle?: string; | ||
private static schema = object().shape({ | ||
icon: string().nullable(), | ||
logo: string().nullable(), | ||
avatar: string().nullable(), | ||
title: string().nullable(), | ||
@@ -61,3 +65,4 @@ subtitle: string().nullable(), | ||
constructor(settings: IWidgetSettings) { | ||
this.icon = settings.icon; | ||
this.logo = settings.logo; | ||
this.avatar = settings.avatar; | ||
this.title = settings.title; | ||
@@ -64,0 +69,0 @@ this.subtitle = settings.subtitle; |
182102
5088