@atlaskit/analytics
Advanced tools
Comparing version 2.2.2 to 2.3.0
@@ -1,6 +0,21 @@ | ||
<a name="2.2.2"></a> | ||
## 2.2.2 (2017-10-17) | ||
<a name="2.3.0"></a> | ||
# 2.3.0 (2017-10-20) | ||
<a name="2.3.0"></a> | ||
# 2.3.0 (2017-10-20) | ||
### Bug Fixes | ||
* **component:** lint fix. Remove bad comment. ([311ca12](https://bitbucket.org/atlassian/atlaskit/commits/311ca12)) | ||
### Features | ||
* **component:** support bubble events between react trees via the AnalyticsDelegate ([f6af591](https://bitbucket.org/atlassian/atlaskit/commits/f6af591)) | ||
<a name="2.2.2"></a> | ||
@@ -7,0 +22,0 @@ ## 2.2.2 (2017-10-17) |
@@ -80,6 +80,7 @@ module.exports = /******/ | ||
value: !0 | ||
}), exports.withAnalytics = exports.cleanProps = exports.AnalyticsListener = exports.AnalyticsDecorator = void 0; | ||
var _AnalyticsDecorator2 = __webpack_require__(2), _AnalyticsDecorator3 = _interopRequireDefault(_AnalyticsDecorator2), _AnalyticsListener2 = __webpack_require__(12), _AnalyticsListener3 = _interopRequireDefault(_AnalyticsListener2), _cleanProps2 = __webpack_require__(13), _cleanProps3 = _interopRequireDefault(_cleanProps2), _withAnalytics2 = __webpack_require__(15), _withAnalytics3 = _interopRequireDefault(_withAnalytics2); | ||
exports.AnalyticsDecorator = _AnalyticsDecorator3.default, exports.AnalyticsListener = _AnalyticsListener3.default, | ||
exports.cleanProps = _cleanProps3.default, exports.withAnalytics = _withAnalytics3.default; | ||
}), exports.withAnalytics = exports.cleanProps = exports.AnalyticsListener = exports.AnalyticsDelegate = exports.AnalyticsDecorator = void 0; | ||
var _AnalyticsDecorator2 = __webpack_require__(2), _AnalyticsDecorator3 = _interopRequireDefault(_AnalyticsDecorator2), _AnalyticsDelegate2 = __webpack_require__(12), _AnalyticsDelegate3 = _interopRequireDefault(_AnalyticsDelegate2), _AnalyticsListener2 = __webpack_require__(13), _AnalyticsListener3 = _interopRequireDefault(_AnalyticsListener2), _cleanProps2 = __webpack_require__(14), _cleanProps3 = _interopRequireDefault(_cleanProps2), _withAnalytics2 = __webpack_require__(16), _withAnalytics3 = _interopRequireDefault(_withAnalytics2); | ||
exports.AnalyticsDecorator = _AnalyticsDecorator3.default, exports.AnalyticsDelegate = _AnalyticsDelegate3.default, | ||
exports.AnalyticsListener = _AnalyticsListener3.default, exports.cleanProps = _cleanProps3.default, | ||
exports.withAnalytics = _withAnalytics3.default; | ||
}, /* 2 */ | ||
@@ -213,2 +214,46 @@ /***/ | ||
}); | ||
var _extends2 = __webpack_require__(5), _extends3 = _interopRequireDefault(_extends2), _classCallCheck2 = __webpack_require__(6), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _possibleConstructorReturn2 = __webpack_require__(7), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(8), _inherits3 = _interopRequireDefault(_inherits2), _propTypes = __webpack_require__(9), _propTypes2 = _interopRequireDefault(_propTypes), _react = __webpack_require__(10), _react2 = _interopRequireDefault(_react), AnalyticsDelegate = function(_Component) { | ||
function AnalyticsDelegate() { | ||
var _temp, _this, _ret; | ||
(0, _classCallCheck3.default)(this, AnalyticsDelegate); | ||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; | ||
return _temp = _this = (0, _possibleConstructorReturn3.default)(this, _Component.call.apply(_Component, [ this ].concat(args))), | ||
_this.onAnalyticsEvent = function(name, data, isPrivate) { | ||
var delegateAnalyticsEvent = _this.props.delegateAnalyticsEvent, eventData = (0, | ||
_extends3.default)({}, data); | ||
delegateAnalyticsEvent && delegateAnalyticsEvent(name, eventData, isPrivate); | ||
// Pass the event up the hierarchy | ||
var onAnalyticsEvent = _this.context.onAnalyticsEvent; | ||
"function" == typeof onAnalyticsEvent && onAnalyticsEvent(name, data, isPrivate); | ||
}, _ret = _temp, (0, _possibleConstructorReturn3.default)(_this, _ret); | ||
} | ||
return (0, _inherits3.default)(AnalyticsDelegate, _Component), AnalyticsDelegate.prototype.getChildContext = function() { | ||
return { | ||
onAnalyticsEvent: this.onAnalyticsEvent | ||
}; | ||
}, AnalyticsDelegate.prototype.render = function() { | ||
var children = this.props.children; | ||
// eslint-disable-line react/prop-types | ||
return _react2.default.Children.only(children); | ||
}, AnalyticsDelegate; | ||
}(_react.Component); | ||
AnalyticsDelegate.propTypes = { | ||
delegateAnalyticsEvent: _propTypes2.default.func | ||
}, AnalyticsDelegate.contextTypes = { | ||
onAnalyticsEvent: _propTypes2.default.func | ||
}, AnalyticsDelegate.childContextTypes = { | ||
onAnalyticsEvent: _propTypes2.default.func | ||
}, exports.default = AnalyticsDelegate; | ||
}, /* 13 */ | ||
/***/ | ||
function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
function _interopRequireDefault(obj) { | ||
return obj && obj.__esModule ? obj : { | ||
default: obj | ||
}; | ||
} | ||
Object.defineProperty(exports, "__esModule", { | ||
value: !0 | ||
}); | ||
var _extends2 = __webpack_require__(5), _extends3 = _interopRequireDefault(_extends2), _classCallCheck2 = __webpack_require__(6), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _possibleConstructorReturn2 = __webpack_require__(7), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(8), _inherits3 = _interopRequireDefault(_inherits2), _propTypes = __webpack_require__(9), _propTypes2 = _interopRequireDefault(_propTypes), _react = __webpack_require__(10), _react2 = _interopRequireDefault(_react), _matchEvent = __webpack_require__(11), _matchEvent2 = _interopRequireDefault(_matchEvent), AnalyticsListener = function(_Component) { | ||
@@ -258,3 +303,3 @@ function AnalyticsListener() { | ||
}, exports.default = AnalyticsListener; | ||
}, /* 13 */ | ||
}, /* 14 */ | ||
/***/ | ||
@@ -273,4 +318,4 @@ function(module, exports, __webpack_require__) { | ||
/* eslint-disable no-unused-vars */ | ||
var cleanedProps = (props.analyticsId, props.analyticsData, props.fireAnalyticsEvent, | ||
props.firePrivateAnalyticsEvent, (0, _objectWithoutProperties3.default)(props, [ "analyticsId", "analyticsData", "fireAnalyticsEvent", "firePrivateAnalyticsEvent" ])); | ||
var cleanedProps = (props.analyticsId, props.analyticsData, props.delegateAnalyticsEvent, | ||
props.fireAnalyticsEvent, props.firePrivateAnalyticsEvent, (0, _objectWithoutProperties3.default)(props, [ "analyticsId", "analyticsData", "delegateAnalyticsEvent", "fireAnalyticsEvent", "firePrivateAnalyticsEvent" ])); | ||
/* eslint-enable no-unused-vars */ | ||
@@ -282,9 +327,9 @@ return cleanedProps; | ||
}); | ||
var _objectWithoutProperties2 = __webpack_require__(14), _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | ||
var _objectWithoutProperties2 = __webpack_require__(15), _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | ||
exports.default = cleanProps; | ||
}, /* 14 */ | ||
}, /* 15 */ | ||
/***/ | ||
function(module, exports) { | ||
module.exports = require("babel-runtime/helpers/objectWithoutProperties"); | ||
}, /* 15 */ | ||
}, /* 16 */ | ||
/***/ | ||
@@ -301,4 +346,4 @@ function(module, exports, __webpack_require__) { | ||
}); | ||
var _keys = __webpack_require__(16), _keys2 = _interopRequireDefault(_keys), _objectWithoutProperties2 = __webpack_require__(14), _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2), _extends2 = __webpack_require__(5), _extends3 = _interopRequireDefault(_extends2), _classCallCheck2 = __webpack_require__(6), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _possibleConstructorReturn2 = __webpack_require__(7), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(8), _inherits3 = _interopRequireDefault(_inherits2), _react = __webpack_require__(10), _react2 = _interopRequireDefault(_react), _propTypes = __webpack_require__(9), _propTypes2 = _interopRequireDefault(_propTypes), withAnalytics = function(WrappedComponent) { | ||
var _class, _temp2, map = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, defaultProps = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; | ||
var _keys = __webpack_require__(17), _keys2 = _interopRequireDefault(_keys), _objectWithoutProperties2 = __webpack_require__(15), _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2), _extends2 = __webpack_require__(5), _extends3 = _interopRequireDefault(_extends2), _classCallCheck2 = __webpack_require__(6), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _possibleConstructorReturn2 = __webpack_require__(7), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(8), _inherits3 = _interopRequireDefault(_inherits2), _react = __webpack_require__(10), _react2 = _interopRequireDefault(_react), _propTypes = __webpack_require__(9), _propTypes2 = _interopRequireDefault(_propTypes), withAnalytics = function(WrappedComponent) { | ||
var _class, _temp2, map = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, defaultProps = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, withDelegation = arguments[3]; | ||
return _temp2 = _class = function(_Component) { | ||
@@ -310,3 +355,6 @@ function WithAnalytics() { | ||
return _temp = _this = (0, _possibleConstructorReturn3.default)(this, _Component.call.apply(_Component, [ this ].concat(args))), | ||
_this.fireAnalyticsEvent = function(name, data) { | ||
_this.delegateAnalyticsEvent = function(analyticsId, data, isPrivate) { | ||
var onAnalyticsEvent = _this.context.onAnalyticsEvent; | ||
onAnalyticsEvent && onAnalyticsEvent(analyticsId, data, isPrivate); | ||
}, _this.fireAnalyticsEvent = function(name, data) { | ||
var _this$props = _this.props, analyticsData = _this$props.analyticsData, analyticsId = _this$props.analyticsId, onAnalyticsEvent = _this.context.onAnalyticsEvent; | ||
@@ -345,2 +393,3 @@ if (analyticsId && onAnalyticsEvent) { | ||
getParentAnalyticsData: this.getParentAnalyticsData, | ||
delegateAnalyticsEvent: withDelegation ? this.delegateAnalyticsEvent : void 0, | ||
analyticsId: analyticsId, | ||
@@ -360,3 +409,3 @@ ref: this.props.innerRef | ||
exports.default = withAnalytics; | ||
}, /* 16 */ | ||
}, /* 17 */ | ||
/***/ | ||
@@ -363,0 +412,0 @@ function(module, exports) { |
@@ -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),x=n(10),E=a(x),P=n(11),b=a(P),g=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.getDecoratedAnalyticsData=function(t,e,n){var r=a.props,o=r.data,l=r.getData,f=r.match,s=r.matchPrivate,d=(0,c.default)({},e);return s===n&&(0,b.default)(f,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);g.propTypes={data:A.default.object,getData:A.default.func,match:A.default.oneOfType([A.default.string,A.default.func,A.default.instanceOf(RegExp)]),matchPrivate:A.default.bool},g.defaultProps={match:"*",matchPrivate:!1},g.contextTypes={onAnalyticsEvent:A.default.func,getParentAnalyticsData:A.default.func},g.childContextTypes={onAnalyticsEvent:A.default.func,getParentAnalyticsData:A.default.func},e.default=g},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),x=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);x.propTypes={onEvent:p.default.func.isRequired,match:p.default.oneOfType([p.default.string,p.default.func,p.default.instanceOf(RegExp)]),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),f=n(6),s=a(f),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,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)},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")}]); | ||
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.AnalyticsDelegate=e.AnalyticsDecorator=void 0;var r=n(2),i=a(r),l=n(12),o=a(l),u=n(13),c=a(u),s=n(14),f=a(s),d=n(16),y=a(d);e.AnalyticsDecorator=i.default,e.AnalyticsDelegate=o.default,e.AnalyticsListener=c.default,e.cleanProps=f.default,e.withAnalytics=y.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),l=n(4),o=a(l),u=n(5),c=a(u),s=n(6),f=a(s),d=n(7),y=a(d),p=n(8),v=a(p),h=n(9),A=a(h),E=n(10),g=a(E),x=n(11),P=a(x),b=function(t){function e(){var n,a,r;(0,f.default)(this,e);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=a=(0,y.default)(this,t.call.apply(t,[this].concat(u))),a.getDecoratedAnalyticsData=function(t,e,n){var r=a.props,l=r.data,u=r.getData,s=r.match,f=r.matchPrivate,d=(0,c.default)({},e);return f===n&&(0,P.default)(s,t)&&("object"===("undefined"==typeof l?"undefined":(0,o.default)(l))&&(0,i.default)(d,l),"function"==typeof u&&(0,i.default)(d,u(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,y.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 g.default.Children.only(t)},e}(E.Component);b.propTypes={data:A.default.object,getData:A.default.func,match:A.default.oneOfType([A.default.string,A.default.func,A.default.instanceOf(RegExp)]),matchPrivate:A.default.bool},b.defaultProps={match:"*",matchPrivate:!1},b.contextTypes={onAnalyticsEvent:A.default.func,getParentAnalyticsData:A.default.func},b.childContextTypes={onAnalyticsEvent:A.default.func,getParentAnalyticsData:A.default.func},e.default=b},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),l=n(6),o=a(l),u=n(7),c=a(u),s=n(8),f=a(s),d=n(9),y=a(d),p=n(10),v=a(p),h=function(t){function e(){var n,a,r;(0,o.default)(this,e);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=a=(0,c.default)(this,t.call.apply(t,[this].concat(u))),a.onAnalyticsEvent=function(t,e,n){var r=a.props.delegateAnalyticsEvent,l=(0,i.default)({},e);r&&r(t,l,n);var o=a.context.onAnalyticsEvent;"function"==typeof o&&o(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}(p.Component);h.propTypes={delegateAnalyticsEvent:y.default.func},h.contextTypes={onAnalyticsEvent:y.default.func},h.childContextTypes={onAnalyticsEvent:y.default.func},e.default=h},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),l=n(6),o=a(l),u=n(7),c=a(u),s=n(8),f=a(s),d=n(9),y=a(d),p=n(10),v=a(p),h=n(11),A=a(h),E=function(t){function e(){var n,a,r;(0,o.default)(this,e);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=a=(0,c.default)(this,t.call.apply(t,[this].concat(u))),a.onAnalyticsEvent=function(t,e,n){var r=a.props,l=r.onEvent,o=r.match,u=r.matchPrivate;if(u===n&&(0,A.default)(o,t)&&"function"==typeof l){var c=(0,i.default)({},e);l(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}(p.Component);E.propTypes={onEvent:y.default.func.isRequired,match:y.default.oneOfType([y.default.string,y.default.func,y.default.instanceOf(RegExp)]),matchPrivate:y.default.bool},E.defaultProps={match:"*",matchPrivate:!1},E.contextTypes={onAnalyticsEvent:y.default.func},E.childContextTypes={onAnalyticsEvent:y.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.delegateAnalyticsEvent,t.fireAnalyticsEvent,t.firePrivateAnalyticsEvent,(0,l.default)(t,["analyticsId","analyticsData","delegateAnalyticsEvent","fireAnalyticsEvent","firePrivateAnalyticsEvent"]));return e}Object.defineProperty(e,"__esModule",{value:!0});var i=n(15),l=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(17),i=a(r),l=n(15),o=a(l),u=n(5),c=a(u),s=n(6),f=a(s),d=n(7),y=a(d),p=n(8),v=a(p),h=n(10),A=a(h),E=n(9),g=a(E),x=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]:{},l=arguments[3];return n=e=function(e){function n(){var t,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 t=a=(0,y.default)(this,e.call.apply(e,[this].concat(l))),a.delegateAnalyticsEvent=function(t,e,n){var r=a.context.onAnalyticsEvent;r&&r(t,e,n)},a.fireAnalyticsEvent=function(t,e){var n=a.props,r=n.analyticsData,i=n.analyticsId,l=a.context.onAnalyticsEvent;if(i&&l){var o=(0,c.default)({},r,e);l(i+"."+t,o,!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,y.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,o.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,delegateAnalyticsEvent:l?this.delegateAnalyticsEvent:void 0,analyticsId:a,ref:this.props.innerRef},r))},n}(h.Component),e.displayName="WithAnalytics("+(t.displayName||t.name)+")",e.contextTypes={onAnalyticsEvent:g.default.func,getParentAnalyticsData:g.default.func},e.defaultProps={analyticsId:r.analyticsId,analyticsData:r.analyticsData},n};e.default=x},function(t,e){t.exports=require("babel-runtime/core-js/object/keys")}]); |
!function(root, factory) { | ||
"object" == typeof exports && "object" == typeof module ? module.exports = factory(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" ], factory) : "object" == typeof exports ? exports["@atlaskit/analytics"] = factory(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")) : root["@atlaskit/analytics"] = factory(root["babel-runtime/core-js/object/assign"], root["babel-runtime/helpers/typeof"], root["babel-runtime/helpers/extends"], root["babel-runtime/helpers/classCallCheck"], root["babel-runtime/helpers/possibleConstructorReturn"], root["babel-runtime/helpers/inherits"], root["prop-types"], root.react, root["babel-runtime/helpers/objectWithoutProperties"], root["babel-runtime/core-js/object/keys"]); | ||
}(this, function(__WEBPACK_EXTERNAL_MODULE_3__, __WEBPACK_EXTERNAL_MODULE_4__, __WEBPACK_EXTERNAL_MODULE_5__, __WEBPACK_EXTERNAL_MODULE_6__, __WEBPACK_EXTERNAL_MODULE_7__, __WEBPACK_EXTERNAL_MODULE_8__, __WEBPACK_EXTERNAL_MODULE_9__, __WEBPACK_EXTERNAL_MODULE_10__, __WEBPACK_EXTERNAL_MODULE_14__, __WEBPACK_EXTERNAL_MODULE_16__) { | ||
}(this, function(__WEBPACK_EXTERNAL_MODULE_3__, __WEBPACK_EXTERNAL_MODULE_4__, __WEBPACK_EXTERNAL_MODULE_5__, __WEBPACK_EXTERNAL_MODULE_6__, __WEBPACK_EXTERNAL_MODULE_7__, __WEBPACK_EXTERNAL_MODULE_8__, __WEBPACK_EXTERNAL_MODULE_9__, __WEBPACK_EXTERNAL_MODULE_10__, __WEBPACK_EXTERNAL_MODULE_15__, __WEBPACK_EXTERNAL_MODULE_17__) { | ||
/******/ | ||
@@ -83,6 +83,7 @@ return function(modules) { | ||
value: !0 | ||
}), exports.withAnalytics = exports.cleanProps = exports.AnalyticsListener = exports.AnalyticsDecorator = void 0; | ||
var _AnalyticsDecorator2 = __webpack_require__(2), _AnalyticsDecorator3 = _interopRequireDefault(_AnalyticsDecorator2), _AnalyticsListener2 = __webpack_require__(12), _AnalyticsListener3 = _interopRequireDefault(_AnalyticsListener2), _cleanProps2 = __webpack_require__(13), _cleanProps3 = _interopRequireDefault(_cleanProps2), _withAnalytics2 = __webpack_require__(15), _withAnalytics3 = _interopRequireDefault(_withAnalytics2); | ||
exports.AnalyticsDecorator = _AnalyticsDecorator3.default, exports.AnalyticsListener = _AnalyticsListener3.default, | ||
exports.cleanProps = _cleanProps3.default, exports.withAnalytics = _withAnalytics3.default; | ||
}), exports.withAnalytics = exports.cleanProps = exports.AnalyticsListener = exports.AnalyticsDelegate = exports.AnalyticsDecorator = void 0; | ||
var _AnalyticsDecorator2 = __webpack_require__(2), _AnalyticsDecorator3 = _interopRequireDefault(_AnalyticsDecorator2), _AnalyticsDelegate2 = __webpack_require__(12), _AnalyticsDelegate3 = _interopRequireDefault(_AnalyticsDelegate2), _AnalyticsListener2 = __webpack_require__(13), _AnalyticsListener3 = _interopRequireDefault(_AnalyticsListener2), _cleanProps2 = __webpack_require__(14), _cleanProps3 = _interopRequireDefault(_cleanProps2), _withAnalytics2 = __webpack_require__(16), _withAnalytics3 = _interopRequireDefault(_withAnalytics2); | ||
exports.AnalyticsDecorator = _AnalyticsDecorator3.default, exports.AnalyticsDelegate = _AnalyticsDelegate3.default, | ||
exports.AnalyticsListener = _AnalyticsListener3.default, exports.cleanProps = _cleanProps3.default, | ||
exports.withAnalytics = _withAnalytics3.default; | ||
}, /* 2 */ | ||
@@ -216,2 +217,46 @@ /***/ | ||
}); | ||
var _extends2 = __webpack_require__(5), _extends3 = _interopRequireDefault(_extends2), _classCallCheck2 = __webpack_require__(6), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _possibleConstructorReturn2 = __webpack_require__(7), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(8), _inherits3 = _interopRequireDefault(_inherits2), _propTypes = __webpack_require__(9), _propTypes2 = _interopRequireDefault(_propTypes), _react = __webpack_require__(10), _react2 = _interopRequireDefault(_react), AnalyticsDelegate = function(_Component) { | ||
function AnalyticsDelegate() { | ||
var _temp, _this, _ret; | ||
(0, _classCallCheck3.default)(this, AnalyticsDelegate); | ||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; | ||
return _temp = _this = (0, _possibleConstructorReturn3.default)(this, _Component.call.apply(_Component, [ this ].concat(args))), | ||
_this.onAnalyticsEvent = function(name, data, isPrivate) { | ||
var delegateAnalyticsEvent = _this.props.delegateAnalyticsEvent, eventData = (0, | ||
_extends3.default)({}, data); | ||
delegateAnalyticsEvent && delegateAnalyticsEvent(name, eventData, isPrivate); | ||
// Pass the event up the hierarchy | ||
var onAnalyticsEvent = _this.context.onAnalyticsEvent; | ||
"function" == typeof onAnalyticsEvent && onAnalyticsEvent(name, data, isPrivate); | ||
}, _ret = _temp, (0, _possibleConstructorReturn3.default)(_this, _ret); | ||
} | ||
return (0, _inherits3.default)(AnalyticsDelegate, _Component), AnalyticsDelegate.prototype.getChildContext = function() { | ||
return { | ||
onAnalyticsEvent: this.onAnalyticsEvent | ||
}; | ||
}, AnalyticsDelegate.prototype.render = function() { | ||
var children = this.props.children; | ||
// eslint-disable-line react/prop-types | ||
return _react2.default.Children.only(children); | ||
}, AnalyticsDelegate; | ||
}(_react.Component); | ||
AnalyticsDelegate.propTypes = { | ||
delegateAnalyticsEvent: _propTypes2.default.func | ||
}, AnalyticsDelegate.contextTypes = { | ||
onAnalyticsEvent: _propTypes2.default.func | ||
}, AnalyticsDelegate.childContextTypes = { | ||
onAnalyticsEvent: _propTypes2.default.func | ||
}, exports.default = AnalyticsDelegate; | ||
}, /* 13 */ | ||
/***/ | ||
function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
function _interopRequireDefault(obj) { | ||
return obj && obj.__esModule ? obj : { | ||
default: obj | ||
}; | ||
} | ||
Object.defineProperty(exports, "__esModule", { | ||
value: !0 | ||
}); | ||
var _extends2 = __webpack_require__(5), _extends3 = _interopRequireDefault(_extends2), _classCallCheck2 = __webpack_require__(6), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _possibleConstructorReturn2 = __webpack_require__(7), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(8), _inherits3 = _interopRequireDefault(_inherits2), _propTypes = __webpack_require__(9), _propTypes2 = _interopRequireDefault(_propTypes), _react = __webpack_require__(10), _react2 = _interopRequireDefault(_react), _matchEvent = __webpack_require__(11), _matchEvent2 = _interopRequireDefault(_matchEvent), AnalyticsListener = function(_Component) { | ||
@@ -261,3 +306,3 @@ function AnalyticsListener() { | ||
}, exports.default = AnalyticsListener; | ||
}, /* 13 */ | ||
}, /* 14 */ | ||
/***/ | ||
@@ -276,4 +321,4 @@ function(module, exports, __webpack_require__) { | ||
/* eslint-disable no-unused-vars */ | ||
var cleanedProps = (props.analyticsId, props.analyticsData, props.fireAnalyticsEvent, | ||
props.firePrivateAnalyticsEvent, (0, _objectWithoutProperties3.default)(props, [ "analyticsId", "analyticsData", "fireAnalyticsEvent", "firePrivateAnalyticsEvent" ])); | ||
var cleanedProps = (props.analyticsId, props.analyticsData, props.delegateAnalyticsEvent, | ||
props.fireAnalyticsEvent, props.firePrivateAnalyticsEvent, (0, _objectWithoutProperties3.default)(props, [ "analyticsId", "analyticsData", "delegateAnalyticsEvent", "fireAnalyticsEvent", "firePrivateAnalyticsEvent" ])); | ||
/* eslint-enable no-unused-vars */ | ||
@@ -285,9 +330,9 @@ return cleanedProps; | ||
}); | ||
var _objectWithoutProperties2 = __webpack_require__(14), _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | ||
var _objectWithoutProperties2 = __webpack_require__(15), _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | ||
exports.default = cleanProps; | ||
}, /* 14 */ | ||
}, /* 15 */ | ||
/***/ | ||
function(module, exports) { | ||
module.exports = __WEBPACK_EXTERNAL_MODULE_14__; | ||
}, /* 15 */ | ||
module.exports = __WEBPACK_EXTERNAL_MODULE_15__; | ||
}, /* 16 */ | ||
/***/ | ||
@@ -304,4 +349,4 @@ function(module, exports, __webpack_require__) { | ||
}); | ||
var _keys = __webpack_require__(16), _keys2 = _interopRequireDefault(_keys), _objectWithoutProperties2 = __webpack_require__(14), _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2), _extends2 = __webpack_require__(5), _extends3 = _interopRequireDefault(_extends2), _classCallCheck2 = __webpack_require__(6), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _possibleConstructorReturn2 = __webpack_require__(7), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(8), _inherits3 = _interopRequireDefault(_inherits2), _react = __webpack_require__(10), _react2 = _interopRequireDefault(_react), _propTypes = __webpack_require__(9), _propTypes2 = _interopRequireDefault(_propTypes), withAnalytics = function(WrappedComponent) { | ||
var _class, _temp2, map = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, defaultProps = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; | ||
var _keys = __webpack_require__(17), _keys2 = _interopRequireDefault(_keys), _objectWithoutProperties2 = __webpack_require__(15), _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2), _extends2 = __webpack_require__(5), _extends3 = _interopRequireDefault(_extends2), _classCallCheck2 = __webpack_require__(6), _classCallCheck3 = _interopRequireDefault(_classCallCheck2), _possibleConstructorReturn2 = __webpack_require__(7), _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2), _inherits2 = __webpack_require__(8), _inherits3 = _interopRequireDefault(_inherits2), _react = __webpack_require__(10), _react2 = _interopRequireDefault(_react), _propTypes = __webpack_require__(9), _propTypes2 = _interopRequireDefault(_propTypes), withAnalytics = function(WrappedComponent) { | ||
var _class, _temp2, map = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, defaultProps = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, withDelegation = arguments[3]; | ||
return _temp2 = _class = function(_Component) { | ||
@@ -313,3 +358,6 @@ function WithAnalytics() { | ||
return _temp = _this = (0, _possibleConstructorReturn3.default)(this, _Component.call.apply(_Component, [ this ].concat(args))), | ||
_this.fireAnalyticsEvent = function(name, data) { | ||
_this.delegateAnalyticsEvent = function(analyticsId, data, isPrivate) { | ||
var onAnalyticsEvent = _this.context.onAnalyticsEvent; | ||
onAnalyticsEvent && onAnalyticsEvent(analyticsId, data, isPrivate); | ||
}, _this.fireAnalyticsEvent = function(name, data) { | ||
var _this$props = _this.props, analyticsData = _this$props.analyticsData, analyticsId = _this$props.analyticsId, onAnalyticsEvent = _this.context.onAnalyticsEvent; | ||
@@ -348,2 +396,3 @@ if (analyticsId && onAnalyticsEvent) { | ||
getParentAnalyticsData: this.getParentAnalyticsData, | ||
delegateAnalyticsEvent: withDelegation ? this.delegateAnalyticsEvent : void 0, | ||
analyticsId: analyticsId, | ||
@@ -363,7 +412,7 @@ ref: this.props.innerRef | ||
exports.default = withAnalytics; | ||
}, /* 16 */ | ||
}, /* 17 */ | ||
/***/ | ||
function(module, exports) { | ||
module.exports = __WEBPACK_EXTERNAL_MODULE_16__; | ||
module.exports = __WEBPACK_EXTERNAL_MODULE_17__; | ||
} ]); | ||
}); |
@@ -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,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,v.default.instanceOf(RegExp)]),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,d.default.instanceOf(RegExp)]),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}])}); | ||
!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.AnalyticsDelegate=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(14),f=a(c),p=n(16),d=a(p);t.AnalyticsDecorator=i.default,t.AnalyticsDelegate=o.default,t.AnalyticsListener=s.default,t.cleanProps=f.default,t.withAnalytics=d.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),v=a(y),h=n(9),b=a(h),A=n(10),m=a(A),E=n(11),g=a(E),x=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,g.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,v.default)(t,e),t.prototype.getChildContext=function(){return{onAnalyticsEvent:this.onAnalyticsEvent,getParentAnalyticsData:this.getParentAnalyticsData}},t.prototype.render=function(){var e=this.props.children;return m.default.Children.only(e)},t}(A.Component);x.propTypes={data:b.default.object,getData:b.default.func,match:b.default.oneOfType([b.default.string,b.default.func,b.default.instanceOf(RegExp)]),matchPrivate:b.default.bool},x.defaultProps={match:"*",matchPrivate:!1},x.contextTypes={onAnalyticsEvent:b.default.func,getParentAnalyticsData:b.default.func},x.childContextTypes={onAnalyticsEvent:b.default.func,getParentAnalyticsData:b.default.func},t.default=x},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),v=a(y),h=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.delegateAnalyticsEvent,l=(0,i.default)({},t);r&&r(e,l,n);var o=a.context.onAnalyticsEvent;"function"==typeof o&&o(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 v.default.Children.only(e)},t}(y.Component);h.propTypes={delegateAnalyticsEvent:d.default.func},h.contextTypes={onAnalyticsEvent:d.default.func},h.childContextTypes={onAnalyticsEvent:d.default.func},t.default=h},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),v=a(y),h=n(11),b=a(h),A=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,b.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 v.default.Children.only(e)},t}(y.Component);A.propTypes={onEvent:d.default.func.isRequired,match:d.default.oneOfType([d.default.string,d.default.func,d.default.instanceOf(RegExp)]),matchPrivate:d.default.bool},A.defaultProps={match:"*",matchPrivate:!1},A.contextTypes={onAnalyticsEvent:d.default.func},A.childContextTypes={onAnalyticsEvent:d.default.func},t.default=A},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.delegateAnalyticsEvent,e.fireAnalyticsEvent,e.firePrivateAnalyticsEvent,(0,l.default)(e,["analyticsId","analyticsData","delegateAnalyticsEvent","fireAnalyticsEvent","firePrivateAnalyticsEvent"]));return t}Object.defineProperty(t,"__esModule",{value:!0});var i=n(15),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(17),i=a(r),l=n(15),o=a(l),u=n(5),s=a(u),c=n(6),f=a(c),p=n(7),d=a(p),y=n(8),v=a(y),h=n(10),b=a(h),A=n(9),m=a(A),E=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]:{},l=arguments[3];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.delegateAnalyticsEvent=function(e,t,n){var r=a.context.onAnalyticsEvent;r&&r(e,t,n)},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,v.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)}}),b.default.createElement(e,(0,s.default)({fireAnalyticsEvent:this.fireAnalyticsEvent,firePrivateAnalyticsEvent:this.privateAnalyticsEvent,getParentAnalyticsData:this.getParentAnalyticsData,delegateAnalyticsEvent:l?this.delegateAnalyticsEvent:void 0,analyticsId:a,ref:this.props.innerRef},r))},n}(h.Component),t.displayName="WithAnalytics("+(e.displayName||e.name)+")",t.contextTypes={onAnalyticsEvent:m.default.func,getParentAnalyticsData:m.default.func},t.defaultProps={analyticsId:r.analyticsId,analyticsData:r.analyticsData},n};t.default=E},function(e,t){e.exports=s}])}); |
{ | ||
"name": "@atlaskit/analytics", | ||
"version": "2.2.2", | ||
"version": "2.3.0", | ||
"config": { | ||
@@ -5,0 +5,0 @@ "access": "public" |
@@ -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.2.2/). | ||
Detailed docs and example usage can be found [here](https://aui-cdn.atlassian.com/atlaskit/stories/@atlaskit/analytics/2.3.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._ |
@@ -19,5 +19,6 @@ import { Component, PureComponent } from 'react'; | ||
export declare function withAnalytics<C>(component: C, map?: EventMapOrFunction, defaultProps?: AnalyticsProps): C; | ||
export declare function withAnalytics<C>(component: C, map: EventMapOrFunction, defaultProps: AnalyticsProps, withDelegation?: boolean): C; | ||
export type FireAnalyticsEvent = (name: string, data: Object) => any; | ||
export type DelegateAnalyticsEvent = (analyticsId: string, data: Object, isPrivate: boolean) => void; | ||
@@ -31,1 +32,16 @@ export interface AnalyticsListenerProps { | ||
export class AnalyticsListener extends Component<AnalyticsListenerProps, {}> { } | ||
export interface AnalyticsDelegateProps { | ||
delegateAnalyticsEvent?: DelegateAnalyticsEvent; | ||
} | ||
export class AnalyticsDelegate extends Component<AnalyticsDelegateProps, {}> { } | ||
export interface AnalyticsDecoratorProps { | ||
data?: Object; | ||
getData?: (name: string, decoratedData: Object) => Object; | ||
match?: string | ((name: string) => boolean); | ||
matchPrivate?: boolean; | ||
} | ||
export class AnalyticsDecorator extends Component<AnalyticsDecoratorProps, {}> { } |
74880
875