crisp-sdk-web
Advanced tools
Comparing version 1.0.24 to 1.0.25
@@ -123,15 +123,17 @@ var CrispMessage = /** @class */ (function () { | ||
var _payload = {}; | ||
if (data && data.url) { | ||
_payload.url = data.url; | ||
} | ||
if (data && data.description) { | ||
_payload.description = data.description; | ||
} | ||
if (data && data.employment) { | ||
_payload.employment = [ | ||
data.employment.title | ||
]; | ||
if (data.employment.role) { | ||
_payload.employment.push(data.employment.role); | ||
if (data) { | ||
if (data.url) { | ||
_payload.url = data.url; | ||
} | ||
if (data.description) { | ||
_payload.description = data.description; | ||
} | ||
if (data.employment) { | ||
_payload.employment = [ | ||
data.employment.title | ||
]; | ||
if (data.employment.role) { | ||
_payload.employment.push(data.employment.role); | ||
} | ||
} | ||
} | ||
@@ -330,3 +332,8 @@ this.parent.createSingletonIfNecessary(); | ||
this.parent.createSingletonIfNecessary(); | ||
window.$crisp.push(["do", "helpdesk:article:open", [locale, slug, title, category]]); | ||
window.$crisp.push(["do", "helpdesk:article:open", [ | ||
locale, | ||
slug, | ||
title, | ||
category | ||
]]); | ||
}; | ||
@@ -532,3 +539,5 @@ CrispChat.prototype.queryHelpdesk = function (query) { | ||
this.createSingletonIfNecessary(); | ||
$crisp.push(["config", "position:reverse", [position === ChatboxPosition.Left]]); | ||
$crisp.push(["config", "position:reverse", [ | ||
position === ChatboxPosition.Left | ||
]]); | ||
}; | ||
@@ -535,0 +544,0 @@ Crisp.prototype.setAvailabilityTooltip = function (enabled) { |
@@ -129,15 +129,17 @@ (function (global, factory) { | ||
var _payload = {}; | ||
if (data && data.url) { | ||
_payload.url = data.url; | ||
} | ||
if (data && data.description) { | ||
_payload.description = data.description; | ||
} | ||
if (data && data.employment) { | ||
_payload.employment = [ | ||
data.employment.title | ||
]; | ||
if (data.employment.role) { | ||
_payload.employment.push(data.employment.role); | ||
if (data) { | ||
if (data.url) { | ||
_payload.url = data.url; | ||
} | ||
if (data.description) { | ||
_payload.description = data.description; | ||
} | ||
if (data.employment) { | ||
_payload.employment = [ | ||
data.employment.title | ||
]; | ||
if (data.employment.role) { | ||
_payload.employment.push(data.employment.role); | ||
} | ||
} | ||
} | ||
@@ -336,3 +338,8 @@ this.parent.createSingletonIfNecessary(); | ||
this.parent.createSingletonIfNecessary(); | ||
window.$crisp.push(["do", "helpdesk:article:open", [locale, slug, title, category]]); | ||
window.$crisp.push(["do", "helpdesk:article:open", [ | ||
locale, | ||
slug, | ||
title, | ||
category | ||
]]); | ||
}; | ||
@@ -538,3 +545,5 @@ CrispChat.prototype.queryHelpdesk = function (query) { | ||
this.createSingletonIfNecessary(); | ||
$crisp.push(["config", "position:reverse", [position === exports.ChatboxPosition.Left]]); | ||
$crisp.push(["config", "position:reverse", [ | ||
position === exports.ChatboxPosition.Left | ||
]]); | ||
}; | ||
@@ -541,0 +550,0 @@ Crisp.prototype.setAvailabilityTooltip = function (enabled) { |
{ | ||
"name": "crisp-sdk-web", | ||
"version": "1.0.24", | ||
"version": "1.0.25", | ||
"description": "Include Crisp chat widget inside web frameworks.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -40,6 +40,16 @@ import { CrispClass as Crisp } from "./index"; | ||
openHelpdeskArticle(locale: string, slug: string, title?: string, category?: string) { | ||
openHelpdeskArticle( | ||
locale: string, | ||
slug: string, | ||
title?: string, | ||
category?: string | ||
) { | ||
this.parent.createSingletonIfNecessary(); | ||
window.$crisp.push(["do", "helpdesk:article:open", [locale, slug, title, category]]); | ||
window.$crisp.push(["do", "helpdesk:article:open", [ | ||
locale, | ||
slug, | ||
title, | ||
category | ||
]]); | ||
} | ||
@@ -123,3 +133,3 @@ | ||
this.offHelpdeskQueried(); | ||
window.$crisp.push(["on", "helpdesk:queried", callback]); | ||
@@ -126,0 +136,0 @@ } |
@@ -25,3 +25,3 @@ import CrispMessage from "./message"; | ||
export { | ||
EventsColors, | ||
EventsColors | ||
} from "./session"; | ||
@@ -38,3 +38,3 @@ | ||
var CRISP_COOKIE_DOMAIN: string; | ||
var CRISP_COOKIE_EXPIRE: number | ||
var CRISP_COOKIE_EXPIRE: number; | ||
} | ||
@@ -109,5 +109,5 @@ /* eslint-enable no-var, @typescript-eslint/no-explicit-any */ | ||
constructor() { | ||
this.chat = new CrispChat(this); | ||
this.chat = new CrispChat(this); | ||
this.session = new CrispSession(this); | ||
this.user = new CrispUser(this); | ||
this.user = new CrispUser(this); | ||
this.message = new CrispMessage(this); | ||
@@ -245,3 +245,5 @@ this.trigger = new CrispTrigger(this); | ||
$crisp.push(["config", "position:reverse", [position === ChatboxPosition.Left]]); | ||
$crisp.push(["config", "position:reverse", [ | ||
position === ChatboxPosition.Left | ||
]]); | ||
} | ||
@@ -283,3 +285,3 @@ | ||
this.offWebsiteAvailabilityChanged(); | ||
window.$crisp.push(["on", "website:availability:changed", callback]); | ||
@@ -286,0 +288,0 @@ } |
@@ -68,3 +68,6 @@ import { CrispClass as Crisp } from "./index"; | ||
send(type: string, content: string | FileMessage | AnimationMessage | AudioMessage) { | ||
send( | ||
type: string, | ||
content: string | FileMessage | AnimationMessage | AudioMessage | ||
) { | ||
this.parent.createSingletonIfNecessary(); | ||
@@ -91,3 +94,6 @@ | ||
show(type: string, content: string | FileMessage | AnimationMessage | AudioMessage | FieldMessage | PickerMessage | CarouselMessage) { | ||
show( | ||
type: string, | ||
content: string | FileMessage | AnimationMessage | AudioMessage | FieldMessage | PickerMessage | CarouselMessage | ||
) { | ||
this.parent.createSingletonIfNecessary(); | ||
@@ -140,3 +146,3 @@ | ||
this.parent.createSingletonIfNecessary(); | ||
window.$crisp.push(["do", "message:thread:end", [name]]); | ||
@@ -149,3 +155,3 @@ } | ||
this.offMessageSent(); | ||
window.$crisp.push(["on", "message:sent", callback]); | ||
@@ -152,0 +158,0 @@ } |
@@ -49,3 +49,7 @@ import { CrispClass as Crisp } from "./index"; | ||
pushEvent(name: string, data: object = {}, color: EventsColors = EventsColors.Blue) { | ||
pushEvent( | ||
name: string, | ||
data: object = {}, | ||
color: EventsColors = EventsColors.Blue | ||
) { | ||
if (this.parent.isCrispInjected()) { | ||
@@ -76,3 +80,3 @@ window.$crisp.push(["set", "session:event", [[[name, data, color]]]]); | ||
this.offLoaded(); | ||
window.$crisp.push(["on", "session:loaded", callback]); | ||
@@ -79,0 +83,0 @@ } |
@@ -54,17 +54,21 @@ import { CrispClass as Crisp } from "./index"; | ||
if (data && data.url) { | ||
_payload.url = data.url; | ||
} | ||
if (data) { | ||
if (data.url) { | ||
_payload.url = data.url; | ||
} | ||
if (data && data.description) { | ||
_payload.description = data.description; | ||
} | ||
if (data.description) { | ||
_payload.description = data.description; | ||
} | ||
if (data && data.employment) { | ||
_payload.employment = [ | ||
(data.employment as CompanyDataEmployment).title | ||
]; | ||
if (data.employment) { | ||
_payload.employment = [ | ||
(data.employment as CompanyDataEmployment).title | ||
]; | ||
if ((data.employment as CompanyDataEmployment).role) { | ||
_payload.employment.push((data.employment as CompanyDataEmployment).role!); | ||
if ((data.employment as CompanyDataEmployment).role) { | ||
_payload.employment.push( | ||
(data.employment as CompanyDataEmployment).role! | ||
); | ||
} | ||
} | ||
@@ -121,3 +125,3 @@ } | ||
this.offEmailChanged(); | ||
window.$crisp.push(["on", "user:email:changed", callback]); | ||
@@ -124,0 +128,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
169371
2167