Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@atlaskit/analytics

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@atlaskit/analytics - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

10

CHANGELOG.md

@@ -1,6 +0,11 @@

<a name="2.1.0"></a>
# 2.1.0 (2017-10-05)
<a name="2.2.0"></a>
# 2.2.0 (2017-10-06)
<a name="2.2.0"></a>
# 2.2.0 (2017-10-06)
<a name="2.1.0"></a>

@@ -13,2 +18,3 @@ # 2.1.0 (2017-10-05)

* **component:** action/decision related analytics ([38ade4e](https://bitbucket.org/atlassian/atlaskit/commits/38ade4e))
* **component:** analytics library support for passing decorated data to stores ([43e3314](https://bitbucket.org/atlassian/atlaskit/commits/43e3314))

@@ -15,0 +21,0 @@

41

dist/bundle-cjs.js

@@ -102,3 +102,10 @@ module.exports = /******/

return _temp = _this = (0, _possibleConstructorReturn3.default)(this, _Component.call.apply(_Component, [ this ].concat(args))),
_this.onAnalyticsEvent = function(name, srcData, isPrivate) {
_this.getDecoratedAnalyticsData = function(name, srcData, isPrivate) {
// Decorate the event data if this decorator matches the event name
var _this$props = _this.props, data = _this$props.data, getData = _this$props.getData, match = _this$props.match, matchPrivate = _this$props.matchPrivate, decoratedData = (0,
_extends3.default)({}, srcData);
return matchPrivate === isPrivate && (0, _matchEvent2.default)(match, name) && ("object" === ("undefined" == typeof data ? "undefined" : (0,
_typeof3.default)(data)) && (0, _assign2.default)(decoratedData, data), "function" == typeof getData && (0,
_assign2.default)(decoratedData, getData(name, decoratedData))), decoratedData;
}, _this.onAnalyticsEvent = function(name, srcData, isPrivate) {
// Check there is a listener to pass the event to, otherwise there's no need

@@ -108,10 +115,10 @@ // to do any of this work

if ("function" == typeof onAnalyticsEvent) {
// Decorate the event data if this decorator matches the event name
var _this$props = _this.props, data = _this$props.data, getData = _this$props.getData, match = _this$props.match, matchPrivate = _this$props.matchPrivate, decoratedData = (0,
_extends3.default)({}, srcData);
matchPrivate === isPrivate && (0, _matchEvent2.default)(match, name) && ("object" === ("undefined" == typeof data ? "undefined" : (0,
_typeof3.default)(data)) && (0, _assign2.default)(decoratedData, data), "function" == typeof getData && (0,
_assign2.default)(decoratedData, getData(name, decoratedData))), // Pass the decorated event data to the next listener up the hierarchy
var decoratedData = _this.getDecoratedAnalyticsData(name, srcData, isPrivate);
// Pass the decorated event data to the next listener up the hierarchy
onAnalyticsEvent(name, decoratedData, isPrivate);
}
}, _this.getParentAnalyticsData = function(name, isPrivate) {
var parentData = _this.getDecoratedAnalyticsData(name, {}, isPrivate), getParentAnalyticsData = _this.context.getParentAnalyticsData;
return "function" == typeof getParentAnalyticsData && (0, _assign2.default)(parentData, getParentAnalyticsData(name, isPrivate)),
parentData;
}, _ret = _temp, (0, _possibleConstructorReturn3.default)(_this, _ret);

@@ -121,3 +128,4 @@ }

return {
onAnalyticsEvent: this.onAnalyticsEvent
onAnalyticsEvent: this.onAnalyticsEvent,
getParentAnalyticsData: this.getParentAnalyticsData
};

@@ -141,5 +149,7 @@ }, AnalyticsDecorator.prototype.render = function() {

}, AnalyticsDecorator.contextTypes = {
onAnalyticsEvent: _propTypes2.default.func
onAnalyticsEvent: _propTypes2.default.func,
getParentAnalyticsData: _propTypes2.default.func
}, AnalyticsDecorator.childContextTypes = {
onAnalyticsEvent: _propTypes2.default.func
onAnalyticsEvent: _propTypes2.default.func,
getParentAnalyticsData: _propTypes2.default.func
}, exports.default = AnalyticsDecorator;

@@ -307,2 +317,9 @@ }, /* 3 */

onAnalyticsEvent && onAnalyticsEvent("" + name, data, !0);
}, _this.getParentAnalyticsData = function(name) {
var getParentAnalyticsData = _this.context.getParentAnalyticsData, parentData = {};
if ("function" == typeof getParentAnalyticsData) {
var _analyticsId = _this.props.analyticsId;
parentData = getParentAnalyticsData(_analyticsId + "." + name, !1);
}
return parentData;
}, _ret = _temp, (0, _possibleConstructorReturn3.default)(_this, _ret);

@@ -325,2 +342,3 @@ }

firePrivateAnalyticsEvent: this.privateAnalyticsEvent,
getParentAnalyticsData: this.getParentAnalyticsData,
analyticsId: analyticsId,

@@ -332,3 +350,4 @@ ref: this.props.innerRef

