@atlaskit/editor-plugin-metrics 3.4.0 → 3.4.2

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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/editor-plugin-metrics
2
2
 
3
+ ## 3.4.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 3.4.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#122391](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/122391)
14
+ [`09f8f912e177c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/09f8f912e177c) -
15
+ ED-26931 Update totalActiveTime to be in seconds and contentChanged to take in absolute value
16
+
3
17
  ## 3.4.0
4
18
 
5
19
  ### Minor Changes
@@ -47,7 +47,7 @@ var getAnalyticsPayload = exports.getAnalyticsPayload = function getAnalyticsPay
47
47
  actionSubjectId: _analytics.ACTION_SUBJECT_ID.ACTIVITY,
48
48
  attributes: {
49
49
  efficiency: {
50
- totalActiveTime: pluginState.activeSessionTime,
50
+ totalActiveTime: pluginState.activeSessionTime / 1000,
51
51
  totalActionCount: pluginState.totalActionCount,
52
52
  actionByTypeCount: _objectSpread(_objectSpread({}, (_pluginState$actionTy = pluginState.actionTypeCount) !== null && _pluginState$actionTy !== void 0 ? _pluginState$actionTy : {}), {}, {
53
53
  nodeDeletionCount: nodeDeletionCount,
@@ -38,7 +38,7 @@ var getNewPluginState = exports.getNewPluginState = function getNewPluginState(_
38
38
  contentSizeChanged = pluginState.contentSizeChanged;
39
39
  var newPluginState = _objectSpread(_objectSpread({}, pluginState), {}, {
40
40
  activeSessionTime: now - intentToStartEditTime,
41
- contentSizeChanged: contentSizeChanged + (newState.doc.content.size - oldState.doc.content.size),
41
+ contentSizeChanged: contentSizeChanged + Math.abs(newState.doc.content.size - oldState.doc.content.size),
42
42
  intentToStartEditTime: intentToStartEditTime,
43
43
  shouldPersistActiveSession: shouldPersistActiveSession
44
44
  });
@@ -31,7 +31,7 @@ export const getAnalyticsPayload = ({
31
31
  actionSubjectId: ACTION_SUBJECT_ID.ACTIVITY,
32
32
  attributes: {
33
33
  efficiency: {
34
- totalActiveTime: pluginState.activeSessionTime,
34
+ totalActiveTime: pluginState.activeSessionTime / 1000,
35
35
  totalActionCount: pluginState.totalActionCount,
36
36
  actionByTypeCount: {
37
37
  ...((_pluginState$actionTy = pluginState.actionTypeCount) !== null && _pluginState$actionTy !== void 0 ? _pluginState$actionTy : {}),
@@ -32,7 +32,7 @@ export const getNewPluginState = ({
32
32
  const newPluginState = {
33
33
  ...pluginState,
34
34
  activeSessionTime: now - intentToStartEditTime,
35
- contentSizeChanged: contentSizeChanged + (newState.doc.content.size - oldState.doc.content.size),
35
+ contentSizeChanged: contentSizeChanged + Math.abs(newState.doc.content.size - oldState.doc.content.size),
36
36
  intentToStartEditTime,
37
37
  shouldPersistActiveSession
38
38
  };
@@ -40,7 +40,7 @@ export var getAnalyticsPayload = function getAnalyticsPayload(_ref) {
40
40
  actionSubjectId: ACTION_SUBJECT_ID.ACTIVITY,
41
41
  attributes: {
42
42
  efficiency: {
43
- totalActiveTime: pluginState.activeSessionTime,
43
+ totalActiveTime: pluginState.activeSessionTime / 1000,
44
44
  totalActionCount: pluginState.totalActionCount,
45
45
  actionByTypeCount: _objectSpread(_objectSpread({}, (_pluginState$actionTy = pluginState.actionTypeCount) !== null && _pluginState$actionTy !== void 0 ? _pluginState$actionTy : {}), {}, {
46
46
  nodeDeletionCount: nodeDeletionCount,
@@ -31,7 +31,7 @@ export var getNewPluginState = function getNewPluginState(_ref) {
31
31
  contentSizeChanged = pluginState.contentSizeChanged;
32
32
  var newPluginState = _objectSpread(_objectSpread({}, pluginState), {}, {
33
33
  activeSessionTime: now - intentToStartEditTime,
34
- contentSizeChanged: contentSizeChanged + (newState.doc.content.size - oldState.doc.content.size),
34
+ contentSizeChanged: contentSizeChanged + Math.abs(newState.doc.content.size - oldState.doc.content.size),
35
35
  intentToStartEditTime: intentToStartEditTime,
36
36
  shouldPersistActiveSession: shouldPersistActiveSession
37
37
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-metrics",
3
- "version": "3.4.0",
3
+ "version": "3.4.2",
4
4
  "description": "Metrics plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@atlaskit/adf-schema": "^47.6.0",
36
- "@atlaskit/editor-common": "^101.1.0",
36
+ "@atlaskit/editor-common": "^102.0.0",
37
37
  "@atlaskit/editor-plugin-analytics": "^2.1.0",
38
38
  "@atlaskit/editor-prosemirror": "7.0.0",
39
39
  "@atlaskit/platform-feature-flags": "^1.1.0",