crisp-sdk-web
Advanced tools
Comparing version 1.0.20 to 1.0.21
@@ -61,6 +61,8 @@ type FileMessage = { | ||
markAsRead(): void; | ||
startThread(name: String): void; | ||
endThread(name?: String): void; | ||
onMessageSent(callback: Function): void; | ||
onMessageReceived(callback: Function): void; | ||
onMessageComposeSent(callback: Function): void; | ||
onMessageComposeReceive(callback: Function): void; | ||
onMessageComposeReceived(callback: Function): void; | ||
} | ||
@@ -139,2 +141,5 @@ | ||
close(): void; | ||
setHelpdeskView(): void; | ||
openHelpdeskArticle(locale: string, slug: string, title?: string, category?: string): void; | ||
queryHelpdesk(query: string): void; | ||
unreadCount(): number; | ||
@@ -146,2 +151,3 @@ isChatOpened(): boolean; | ||
onChatClosed(callback: () => void): void; | ||
onHelpdeskQueried(callback: Function): void; | ||
} | ||
@@ -226,4 +232,5 @@ | ||
toggleOperatorCount(enabled: boolean): void; | ||
onWebsiteAvailabilityChanged(callback: Function): void; | ||
createSingletonIfNecessary(): void; | ||
autoInjectIfNecessasy(): void; | ||
autoInjectIfNecessary(): void; | ||
isCrispInjected(): boolean; | ||
@@ -230,0 +237,0 @@ private deferredLoading; |
@@ -50,2 +50,10 @@ var CrispMessage = /** @class */ (function () { | ||
}; | ||
CrispMessage.prototype.startThread = function (name) { | ||
this.parent.createSingletonIfNecessary(); | ||
window.$crisp.push(["do", "message:thread:start", [name]]); | ||
}; | ||
CrispMessage.prototype.endThread = function (name) { | ||
this.parent.createSingletonIfNecessary(); | ||
window.$crisp.push(["do", "message:thread:end", [name]]); | ||
}; | ||
CrispMessage.prototype.onMessageSent = function (callback) { | ||
@@ -66,3 +74,3 @@ this.parent.createSingletonIfNecessary(); | ||
}; | ||
CrispMessage.prototype.onMessageComposeReceive = function (callback) { | ||
CrispMessage.prototype.onMessageComposeReceived = function (callback) { | ||
this.parent.createSingletonIfNecessary(); | ||
@@ -257,11 +265,11 @@ window.$crisp.push(["off", "message:compose:received"]); | ||
CrispChat.prototype.show = function () { | ||
this.parent.autoInjectIfNecessasy(); | ||
this.parent.autoInjectIfNecessary(); | ||
window.$crisp.push(["do", "chat:show"]); | ||
}; | ||
CrispChat.prototype.hide = function () { | ||
this.parent.autoInjectIfNecessasy(); | ||
this.parent.autoInjectIfNecessary(); | ||
window.$crisp.push(["do", "chat:hide"]); | ||
}; | ||
CrispChat.prototype.open = function () { | ||
this.parent.autoInjectIfNecessasy(); | ||
this.parent.autoInjectIfNecessary(); | ||
window.$crisp.push(["do", "chat:open"]); | ||
@@ -274,2 +282,14 @@ }; | ||
}; | ||
CrispChat.prototype.setHelpdeskView = function () { | ||
this.parent.createSingletonIfNecessary(); | ||
window.$crisp.push(["do", "helpdesk:search"]); | ||
}; | ||
CrispChat.prototype.openHelpdeskArticle = function (locale, slug, title, category) { | ||
this.parent.createSingletonIfNecessary(); | ||
window.$crisp.push(["do", "helpdesk:article:open", [locale, slug, title, category]]); | ||
}; | ||
CrispChat.prototype.queryHelpdesk = function (query) { | ||
this.parent.createSingletonIfNecessary(); | ||
window.$crisp.push(["do", "helpdesk:query", [query]]); | ||
}; | ||
CrispChat.prototype.unreadCount = function () { | ||
@@ -308,2 +328,7 @@ if (!this.parent.isCrispInjected()) { | ||
}; | ||
CrispChat.prototype.onHelpdeskQueried = function (callback) { | ||
this.parent.createSingletonIfNecessary(); | ||
window.$crisp.push(["off", "helpdesk:queried"]); | ||
window.$crisp.push(["on", "helpdesk:queried", callback]); | ||
}; | ||
return CrispChat; | ||
@@ -473,2 +498,7 @@ }()); | ||
}; | ||
Crisp.prototype.onWebsiteAvailabilityChanged = function (callback) { | ||
this.createSingletonIfNecessary(); | ||
window.$crisp.push(["off", "website:availability:changed"]); | ||
window.$crisp.push(["on", "website:availability:changed", callback]); | ||
}; | ||
Crisp.prototype.createSingletonIfNecessary = function () { | ||
@@ -480,3 +510,3 @@ // Assigns $crisp singleton | ||
}; | ||
Crisp.prototype.autoInjectIfNecessasy = function () { | ||
Crisp.prototype.autoInjectIfNecessary = function () { | ||
if (!this.isCrispInjected()) { | ||
@@ -483,0 +513,0 @@ this.load(); |
@@ -56,2 +56,10 @@ (function (global, factory) { | ||
}; | ||
CrispMessage.prototype.startThread = function (name) { | ||
this.parent.createSingletonIfNecessary(); | ||
window.$crisp.push(["do", "message:thread:start", [name]]); | ||
}; | ||
CrispMessage.prototype.endThread = function (name) { | ||
this.parent.createSingletonIfNecessary(); | ||
window.$crisp.push(["do", "message:thread:end", [name]]); | ||
}; | ||
CrispMessage.prototype.onMessageSent = function (callback) { | ||
@@ -72,3 +80,3 @@ this.parent.createSingletonIfNecessary(); | ||
}; | ||
CrispMessage.prototype.onMessageComposeReceive = function (callback) { | ||
CrispMessage.prototype.onMessageComposeReceived = function (callback) { | ||
this.parent.createSingletonIfNecessary(); | ||
@@ -263,11 +271,11 @@ window.$crisp.push(["off", "message:compose:received"]); | ||
CrispChat.prototype.show = function () { | ||
this.parent.autoInjectIfNecessasy(); | ||
this.parent.autoInjectIfNecessary(); | ||
window.$crisp.push(["do", "chat:show"]); | ||
}; | ||
CrispChat.prototype.hide = function () { | ||
this.parent.autoInjectIfNecessasy(); | ||
this.parent.autoInjectIfNecessary(); | ||
window.$crisp.push(["do", "chat:hide"]); | ||
}; | ||
CrispChat.prototype.open = function () { | ||
this.parent.autoInjectIfNecessasy(); | ||
this.parent.autoInjectIfNecessary(); | ||
window.$crisp.push(["do", "chat:open"]); | ||
@@ -280,2 +288,14 @@ }; | ||
}; | ||
CrispChat.prototype.setHelpdeskView = function () { | ||
this.parent.createSingletonIfNecessary(); | ||
window.$crisp.push(["do", "helpdesk:search"]); | ||
}; | ||
CrispChat.prototype.openHelpdeskArticle = function (locale, slug, title, category) { | ||
this.parent.createSingletonIfNecessary(); | ||
window.$crisp.push(["do", "helpdesk:article:open", [locale, slug, title, category]]); | ||
}; | ||
CrispChat.prototype.queryHelpdesk = function (query) { | ||
this.parent.createSingletonIfNecessary(); | ||
window.$crisp.push(["do", "helpdesk:query", [query]]); | ||
}; | ||
CrispChat.prototype.unreadCount = function () { | ||
@@ -314,2 +334,7 @@ if (!this.parent.isCrispInjected()) { | ||
}; | ||
CrispChat.prototype.onHelpdeskQueried = function (callback) { | ||
this.parent.createSingletonIfNecessary(); | ||
window.$crisp.push(["off", "helpdesk:queried"]); | ||
window.$crisp.push(["on", "helpdesk:queried", callback]); | ||
}; | ||
return CrispChat; | ||
@@ -479,2 +504,7 @@ }()); | ||
}; | ||
Crisp.prototype.onWebsiteAvailabilityChanged = function (callback) { | ||
this.createSingletonIfNecessary(); | ||
window.$crisp.push(["off", "website:availability:changed"]); | ||
window.$crisp.push(["on", "website:availability:changed", callback]); | ||
}; | ||
Crisp.prototype.createSingletonIfNecessary = function () { | ||
@@ -486,3 +516,3 @@ // Assigns $crisp singleton | ||
}; | ||
Crisp.prototype.autoInjectIfNecessasy = function () { | ||
Crisp.prototype.autoInjectIfNecessary = function () { | ||
if (!this.isCrispInjected()) { | ||
@@ -489,0 +519,0 @@ this.load(); |
{ | ||
"name": "crisp-sdk-web", | ||
"version": "1.0.20", | ||
"version": "1.0.21", | ||
"description": "Include Crisp chat widget inside web frameworks.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -11,3 +11,3 @@ import { CrispClass as Crisp } from "./index"; | ||
show() { | ||
this.parent.autoInjectIfNecessasy(); | ||
this.parent.autoInjectIfNecessary(); | ||
@@ -18,3 +18,3 @@ window.$crisp.push(["do", "chat:show"]); | ||
hide() { | ||
this.parent.autoInjectIfNecessasy(); | ||
this.parent.autoInjectIfNecessary(); | ||
@@ -25,3 +25,3 @@ window.$crisp.push(["do", "chat:hide"]); | ||
open() { | ||
this.parent.autoInjectIfNecessasy(); | ||
this.parent.autoInjectIfNecessary(); | ||
@@ -37,2 +37,20 @@ window.$crisp.push(["do", "chat:open"]); | ||
setHelpdeskView() { | ||
this.parent.createSingletonIfNecessary(); | ||
window.$crisp.push(["do", "helpdesk:search"]); | ||
} | ||
openHelpdeskArticle(locale: string, slug: string, title?: string, category?: string) { | ||
this.parent.createSingletonIfNecessary(); | ||
window.$crisp.push(["do", "helpdesk:article:open", [locale, slug, title, category]]); | ||
} | ||
queryHelpdesk(query: string) { | ||
this.parent.createSingletonIfNecessary(); | ||
window.$crisp.push(["do", "helpdesk:query", [query]]); | ||
} | ||
unreadCount(): number { | ||
@@ -82,2 +100,9 @@ if (!this.parent.isCrispInjected()) { | ||
} | ||
onHelpdeskQueried(callback: Function) { | ||
this.parent.createSingletonIfNecessary(); | ||
window.$crisp.push(["off", "helpdesk:queried"]); | ||
window.$crisp.push(["on", "helpdesk:queried", callback]); | ||
} | ||
} |
@@ -275,2 +275,9 @@ import CrispMessage from "./message"; | ||
onWebsiteAvailabilityChanged(callback: Function) { | ||
this.createSingletonIfNecessary(); | ||
window.$crisp.push(["off", "website:availability:changed"]); | ||
window.$crisp.push(["on", "website:availability:changed", callback]); | ||
} | ||
createSingletonIfNecessary() { | ||
@@ -283,3 +290,3 @@ // Assigns $crisp singleton | ||
autoInjectIfNecessasy() { | ||
autoInjectIfNecessary() { | ||
if (!this.isCrispInjected()) { | ||
@@ -286,0 +293,0 @@ this.load(); |
@@ -124,2 +124,14 @@ import { CrispClass as Crisp } from "./index"; | ||
startThread(name: String) { | ||
this.parent.createSingletonIfNecessary(); | ||
window.$crisp.push(["do", "message:thread:start", [name]]); | ||
} | ||
endThread(name?: String) { | ||
this.parent.createSingletonIfNecessary(); | ||
window.$crisp.push(["do", "message:thread:end", [name]]); | ||
} | ||
onMessageSent(callback: Function) { | ||
@@ -146,3 +158,3 @@ this.parent.createSingletonIfNecessary(); | ||
onMessageComposeReceive(callback: Function) { | ||
onMessageComposeReceived(callback: Function) { | ||
this.parent.createSingletonIfNecessary(); | ||
@@ -149,0 +161,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
153494
1916