_class.contextTypes = {
onAnalyticsEvent: _propTypes2.default.func
onAnalyticsEvent: _propTypes2.default.func,
getParentAnalyticsData: _propTypes2.default.func
}, _class.defaultProps = {

@@ -335,0 +354,0 @@ analyticsId: defaultProps.analyticsId,

@@ -1,1 +0,1 @@

module.exports=function(t){function e(a){if(n[a])return n[a].exports;var r=n[a]={exports:{},id:a,loaded:!1};return t[a].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){t.exports=n(1)},function(t,e,n){"use strict";function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.withAnalytics=e.cleanProps=e.AnalyticsListener=e.AnalyticsDecorator=void 0;var r=n(2),i=a(r),o=n(12),u=a(o),l=n(13),c=a(l),f=n(15),s=a(f);e.AnalyticsDecorator=i.default,e.AnalyticsListener=u.default,e.cleanProps=c.default,e.withAnalytics=s.default},function(t,e,n){"use strict";function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),i=a(r),o=n(4),u=a(o),l=n(5),c=a(l),f=n(6),s=a(f),d=n(7),p=a(d),y=n(8),v=a(y),h=n(9),A=a(h),E=n(10),b=a(E),m=n(11),x=a(m),_=function(t){function e(){var n,a,r;(0,s.default)(this,e);for(var o=arguments.length,l=Array(o),f=0;f<o;f++)l[f]=arguments[f];return n=a=(0,p.default)(this,t.call.apply(t,[this].concat(l))),a.onAnalyticsEvent=function(t,e,n){var r=a.context.onAnalyticsEvent;if("function"==typeof r){var o=a.props,l=o.data,f=o.getData,s=o.match,d=o.matchPrivate,p=(0,c.default)({},e);d===n&&(0,x.default)(s,t)&&("object"===("undefined"==typeof l?"undefined":(0,u.default)(l))&&(0,i.default)(p,l),"function"==typeof f&&(0,i.default)(p,f(t,p))),r(t,p,n)}},r=n,(0,p.default)(a,r)}return(0,v.default)(e,t),e.prototype.getChildContext=function(){return{onAnalyticsEvent:this.onAnalyticsEvent}},e.prototype.render=function(){var t=this.props.children;return b.default.Children.only(t)},e}(E.Component);_.propTypes={data:A.default.object,getData:A.default.func,match:A.default.oneOfType([A.default.string,A.default.func]),matchPrivate:A.default.bool},_.defaultProps={match:"*",matchPrivate:!1},_.contextTypes={onAnalyticsEvent:A.default.func},_.childContextTypes={onAnalyticsEvent:A.default.func},e.default=_},function(t,e){t.exports=require("babel-runtime/core-js/object/assign")},function(t,e){t.exports=require("babel-runtime/helpers/typeof")},function(t,e){t.exports=require("babel-runtime/helpers/extends")},function(t,e){t.exports=require("babel-runtime/helpers/classCallCheck")},function(t,e){t.exports=require("babel-runtime/helpers/possibleConstructorReturn")},function(t,e){t.exports=require("babel-runtime/helpers/inherits")},function(t,e){t.exports=require("prop-types")},function(t,e){t.exports=require("react")},function(t,e){"use strict";function n(t,e){return"*"===t||void 0===e||("string"==typeof t?a.test(t)?e.substr(0,t.length)===t:e===t:"function"==typeof t?t(e):t instanceof RegExp&&t.test(e))}Object.defineProperty(e,"__esModule",{value:!0});var a=/\.$/;e.default=n},function(t,e,n){"use strict";function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=n(5),i=a(r),o=n(6),u=a(o),l=n(7),c=a(l),f=n(8),s=a(f),d=n(9),p=a(d),y=n(10),v=a(y),h=n(11),A=a(h),E=function(t){function e(){var n,a,r;(0,u.default)(this,e);for(var o=arguments.length,l=Array(o),f=0;f<o;f++)l[f]=arguments[f];return n=a=(0,c.default)(this,t.call.apply(t,[this].concat(l))),a.onAnalyticsEvent=function(t,e,n){var r=a.props,o=r.onEvent,u=r.match,l=r.matchPrivate;if(l===n&&(0,A.default)(u,t)&&"function"==typeof o){var c=(0,i.default)({},e);o(t,c)}var f=a.context.onAnalyticsEvent;"function"==typeof f&&f(t,e,n)},r=n,(0,c.default)(a,r)}return(0,s.default)(e,t),e.prototype.getChildContext=function(){return{onAnalyticsEvent:this.onAnalyticsEvent}},e.prototype.render=function(){var t=this.props.children;return v.default.Children.only(t)},e}(y.Component);E.propTypes={onEvent:p.default.func.isRequired,match:p.default.oneOfType([p.default.string,p.default.func]),matchPrivate:p.default.bool},E.defaultProps={match:"*",matchPrivate:!1},E.contextTypes={onAnalyticsEvent:p.default.func},E.childContextTypes={onAnalyticsEvent:p.default.func},e.default=E},function(t,e,n){"use strict";function a(t){return t&&t.__esModule?t:{default:t}}function r(t){var e=(t.analyticsId,t.analyticsData,t.fireAnalyticsEvent,t.firePrivateAnalyticsEvent,(0,o.default)(t,["analyticsId","analyticsData","fireAnalyticsEvent","firePrivateAnalyticsEvent"]));return e}Object.defineProperty(e,"__esModule",{value:!0});var i=n(14),o=a(i);e.default=r},function(t,e){t.exports=require("babel-runtime/helpers/objectWithoutProperties")},function(t,e,n){"use strict";function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=n(16),i=a(r),o=n(14),u=a(o),l=n(5),c=a(l),f=n(6),s=a(f),d=n(7),p=a(d),y=n(8),v=a(y),h=n(10),A=a(h),E=n(9),b=a(E),m=function(t){var e,n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n=e=function(e){function n(){var t,a,r;(0,s.default)(this,n);for(var i=arguments.length,o=Array(i),u=0;u<i;u++)o[u]=arguments[u];return t=a=(0,p.default)(this,e.call.apply(e,[this].concat(o))),a.fireAnalyticsEvent=function(t,e){var n=a.props,r=n.analyticsData,i=n.analyticsId,o=a.context.onAnalyticsEvent;if(i&&o){var u=(0,c.default)({},r,e);o(i+"."+t,u,!1)}},a.privateAnalyticsEvent=function(t,e){var n=a.context.onAnalyticsEvent;n&&n(""+t,e,!0)},r=t,(0,p.default)(a,r)}return(0,v.default)(n,e),n.prototype.componentWillMount=function(){this.evaluatedMap="function"==typeof a?a(this.fireAnalyticsEvent):a},n.prototype.render=function(){var e=this,n=this.props,a=n.analyticsId,r=(n.analyticsData,(0,u.default)(n,["analyticsId","analyticsData"]));return(0,i.default)(this.evaluatedMap).forEach(function(t){var n=e.evaluatedMap[t],a=r[t];r[t]=function(){"function"==typeof n?n.apply(void 0,arguments):e.fireAnalyticsEvent(n),"function"==typeof a&&a.apply(void 0,arguments)}}),A.default.createElement(t,(0,c.default)({fireAnalyticsEvent:this.fireAnalyticsEvent,firePrivateAnalyticsEvent:this.privateAnalyticsEvent,analyticsId:a,ref:this.props.innerRef},r))},n}(h.Component),e.displayName="WithAnalytics("+(t.displayName||t.name)+")",e.contextTypes={onAnalyticsEvent:b.default.func},e.defaultProps={analyticsId:r.analyticsId,analyticsData:r.analyticsData},n};e.default=m},function(t,e){t.exports=require("babel-runtime/core-js/object/keys")}]);
module.exports=function(t){function e(a){if(n[a])return n[a].exports;var r=n[a]={exports:{},id:a,loaded:!1};return t[a].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){t.exports=n(1)},function(t,e,n){"use strict";function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.withAnalytics=e.cleanProps=e.AnalyticsListener=e.AnalyticsDecorator=void 0;var r=n(2),i=a(r),o=n(12),u=a(o),l=n(13),c=a(l),s=n(15),f=a(s);e.AnalyticsDecorator=i.default,e.AnalyticsListener=u.default,e.cleanProps=c.default,e.withAnalytics=f.default},function(t,e,n){"use strict";function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),i=a(r),o=n(4),u=a(o),l=n(5),c=a(l),s=n(6),f=a(s),d=n(7),p=a(d),y=n(8),v=a(y),h=n(9),A=a(h),x=n(10),E=a(x),P=n(11),b=a(P),m=function(t){function e(){var n,a,r;(0,f.default)(this,e);for(var o=arguments.length,l=Array(o),s=0;s<o;s++)l[s]=arguments[s];return n=a=(0,p.default)(this,t.call.apply(t,[this].concat(l))),a.getDecoratedAnalyticsData=function(t,e,n){var r=a.props,o=r.data,l=r.getData,s=r.match,f=r.matchPrivate,d=(0,c.default)({},e);return f===n&&(0,b.default)(s,t)&&("object"===("undefined"==typeof o?"undefined":(0,u.default)(o))&&(0,i.default)(d,o),"function"==typeof l&&(0,i.default)(d,l(t,d))),d},a.onAnalyticsEvent=function(t,e,n){var r=a.context.onAnalyticsEvent;if("function"==typeof r){var i=a.getDecoratedAnalyticsData(t,e,n);r(t,i,n)}},a.getParentAnalyticsData=function(t,e){var n=a.getDecoratedAnalyticsData(t,{},e),r=a.context.getParentAnalyticsData;return"function"==typeof r&&(0,i.default)(n,r(t,e)),n},r=n,(0,p.default)(a,r)}return(0,v.default)(e,t),e.prototype.getChildContext=function(){return{onAnalyticsEvent:this.onAnalyticsEvent,getParentAnalyticsData:this.getParentAnalyticsData}},e.prototype.render=function(){var t=this.props.children;return E.default.Children.only(t)},e}(x.Component);m.propTypes={data:A.default.object,getData:A.default.func,match:A.default.oneOfType([A.default.string,A.default.func]),matchPrivate:A.default.bool},m.defaultProps={match:"*",matchPrivate:!1},m.contextTypes={onAnalyticsEvent:A.default.func,getParentAnalyticsData:A.default.func},m.childContextTypes={onAnalyticsEvent:A.default.func,getParentAnalyticsData:A.default.func},e.default=m},function(t,e){t.exports=require("babel-runtime/core-js/object/assign")},function(t,e){t.exports=require("babel-runtime/helpers/typeof")},function(t,e){t.exports=require("babel-runtime/helpers/extends")},function(t,e){t.exports=require("babel-runtime/helpers/classCallCheck")},function(t,e){t.exports=require("babel-runtime/helpers/possibleConstructorReturn")},function(t,e){t.exports=require("babel-runtime/helpers/inherits")},function(t,e){t.exports=require("prop-types")},function(t,e){t.exports=require("react")},function(t,e){"use strict";function n(t,e){return"*"===t||void 0===e||("string"==typeof t?a.test(t)?e.substr(0,t.length)===t:e===t:"function"==typeof t?t(e):t instanceof RegExp&&t.test(e))}Object.defineProperty(e,"__esModule",{value:!0});var a=/\.$/;e.default=n},function(t,e,n){"use strict";function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=n(5),i=a(r),o=n(6),u=a(o),l=n(7),c=a(l),s=n(8),f=a(s),d=n(9),p=a(d),y=n(10),v=a(y),h=n(11),A=a(h),x=function(t){function e(){var n,a,r;(0,u.default)(this,e);for(var o=arguments.length,l=Array(o),s=0;s<o;s++)l[s]=arguments[s];return n=a=(0,c.default)(this,t.call.apply(t,[this].concat(l))),a.onAnalyticsEvent=function(t,e,n){var r=a.props,o=r.onEvent,u=r.match,l=r.matchPrivate;if(l===n&&(0,A.default)(u,t)&&"function"==typeof o){var c=(0,i.default)({},e);o(t,c)}var s=a.context.onAnalyticsEvent;"function"==typeof s&&s(t,e,n)},r=n,(0,c.default)(a,r)}return(0,f.default)(e,t),e.prototype.getChildContext=function(){return{onAnalyticsEvent:this.onAnalyticsEvent}},e.prototype.render=function(){var t=this.props.children;return v.default.Children.only(t)},e}(y.Component);x.propTypes={onEvent:p.default.func.isRequired,match:p.default.oneOfType([p.default.string,p.default.func]),matchPrivate:p.default.bool},x.defaultProps={match:"*",matchPrivate:!1},x.contextTypes={onAnalyticsEvent:p.default.func},x.childContextTypes={onAnalyticsEvent:p.default.func},e.default=x},function(t,e,n){"use strict";function a(t){return t&&t.__esModule?t:{default:t}}function r(t){var e=(t.analyticsId,t.analyticsData,t.fireAnalyticsEvent,t.firePrivateAnalyticsEvent,(0,o.default)(t,["analyticsId","analyticsData","fireAnalyticsEvent","firePrivateAnalyticsEvent"]));return e}Object.defineProperty(e,"__esModule",{value:!0});var i=n(14),o=a(i);e.default=r},function(t,e){t.exports=require("babel-runtime/helpers/objectWithoutProperties")},function(t,e,n){"use strict";function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=n(16),i=a(r),o=n(14),u=a(o),l=n(5),c=a(l),s=n(6),f=a(s),d=n(7),p=a(d),y=n(8),v=a(y),h=n(10),A=a(h),x=n(9),E=a(x),P=function(t){var e,n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n=e=function(e){function n(){var t,a,r;(0,f.default)(this,n);for(var i=arguments.length,o=Array(i),u=0;u<i;u++)o[u]=arguments[u];return t=a=(0,p.default)(this,e.call.apply(e,[this].concat(o))),a.fireAnalyticsEvent=function(t,e){var n=a.props,r=n.analyticsData,i=n.analyticsId,o=a.context.onAnalyticsEvent;if(i&&o){var u=(0,c.default)({},r,e);o(i+"."+t,u,!1)}},a.privateAnalyticsEvent=function(t,e){var n=a.context.onAnalyticsEvent;n&&n(""+t,e,!0)},a.getParentAnalyticsData=function(t){var e=a.context.getParentAnalyticsData,n={};if("function"==typeof e){var r=a.props.analyticsId;n=e(r+"."+t,!1)}return n},r=t,(0,p.default)(a,r)}return(0,v.default)(n,e),n.prototype.componentWillMount=function(){this.evaluatedMap="function"==typeof a?a(this.fireAnalyticsEvent):a},n.prototype.render=function(){var e=this,n=this.props,a=n.analyticsId,r=(n.analyticsData,(0,u.default)(n,["analyticsId","analyticsData"]));return(0,i.default)(this.evaluatedMap).forEach(function(t){var n=e.evaluatedMap[t],a=r[t];r[t]=function(){"function"==typeof n?n.apply(void 0,arguments):e.fireAnalyticsEvent(n),"function"==typeof a&&a.apply(void 0,arguments)}}),A.default.createElement(t,(0,c.default)({fireAnalyticsEvent:this.fireAnalyticsEvent,firePrivateAnalyticsEvent:this.privateAnalyticsEvent,getParentAnalyticsData:this.getParentAnalyticsData,analyticsId:a,ref:this.props.innerRef},r))},n}(h.Component),e.displayName="WithAnalytics("+(t.displayName||t.name)+")",e.contextTypes={onAnalyticsEvent:E.default.func,getParentAnalyticsData:E.default.func},e.defaultProps={analyticsId:r.analyticsId,analyticsData:r.analyticsData},n};e.default=P},function(t,e){t.exports=require("babel-runtime/core-js/object/keys")}]);

