@atlaskit/editor-plugin-analytics 0.2.5 → 0.3.0
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 +24 -12
- package/README.md +1 -1
- package/dist/cjs/analytics-api/attach-payload-into-transaction.js +3 -5
- package/dist/cjs/analytics-api/editor-state-context.js +1 -1
- package/dist/cjs/consts.js +2 -4
- package/dist/cjs/plugin-key.js +1 -2
- package/dist/cjs/plugin.js +9 -7
- package/dist/cjs/undo-redo-input-source.js +2 -3
- package/dist/es2019/plugin.js +6 -3
- package/dist/esm/analytics-api/editor-state-context.js +1 -1
- package/dist/esm/plugin.js +8 -5
- package/dist/types/plugin.d.ts +1 -0
- package/dist/types-ts4.5/plugin.d.ts +1 -0
- package/package.json +3 -3
- package/report.api.md +1 -0
- package/tmp/api-report-tmp.d.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-analytics
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#42373](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42373) [`f607a815ffc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f607a815ffc) - Decoupled deprecated analytics plugin imports from remaining plugins except for collab-edit, macro, find-replace, extension.
|
|
8
|
+
|
|
9
|
+
## 0.2.6
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#39749](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39749) [`e6b69f455c3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e6b69f455c3) - Connect yarn changeset to packages, upgrade adf-schema
|
|
14
|
+
|
|
3
15
|
## 0.2.5
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -10,7 +22,7 @@
|
|
|
10
22
|
|
|
11
23
|
### Patch Changes
|
|
12
24
|
|
|
13
|
-
- [`37c62369dae`](https://bitbucket.org/atlassian/atlassian-frontend/commits/37c62369dae) - NO-ISSUE Import doc builder types from editor-common
|
|
25
|
+
- [#39984](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39984) [`37c62369dae`](https://bitbucket.org/atlassian/atlassian-frontend/commits/37c62369dae) - NO-ISSUE Import doc builder types from editor-common
|
|
14
26
|
|
|
15
27
|
## 0.2.3
|
|
16
28
|
|
|
@@ -22,14 +34,14 @@
|
|
|
22
34
|
|
|
23
35
|
### Patch Changes
|
|
24
36
|
|
|
25
|
-
- [`aeb5c9a01e8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/aeb5c9a01e8) - Delete adf-schema from AFE and rely on npm package for adf-schema
|
|
37
|
+
- [#39481](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39481) [`aeb5c9a01e8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/aeb5c9a01e8) - Delete adf-schema from AFE and rely on npm package for adf-schema
|
|
26
38
|
- [`4b4dcfe0bba`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4b4dcfe0bba) - Delete adf-schema, use published version
|
|
27
39
|
|
|
28
40
|
## 0.2.1
|
|
29
41
|
|
|
30
42
|
### Patch Changes
|
|
31
43
|
|
|
32
|
-
- [`6acf9830b36`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6acf9830b36) - Update feature flags plugin
|
|
44
|
+
- [#39304](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39304) [`6acf9830b36`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6acf9830b36) - Update feature flags plugin
|
|
33
45
|
(@atlaskit/editor-plugin-feature-flags) to use a named export
|
|
34
46
|
rather than default export to match other plugins.
|
|
35
47
|
|
|
@@ -47,7 +59,7 @@
|
|
|
47
59
|
|
|
48
60
|
### Minor Changes
|
|
49
61
|
|
|
50
|
-
- [`ad3c5c21079`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ad3c5c21079) - Updating all plugins with minor version to correct issue with semver.
|
|
62
|
+
- [#39325](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39325) [`ad3c5c21079`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ad3c5c21079) - Updating all plugins with minor version to correct issue with semver.
|
|
51
63
|
|
|
52
64
|
### Patch Changes
|
|
53
65
|
|
|
@@ -57,7 +69,7 @@
|
|
|
57
69
|
|
|
58
70
|
### Patch Changes
|
|
59
71
|
|
|
60
|
-
- [`8467bdcdf4f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8467bdcdf4f) - Removing `dependencies` prop from PluginInjectionAPI and changing
|
|
72
|
+
- [#39010](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39010) [`8467bdcdf4f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8467bdcdf4f) - Removing `dependencies` prop from PluginInjectionAPI and changing
|
|
61
73
|
signature of `NextEditorPlugin`.
|
|
62
74
|
|
|
63
75
|
Previously a `NextEditorPlugin` would be consumed as so:
|
|
@@ -87,13 +99,13 @@
|
|
|
87
99
|
|
|
88
100
|
### Patch Changes
|
|
89
101
|
|
|
90
|
-
- [`24e27147cbd`](https://bitbucket.org/atlassian/atlassian-frontend/commits/24e27147cbd) - Added atlaskit docs to all existing plugins.
|
|
102
|
+
- [#39177](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39177) [`24e27147cbd`](https://bitbucket.org/atlassian/atlassian-frontend/commits/24e27147cbd) - Added atlaskit docs to all existing plugins.
|
|
91
103
|
|
|
92
104
|
## 0.1.5
|
|
93
105
|
|
|
94
106
|
### Patch Changes
|
|
95
107
|
|
|
96
|
-
- [`33cb07de05f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/33cb07de05f) - change adf-schema to fixed versioning
|
|
108
|
+
- [#38976](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/38976) [`33cb07de05f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/33cb07de05f) - change adf-schema to fixed versioning
|
|
97
109
|
|
|
98
110
|
## 0.1.4
|
|
99
111
|
|
|
@@ -117,19 +129,19 @@
|
|
|
117
129
|
|
|
118
130
|
### Patch Changes
|
|
119
131
|
|
|
120
|
-
- [`4e6f1bf8511`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4e6f1bf8511) - [ED-19233] Import prosemirror libraries from internal facade package
|
|
132
|
+
- [#37785](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/37785) [`4e6f1bf8511`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4e6f1bf8511) - [ED-19233] Import prosemirror libraries from internal facade package
|
|
121
133
|
|
|
122
134
|
## 0.1.0
|
|
123
135
|
|
|
124
136
|
### Minor Changes
|
|
125
137
|
|
|
126
|
-
- [`91c4edcea5a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/91c4edcea5a) - The analytics plugin (`editor-plugin-analytics`) now creates the `createAnalyticsEvent` if none is supplied and shares it with other plugins internally.
|
|
138
|
+
- [#36748](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/36748) [`91c4edcea5a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/91c4edcea5a) - The analytics plugin (`editor-plugin-analytics`) now creates the `createAnalyticsEvent` if none is supplied and shares it with other plugins internally.
|
|
127
139
|
|
|
128
140
|
## 0.0.5
|
|
129
141
|
|
|
130
142
|
### Patch Changes
|
|
131
143
|
|
|
132
|
-
- [`5f5ba16de66`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5f5ba16de66) - [ED-13910] Fix prosemirror types
|
|
144
|
+
- [#36241](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/36241) [`5f5ba16de66`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5f5ba16de66) - [ED-13910] Fix prosemirror types
|
|
133
145
|
|
|
134
146
|
## 0.0.4
|
|
135
147
|
|
|
@@ -141,12 +153,12 @@
|
|
|
141
153
|
|
|
142
154
|
### Patch Changes
|
|
143
155
|
|
|
144
|
-
- [`73b5128036b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/73b5128036b) - [ED-17082] Mark package as a singleton one
|
|
156
|
+
- [#35782](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/35782) [`73b5128036b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/73b5128036b) - [ED-17082] Mark package as a singleton one
|
|
145
157
|
- Updated dependencies
|
|
146
158
|
|
|
147
159
|
## 0.0.2
|
|
148
160
|
|
|
149
161
|
### Patch Changes
|
|
150
162
|
|
|
151
|
-
- [`f07a1e036a9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f07a1e036a9) - Refactoring editor-core to prepare for extracting card plugin.
|
|
163
|
+
- [#35005](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/35005) [`f07a1e036a9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f07a1e036a9) - Refactoring editor-core to prepare for extracting card plugin.
|
|
152
164
|
- Updated dependencies
|
package/README.md
CHANGED
|
@@ -27,4 +27,4 @@ Please see [Atlaskit - Editor plugin analytics](https://atlaskit.atlassian.com/p
|
|
|
27
27
|
For internal Atlassian, visit the slack channel [#help-editor](https://atlassian.slack.com/archives/CFG3PSQ9E) for support or visit [go/editor-help](https://go/editor-help) to submit a bug.
|
|
28
28
|
## License
|
|
29
29
|
---
|
|
30
|
-
Please see [Atlassian Frontend - License](https://
|
|
30
|
+
Please see [Atlassian Frontend - License](https://hello.atlassian.net/wiki/spaces/AF/pages/2589099144/Documentation#License) for more licensing information.
|
|
@@ -9,7 +9,7 @@ var _analytics = require("@atlaskit/editor-common/analytics");
|
|
|
9
9
|
var _editorStateContext = require("./editor-state-context");
|
|
10
10
|
var _mapAttributes = require("./map-attributes");
|
|
11
11
|
var actionsToIgnore = [_analytics.ACTION.INVOKED, _analytics.ACTION.OPENED];
|
|
12
|
-
var createAttachPayloadIntoTransaction = function createAttachPayloadIntoTransaction(selection) {
|
|
12
|
+
var createAttachPayloadIntoTransaction = exports.createAttachPayloadIntoTransaction = function createAttachPayloadIntoTransaction(selection) {
|
|
13
13
|
return function (_ref) {
|
|
14
14
|
var payload = _ref.payload,
|
|
15
15
|
tr = _ref.tr,
|
|
@@ -27,8 +27,7 @@ var createAttachPayloadIntoTransaction = function createAttachPayloadIntoTransac
|
|
|
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
|
-
exports.
|
|
31
|
-
var attachPayloadIntoTransaction = function attachPayloadIntoTransaction(_ref2) {
|
|
30
|
+
var attachPayloadIntoTransaction = exports.attachPayloadIntoTransaction = function attachPayloadIntoTransaction(_ref2) {
|
|
32
31
|
var payload = _ref2.payload,
|
|
33
32
|
selection = _ref2.selection,
|
|
34
33
|
tr = _ref2.tr,
|
|
@@ -47,5 +46,4 @@ var attachPayloadIntoTransaction = function attachPayloadIntoTransaction(_ref2)
|
|
|
47
46
|
if (storedMarks) {
|
|
48
47
|
tr.setStoredMarks(storedMarks);
|
|
49
48
|
}
|
|
50
|
-
};
|
|
51
|
-
exports.attachPayloadIntoTransaction = attachPayloadIntoTransaction;
|
|
49
|
+
};
|
|
@@ -14,7 +14,7 @@ function getSelectionType(selection) {
|
|
|
14
14
|
var _selection$constructo;
|
|
15
15
|
var type;
|
|
16
16
|
var position;
|
|
17
|
-
if ((selection === null || selection === void 0
|
|
17
|
+
if ((selection === null || selection === void 0 || (_selection$constructo = selection.constructor) === null || _selection$constructo === void 0 ? void 0 : _selection$constructo.name) === 'GapCursorSelection') {
|
|
18
18
|
type = _analytics.SELECTION_TYPE.GAP_CURSOR;
|
|
19
19
|
position = selection.side;
|
|
20
20
|
} else if (selection instanceof _cellSelection.CellSelection) {
|
package/dist/cjs/consts.js
CHANGED
|
@@ -6,7 +6,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.editorAnalyticsChannel = exports.analyticsEventKey = void 0;
|
|
7
7
|
var _analyticsListeners = require("@atlaskit/analytics-listeners");
|
|
8
8
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
9
|
-
var analyticsEventKey = _utils.analyticsEventKey;
|
|
10
|
-
exports.
|
|
11
|
-
var editorAnalyticsChannel = _analyticsListeners.FabricChannel.editor;
|
|
12
|
-
exports.editorAnalyticsChannel = editorAnalyticsChannel;
|
|
9
|
+
var analyticsEventKey = exports.analyticsEventKey = _utils.analyticsEventKey;
|
|
10
|
+
var editorAnalyticsChannel = exports.editorAnalyticsChannel = _analyticsListeners.FabricChannel.editor;
|
package/dist/cjs/plugin-key.js
CHANGED
|
@@ -5,5 +5,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.analyticsPluginKey = void 0;
|
|
7
7
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
8
|
-
var analyticsPluginKey = new _state.PluginKey('analyticsPlugin');
|
|
9
|
-
exports.analyticsPluginKey = analyticsPluginKey;
|
|
8
|
+
var analyticsPluginKey = exports.analyticsPluginKey = new _state.PluginKey('analyticsPlugin');
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -99,12 +99,12 @@ function createPlugin(options, featureFlags) {
|
|
|
99
99
|
* Analytics plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
|
|
100
100
|
* from `@atlaskit/editor-core`.
|
|
101
101
|
*/
|
|
102
|
-
var analyticsPlugin = function analyticsPlugin(_ref3) {
|
|
102
|
+
var analyticsPlugin = exports.analyticsPlugin = function analyticsPlugin(_ref3) {
|
|
103
103
|
var _api$featureFlags;
|
|
104
104
|
var _ref3$config = _ref3.config,
|
|
105
105
|
options = _ref3$config === void 0 ? {} : _ref3$config,
|
|
106
106
|
api = _ref3.api;
|
|
107
|
-
var featureFlags = (api === null || api === void 0
|
|
107
|
+
var featureFlags = (api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
108
108
|
return {
|
|
109
109
|
name: 'analytics',
|
|
110
110
|
getSharedState: function getSharedState(editorState) {
|
|
@@ -112,14 +112,17 @@ var analyticsPlugin = function analyticsPlugin(_ref3) {
|
|
|
112
112
|
if (!editorState) {
|
|
113
113
|
return {
|
|
114
114
|
createAnalyticsEvent: null,
|
|
115
|
-
attachAnalyticsEvent: null
|
|
115
|
+
attachAnalyticsEvent: null,
|
|
116
|
+
performanceTracking: undefined
|
|
116
117
|
};
|
|
117
118
|
}
|
|
118
119
|
var _ref4 = (_analyticsPluginKey$g = _pluginKey.analyticsPluginKey.getState(editorState)) !== null && _analyticsPluginKey$g !== void 0 ? _analyticsPluginKey$g : {},
|
|
119
|
-
createAnalyticsEvent = _ref4.createAnalyticsEvent
|
|
120
|
+
createAnalyticsEvent = _ref4.createAnalyticsEvent,
|
|
121
|
+
performanceTracking = _ref4.performanceTracking;
|
|
120
122
|
return {
|
|
121
123
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
122
|
-
attachAnalyticsEvent: (0, _attachPayloadIntoTransaction.createAttachPayloadIntoTransaction)(editorState.selection)
|
|
124
|
+
attachAnalyticsEvent: (0, _attachPayloadIntoTransaction.createAttachPayloadIntoTransaction)(editorState.selection),
|
|
125
|
+
performanceTracking: performanceTracking
|
|
123
126
|
};
|
|
124
127
|
},
|
|
125
128
|
actions: {
|
|
@@ -127,7 +130,7 @@ var analyticsPlugin = function analyticsPlugin(_ref3) {
|
|
|
127
130
|
var channel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _analyticsListeners.FabricChannel.editor;
|
|
128
131
|
return function (tr) {
|
|
129
132
|
var _api$analytics$shared, _api$analytics;
|
|
130
|
-
var _ref5 = (_api$analytics$shared = api === null || api === void 0
|
|
133
|
+
var _ref5 = (_api$analytics$shared = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.sharedState.currentState()) !== null && _api$analytics$shared !== void 0 ? _api$analytics$shared : {},
|
|
131
134
|
createAnalyticsEvent = _ref5.createAnalyticsEvent,
|
|
132
135
|
attachAnalyticsEvent = _ref5.attachAnalyticsEvent;
|
|
133
136
|
if (!tr || !createAnalyticsEvent || !attachAnalyticsEvent) {
|
|
@@ -199,7 +202,6 @@ var analyticsPlugin = function analyticsPlugin(_ref3) {
|
|
|
199
202
|
}
|
|
200
203
|
};
|
|
201
204
|
};
|
|
202
|
-
exports.analyticsPlugin = analyticsPlugin;
|
|
203
205
|
function extendPayload(_ref9) {
|
|
204
206
|
var payload = _ref9.payload,
|
|
205
207
|
duration = _ref9.duration,
|
|
@@ -13,7 +13,7 @@ var getUndoRedoInputSource = function getUndoRedoInputSource(tr) {
|
|
|
13
13
|
// TODO: Please, do not copy or use this kind of code below
|
|
14
14
|
return (_tr$getMeta = tr.getMeta('undoRedoPlugin$')) !== null && _tr$getMeta !== void 0 ? _tr$getMeta : null;
|
|
15
15
|
};
|
|
16
|
-
var generateUndoRedoInputSoucePayload = function generateUndoRedoInputSoucePayload(tr) {
|
|
16
|
+
var generateUndoRedoInputSoucePayload = exports.generateUndoRedoInputSoucePayload = function generateUndoRedoInputSoucePayload(tr) {
|
|
17
17
|
var undoRedoPluginInputSource = getUndoRedoInputSource(tr);
|
|
18
18
|
return function (payload) {
|
|
19
19
|
var shouldAddHistoryTriggerMethodAttribute = undoRedoPluginInputSource && ['undid', 'redid'].includes(payload.action);
|
|
@@ -23,5 +23,4 @@ var generateUndoRedoInputSoucePayload = function generateUndoRedoInputSoucePaylo
|
|
|
23
23
|
})
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
|
-
};
|
|
27
|
-
exports.generateUndoRedoInputSoucePayload = generateUndoRedoInputSoucePayload;
|
|
26
|
+
};
|
package/dist/es2019/plugin.js
CHANGED
|
@@ -90,15 +90,18 @@ const analyticsPlugin = ({
|
|
|
90
90
|
if (!editorState) {
|
|
91
91
|
return {
|
|
92
92
|
createAnalyticsEvent: null,
|
|
93
|
-
attachAnalyticsEvent: null
|
|
93
|
+
attachAnalyticsEvent: null,
|
|
94
|
+
performanceTracking: undefined
|
|
94
95
|
};
|
|
95
96
|
}
|
|
96
97
|
const {
|
|
97
|
-
createAnalyticsEvent
|
|
98
|
+
createAnalyticsEvent,
|
|
99
|
+
performanceTracking
|
|
98
100
|
} = (_analyticsPluginKey$g = analyticsPluginKey.getState(editorState)) !== null && _analyticsPluginKey$g !== void 0 ? _analyticsPluginKey$g : {};
|
|
99
101
|
return {
|
|
100
102
|
createAnalyticsEvent,
|
|
101
|
-
attachAnalyticsEvent: createAttachPayloadIntoTransaction(editorState.selection)
|
|
103
|
+
attachAnalyticsEvent: createAttachPayloadIntoTransaction(editorState.selection),
|
|
104
|
+
performanceTracking
|
|
102
105
|
};
|
|
103
106
|
},
|
|
104
107
|
actions: {
|
|
@@ -6,7 +6,7 @@ export function getSelectionType(selection) {
|
|
|
6
6
|
var _selection$constructo;
|
|
7
7
|
var type;
|
|
8
8
|
var position;
|
|
9
|
-
if ((selection === null || selection === void 0
|
|
9
|
+
if ((selection === null || selection === void 0 || (_selection$constructo = selection.constructor) === null || _selection$constructo === void 0 ? void 0 : _selection$constructo.name) === 'GapCursorSelection') {
|
|
10
10
|
type = SELECTION_TYPE.GAP_CURSOR;
|
|
11
11
|
position = selection.side;
|
|
12
12
|
} else if (selection instanceof CellSelection) {
|
package/dist/esm/plugin.js
CHANGED
|
@@ -96,7 +96,7 @@ var analyticsPlugin = function analyticsPlugin(_ref3) {
|
|
|
96
96
|
var _ref3$config = _ref3.config,
|
|
97
97
|
options = _ref3$config === void 0 ? {} : _ref3$config,
|
|
98
98
|
api = _ref3.api;
|
|
99
|
-
var featureFlags = (api === null || api === void 0
|
|
99
|
+
var featureFlags = (api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
100
100
|
return {
|
|
101
101
|
name: 'analytics',
|
|
102
102
|
getSharedState: function getSharedState(editorState) {
|
|
@@ -104,14 +104,17 @@ var analyticsPlugin = function analyticsPlugin(_ref3) {
|
|
|
104
104
|
if (!editorState) {
|
|
105
105
|
return {
|
|
106
106
|
createAnalyticsEvent: null,
|
|
107
|
-
attachAnalyticsEvent: null
|
|
107
|
+
attachAnalyticsEvent: null,
|
|
108
|
+
performanceTracking: undefined
|
|
108
109
|
};
|
|
109
110
|
}
|
|
110
111
|
var _ref4 = (_analyticsPluginKey$g = analyticsPluginKey.getState(editorState)) !== null && _analyticsPluginKey$g !== void 0 ? _analyticsPluginKey$g : {},
|
|
111
|
-
createAnalyticsEvent = _ref4.createAnalyticsEvent
|
|
112
|
+
createAnalyticsEvent = _ref4.createAnalyticsEvent,
|
|
113
|
+
performanceTracking = _ref4.performanceTracking;
|
|
112
114
|
return {
|
|
113
115
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
114
|
-
attachAnalyticsEvent: createAttachPayloadIntoTransaction(editorState.selection)
|
|
116
|
+
attachAnalyticsEvent: createAttachPayloadIntoTransaction(editorState.selection),
|
|
117
|
+
performanceTracking: performanceTracking
|
|
115
118
|
};
|
|
116
119
|
},
|
|
117
120
|
actions: {
|
|
@@ -119,7 +122,7 @@ var analyticsPlugin = function analyticsPlugin(_ref3) {
|
|
|
119
122
|
var channel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : FabricChannel.editor;
|
|
120
123
|
return function (tr) {
|
|
121
124
|
var _api$analytics$shared, _api$analytics;
|
|
122
|
-
var _ref5 = (_api$analytics$shared = api === null || api === void 0
|
|
125
|
+
var _ref5 = (_api$analytics$shared = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.sharedState.currentState()) !== null && _api$analytics$shared !== void 0 ? _api$analytics$shared : {},
|
|
123
126
|
createAnalyticsEvent = _ref5.createAnalyticsEvent,
|
|
124
127
|
attachAnalyticsEvent = _ref5.attachAnalyticsEvent;
|
|
125
128
|
if (!tr || !createAnalyticsEvent || !attachAnalyticsEvent) {
|
package/dist/types/plugin.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export type AnalyticsPlugin = NextEditorPlugin<'analytics', {
|
|
|
12
12
|
sharedState: {
|
|
13
13
|
createAnalyticsEvent: CreateUIAnalyticsEvent | null;
|
|
14
14
|
attachAnalyticsEvent: CreateAttachPayloadIntoTransaction | null;
|
|
15
|
+
performanceTracking: PerformanceTracking | undefined;
|
|
15
16
|
};
|
|
16
17
|
dependencies: [FeatureFlagsPlugin];
|
|
17
18
|
actions: EditorAnalyticsAPI;
|
|
@@ -12,6 +12,7 @@ export type AnalyticsPlugin = NextEditorPlugin<'analytics', {
|
|
|
12
12
|
sharedState: {
|
|
13
13
|
createAnalyticsEvent: CreateUIAnalyticsEvent | null;
|
|
14
14
|
attachAnalyticsEvent: CreateAttachPayloadIntoTransaction | null;
|
|
15
|
+
performanceTracking: PerformanceTracking | undefined;
|
|
15
16
|
};
|
|
16
17
|
dependencies: [
|
|
17
18
|
FeatureFlagsPlugin
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-analytics",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Analytics plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
".": "./src/index.ts"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@atlaskit/adf-schema": "^
|
|
34
|
+
"@atlaskit/adf-schema": "^32.0.0",
|
|
35
35
|
"@atlaskit/analytics-listeners": "^8.6.0",
|
|
36
36
|
"@atlaskit/analytics-next": "^9.0.0",
|
|
37
|
-
"@atlaskit/editor-common": "^76.
|
|
37
|
+
"@atlaskit/editor-common": "^76.17.0",
|
|
38
38
|
"@atlaskit/editor-plugin-feature-flags": "^1.0.0",
|
|
39
39
|
"@atlaskit/editor-prosemirror": "1.1.0",
|
|
40
40
|
"@atlaskit/editor-tables": "^2.2.0",
|
package/report.api.md
CHANGED
|
@@ -31,6 +31,7 @@ export type AnalyticsPlugin = NextEditorPlugin<
|
|
|
31
31
|
sharedState: {
|
|
32
32
|
createAnalyticsEvent: CreateUIAnalyticsEvent | null;
|
|
33
33
|
attachAnalyticsEvent: CreateAttachPayloadIntoTransaction | null;
|
|
34
|
+
performanceTracking: PerformanceTracking | undefined;
|
|
34
35
|
};
|
|
35
36
|
dependencies: [FeatureFlagsPlugin];
|
|
36
37
|
actions: EditorAnalyticsAPI;
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export type AnalyticsPlugin = NextEditorPlugin<'analytics', {
|
|
|
18
18
|
sharedState: {
|
|
19
19
|
createAnalyticsEvent: CreateUIAnalyticsEvent | null;
|
|
20
20
|
attachAnalyticsEvent: CreateAttachPayloadIntoTransaction | null;
|
|
21
|
+
performanceTracking: PerformanceTracking | undefined;
|
|
21
22
|
};
|
|
22
23
|
dependencies: [FeatureFlagsPlugin];
|
|
23
24
|
actions: EditorAnalyticsAPI;
|