@atlaskit/analytics-next
Advanced tools
Comparing version 6.1.0 to 6.2.0
# @atlaskit/analytics-next | ||
## 6.2.0 | ||
### Minor Changes | ||
- [minor][42fd897e16](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/42fd897e16): | ||
- Introduces a new custom React hook, `useAnalyticsEvents_experimental`, for creating analytics events within functional components. This hook replaces the need for the `withAnalyticsEvents` HOC. See the [Reference documentation](https://atlaskit.atlassian.com/packages/core/analytics-next/docs/reference) for details on how to use this new hook. | ||
## 6.1.0 | ||
@@ -4,0 +12,0 @@ |
@@ -10,3 +10,3 @@ import React, { Component } from 'react'; | ||
} | ||
export default class AnalyticsContext extends Component<Props> { | ||
declare class AnalyticsContext extends Component<Props> { | ||
static contextTypes: { | ||
@@ -22,4 +22,4 @@ getAtlaskitAnalyticsContext: PropTypes.Requireable<any>; | ||
getAnalyticsContext: () => any[]; | ||
render(): string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactPortal | null | undefined; | ||
render(): JSX.Element; | ||
} | ||
export {}; | ||
export default AnalyticsContext; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var react_1 = require("react"); | ||
var react_1 = tslib_1.__importStar(require("react")); | ||
var prop_types_1 = tslib_1.__importDefault(require("prop-types")); | ||
var AnalyticsReactContext_1 = require("./AnalyticsReactContext"); | ||
var ContextTypes = { | ||
@@ -27,3 +28,8 @@ getAtlaskitAnalyticsContext: prop_types_1.default.func, | ||
AnalyticsContext.prototype.render = function () { | ||
return react_1.Children.only(this.props.children); | ||
var _a = this.context.getAtlaskitAnalyticsEventHandlers, getAtlaskitAnalyticsEventHandlers = _a === void 0 ? function () { return []; } : _a; | ||
var children = this.props.children; | ||
return (react_1.default.createElement(AnalyticsReactContext_1.AnalyticsReactContext.Provider, { value: { | ||
getAtlaskitAnalyticsContext: this.getAnalyticsContext, | ||
getAtlaskitAnalyticsEventHandlers: getAtlaskitAnalyticsEventHandlers, | ||
} }, react_1.Children.only(children))); | ||
}; | ||
@@ -30,0 +36,0 @@ AnalyticsContext.contextTypes = ContextTypes; |
@@ -13,3 +13,3 @@ import React, { Component } from 'react'; | ||
}; | ||
export default class AnalyticsListener extends Component<Props> { | ||
declare class AnalyticsListener extends Component<Props> { | ||
static contextTypes: { | ||
@@ -25,4 +25,4 @@ getAtlaskitAnalyticsEventHandlers: PropTypes.Requireable<any>; | ||
getAnalyticsEventHandlers: () => any[]; | ||
render(): React.ReactNode; | ||
render(): JSX.Element; | ||
} | ||
export {}; | ||
export default AnalyticsListener; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var react_1 = require("react"); | ||
var react_1 = tslib_1.__importStar(require("react")); | ||
var prop_types_1 = tslib_1.__importDefault(require("prop-types")); | ||
var AnalyticsReactContext_1 = require("./AnalyticsReactContext"); | ||
var ContextTypes = { | ||
@@ -32,3 +33,8 @@ getAtlaskitAnalyticsEventHandlers: prop_types_1.default.func, | ||
AnalyticsListener.prototype.render = function () { | ||
return this.props.children; | ||
var _a = this.context.getAtlaskitAnalyticsContext, getAtlaskitAnalyticsContext = _a === void 0 ? function () { return []; } : _a; | ||
var children = this.props.children; | ||
return (react_1.default.createElement(AnalyticsReactContext_1.AnalyticsReactContext.Provider, { value: { | ||
getAtlaskitAnalyticsEventHandlers: this.getAnalyticsEventHandlers, | ||
getAtlaskitAnalyticsContext: getAtlaskitAnalyticsContext, | ||
} }, children)); | ||
}; | ||
@@ -35,0 +41,0 @@ AnalyticsListener.contextTypes = ContextTypes; |
@@ -9,3 +9,5 @@ export { CreateUIAnalyticsEvent } from './types'; | ||
export { default as withAnalyticsEvents, WithAnalyticsEventsProps, } from './withAnalyticsEvents'; | ||
export { AnalyticsReactContext, AnalyticsReactContextInterface, } from './AnalyticsReactContext'; | ||
export { useAnalyticsEvents_experimental, UseAnalyticsEventsHook, } from './useAnalyticsEvents'; | ||
export { default as createAndFireEvent } from './createAndFireEvent'; | ||
export { default as cleanProps } from './cleanProps'; |
@@ -22,2 +22,8 @@ "use strict"; | ||
exports.withAnalyticsEvents = withAnalyticsEvents_1.default; | ||
// React context | ||
var AnalyticsReactContext_1 = require("./AnalyticsReactContext"); | ||
exports.AnalyticsReactContext = AnalyticsReactContext_1.AnalyticsReactContext; | ||
// Hook for creating and firing analytics events | ||
var useAnalyticsEvents_1 = require("./useAnalyticsEvents"); | ||
exports.useAnalyticsEvents_experimental = useAnalyticsEvents_1.useAnalyticsEvents_experimental; | ||
// Helper functions | ||
@@ -24,0 +30,0 @@ var createAndFireEvent_1 = require("./createAndFireEvent"); |
{ | ||
"name": "@atlaskit/analytics-next", | ||
"version": "6.1.0", | ||
"version": "6.2.0", | ||
"sideEffects": false | ||
} |
@@ -10,3 +10,3 @@ import React, { Component } from 'react'; | ||
} | ||
export default class AnalyticsContext extends Component<Props> { | ||
declare class AnalyticsContext extends Component<Props> { | ||
static contextTypes: { | ||
@@ -22,4 +22,4 @@ getAtlaskitAnalyticsContext: PropTypes.Requireable<any>; | ||
getAnalyticsContext: () => any[]; | ||
render(): string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactPortal | null | undefined; | ||
render(): JSX.Element; | ||
} | ||
export {}; | ||
export default AnalyticsContext; |
import { __extends, __read, __spread } from "tslib"; | ||
import { Children, Component } from 'react'; | ||
import React, { Children, Component } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { AnalyticsReactContext } from './AnalyticsReactContext'; | ||
var ContextTypes = { | ||
@@ -25,3 +26,8 @@ getAtlaskitAnalyticsContext: PropTypes.func, | ||
AnalyticsContext.prototype.render = function () { | ||
return Children.only(this.props.children); | ||
var _a = this.context.getAtlaskitAnalyticsEventHandlers, getAtlaskitAnalyticsEventHandlers = _a === void 0 ? function () { return []; } : _a; | ||
var children = this.props.children; | ||
return (React.createElement(AnalyticsReactContext.Provider, { value: { | ||
getAtlaskitAnalyticsContext: this.getAnalyticsContext, | ||
getAtlaskitAnalyticsEventHandlers: getAtlaskitAnalyticsEventHandlers, | ||
} }, Children.only(children))); | ||
}; | ||
@@ -28,0 +34,0 @@ AnalyticsContext.contextTypes = ContextTypes; |
@@ -13,3 +13,3 @@ import React, { Component } from 'react'; | ||
}; | ||
export default class AnalyticsListener extends Component<Props> { | ||
declare class AnalyticsListener extends Component<Props> { | ||
static contextTypes: { | ||
@@ -25,4 +25,4 @@ getAtlaskitAnalyticsEventHandlers: PropTypes.Requireable<any>; | ||
getAnalyticsEventHandlers: () => any[]; | ||
render(): React.ReactNode; | ||
render(): JSX.Element; | ||
} | ||
export {}; | ||
export default AnalyticsListener; |
import { __extends, __read, __spread } from "tslib"; | ||
import { Component } from 'react'; | ||
import React, { Component } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { AnalyticsReactContext } from './AnalyticsReactContext'; | ||
var ContextTypes = { | ||
@@ -30,3 +31,8 @@ getAtlaskitAnalyticsEventHandlers: PropTypes.func, | ||
AnalyticsListener.prototype.render = function () { | ||
return this.props.children; | ||
var _a = this.context.getAtlaskitAnalyticsContext, getAtlaskitAnalyticsContext = _a === void 0 ? function () { return []; } : _a; | ||
var children = this.props.children; | ||
return (React.createElement(AnalyticsReactContext.Provider, { value: { | ||
getAtlaskitAnalyticsEventHandlers: this.getAnalyticsEventHandlers, | ||
getAtlaskitAnalyticsContext: getAtlaskitAnalyticsContext, | ||
} }, children)); | ||
}; | ||
@@ -33,0 +39,0 @@ AnalyticsListener.contextTypes = ContextTypes; |
@@ -9,3 +9,5 @@ export { CreateUIAnalyticsEvent } from './types'; | ||
export { default as withAnalyticsEvents, WithAnalyticsEventsProps, } from './withAnalyticsEvents'; | ||
export { AnalyticsReactContext, AnalyticsReactContextInterface, } from './AnalyticsReactContext'; | ||
export { useAnalyticsEvents_experimental, UseAnalyticsEventsHook, } from './useAnalyticsEvents'; | ||
export { default as createAndFireEvent } from './createAndFireEvent'; | ||
export { default as cleanProps } from './cleanProps'; |
@@ -13,2 +13,6 @@ // Analytics event classes | ||
export { default as withAnalyticsEvents, } from './withAnalyticsEvents'; | ||
// React context | ||
export { AnalyticsReactContext, } from './AnalyticsReactContext'; | ||
// Hook for creating and firing analytics events | ||
export { useAnalyticsEvents_experimental, } from './useAnalyticsEvents'; | ||
// Helper functions | ||
@@ -15,0 +19,0 @@ export { default as createAndFireEvent } from './createAndFireEvent'; |
{ | ||
"name": "@atlaskit/analytics-next", | ||
"version": "6.1.0", | ||
"version": "6.2.0", | ||
"sideEffects": false | ||
} |
{ | ||
"name": "@atlaskit/analytics-next", | ||
"version": "6.1.0", | ||
"version": "6.2.0", | ||
"description": "The 🆕 Atlaskit component analytics framework", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
{ | ||
"name": "@atlaskit/analytics-next", | ||
"version": "6.1.0", | ||
"version": "6.2.0", | ||
"sideEffects": false | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
218260
131
3386
1
3