Socket
Socket
Sign inDemoInstall

@atlaskit/analytics-next

Package Overview
Dependencies
Maintainers
1
Versions
118
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@atlaskit/analytics-next - npm Package Compare versions

Comparing version 6.3.1 to 6.3.2

8

CHANGELOG.md
# @atlaskit/analytics-next
## 6.3.2
### Patch Changes
- [patch][768bac6d81](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/768bac6d81):
Remove redundant object check (which was previously required to appease type checking)
## 6.3.1

@@ -4,0 +12,0 @@

2

dist/cjs/AnalyticsContext.d.ts

@@ -8,3 +8,3 @@ import React, { Component } from 'react';

* have this added as an item in their context array. */
data: unknown;
data: Object;
}

@@ -11,0 +11,0 @@ interface State {

@@ -7,5 +7,2 @@ "use strict";

var AnalyticsContext_1 = tslib_1.__importDefault(require("./AnalyticsContext"));
var isObject = function (o) {
return typeof o === 'object' && o !== null && !Array.isArray(o);
};
var BaseAnalyticsErrorBoundary = /** @class */ (function (_super) {

@@ -22,3 +19,3 @@ tslib_1.__extends(BaseAnalyticsErrorBoundary, _super);

? window.navigator.userAgent
: 'unknown' }, data), (isObject(analyticsErrorPayload) ? analyticsErrorPayload : {})),
: 'unknown' }, data), analyticsErrorPayload),
}).fire(channel);

@@ -25,0 +22,0 @@ };

export declare type AnalyticsEventPayload = Record<string, any>;
declare type AnalyticsEventCallback = ((payload: AnalyticsEventPayload) => AnalyticsEventPayload);
declare type AnalyticsEventCallback = (payload: AnalyticsEventPayload) => AnalyticsEventPayload;
declare type AnalyticsEventUpdater = AnalyticsEventPayload | AnalyticsEventCallback;