@@ -105,3 +105,10 @@ !function(root, factory) {

return _temp = _this = (0, _possibleConstructorReturn3.default)(this, _Component.call.apply(_Component, [ this ].concat(args))),
_this.onAnalyticsEvent = function(name, srcData, isPrivate) {
_this.getDecoratedAnalyticsData = function(name, srcData, isPrivate) {
// Decorate the event data if this decorator matches the event name
var _this$props = _this.props, data = _this$props.data, getData = _this$props.getData, match = _this$props.match, matchPrivate = _this$props.matchPrivate, decoratedData = (0,
_extends3.default)({}, srcData);
return matchPrivate === isPrivate && (0, _matchEvent2.default)(match, name) && ("object" === ("undefined" == typeof data ? "undefined" : (0,
_typeof3.default)(data)) && (0, _assign2.default)(decoratedData, data), "function" == typeof getData && (0,
_assign2.default)(decoratedData, getData(name, decoratedData))), decoratedData;
}, _this.onAnalyticsEvent = function(name, srcData, isPrivate) {
// Check there is a listener to pass the event to, otherwise there's no need

@@ -111,10 +118,10 @@ // to do any of this work

if ("function" == typeof onAnalyticsEvent) {
// Decorate the event data if this decorator matches the event name
var _this$props = _this.props, data = _this$props.data, getData = _this$props.getData, match = _this$props.match, matchPrivate = _this$props.matchPrivate, decoratedData = (0,
_extends3.default)({}, srcData);
matchPrivate === isPrivate && (0, _matchEvent2.default)(match, name) && ("object" === ("undefined" == typeof data ? "undefined" : (0,
_typeof3.default)(data)) && (0, _assign2.default)(decoratedData, data), "function" == typeof getData && (0,
_assign2.default)(decoratedData, getData(name, decoratedData))), // Pass the decorated event data to the next listener up the hierarchy
var decoratedData = _this.getDecoratedAnalyticsData(name, srcData, isPrivate);
// Pass the decorated event data to the next listener up the hierarchy
onAnalyticsEvent(name, decoratedData, isPrivate);
}
}, _this.getParentAnalyticsData = function(name, isPrivate) {
var parentData = _this.getDecoratedAnalyticsData(name, {}, isPrivate), getParentAnalyticsData = _this.context.getParentAnalyticsData;
return "function" == typeof getParentAnalyticsData && (0, _assign2.default)(parentData, getParentAnalyticsData(name, isPrivate)),
parentData;
}, _ret = _temp, (0, _possibleConstructorReturn3.default)(_this, _ret);

@@ -124,3 +131,4 @@ }

return {
onAnalyticsEvent: this.onAnalyticsEvent
onAnalyticsEvent: this.onAnalyticsEvent,
getParentAnalyticsData: this.getParentAnalyticsData
};

@@ -144,5 +152,7 @@ }, AnalyticsDecorator.prototype.render = function() {

}, AnalyticsDecorator.contextTypes = {
onAnalyticsEvent: _propTypes2.default.func
onAnalyticsEvent: _propTypes2.default.func,
getParentAnalyticsData: _propTypes2.default.func
}, AnalyticsDecorator.childContextTypes = {
onAnalyticsEvent: _propTypes2.default.func
onAnalyticsEvent: _propTypes2.default.func,
getParentAnalyticsData: _propTypes2.default.func
}, exports.default = AnalyticsDecorator;

