@atlaskit/editor-plugin-analytics 16.1.3 → 16.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/analyticsPlugin.js +10 -10
- package/dist/cjs/pm-plugins/analytics-api/attach-payload-into-transaction.js +4 -4
- package/dist/es2019/analyticsPlugin.js +1 -1
- package/dist/es2019/pm-plugins/analytics-api/attach-payload-into-transaction.js +1 -1
- package/dist/esm/analyticsPlugin.js +1 -1
- package/dist/esm/pm-plugins/analytics-api/attach-payload-into-transaction.js +1 -1
- package/dist/types/pm-plugins/undo-redo-input-source.d.ts +1 -1
- package/package.json +3 -36
package/CHANGELOG.md
CHANGED
|
@@ -8,9 +8,9 @@ exports.analyticsPlugin = void 0;
|
|
|
8
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _react = require("react");
|
|
11
|
-
var
|
|
11
|
+
var _analytics = require("@atlaskit/adf-schema/steps/analytics");
|
|
12
12
|
var _useAnalyticsEvents2 = require("@atlaskit/analytics-next/useAnalyticsEvents");
|
|
13
|
-
var
|
|
13
|
+
var _analytics2 = require("@atlaskit/editor-common/analytics");
|
|
14
14
|
var _isPerformanceApiAvailable = require("@atlaskit/editor-common/is-performance-api-available");
|
|
15
15
|
var _measureRender = require("@atlaskit/editor-common/performance/measure-render");
|
|
16
16
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
@@ -34,7 +34,7 @@ function createPlugin(options, featureFlags) {
|
|
|
34
34
|
state: {
|
|
35
35
|
init: function init() {
|
|
36
36
|
return _objectSpread(_objectSpread({}, options), {}, {
|
|
37
|
-
fireAnalytics: (0,
|
|
37
|
+
fireAnalytics: (0, _analytics2.fireAnalyticsEvent)(options.createAnalyticsEvent)
|
|
38
38
|
});
|
|
39
39
|
},
|
|
40
40
|
apply: function apply(tr, pluginState, _, state) {
|
|
@@ -50,7 +50,7 @@ function createPlugin(options, featureFlags) {
|
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
if (featureFlags.catchAllTracking) {
|
|
53
|
-
var analyticsEventWithChannel = (0,
|
|
53
|
+
var analyticsEventWithChannel = (0, _analytics2.getAnalyticsEventsFromTransaction)(tr);
|
|
54
54
|
if (analyticsEventWithChannel.length > 0) {
|
|
55
55
|
var _iterator = _createForOfIteratorHelper(analyticsEventWithChannel),
|
|
56
56
|
_step;
|
|
@@ -61,7 +61,7 @@ function createPlugin(options, featureFlags) {
|
|
|
61
61
|
channel = _step$value.channel;
|
|
62
62
|
// Measures how much time it takes to update the DOM after each ProseMirror document update
|
|
63
63
|
// that has an analytics event.
|
|
64
|
-
if (hasRequiredPerformanceAPIs && tr.docChanged && payload.action !==
|
|
64
|
+
if (hasRequiredPerformanceAPIs && tr.docChanged && payload.action !== _analytics2.ACTION.INSERTED && payload.action !== _analytics2.ACTION.DELETED) {
|
|
65
65
|
var measureName = "".concat(payload.actionSubject, ":").concat(payload.action, ":").concat(payload.actionSubjectId);
|
|
66
66
|
(0, _measureRender.measureRender)(
|
|
67
67
|
// NOTE this name could be resulting in misleading data -- where if multiple payloads are
|
|
@@ -70,7 +70,7 @@ function createPlugin(options, featureFlags) {
|
|
|
70
70
|
measureName, function (_ref2) {
|
|
71
71
|
var duration = _ref2.duration,
|
|
72
72
|
distortedDuration = _ref2.distortedDuration;
|
|
73
|
-
(0,
|
|
73
|
+
(0, _analytics2.fireAnalyticsEvent)(pluginState.createAnalyticsEvent)({
|
|
74
74
|
payload: extendPayload({
|
|
75
75
|
payload: payload,
|
|
76
76
|
duration: duration,
|
|
@@ -173,7 +173,7 @@ var analyticsPlugin = exports.analyticsPlugin = function analyticsPlugin(_ref3)
|
|
|
173
173
|
// createAnalyticsEvent actually fires our standard AnalyticsEventPayload type which is less strict
|
|
174
174
|
// so this is safe.
|
|
175
175
|
var firedPayload = payload;
|
|
176
|
-
(0,
|
|
176
|
+
(0, _analytics2.fireAnalyticsEvent)(createAnalyticsEvent, options)({
|
|
177
177
|
payload: firedPayload,
|
|
178
178
|
channel: channel
|
|
179
179
|
});
|
|
@@ -229,7 +229,7 @@ var analyticsPlugin = exports.analyticsPlugin = function analyticsPlugin(_ref3)
|
|
|
229
229
|
// Ignored via go/ees005
|
|
230
230
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
231
231
|
.filter(function (step) {
|
|
232
|
-
return step instanceof
|
|
232
|
+
return step instanceof _analytics.AnalyticsStep;
|
|
233
233
|
}).map(function (x) {
|
|
234
234
|
return x.analyticsEvents;
|
|
235
235
|
}).reduce(function (acc, val) {
|
|
@@ -247,7 +247,7 @@ var analyticsPlugin = exports.analyticsPlugin = function analyticsPlugin(_ref3)
|
|
|
247
247
|
var payload = _ref0.payload,
|
|
248
248
|
channel = _ref0.channel;
|
|
249
249
|
var nextPayload = undoAnaltyicsEventTransformer(payload);
|
|
250
|
-
(0,
|
|
250
|
+
(0, _analytics2.fireAnalyticsEvent)(createAnalyticsEvent)({
|
|
251
251
|
payload: nextPayload,
|
|
252
252
|
channel: channel
|
|
253
253
|
});
|
|
@@ -264,6 +264,6 @@ function extendPayload(_ref1) {
|
|
|
264
264
|
duration: duration,
|
|
265
265
|
distortedDuration: distortedDuration
|
|
266
266
|
}),
|
|
267
|
-
eventType:
|
|
267
|
+
eventType: _analytics2.EVENT_TYPE.OPERATIONAL
|
|
268
268
|
});
|
|
269
269
|
}
|
|
@@ -4,11 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.createAttachPayloadIntoTransaction = void 0;
|
|
7
|
-
var
|
|
8
|
-
var
|
|
7
|
+
var _analytics = require("@atlaskit/adf-schema/steps/analytics");
|
|
8
|
+
var _analytics2 = require("@atlaskit/editor-common/analytics");
|
|
9
9
|
var _editorStateContext = require("./editor-state-context");
|
|
10
10
|
var _mapAttributes = require("./map-attributes");
|
|
11
|
-
var actionsToIgnore = [
|
|
11
|
+
var actionsToIgnore = [_analytics2.ACTION.INVOKED, _analytics2.ACTION.OPENED];
|
|
12
12
|
var createAttachPayloadIntoTransaction = exports.createAttachPayloadIntoTransaction = function createAttachPayloadIntoTransaction(selection) {
|
|
13
13
|
return function (_ref) {
|
|
14
14
|
var payload = _ref.payload,
|
|
@@ -36,7 +36,7 @@ var attachPayloadIntoTransaction = function attachPayloadIntoTransaction(_ref2)
|
|
|
36
36
|
payload = (0, _mapAttributes.mapActionSubjectIdToAttributes)(payload);
|
|
37
37
|
var storedMarks = tr.storedMarks;
|
|
38
38
|
var pos = tr.mapping.map(selection.$from.pos, -1);
|
|
39
|
-
tr.step(new
|
|
39
|
+
tr.step(new _analytics.AnalyticsStep([{
|
|
40
40
|
payload: payload,
|
|
41
41
|
channel: channel
|
|
42
42
|
}], actionsToIgnore, pos // We need to create the step based on a position, this prevent split history for relative changes.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useLayoutEffect } from 'react';
|
|
2
|
-
import { AnalyticsStep } from '@atlaskit/adf-schema/steps';
|
|
2
|
+
import { AnalyticsStep } from '@atlaskit/adf-schema/steps/analytics';
|
|
3
3
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next/useAnalyticsEvents';
|
|
4
4
|
import { ACTION, EVENT_TYPE, fireAnalyticsEvent, getAnalyticsEventsFromTransaction } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { isPerformanceAPIAvailable } from '@atlaskit/editor-common/is-performance-api-available';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnalyticsStep } from '@atlaskit/adf-schema/steps';
|
|
1
|
+
import { AnalyticsStep } from '@atlaskit/adf-schema/steps/analytics';
|
|
2
2
|
import { ACTION } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { getStateContext } from './editor-state-context';
|
|
4
4
|
import { mapActionSubjectIdToAttributes } from './map-attributes';
|
|
@@ -6,7 +6,7 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
|
|
|
6
6
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7
7
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
8
|
import { useLayoutEffect } from 'react';
|
|
9
|
-
import { AnalyticsStep } from '@atlaskit/adf-schema/steps';
|
|
9
|
+
import { AnalyticsStep } from '@atlaskit/adf-schema/steps/analytics';
|
|
10
10
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next/useAnalyticsEvents';
|
|
11
11
|
import { ACTION, EVENT_TYPE, fireAnalyticsEvent as _fireAnalyticsEvent, getAnalyticsEventsFromTransaction } from '@atlaskit/editor-common/analytics';
|
|
12
12
|
import { isPerformanceAPIAvailable } from '@atlaskit/editor-common/is-performance-api-available';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnalyticsStep } from '@atlaskit/adf-schema/steps';
|
|
1
|
+
import { AnalyticsStep } from '@atlaskit/adf-schema/steps/analytics';
|
|
2
2
|
import { ACTION } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { getStateContext } from './editor-state-context';
|
|
4
4
|
import { mapActionSubjectIdToAttributes } from './map-attributes';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { AnalyticsPayload } from '@atlaskit/adf-schema/steps';
|
|
1
|
+
import type { AnalyticsPayload } from '@atlaskit/adf-schema/steps/analytics';
|
|
2
2
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
export declare const generateUndoRedoInputSoucePayload: (tr: Readonly<Transaction>) => <T extends AnalyticsPayload>(payload: T) => T;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-analytics",
|
|
3
|
-
"version": "16.1.
|
|
3
|
+
"version": "16.1.5",
|
|
4
4
|
"description": "Analytics plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -26,46 +26,13 @@
|
|
|
26
26
|
"@atlaskit/editor-prosemirror": "^8.0.0",
|
|
27
27
|
"@atlaskit/editor-tables": "^3.1.0",
|
|
28
28
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
29
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
29
|
+
"@atlaskit/tmp-editor-statsig": "^173.0.0",
|
|
30
30
|
"@babel/runtime": "^7.0.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@atlaskit/editor-common": "^120.
|
|
33
|
+
"@atlaskit/editor-common": "^120.11.0",
|
|
34
34
|
"react": "^18.2.0 || ^19.2.0"
|
|
35
35
|
},
|
|
36
|
-
"techstack": {
|
|
37
|
-
"@atlassian/frontend": {
|
|
38
|
-
"code-structure": [
|
|
39
|
-
"editor-plugin"
|
|
40
|
-
],
|
|
41
|
-
"import-structure": [
|
|
42
|
-
"atlassian-conventions"
|
|
43
|
-
],
|
|
44
|
-
"circular-dependencies": [
|
|
45
|
-
"file-and-folder-level"
|
|
46
|
-
]
|
|
47
|
-
},
|
|
48
|
-
"@repo/internal": {
|
|
49
|
-
"dom-events": "use-bind-event-listener",
|
|
50
|
-
"analytics": [
|
|
51
|
-
"analytics-next"
|
|
52
|
-
],
|
|
53
|
-
"design-tokens": [
|
|
54
|
-
"color"
|
|
55
|
-
],
|
|
56
|
-
"theming": [
|
|
57
|
-
"react-context"
|
|
58
|
-
],
|
|
59
|
-
"ui-components": [
|
|
60
|
-
"lite-mode"
|
|
61
|
-
],
|
|
62
|
-
"deprecation": "no-deprecated-imports",
|
|
63
|
-
"styling": [
|
|
64
|
-
"emotion",
|
|
65
|
-
"emotion"
|
|
66
|
-
]
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
36
|
"devDependencies": {
|
|
70
37
|
"react": "^19.2.0"
|
|
71
38
|
}
|