@atlaskit/editor-plugin-analytics 3.0.4 → 3.0.6

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,20 @@
1
1
  # @atlaskit/editor-plugin-analytics
2
2
 
3
+ ## 3.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [`a2cd8c46a3e94`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a2cd8c46a3e94) -
8
+ EDITOR-1442 Bump adf-schema
9
+ - Updated dependencies
10
+
11
+ ## 3.0.5
12
+
13
+ ### Patch Changes
14
+
15
+ - [`265c1bf0cefa4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/265c1bf0cefa4) -
16
+ Sorted type and interface props to improve Atlaskit docs
17
+
3
18
  ## 3.0.4
4
19
 
5
20
  ### Patch Changes
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.analyticsPlugin = void 0;
8
- exports.extendPayload = extendPayload;
9
8
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
10
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
10
  var _react = require("react");
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.createAttachPayloadIntoTransaction = exports.attachPayloadIntoTransaction = void 0;
6
+ exports.createAttachPayloadIntoTransaction = void 0;
7
7
  var _steps = require("@atlaskit/adf-schema/steps");
8
8
  var _analytics = require("@atlaskit/editor-common/analytics");
9
9
  var _editorStateContext = require("./editor-state-context");
@@ -27,7 +27,7 @@ var createAttachPayloadIntoTransaction = exports.createAttachPayloadIntoTransact
27
27
  // to create new util attachPayloadIntoTransaction in above file.
28
28
  // If you make a change here, please review attachPayloadIntoTransaction in above
29
29
  // file and update it as well if needed.
30
- var attachPayloadIntoTransaction = exports.attachPayloadIntoTransaction = function attachPayloadIntoTransaction(_ref2) {
30
+ var attachPayloadIntoTransaction = function attachPayloadIntoTransaction(_ref2) {
31
31
  var payload = _ref2.payload,
32
32
  selection = _ref2.selection,
33
33
  tr = _ref2.tr,
@@ -3,7 +3,6 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.findInsertedLocation = findInsertedLocation;
7
6
  exports.getSelectionType = getSelectionType;
8
7
  exports.getStateContext = getStateContext;
9
8
  var _analytics = require("@atlaskit/editor-common/analytics");
@@ -229,7 +229,7 @@ const analyticsPlugin = ({
229
229
  }
230
230
  };
231
231
  };
232
- export function extendPayload({
232
+ function extendPayload({
233
233
  payload,
234
234
  duration,
235
235
  distortedDuration
@@ -18,7 +18,7 @@ export const createAttachPayloadIntoTransaction = selection => ({
18
18
  // to create new util attachPayloadIntoTransaction in above file.
19
19
  // If you make a change here, please review attachPayloadIntoTransaction in above
20
20
  // file and update it as well if needed.
21
- export const attachPayloadIntoTransaction = ({
21
+ const attachPayloadIntoTransaction = ({
22
22
  payload,
23
23
  selection,
24
24
  tr,
@@ -37,7 +37,7 @@ export function getSelectionType(selection) {
37
37
  position
38
38
  };
39
39
  }
40
- export function findInsertedLocation(oldSelection, newSelection) {
40
+ function findInsertedLocation(oldSelection, newSelection) {
41
41
  const {
42
42
  schema
43
43
  } = newSelection.$from.doc.type;
@@ -242,7 +242,7 @@ var analyticsPlugin = function analyticsPlugin(_ref3) {
242
242
  }
243
243
  };
244
244
  };
245
- export function extendPayload(_ref1) {
245
+ function extendPayload(_ref1) {
246
246
  var payload = _ref1.payload,
247
247
  duration = _ref1.duration,
248
248
  distortedDuration = _ref1.distortedDuration;
@@ -21,7 +21,7 @@ export var createAttachPayloadIntoTransaction = function createAttachPayloadInto
21
21
  // to create new util attachPayloadIntoTransaction in above file.
22
22
  // If you make a change here, please review attachPayloadIntoTransaction in above
23
23
  // file and update it as well if needed.
24
- export var attachPayloadIntoTransaction = function attachPayloadIntoTransaction(_ref2) {
24
+ var attachPayloadIntoTransaction = function attachPayloadIntoTransaction(_ref2) {
25
25
  var payload = _ref2.payload,
26
26
  selection = _ref2.selection,
27
27
  tr = _ref2.tr,
@@ -35,7 +35,7 @@ export function getSelectionType(selection) {
35
35
  position: position
36
36
  };
37
37
  }
38
- export function findInsertedLocation(oldSelection, newSelection) {
38
+ function findInsertedLocation(oldSelection, newSelection) {
39
39
  var schema = newSelection.$from.doc.type.schema;
40
40
  var _schema$nodes = schema.nodes,
41
41
  paragraph = _schema$nodes.paragraph,
@@ -1,13 +1,7 @@
1
- import type { AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
2
1
  import type { AnalyticsPlugin } from './analyticsPluginType';
3
2
  /**
4
3
  * Analytics plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
5
4
  * from `@atlaskit/editor-core`.
6
5
  */
7
6
  declare const analyticsPlugin: AnalyticsPlugin;
8
- export declare function extendPayload({ payload, duration, distortedDuration, }: {
9
- payload: AnalyticsEventPayload;
10
- duration: number;
11
- distortedDuration: boolean;
12
- }): AnalyticsEventPayload;
13
7
  export { analyticsPlugin };
@@ -8,20 +8,20 @@ export interface AnalyticsPluginOptions {
8
8
  performanceTracking?: PerformanceTracking;
9
9
  }
10
10
  export type AnalyticsPlugin = NextEditorPlugin<'analytics', {
11
+ actions: EditorAnalyticsAPI;
12
+ dependencies: [OptionalPlugin<FeatureFlagsPlugin>];
11
13
  pluginConfiguration: AnalyticsPluginOptions;
12
14
  sharedState: {
13
15
  /**
14
16
  * **Warning:** Do not use this directly. Use the `analyticsPlugin.actions`
15
17
  * instead, as it will properly queue all events.
16
18
  */
17
- createAnalyticsEvent: CreateUIAnalyticsEvent | null;
19
+ attachAnalyticsEvent: CreateAttachPayloadIntoTransaction | null;
18
20
  /**
19
21
  * **Warning:** Do not use this directly. Use the `analyticsPlugin.actions`
20
22
  * instead, as it will properly queue all events.
21
23
  */
22
- attachAnalyticsEvent: CreateAttachPayloadIntoTransaction | null;
24
+ createAnalyticsEvent: CreateUIAnalyticsEvent | null;
23
25
  performanceTracking: PerformanceTracking | undefined;
24
26
  };
25
- dependencies: [OptionalPlugin<FeatureFlagsPlugin>];
26
- actions: EditorAnalyticsAPI;
27
27
  }>;
@@ -1,16 +1,8 @@
1
1
  import type { AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
2
2
  import type { Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
3
- type AttachPayloadIntoTransaction = (props: {
4
- payload: AnalyticsEventPayload;
5
- selection: Selection;
6
- tr: Transaction;
7
- channel: string;
8
- }) => void;
9
3
  export type CreateAttachPayloadIntoTransaction = (props: {
4
+ channel: string;
10
5
  payload: AnalyticsEventPayload;
11
6
  tr: Transaction;
12
- channel: string;
13
7
  }) => void;
14
8
  export declare const createAttachPayloadIntoTransaction: (selection: Selection) => CreateAttachPayloadIntoTransaction;
15
- export declare const attachPayloadIntoTransaction: AttachPayloadIntoTransaction;
16
- export {};
@@ -2,8 +2,7 @@ import type { AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
2
2
  import { SELECTION_POSITION, SELECTION_TYPE } from '@atlaskit/editor-common/analytics';
3
3
  import type { Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
4
4
  export declare function getSelectionType(selection: Selection): {
5
- type: SELECTION_TYPE;
6
5
  position?: SELECTION_POSITION;
6
+ type: SELECTION_TYPE;
7
7
  };
8
- export declare function findInsertedLocation(oldSelection: Selection, newSelection: Selection): string;
9
8
  export declare function getStateContext(selection: Selection, payload: AnalyticsEventPayload, tr?: Transaction): AnalyticsEventPayload;
@@ -1,13 +1,7 @@
1
- import type { AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
2
1
  import type { AnalyticsPlugin } from './analyticsPluginType';
3
2
  /**
4
3
  * Analytics plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
5
4
  * from `@atlaskit/editor-core`.
6
5
  */
7
6
  declare const analyticsPlugin: AnalyticsPlugin;
8
- export declare function extendPayload({ payload, duration, distortedDuration, }: {
9
- payload: AnalyticsEventPayload;
10
- duration: number;
11
- distortedDuration: boolean;
12
- }): AnalyticsEventPayload;
13
7
  export { analyticsPlugin };
@@ -8,22 +8,22 @@ export interface AnalyticsPluginOptions {
8
8
  performanceTracking?: PerformanceTracking;
9
9
  }
10
10
  export type AnalyticsPlugin = NextEditorPlugin<'analytics', {
11
+ actions: EditorAnalyticsAPI;
12
+ dependencies: [
13
+ OptionalPlugin<FeatureFlagsPlugin>
14
+ ];
11
15
  pluginConfiguration: AnalyticsPluginOptions;
12
16
  sharedState: {
13
17
  /**
14
18
  * **Warning:** Do not use this directly. Use the `analyticsPlugin.actions`
15
19
  * instead, as it will properly queue all events.
16
20
  */
17
- createAnalyticsEvent: CreateUIAnalyticsEvent | null;
21
+ attachAnalyticsEvent: CreateAttachPayloadIntoTransaction | null;
18
22
  /**
19
23
  * **Warning:** Do not use this directly. Use the `analyticsPlugin.actions`
20
24
  * instead, as it will properly queue all events.
21
25
  */
22
- attachAnalyticsEvent: CreateAttachPayloadIntoTransaction | null;
26
+ createAnalyticsEvent: CreateUIAnalyticsEvent | null;
23
27
  performanceTracking: PerformanceTracking | undefined;
24
28
  };
25
- dependencies: [
26
- OptionalPlugin<FeatureFlagsPlugin>
27
- ];
28
- actions: EditorAnalyticsAPI;
29
29
  }>;
@@ -1,16 +1,8 @@
1
1
  import type { AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
2
2
  import type { Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
3
- type AttachPayloadIntoTransaction = (props: {
4
- payload: AnalyticsEventPayload;
5
- selection: Selection;
6
- tr: Transaction;
7
- channel: string;
8
- }) => void;
9
3
  export type CreateAttachPayloadIntoTransaction = (props: {
4
+ channel: string;
10
5
  payload: AnalyticsEventPayload;
11
6
  tr: Transaction;
12
- channel: string;
13
7
  }) => void;
14
8
  export declare const createAttachPayloadIntoTransaction: (selection: Selection) => CreateAttachPayloadIntoTransaction;
15
- export declare const attachPayloadIntoTransaction: AttachPayloadIntoTransaction;
16
- export {};
@@ -2,8 +2,7 @@ import type { AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
2
2
  import { SELECTION_POSITION, SELECTION_TYPE } from '@atlaskit/editor-common/analytics';
3
3
  import type { Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
4
4
  export declare function getSelectionType(selection: Selection): {
5
- type: SELECTION_TYPE;
6
5
  position?: SELECTION_POSITION;
6
+ type: SELECTION_TYPE;
7
7
  };
8
- export declare function findInsertedLocation(oldSelection: Selection, newSelection: Selection): string;
9
8
  export declare function getStateContext(selection: Selection, payload: AnalyticsEventPayload, tr?: Transaction): AnalyticsEventPayload;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-analytics",
3
- "version": "3.0.4",
3
+ "version": "3.0.6",
4
4
  "description": "Analytics plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -26,11 +26,8 @@
26
26
  },
27
27
  "sideEffects": false,
28
28
  "atlaskit:src": "src/index.ts",
29
- "af:exports": {
30
- ".": "./src/index.ts"
31
- },
32
29
  "dependencies": {
33
- "@atlaskit/adf-schema": "^50.2.1",
30
+ "@atlaskit/adf-schema": "^50.2.3",
34
31
  "@atlaskit/analytics-listeners": "^9.0.0",
35
32
  "@atlaskit/analytics-next": "^11.1.0",
36
33
  "@atlaskit/editor-plugin-feature-flags": "^2.0.0",
@@ -39,7 +36,7 @@
39
36
  "@babel/runtime": "^7.0.0"
40
37
  },
41
38
  "peerDependencies": {
42
- "@atlaskit/editor-common": "^107.26.0",
39
+ "@atlaskit/editor-common": "^107.33.0",
43
40
  "react": "^18.2.0"
44
41
  },
45
42
  "techstack": {