@atlaskit/editor-plugin-analytics 0.1.0 → 0.1.1

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,11 @@
1
1
  # @atlaskit/editor-plugin-analytics
2
2
 
3
+ ## 0.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`4e6f1bf8511`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4e6f1bf8511) - [ED-19233] Import prosemirror libraries from internal facade package
8
+
3
9
  ## 0.1.0
4
10
 
5
11
  ### Minor Changes
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.findInsertLocation = findInsertLocation;
7
7
  exports.getSelectionType = getSelectionType;
8
8
  exports.getStateContext = getStateContext;
9
- var _prosemirrorState = require("prosemirror-state");
10
- var _prosemirrorUtils = require("prosemirror-utils");
11
9
  var _analytics = require("@atlaskit/editor-common/analytics");
10
+ var _state = require("@atlaskit/editor-prosemirror/state");
11
+ var _utils = require("@atlaskit/editor-prosemirror/utils");
12
12
  var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
13
13
  function getSelectionType(selection) {
14
14
  var _selection$constructo;
@@ -19,7 +19,7 @@ function getSelectionType(selection) {
19
19
  position = selection.side;
20
20
  } else if (selection instanceof _cellSelection.CellSelection) {
21
21
  type = _analytics.SELECTION_TYPE.CELL;
22
- } else if (selection instanceof _prosemirrorState.NodeSelection) {
22
+ } else if (selection instanceof _state.NodeSelection) {
23
23
  type = _analytics.SELECTION_TYPE.NODE;
24
24
  } else if (selection.from !== selection.to) {
25
25
  type = _analytics.SELECTION_TYPE.RANGED;
@@ -44,7 +44,7 @@ function findInsertLocation(selection) {
44
44
  var _selection$$from$doc$ = selection.$from.doc.type,
45
45
  schema = _selection$$from$doc$.schema,
46
46
  name = _selection$$from$doc$.name;
47
- if (selection instanceof _prosemirrorState.NodeSelection) {
47
+ if (selection instanceof _state.NodeSelection) {
48
48
  return selection.node.type.name;
49
49
  }
50
50
  if (selection instanceof _cellSelection.CellSelection) {
@@ -52,7 +52,7 @@ function findInsertLocation(selection) {
52
52
  }
53
53
 
54
54
  // Text selection
55
- var parentNodeInfo = (0, _prosemirrorUtils.findParentNode)(function (node) {
55
+ var parentNodeInfo = (0, _utils.findParentNode)(function (node) {
56
56
  return node.type !== schema.nodes.paragraph;
57
57
  })(selection);
58
58
  return parentNodeInfo ? parentNodeInfo.node.type.name : name;
@@ -4,6 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.analyticsPluginKey = void 0;
7
- var _prosemirrorState = require("prosemirror-state");
8
- var analyticsPluginKey = new _prosemirrorState.PluginKey('analyticsPlugin');
7
+ var _state = require("@atlaskit/editor-prosemirror/state");
8
+ var analyticsPluginKey = new _state.PluginKey('analyticsPlugin');
9
9
  exports.analyticsPluginKey = analyticsPluginKey;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-analytics",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "sideEffects": false
5
5
  }
@@ -1,6 +1,6 @@
1
- import { NodeSelection } from 'prosemirror-state';
2
- import { findParentNode } from 'prosemirror-utils';
3
1
  import { ACTION, ACTION_SUBJECT, SELECTION_POSITION, SELECTION_TYPE } from '@atlaskit/editor-common/analytics';
2
+ import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
3
+ import { findParentNode } from '@atlaskit/editor-prosemirror/utils';
4
4
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
5
5
  export function getSelectionType(selection) {
6
6
  var _selection$constructo;
@@ -1,2 +1,2 @@
1
- import { PluginKey } from 'prosemirror-state';
1
+ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
2
  export const analyticsPluginKey = new PluginKey('analyticsPlugin');
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-analytics",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "sideEffects": false
5
5
  }
@@ -1,6 +1,6 @@
1
- import { NodeSelection } from 'prosemirror-state';
2
- import { findParentNode } from 'prosemirror-utils';
3
1
  import { ACTION, ACTION_SUBJECT, SELECTION_POSITION, SELECTION_TYPE } from '@atlaskit/editor-common/analytics';
2
+ import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
3
+ import { findParentNode } from '@atlaskit/editor-prosemirror/utils';
4
4
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
5
5
  export function getSelectionType(selection) {
6
6
  var _selection$constructo;
@@ -1,2 +1,2 @@
1
- import { PluginKey } from 'prosemirror-state';
1
+ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
2
  export var analyticsPluginKey = new PluginKey('analyticsPlugin');
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-analytics",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
- import type { Selection, Transaction } from 'prosemirror-state';
2
1
  import { AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
2
+ import type { Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
3
3
  type AttachPayloadIntoTransaction = (props: {
4
4
  payload: AnalyticsEventPayload;
5
5
  selection: Selection;
@@ -1,5 +1,5 @@
1
- import { Selection } from 'prosemirror-state';
2
1
  import { AnalyticsEventPayload, SELECTION_POSITION, SELECTION_TYPE } from '@atlaskit/editor-common/analytics';
2
+ import { Selection } from '@atlaskit/editor-prosemirror/state';
3
3
  export declare function getSelectionType(selection: Selection): {
4
4
  type: SELECTION_TYPE;
5
5
  position?: SELECTION_POSITION;
@@ -1,2 +1,2 @@
1
- import { PluginKey } from 'prosemirror-state';
1
+ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
2
  export declare const analyticsPluginKey: PluginKey<any>;
@@ -1,3 +1,3 @@
1
- import { Transaction } from 'prosemirror-state';
2
1
  import { AnalyticsPayload } from '@atlaskit/adf-schema/steps';
2
+ import { Transaction } from '@atlaskit/editor-prosemirror/state';
3
3
  export declare const generateUndoRedoInputSoucePayload: (tr: Readonly<Transaction>) => <T extends AnalyticsPayload>(payload: T) => T;
@@ -1,5 +1,5 @@
1
- import type { Selection, Transaction } from 'prosemirror-state';
2
1
  import { AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
2
+ import type { Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
3
3
  type AttachPayloadIntoTransaction = (props: {
4
4
  payload: AnalyticsEventPayload;
5
5
  selection: Selection;
@@ -1,5 +1,5 @@
1
- import { Selection } from 'prosemirror-state';
2
1
  import { AnalyticsEventPayload, SELECTION_POSITION, SELECTION_TYPE } from '@atlaskit/editor-common/analytics';
2
+ import { Selection } from '@atlaskit/editor-prosemirror/state';
3
3
  export declare function getSelectionType(selection: Selection): {
4
4
  type: SELECTION_TYPE;
5
5
  position?: SELECTION_POSITION;
@@ -1,2 +1,2 @@
1
- import { PluginKey } from 'prosemirror-state';
1
+ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
2
  export declare const analyticsPluginKey: PluginKey<any>;
@@ -1,3 +1,3 @@
1
- import { Transaction } from 'prosemirror-state';
2
1
  import { AnalyticsPayload } from '@atlaskit/adf-schema/steps';
2
+ import { 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": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Analytics plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -31,15 +31,14 @@
31
31
  ".": "./src/index.ts"
32
32
  },
33
33
  "dependencies": {
34
- "@atlaskit/adf-schema": "^26.2.0",
34
+ "@atlaskit/adf-schema": "^26.4.0",
35
35
  "@atlaskit/analytics-listeners": "^8.6.0",
36
36
  "@atlaskit/analytics-next": "^9.0.0",
37
- "@atlaskit/editor-common": "^74.19.0",
37
+ "@atlaskit/editor-common": "^74.29.0",
38
38
  "@atlaskit/editor-plugin-feature-flags": "^0.1.0",
39
+ "@atlaskit/editor-prosemirror": "1.0.2",
39
40
  "@atlaskit/editor-tables": "^2.2.0",
40
- "@babel/runtime": "^7.0.0",
41
- "prosemirror-state": "1.3.4",
42
- "prosemirror-utils": "^1.0.0-0"
41
+ "@babel/runtime": "^7.0.0"
43
42
  },
44
43
  "peerDependencies": {
45
44
  "react": "^16.8.0"
package/report.api.md CHANGED
@@ -21,7 +21,7 @@ import { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
21
21
  import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
22
22
  import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
23
23
  import type { PerformanceTracking } from '@atlaskit/editor-common/types';
24
- import type { Transaction } from 'prosemirror-state';
24
+ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
25
25
 
26
26
  // @public (undocumented)
27
27
  export const analyticsPlugin: NextEditorPlugin<
@@ -0,0 +1,43 @@
1
+ ## API Report File for "@atlaskit/editor-plugin-analytics"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import { AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
8
+ import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
9
+ import { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
10
+ import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
11
+ import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
12
+ import type { PerformanceTracking } from '@atlaskit/editor-common/types';
13
+ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
14
+
15
+ // @public (undocumented)
16
+ export const analyticsPlugin: NextEditorPlugin<'analytics', {
17
+ pluginConfiguration: AnalyticsPluginOptions;
18
+ sharedState: {
19
+ createAnalyticsEvent: CreateUIAnalyticsEvent | null;
20
+ attachAnalyticsEvent: CreateAttachPayloadIntoTransaction | null;
21
+ };
22
+ dependencies: [typeof featureFlagsPlugin];
23
+ actions: EditorAnalyticsAPI;
24
+ }>;
25
+
26
+ // @public (undocumented)
27
+ export interface AnalyticsPluginOptions {
28
+ // (undocumented)
29
+ createAnalyticsEvent?: CreateUIAnalyticsEvent;
30
+ // (undocumented)
31
+ performanceTracking?: PerformanceTracking;
32
+ }
33
+
34
+ // @public (undocumented)
35
+ export type CreateAttachPayloadIntoTransaction = (props: {
36
+ payload: AnalyticsEventPayload;
37
+ tr: Transaction;
38
+ channel: string;
39
+ }) => void;
40
+
41
+ // (No @packageDocumentation comment for this package)
42
+
43
+ ```