@@ -4,0 +4,0 @@ export declare type AnalyticsEventProps = {

@@ -10,2 +10,3 @@ "use strict";

};
var noop = function () { return []; };
var AnalyticsListener = /** @class */ (function (_super) {

@@ -34,3 +35,3 @@ tslib_1.__extends(AnalyticsListener, _super);

AnalyticsListener.prototype.render = function () {
var _a = this.context.getAtlaskitAnalyticsContext, getAtlaskitAnalyticsContext = _a === void 0 ? function () { return []; } : _a;
var _a = this.context.getAtlaskitAnalyticsContext, getAtlaskitAnalyticsContext = _a === void 0 ? noop : _a;
var children = this.props.children;

@@ -37,0 +38,0 @@ return (react_1.default.createElement(AnalyticsReactContext_1.AnalyticsReactContext.Provider, { value: {

import React from 'react';
export interface AnalyticsReactContextInterface {
getAtlaskitAnalyticsContext(): any[];
getAtlaskitAnalyticsEventHandlers(): any[];
getAtlaskitAnalyticsContext: null | (() => any[]);
getAtlaskitAnalyticsEventHandlers: null | (() => any[]);
}
export declare const AnalyticsReactContext: React.Context<AnalyticsReactContextInterface>;

@@ -6,5 +6,5 @@ "use strict";

exports.AnalyticsReactContext = react_1.default.createContext({
getAtlaskitAnalyticsContext: function () { return []; },
getAtlaskitAnalyticsEventHandlers: function () { return []; },
getAtlaskitAnalyticsContext: null,
getAtlaskitAnalyticsEventHandlers: null,
});
//# sourceMappingURL=AnalyticsReactContext.js.map

@@ -5,13 +5,22 @@ "use strict";

var react_1 = require("react");
var use_memo_one_1 = require("use-memo-one");
var AnalyticsReactContext_1 = require("./AnalyticsReactContext");
var UIAnalyticsEvent_1 = tslib_1.__importDefault(require("./UIAnalyticsEvent"));
var noop = function () { return []; };
function useAnalyticsEvents() {
var _a = react_1.useContext(AnalyticsReactContext_1.AnalyticsReactContext), getAtlaskitAnalyticsEventHandlers = _a.getAtlaskitAnalyticsEventHandlers, getAtlaskitAnalyticsContext = _a.getAtlaskitAnalyticsContext;
if ((getAtlaskitAnalyticsEventHandlers === null ||
getAtlaskitAnalyticsContext === null) &&
process.env.NODE_ENV !== 'production') {
/* eslint-disable-next-line no-console */
console.warn("No compatible AnalyticsListener is listening to this event fire. Use of this hook requires the firing component/hook to be wrapped in an AnalyticsListener from @atlaskit/analytics-next@^6.3.0 or above.");
}
var createAnalyticsEvent = react_1.useCallback(function (payload) {
var analyticsContext = react_1.useContext(AnalyticsReactContext_1.AnalyticsReactContext);
var contextRef = react_1.useRef(analyticsContext);
contextRef.current.getAtlaskitAnalyticsEventHandlers =
analyticsContext.getAtlaskitAnalyticsEventHandlers;
contextRef.current.getAtlaskitAnalyticsContext =
analyticsContext.getAtlaskitAnalyticsContext;
var createAnalyticsEvent = use_memo_one_1.useCallbackOne(function (payload) {
if (process.env.NODE_ENV !== 'production' &&
(contextRef.current.getAtlaskitAnalyticsEventHandlers === null ||
contextRef.current.getAtlaskitAnalyticsContext === null)) {
/* eslint-disable-next-line no-console */
console.error("\n@atlaskit/analytics-next\n---\nNo compatible <AnalyticsListener /> was found to fire this analytics event.\nUse of the useAnalyticsEvents() hook requires a parent <AnalyticsListener /> from @atlaskit/analytics-next@^6.3.0 or above.\nSee: https://atlaskit.atlassian.com/packages/core/analytics-next/docs/reference#AnalyticsListener\n");
}
var getAtlaskitAnalyticsContext = contextRef.current.getAtlaskitAnalyticsContext || noop;
var getAtlaskitAnalyticsEventHandlers = contextRef.current.getAtlaskitAnalyticsEventHandlers || noop;
return new UIAnalyticsEvent_1.default({

@@ -22,3 +31,3 @@ context: getAtlaskitAnalyticsContext(),

});
}, [getAtlaskitAnalyticsEventHandlers, getAtlaskitAnalyticsContext]);
}, []);
return {

@@ -25,0 +34,0 @@ createAnalyticsEvent: createAnalyticsEvent,

{
"name": "@atlaskit/analytics-next",
"version": "6.3.1",
"version": "6.3.2",
"sideEffects": false
}

@@ -8,3 +8,3 @@ import React, { Component } from 'react';

* have this added as an item in their context array. */
data: unknown;
data: Object;
}

@@ -11,0 +11,0 @@ interface State {

@@ -5,5 +5,2 @@ import { __assign, __extends } from "tslib";

import AnalyticsContext from './AnalyticsContext';
var isObject = function (o) {
return typeof o === 'object' && o !== null && !Array.isArray(o);
};
var BaseAnalyticsErrorBoundary = /** @class */ (function (_super) {

@@ -20,3 +17,3 @@ __extends(BaseAnalyticsErrorBoundary, _super);

? window.navigator.userAgent
: 'unknown' }, data), (isObject(analyticsErrorPayload) ? analyticsErrorPayload : {})),
: 'unknown' }, data), analyticsErrorPayload),
}).fire(channel);

@@ -23,0 +20,0 @@ };

export declare type AnalyticsEventPayload = Record<string, any>;
declare type AnalyticsEventCallback = ((payload: AnalyticsEventPayload) => AnalyticsEventPayload);
declare type AnalyticsEventCallback = (payload: AnalyticsEventPayload) => AnalyticsEventPayload;
declare type AnalyticsEventUpdater = AnalyticsEventPayload | AnalyticsEventCallback;

@@ -4,0 +4,0 @@ export declare type AnalyticsEventProps = {

@@ -8,2 +8,3 @@ import { __extends, __read, __spread } from "tslib";

};
var noop = function () { return []; };
var AnalyticsListener = /** @class */ (function (_super) {

@@ -32,3 +33,3 @@ __extends(AnalyticsListener, _super);

AnalyticsListener.prototype.render = function () {
var _a = this.context.getAtlaskitAnalyticsContext, getAtlaskitAnalyticsContext = _a === void 0 ? function () { return []; } : _a;
var _a = this.context.getAtlaskitAnalyticsContext, getAtlaskitAnalyticsContext = _a === void 0 ? noop : _a;
var children = this.props.children;

@@ -35,0 +36,0 @@ return (React.createElement(AnalyticsReactContext.Provider, { value: {

import React from 'react';
export interface AnalyticsReactContextInterface {
getAtlaskitAnalyticsContext(): any[];
getAtlaskitAnalyticsEventHandlers(): any[];
getAtlaskitAnalyticsContext: null | (() => any[]);
getAtlaskitAnalyticsEventHandlers: null | (() => any[]);
}
export declare const AnalyticsReactContext: React.Context<AnalyticsReactContextInterface>;
import React from 'react';
export var AnalyticsReactContext = React.createContext({
getAtlaskitAnalyticsContext: function () { return []; },
getAtlaskitAnalyticsEventHandlers: function () { return []; },
getAtlaskitAnalyticsContext: null,
getAtlaskitAnalyticsEventHandlers: null,
});
//# sourceMappingURL=AnalyticsReactContext.js.map

@@ -1,13 +0,22 @@

import { useContext, useCallback } from 'react';
import { AnalyticsReactContext } from './AnalyticsReactContext';
import { useContext, useRef } from 'react';
import { useCallbackOne } from 'use-memo-one';
import { AnalyticsReactContext, } from './AnalyticsReactContext';
import UIAnalyticsEvent from './UIAnalyticsEvent';
var noop = function () { return []; };
export function useAnalyticsEvents() {
var _a = useContext(AnalyticsReactContext), getAtlaskitAnalyticsEventHandlers = _a.getAtlaskitAnalyticsEventHandlers, getAtlaskitAnalyticsContext = _a.getAtlaskitAnalyticsContext;
if ((getAtlaskitAnalyticsEventHandlers === null ||
getAtlaskitAnalyticsContext === null) &&
process.env.NODE_ENV !== 'production') {
/* eslint-disable-next-line no-console */
console.warn("No compatible AnalyticsListener is listening to this event fire. Use of this hook requires the firing component/hook to be wrapped in an AnalyticsListener from @atlaskit/analytics-next@^6.3.0 or above.");
}
var createAnalyticsEvent = useCallback(function (payload) {
var analyticsContext = useContext(AnalyticsReactContext);
var contextRef = useRef(analyticsContext);
contextRef.current.getAtlaskitAnalyticsEventHandlers =
analyticsContext.getAtlaskitAnalyticsEventHandlers;
contextRef.current.getAtlaskitAnalyticsContext =
analyticsContext.getAtlaskitAnalyticsContext;
var createAnalyticsEvent = useCallbackOne(function (payload) {
if (process.env.NODE_ENV !== 'production' &&
(contextRef.current.getAtlaskitAnalyticsEventHandlers === null ||
contextRef.current.getAtlaskitAnalyticsContext === null)) {
/* eslint-disable-next-line no-console */
console.error("\n@atlaskit/analytics-next\n---\nNo compatible <AnalyticsListener /> was found to fire this analytics event.\nUse of the useAnalyticsEvents() hook requires a parent <AnalyticsListener /> from @atlaskit/analytics-next@^6.3.0 or above.\nSee: https://atlaskit.atlassian.com/packages/core/analytics-next/docs/reference#AnalyticsListener\n");
}
var getAtlaskitAnalyticsContext = contextRef.current.getAtlaskitAnalyticsContext || noop;
var getAtlaskitAnalyticsEventHandlers = contextRef.current.getAtlaskitAnalyticsEventHandlers || noop;
return new UIAnalyticsEvent({

@@ -18,3 +27,3 @@ context: getAtlaskitAnalyticsContext(),

});
}, [getAtlaskitAnalyticsEventHandlers, getAtlaskitAnalyticsContext]);
}, []);
return {

@@ -21,0 +30,0 @@ createAnalyticsEvent: createAnalyticsEvent,

{
"name": "@atlaskit/analytics-next",
"version": "6.3.1",
"version": "6.3.2",
"sideEffects": false
}
{
"name": "@atlaskit/analytics-next",
"version": "6.3.1",
"version": "6.3.2",
"description": "The 🆕 Atlaskit component analytics framework",

@@ -26,3 +26,4 @@ "license": "Apache-2.0",

"prop-types": "^15.5.10",
"tslib": "^1.9.3"
"tslib": "^1.9.3",
"use-memo-one": "^1.1.1"
},

@@ -39,6 +40,7 @@ "peerDependencies": {

"@atlaskit/type-helpers": "^4.2.2",
"enzyme": "^3.7.0",
"@testing-library/react": "^8.0.1",
"enzyme": "^3.10.0",
"react-dom": "^16.8.0",
"redux": "^3.7.2"
}
}
}

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

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

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

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