@@ -310,2 +320,9 @@ }, /* 3 */

onAnalyticsEvent && onAnalyticsEvent("" + name, data, !0);
}, _this.getParentAnalyticsData = function(name) {
var getParentAnalyticsData = _this.context.getParentAnalyticsData, parentData = {};
if ("function" == typeof getParentAnalyticsData) {
var _analyticsId = _this.props.analyticsId;
parentData = getParentAnalyticsData(_analyticsId + "." + name, !1);
}
return parentData;
}, _ret = _temp, (0, _possibleConstructorReturn3.default)(_this, _ret);

@@ -328,2 +345,3 @@ }

firePrivateAnalyticsEvent: this.privateAnalyticsEvent,
getParentAnalyticsData: this.getParentAnalyticsData,
analyticsId: analyticsId,

@@ -335,3 +353,4 @@ ref: this.props.innerRef

_class.contextTypes = {
onAnalyticsEvent: _propTypes2.default.func
onAnalyticsEvent: _propTypes2.default.func,
getParentAnalyticsData: _propTypes2.default.func
}, _class.defaultProps = {

@@ -338,0 +357,0 @@ analyticsId: defaultProps.analyticsId,

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("babel-runtime/core-js/object/assign"),require("babel-runtime/helpers/typeof"),require("babel-runtime/helpers/extends"),require("babel-runtime/helpers/classCallCheck"),require("babel-runtime/helpers/possibleConstructorReturn"),require("babel-runtime/helpers/inherits"),require("prop-types"),require("react"),require("babel-runtime/helpers/objectWithoutProperties"),require("babel-runtime/core-js/object/keys")):"function"==typeof define&&define.amd?define(["babel-runtime/core-js/object/assign","babel-runtime/helpers/typeof","babel-runtime/helpers/extends","babel-runtime/helpers/classCallCheck","babel-runtime/helpers/possibleConstructorReturn","babel-runtime/helpers/inherits","prop-types","react","babel-runtime/helpers/objectWithoutProperties","babel-runtime/core-js/object/keys"],t):"object"==typeof exports?exports["@atlaskit/analytics"]=t(require("babel-runtime/core-js/object/assign"),require("babel-runtime/helpers/typeof"),require("babel-runtime/helpers/extends"),require("babel-runtime/helpers/classCallCheck"),require("babel-runtime/helpers/possibleConstructorReturn"),require("babel-runtime/helpers/inherits"),require("prop-types"),require("react"),require("babel-runtime/helpers/objectWithoutProperties"),require("babel-runtime/core-js/object/keys")):e["@atlaskit/analytics"]=t(e["babel-runtime/core-js/object/assign"],e["babel-runtime/helpers/typeof"],e["babel-runtime/helpers/extends"],e["babel-runtime/helpers/classCallCheck"],e["babel-runtime/helpers/possibleConstructorReturn"],e["babel-runtime/helpers/inherits"],e["prop-types"],e.react,e["babel-runtime/helpers/objectWithoutProperties"],e["babel-runtime/core-js/object/keys"])}(this,function(e,t,n,r,a,i,o,l,u,s){return function(e){function t(r){if(n[r])return n[r].exports;var a=n[r]={exports:{},id:r,loaded:!1};return e[r].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.withAnalytics=t.cleanProps=t.AnalyticsListener=t.AnalyticsDecorator=void 0;var a=n(2),i=r(a),o=n(12),l=r(o),u=n(13),s=r(u),c=n(15),f=r(c);t.AnalyticsDecorator=i.default,t.AnalyticsListener=l.default,t.cleanProps=s.default,t.withAnalytics=f.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(3),i=r(a),o=n(4),l=r(o),u=n(5),s=r(u),c=n(6),f=r(c),p=n(7),d=r(p),y=n(8),b=r(y),h=n(9),v=r(h),m=n(10),A=r(m),x=n(11),E=r(x),j=function(e){function t(){var n,r,a;(0,f.default)(this,t);for(var o=arguments.length,u=Array(o),c=0;c<o;c++)u[c]=arguments[c];return n=r=(0,d.default)(this,e.call.apply(e,[this].concat(u))),r.onAnalyticsEvent=function(e,t,n){var a=r.context.onAnalyticsEvent;if("function"==typeof a){var o=r.props,u=o.data,c=o.getData,f=o.match,p=o.matchPrivate,d=(0,s.default)({},t);p===n&&(0,E.default)(f,e)&&("object"===("undefined"==typeof u?"undefined":(0,l.default)(u))&&(0,i.default)(d,u),"function"==typeof c&&(0,i.default)(d,c(e,d))),a(e,d,n)}},a=n,(0,d.default)(r,a)}return(0,b.default)(t,e),t.prototype.getChildContext=function(){return{onAnalyticsEvent:this.onAnalyticsEvent}},t.prototype.render=function(){var e=this.props.children;return A.default.Children.only(e)},t}(m.Component);j.propTypes={data:v.default.object,getData:v.default.func,match:v.default.oneOfType([v.default.string,v.default.func]),matchPrivate:v.default.bool},j.defaultProps={match:"*",matchPrivate:!1},j.contextTypes={onAnalyticsEvent:v.default.func},j.childContextTypes={onAnalyticsEvent:v.default.func},t.default=j},function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t){e.exports=n},function(e,t){e.exports=r},function(e,t){e.exports=a},function(e,t){e.exports=i},function(e,t){e.exports=o},function(e,t){e.exports=l},function(e,t){"use strict";function n(e,t){return"*"===e||void 0===t||("string"==typeof e?r.test(e)?t.substr(0,e.length)===e:t===e:"function"==typeof e?e(t):e instanceof RegExp&&e.test(t))}Object.defineProperty(t,"__esModule",{value:!0});var r=/\.$/;t.default=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(5),i=r(a),o=n(6),l=r(o),u=n(7),s=r(u),c=n(8),f=r(c),p=n(9),d=r(p),y=n(10),b=r(y),h=n(11),v=r(h),m=function(e){function t(){var n,r,a;(0,l.default)(this,t);for(var o=arguments.length,u=Array(o),c=0;c<o;c++)u[c]=arguments[c];return n=r=(0,s.default)(this,e.call.apply(e,[this].concat(u))),r.onAnalyticsEvent=function(e,t,n){var a=r.props,o=a.onEvent,l=a.match,u=a.matchPrivate;if(u===n&&(0,v.default)(l,e)&&"function"==typeof o){var s=(0,i.default)({},t);o(e,s)}var c=r.context.onAnalyticsEvent;"function"==typeof c&&c(e,t,n)},a=n,(0,s.default)(r,a)}return(0,f.default)(t,e),t.prototype.getChildContext=function(){return{onAnalyticsEvent:this.onAnalyticsEvent}},t.prototype.render=function(){var e=this.props.children;return b.default.Children.only(e)},t}(y.Component);m.propTypes={onEvent:d.default.func.isRequired,match:d.default.oneOfType([d.default.string,d.default.func]),matchPrivate:d.default.bool},m.defaultProps={match:"*",matchPrivate:!1},m.contextTypes={onAnalyticsEvent:d.default.func},m.childContextTypes={onAnalyticsEvent:d.default.func},t.default=m},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e){var t=(e.analyticsId,e.analyticsData,e.fireAnalyticsEvent,e.firePrivateAnalyticsEvent,(0,o.default)(e,["analyticsId","analyticsData","fireAnalyticsEvent","firePrivateAnalyticsEvent"]));return t}Object.defineProperty(t,"__esModule",{value:!0});var i=n(14),o=r(i);t.default=a},function(e,t){e.exports=u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(16),i=r(a),o=n(14),l=r(o),u=n(5),s=r(u),c=n(6),f=r(c),p=n(7),d=r(p),y=n(8),b=r(y),h=n(10),v=r(h),m=n(9),A=r(m),x=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n=t=function(t){function n(){var e,r,a;(0,f.default)(this,n);for(var i=arguments.length,o=Array(i),l=0;l<i;l++)o[l]=arguments[l];return e=r=(0,d.default)(this,t.call.apply(t,[this].concat(o))),r.fireAnalyticsEvent=function(e,t){var n=r.props,a=n.analyticsData,i=n.analyticsId,o=r.context.onAnalyticsEvent;if(i&&o){var l=(0,s.default)({},a,t);o(i+"."+e,l,!1)}},r.privateAnalyticsEvent=function(e,t){var n=r.context.onAnalyticsEvent;n&&n(""+e,t,!0)},a=e,(0,d.default)(r,a)}return(0,b.default)(n,t),n.prototype.componentWillMount=function(){this.evaluatedMap="function"==typeof r?r(this.fireAnalyticsEvent):r},n.prototype.render=function(){var t=this,n=this.props,r=n.analyticsId,a=(n.analyticsData,(0,l.default)(n,["analyticsId","analyticsData"]));return(0,i.default)(this.evaluatedMap).forEach(function(e){var n=t.evaluatedMap[e],r=a[e];a[e]=function(){"function"==typeof n?n.apply(void 0,arguments):t.fireAnalyticsEvent(n),"function"==typeof r&&r.apply(void 0,arguments)}}),v.default.createElement(e,(0,s.default)({fireAnalyticsEvent:this.fireAnalyticsEvent,firePrivateAnalyticsEvent:this.privateAnalyticsEvent,analyticsId:r,ref:this.props.innerRef},a))},n}(h.Component),t.displayName="WithAnalytics("+(e.displayName||e.name)+")",t.contextTypes={onAnalyticsEvent:A.default.func},t.defaultProps={analyticsId:a.analyticsId,analyticsData:a.analyticsData},n};t.default=x},function(e,t){e.exports=s}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("babel-runtime/core-js/object/assign"),require("babel-runtime/helpers/typeof"),require("babel-runtime/helpers/extends"),require("babel-runtime/helpers/classCallCheck"),require("babel-runtime/helpers/possibleConstructorReturn"),require("babel-runtime/helpers/inherits"),require("prop-types"),require("react"),require("babel-runtime/helpers/objectWithoutProperties"),require("babel-runtime/core-js/object/keys")):"function"==typeof define&&define.amd?define(["babel-runtime/core-js/object/assign","babel-runtime/helpers/typeof","babel-runtime/helpers/extends","babel-runtime/helpers/classCallCheck","babel-runtime/helpers/possibleConstructorReturn","babel-runtime/helpers/inherits","prop-types","react","babel-runtime/helpers/objectWithoutProperties","babel-runtime/core-js/object/keys"],t):"object"==typeof exports?exports["@atlaskit/analytics"]=t(require("babel-runtime/core-js/object/assign"),require("babel-runtime/helpers/typeof"),require("babel-runtime/helpers/extends"),require("babel-runtime/helpers/classCallCheck"),require("babel-runtime/helpers/possibleConstructorReturn"),require("babel-runtime/helpers/inherits"),require("prop-types"),require("react"),require("babel-runtime/helpers/objectWithoutProperties"),require("babel-runtime/core-js/object/keys")):e["@atlaskit/analytics"]=t(e["babel-runtime/core-js/object/assign"],e["babel-runtime/helpers/typeof"],e["babel-runtime/helpers/extends"],e["babel-runtime/helpers/classCallCheck"],e["babel-runtime/helpers/possibleConstructorReturn"],e["babel-runtime/helpers/inherits"],e["prop-types"],e.react,e["babel-runtime/helpers/objectWithoutProperties"],e["babel-runtime/core-js/object/keys"])}(this,function(e,t,n,a,r,i,l,o,u,s){return function(e){function t(a){if(n[a])return n[a].exports;var r=n[a]={exports:{},id:a,loaded:!1};return e[a].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.withAnalytics=t.cleanProps=t.AnalyticsListener=t.AnalyticsDecorator=void 0;var r=n(2),i=a(r),l=n(12),o=a(l),u=n(13),s=a(u),c=n(15),f=a(c);t.AnalyticsDecorator=i.default,t.AnalyticsListener=o.default,t.cleanProps=s.default,t.withAnalytics=f.default},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(3),i=a(r),l=n(4),o=a(l),u=n(5),s=a(u),c=n(6),f=a(c),p=n(7),d=a(p),y=n(8),b=a(y),h=n(9),v=a(h),m=n(10),A=a(m),x=n(11),P=a(x),g=function(e){function t(){var n,a,r;(0,f.default)(this,t);for(var l=arguments.length,u=Array(l),c=0;c<l;c++)u[c]=arguments[c];return n=a=(0,d.default)(this,e.call.apply(e,[this].concat(u))),a.getDecoratedAnalyticsData=function(e,t,n){var r=a.props,l=r.data,u=r.getData,c=r.match,f=r.matchPrivate,p=(0,s.default)({},t);return f===n&&(0,P.default)(c,e)&&("object"===("undefined"==typeof l?"undefined":(0,o.default)(l))&&(0,i.default)(p,l),"function"==typeof u&&(0,i.default)(p,u(e,p))),p},a.onAnalyticsEvent=function(e,t,n){var r=a.context.onAnalyticsEvent;if("function"==typeof r){var i=a.getDecoratedAnalyticsData(e,t,n);r(e,i,n)}},a.getParentAnalyticsData=function(e,t){var n=a.getDecoratedAnalyticsData(e,{},t),r=a.context.getParentAnalyticsData;return"function"==typeof r&&(0,i.default)(n,r(e,t)),n},r=n,(0,d.default)(a,r)}return(0,b.default)(t,e),t.prototype.getChildContext=function(){return{onAnalyticsEvent:this.onAnalyticsEvent,getParentAnalyticsData:this.getParentAnalyticsData}},t.prototype.render=function(){var e=this.props.children;return A.default.Children.only(e)},t}(m.Component);g.propTypes={data:v.default.object,getData:v.default.func,match:v.default.oneOfType([v.default.string,v.default.func]),matchPrivate:v.default.bool},g.defaultProps={match:"*",matchPrivate:!1},g.contextTypes={onAnalyticsEvent:v.default.func,getParentAnalyticsData:v.default.func},g.childContextTypes={onAnalyticsEvent:v.default.func,getParentAnalyticsData:v.default.func},t.default=g},function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t){e.exports=n},function(e,t){e.exports=a},function(e,t){e.exports=r},function(e,t){e.exports=i},function(e,t){e.exports=l},function(e,t){e.exports=o},function(e,t){"use strict";function n(e,t){return"*"===e||void 0===t||("string"==typeof e?a.test(e)?t.substr(0,e.length)===e:t===e:"function"==typeof e?e(t):e instanceof RegExp&&e.test(t))}Object.defineProperty(t,"__esModule",{value:!0});var a=/\.$/;t.default=n},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=a(r),l=n(6),o=a(l),u=n(7),s=a(u),c=n(8),f=a(c),p=n(9),d=a(p),y=n(10),b=a(y),h=n(11),v=a(h),m=function(e){function t(){var n,a,r;(0,o.default)(this,t);for(var l=arguments.length,u=Array(l),c=0;c<l;c++)u[c]=arguments[c];return n=a=(0,s.default)(this,e.call.apply(e,[this].concat(u))),a.onAnalyticsEvent=function(e,t,n){var r=a.props,l=r.onEvent,o=r.match,u=r.matchPrivate;if(u===n&&(0,v.default)(o,e)&&"function"==typeof l){var s=(0,i.default)({},t);l(e,s)}var c=a.context.onAnalyticsEvent;"function"==typeof c&&c(e,t,n)},r=n,(0,s.default)(a,r)}return(0,f.default)(t,e),t.prototype.getChildContext=function(){return{onAnalyticsEvent:this.onAnalyticsEvent}},t.prototype.render=function(){var e=this.props.children;return b.default.Children.only(e)},t}(y.Component);m.propTypes={onEvent:d.default.func.isRequired,match:d.default.oneOfType([d.default.string,d.default.func]),matchPrivate:d.default.bool},m.defaultProps={match:"*",matchPrivate:!1},m.contextTypes={onAnalyticsEvent:d.default.func},m.childContextTypes={onAnalyticsEvent:d.default.func},t.default=m},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function r(e){var t=(e.analyticsId,e.analyticsData,e.fireAnalyticsEvent,e.firePrivateAnalyticsEvent,(0,l.default)(e,["analyticsId","analyticsData","fireAnalyticsEvent","firePrivateAnalyticsEvent"]));return t}Object.defineProperty(t,"__esModule",{value:!0});var i=n(14),l=a(i);t.default=r},function(e,t){e.exports=u},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(16),i=a(r),l=n(14),o=a(l),u=n(5),s=a(u),c=n(6),f=a(c),p=n(7),d=a(p),y=n(8),b=a(y),h=n(10),v=a(h),m=n(9),A=a(m),x=function(e){var t,n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n=t=function(t){function n(){var e,a,r;(0,f.default)(this,n);for(var i=arguments.length,l=Array(i),o=0;o<i;o++)l[o]=arguments[o];return e=a=(0,d.default)(this,t.call.apply(t,[this].concat(l))),a.fireAnalyticsEvent=function(e,t){var n=a.props,r=n.analyticsData,i=n.analyticsId,l=a.context.onAnalyticsEvent;if(i&&l){var o=(0,s.default)({},r,t);l(i+"."+e,o,!1)}},a.privateAnalyticsEvent=function(e,t){var n=a.context.onAnalyticsEvent;n&&n(""+e,t,!0)},a.getParentAnalyticsData=function(e){var t=a.context.getParentAnalyticsData,n={};if("function"==typeof t){var r=a.props.analyticsId;n=t(r+"."+e,!1)}return n},r=e,(0,d.default)(a,r)}return(0,b.default)(n,t),n.prototype.componentWillMount=function(){this.evaluatedMap="function"==typeof a?a(this.fireAnalyticsEvent):a},n.prototype.render=function(){var t=this,n=this.props,a=n.analyticsId,r=(n.analyticsData,(0,o.default)(n,["analyticsId","analyticsData"]));return(0,i.default)(this.evaluatedMap).forEach(function(e){var n=t.evaluatedMap[e],a=r[e];r[e]=function(){"function"==typeof n?n.apply(void 0,arguments):t.fireAnalyticsEvent(n),"function"==typeof a&&a.apply(void 0,arguments)}}),v.default.createElement(e,(0,s.default)({fireAnalyticsEvent:this.fireAnalyticsEvent,firePrivateAnalyticsEvent:this.privateAnalyticsEvent,getParentAnalyticsData:this.getParentAnalyticsData,analyticsId:a,ref:this.props.innerRef},r))},n}(h.Component),t.displayName="WithAnalytics("+(e.displayName||e.name)+")",t.contextTypes={onAnalyticsEvent:A.default.func,getParentAnalyticsData:A.default.func},t.defaultProps={analyticsId:r.analyticsId,analyticsData:r.analyticsData},n};t.default=x},function(e,t){e.exports=s}])});
{
"name": "@atlaskit/analytics",
"version": "2.1.0",
"version": "2.2.0",
"config": {

@@ -27,3 +27,5 @@ "access": "public"

"devDependencies": {
"@atlaskit/theme": "^2.0.0"
"@atlaskit/theme": "^2.0.0",
"react-redux": "^5.0.0",
"redux": "^3.7.2"
},

@@ -30,0 +32,0 @@ "dependencies": {

@@ -18,3 +18,3 @@ [![AtlasKit component registry](https://img.shields.io/badge/AtlasKit-components-FF5230.svg)](http://atlaskit.atlassian.com)

Detailed docs and example usage can be found [here](https://aui-cdn.atlassian.com/atlaskit/stories/@atlaskit/analytics/2.1.0/).
Detailed docs and example usage can be found [here](https://aui-cdn.atlassian.com/atlaskit/stories/@atlaskit/analytics/2.2.0/).

@@ -21,0 +21,0 @@ _* Please note that this module could have dependencies that are governed by the Atlassian Design Guidelines license which will be automatically included on install. Each dependency has a license file that indicates whether the Atlassian Design Guidelines license applies._

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc