announcekit-react
Advanced tools
Comparing version 2.1.5 to 2.1.6
@@ -7,2 +7,3 @@ import * as React from "react"; | ||
widgetStyle?: React.CSSProperties; | ||
boosters?: boolean; | ||
floatWidget?: boolean; | ||
@@ -9,0 +10,0 @@ embedWidget?: boolean; |
@@ -92,2 +92,4 @@ "use strict"; | ||
var _a; | ||
if (typeof window === "undefined") | ||
return; | ||
if (!window["announcekit"]) { | ||
@@ -131,3 +133,3 @@ window["announcekit"] = window["announcekit"] || { | ||
this.name = Math.random().toString(36).substring(10); | ||
window["announcekit"].push(__assign(__assign({ widget: this.props.widget, name: this.name, version: 2, framework: "react", framework_version: "2.0.0", selector: this.selector, embed: this.props.embedWidget }, styleParams), { onInit: function (_widget) { | ||
window["announcekit"].push(__assign(__assign({ widget: this.props.widget, name: this.name, version: 2, framework: "react", framework_version: "2.0.0", selector: this.selector, embed: this.props.embedWidget, boosters: typeof this.props.boosters === "undefined" ? true : this.props.boosters }, styleParams), { onInit: function (_widget) { | ||
if (_widget.conf.name !== _this.name) { | ||
@@ -163,8 +165,5 @@ return _widget.destroy(); | ||
}); | ||
ann.on("widget-unread", function (_a) { | ||
var widget = _a.widget, unread = _a.unread; | ||
if (widget === _widget && _this.props.onWidgetUnread) { | ||
_this.props.onWidgetUnread({ widget: widget, unread: unread }); | ||
} | ||
}); | ||
if (_this.props.onWidgetUnread) { | ||
_this.props.onWidgetUnread(_widget.state.ui.unreadCount); | ||
} | ||
}, data: this.props.data, user: this.props.user, lang: this.props.lang })); | ||
@@ -171,0 +170,0 @@ }; |
{ | ||
"name": "announcekit-react", | ||
"version": "2.1.5", | ||
"version": "2.1.6", | ||
"description": "Use AnnounceKit widgets in your React App", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -51,2 +51,3 @@ ![](https://announcekit.app/images/logo@2x.png) | ||
- `embedWidget` - Set true if the widget is a Embed widget. | ||
- `boosters` - In case you don't want to boosters appear on the page the widget is placed. | ||
- `lang` - Language selector | ||
@@ -53,0 +54,0 @@ - `user` - User properties (for [user tracking](https://announcekit.app/docs#user-tracking)) |
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
18562
433
89