@atlaskit/editor-core 189.3.17 → 189.3.19
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 +13 -0
- package/dist/cjs/plugins/avatar-group/index.js +3 -1
- package/dist/cjs/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +2 -1
- package/dist/cjs/plugins/collab-edit/ui/avatars-with-plugin-state.js +5 -3
- package/dist/cjs/plugins/collab-edit/ui/avatars.js +1 -1
- package/dist/cjs/plugins/collab-edit/utils.js +2 -3
- package/dist/cjs/plugins/extension/actions.js +2 -3
- package/dist/cjs/plugins/index.js +0 -7
- package/dist/cjs/presets/default.js +0 -11
- package/dist/cjs/test-utils.js +1 -8
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +4 -3
- package/dist/cjs/ui/ToolbarFeedback/index.js +2 -2
- package/dist/cjs/ui/WithHelpTrigger/index.js +2 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/plugins/avatar-group/index.js +3 -1
- package/dist/es2019/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +2 -1
- package/dist/es2019/plugins/collab-edit/ui/avatars-with-plugin-state.js +5 -3
- package/dist/es2019/plugins/collab-edit/ui/avatars.js +1 -1
- package/dist/es2019/plugins/collab-edit/utils.js +2 -3
- package/dist/es2019/plugins/extension/actions.js +1 -2
- package/dist/es2019/plugins/index.js +0 -1
- package/dist/es2019/presets/default.js +0 -13
- package/dist/es2019/test-utils.js +0 -5
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +4 -3
- package/dist/es2019/ui/ToolbarFeedback/index.js +1 -1
- package/dist/es2019/ui/WithHelpTrigger/index.js +1 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/plugins/avatar-group/index.js +3 -1
- package/dist/esm/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +2 -1
- package/dist/esm/plugins/collab-edit/ui/avatars-with-plugin-state.js +5 -3
- package/dist/esm/plugins/collab-edit/ui/avatars.js +1 -1
- package/dist/esm/plugins/collab-edit/utils.js +2 -3
- package/dist/esm/plugins/extension/actions.js +1 -2
- package/dist/esm/plugins/index.js +0 -1
- package/dist/esm/presets/default.js +0 -11
- package/dist/esm/test-utils.js +0 -5
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +4 -3
- package/dist/esm/ui/ToolbarFeedback/index.js +1 -1
- package/dist/esm/ui/WithHelpTrigger/index.js +1 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/plugins/avatar-group/index.d.ts +3 -2
- package/dist/types/plugins/avatar-group/ui/AvatarGroupPluginWrapper.d.ts +2 -1
- package/dist/types/plugins/collab-edit/ui/avatars-with-plugin-state.d.ts +4 -0
- package/dist/types/plugins/collab-edit/ui/avatars.d.ts +2 -0
- package/dist/types/plugins/collab-edit/utils.d.ts +2 -1
- package/dist/types/plugins/index.d.ts +0 -1
- package/dist/types/test-utils.d.ts +1 -2
- package/dist/types/ui/Appearance/FullPage/FullPageContentArea.d.ts +1 -1
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types/utils/document.d.ts +1 -1
- package/dist/types-ts4.5/plugins/avatar-group/index.d.ts +4 -2
- package/dist/types-ts4.5/plugins/avatar-group/ui/AvatarGroupPluginWrapper.d.ts +2 -1
- package/dist/types-ts4.5/plugins/collab-edit/ui/avatars-with-plugin-state.d.ts +4 -0
- package/dist/types-ts4.5/plugins/collab-edit/ui/avatars.d.ts +2 -0
- package/dist/types-ts4.5/plugins/collab-edit/utils.d.ts +2 -1
- package/dist/types-ts4.5/plugins/index.d.ts +0 -1
- package/dist/types-ts4.5/test-utils.d.ts +1 -2
- package/dist/types-ts4.5/ui/Appearance/FullPage/FullPageContentArea.d.ts +1 -1
- package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
- package/dist/types-ts4.5/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types-ts4.5/utils/document.d.ts +1 -1
- package/package.json +5 -5
- package/dist/cjs/plugins/analytics/consts.js +0 -10
- package/dist/cjs/plugins/analytics/index.js +0 -16
- package/dist/cjs/plugins/analytics/plugin-key.js +0 -14
- package/dist/cjs/plugins/analytics/plugin.js +0 -131
- package/dist/cjs/plugins/analytics/types/dispatch-analytics-event.js +0 -5
- package/dist/cjs/plugins/analytics/types/enums.js +0 -54
- package/dist/cjs/plugins/analytics/types/events.js +0 -5
- package/dist/cjs/plugins/analytics/types/extension-events.js +0 -24
- package/dist/cjs/plugins/analytics/types/general-events.js +0 -30
- package/dist/cjs/plugins/analytics/types/index.js +0 -128
- package/dist/cjs/plugins/analytics/types/inline-comment-events.js +0 -12
- package/dist/cjs/plugins/analytics/types/link-tool-bar-events.js +0 -5
- package/dist/cjs/plugins/analytics/types/media-events.js +0 -5
- package/dist/cjs/plugins/analytics/types/node-events.js +0 -18
- package/dist/cjs/plugins/analytics/utils.js +0 -35
- package/dist/es2019/plugins/analytics/consts.js +0 -4
- package/dist/es2019/plugins/analytics/index.js +0 -3
- package/dist/es2019/plugins/analytics/plugin-key.js +0 -9
- package/dist/es2019/plugins/analytics/plugin.js +0 -111
- package/dist/es2019/plugins/analytics/types/dispatch-analytics-event.js +0 -1
- package/dist/es2019/plugins/analytics/types/enums.js +0 -1
- package/dist/es2019/plugins/analytics/types/events.js +0 -1
- package/dist/es2019/plugins/analytics/types/extension-events.js +0 -1
- package/dist/es2019/plugins/analytics/types/general-events.js +0 -1
- package/dist/es2019/plugins/analytics/types/index.js +0 -3
- package/dist/es2019/plugins/analytics/types/inline-comment-events.js +0 -1
- package/dist/es2019/plugins/analytics/types/link-tool-bar-events.js +0 -1
- package/dist/es2019/plugins/analytics/types/media-events.js +0 -1
- package/dist/es2019/plugins/analytics/types/node-events.js +0 -1
- package/dist/es2019/plugins/analytics/utils.js +0 -28
- package/dist/esm/plugins/analytics/consts.js +0 -4
- package/dist/esm/plugins/analytics/index.js +0 -3
- package/dist/esm/plugins/analytics/plugin-key.js +0 -9
- package/dist/esm/plugins/analytics/plugin.js +0 -123
- package/dist/esm/plugins/analytics/types/dispatch-analytics-event.js +0 -1
- package/dist/esm/plugins/analytics/types/enums.js +0 -1
- package/dist/esm/plugins/analytics/types/events.js +0 -1
- package/dist/esm/plugins/analytics/types/extension-events.js +0 -1
- package/dist/esm/plugins/analytics/types/general-events.js +0 -1
- package/dist/esm/plugins/analytics/types/index.js +0 -3
- package/dist/esm/plugins/analytics/types/inline-comment-events.js +0 -1
- package/dist/esm/plugins/analytics/types/link-tool-bar-events.js +0 -1
- package/dist/esm/plugins/analytics/types/media-events.js +0 -1
- package/dist/esm/plugins/analytics/types/node-events.js +0 -1
- package/dist/esm/plugins/analytics/utils.js +0 -29
- package/dist/types/plugins/analytics/consts.d.ts +0 -3
- package/dist/types/plugins/analytics/index.d.ts +0 -3
- package/dist/types/plugins/analytics/plugin-key.d.ts +0 -8
- package/dist/types/plugins/analytics/plugin.d.ts +0 -26
- package/dist/types/plugins/analytics/types/dispatch-analytics-event.d.ts +0 -1
- package/dist/types/plugins/analytics/types/enums.d.ts +0 -1
- package/dist/types/plugins/analytics/types/events.d.ts +0 -1
- package/dist/types/plugins/analytics/types/extension-events.d.ts +0 -2
- package/dist/types/plugins/analytics/types/general-events.d.ts +0 -2
- package/dist/types/plugins/analytics/types/index.d.ts +0 -9
- package/dist/types/plugins/analytics/types/inline-comment-events.d.ts +0 -2
- package/dist/types/plugins/analytics/types/link-tool-bar-events.d.ts +0 -1
- package/dist/types/plugins/analytics/types/media-events.d.ts +0 -1
- package/dist/types/plugins/analytics/types/node-events.d.ts +0 -2
- package/dist/types/plugins/analytics/utils.d.ts +0 -11
- package/dist/types-ts4.5/plugins/analytics/consts.d.ts +0 -3
- package/dist/types-ts4.5/plugins/analytics/index.d.ts +0 -3
- package/dist/types-ts4.5/plugins/analytics/plugin-key.d.ts +0 -8
- package/dist/types-ts4.5/plugins/analytics/plugin.d.ts +0 -29
- package/dist/types-ts4.5/plugins/analytics/types/dispatch-analytics-event.d.ts +0 -1
- package/dist/types-ts4.5/plugins/analytics/types/enums.d.ts +0 -1
- package/dist/types-ts4.5/plugins/analytics/types/events.d.ts +0 -1
- package/dist/types-ts4.5/plugins/analytics/types/extension-events.d.ts +0 -2
- package/dist/types-ts4.5/plugins/analytics/types/general-events.d.ts +0 -2
- package/dist/types-ts4.5/plugins/analytics/types/index.d.ts +0 -9
- package/dist/types-ts4.5/plugins/analytics/types/inline-comment-events.d.ts +0 -2
- package/dist/types-ts4.5/plugins/analytics/types/link-tool-bar-events.d.ts +0 -1
- package/dist/types-ts4.5/plugins/analytics/types/media-events.d.ts +0 -1
- package/dist/types-ts4.5/plugins/analytics/types/node-events.d.ts +0 -2
- package/dist/types-ts4.5/plugins/analytics/utils.d.ts +0 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 189.3.19
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#43099](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43099) [`743652a9a4a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/743652a9a4a) - Remove deprecated internal analytics plugin.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
10
|
+
## 189.3.18
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
3
16
|
## 189.3.17
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -15,6 +15,7 @@ var avatarGroup = function avatarGroup(_ref) {
|
|
|
15
15
|
return {
|
|
16
16
|
name: 'avatarGroup',
|
|
17
17
|
primaryToolbarComponent: function primaryToolbarComponent(_ref2) {
|
|
18
|
+
var _api$analytics;
|
|
18
19
|
var editorView = _ref2.editorView,
|
|
19
20
|
popupsMountPoint = _ref2.popupsMountPoint,
|
|
20
21
|
popupsBoundariesElement = _ref2.popupsBoundariesElement,
|
|
@@ -29,7 +30,8 @@ var avatarGroup = function avatarGroup(_ref) {
|
|
|
29
30
|
eventDispatcher: eventDispatcher,
|
|
30
31
|
collabEdit: props === null || props === void 0 ? void 0 : props.collabEdit,
|
|
31
32
|
takeFullWidth: props === null || props === void 0 ? void 0 : props.takeFullWidth,
|
|
32
|
-
featureFlags: featureFlags
|
|
33
|
+
featureFlags: featureFlags,
|
|
34
|
+
editorAnalyticsAPI: api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions
|
|
33
35
|
});
|
|
34
36
|
}
|
|
35
37
|
};
|
|
@@ -41,7 +41,8 @@ var AvatarGroupPluginWrapper = function AvatarGroupPluginWrapper(props) {
|
|
|
41
41
|
inviteToEditComponent: props.collabEdit && props.collabEdit.inviteToEditComponent,
|
|
42
42
|
inviteToEditHandler: props.collabEdit && props.collabEdit.inviteToEditHandler,
|
|
43
43
|
isInviteToEditButtonSelected: props.collabEdit && props.collabEdit.isInviteToEditButtonSelected,
|
|
44
|
-
featureFlags: featureFlags
|
|
44
|
+
featureFlags: featureFlags,
|
|
45
|
+
editorAnalyticsAPI: props.editorAnalyticsAPI
|
|
45
46
|
}));
|
|
46
47
|
};
|
|
47
48
|
var _default = exports.default = AvatarGroupPluginWrapper;
|
|
@@ -18,7 +18,8 @@ var AvatarsWithPluginState = function AvatarsWithPluginState(props) {
|
|
|
18
18
|
onClick = props.inviteToEditHandler,
|
|
19
19
|
Component = props.inviteToEditComponent,
|
|
20
20
|
editorView = props.editorView,
|
|
21
|
-
featureFlags = props.featureFlags
|
|
21
|
+
featureFlags = props.featureFlags,
|
|
22
|
+
editorAnalyticsAPI = props.editorAnalyticsAPI;
|
|
22
23
|
var render = _react.default.useCallback(function (_ref) {
|
|
23
24
|
var data = _ref.data;
|
|
24
25
|
if (!data) {
|
|
@@ -28,14 +29,15 @@ var AvatarsWithPluginState = function AvatarsWithPluginState(props) {
|
|
|
28
29
|
sessionId: data.sessionId,
|
|
29
30
|
participants: data.activeParticipants,
|
|
30
31
|
editorView: editorView,
|
|
31
|
-
featureFlags: featureFlags
|
|
32
|
+
featureFlags: featureFlags,
|
|
33
|
+
editorAnalyticsAPI: editorAnalyticsAPI
|
|
32
34
|
}, /*#__PURE__*/_react.default.createElement(_inviteToEdit.InviteToEditButton, {
|
|
33
35
|
title: title,
|
|
34
36
|
selected: selected,
|
|
35
37
|
onClick: onClick,
|
|
36
38
|
Component: Component
|
|
37
39
|
}));
|
|
38
|
-
}, [selected, onClick, Component, title, editorView, featureFlags]);
|
|
40
|
+
}, [selected, onClick, Component, title, editorView, featureFlags, editorAnalyticsAPI]);
|
|
39
41
|
return /*#__PURE__*/_react.default.createElement(_WithPluginState.default, {
|
|
40
42
|
plugins: {
|
|
41
43
|
data: _plugin.pluginKey
|
|
@@ -39,7 +39,7 @@ var Avatars = exports.Avatars = /*#__PURE__*/_react.default.memo(function (props
|
|
|
39
39
|
|
|
40
40
|
// user does not need to scroll to their own position (index 0)
|
|
41
41
|
if (allowCollabAvatarScroll && index > 0) {
|
|
42
|
-
(0, _utils.scrollToCollabCursor)(editorView, participants, props.sessionId, index);
|
|
42
|
+
(0, _utils.scrollToCollabCursor)(editorView, participants, props.sessionId, index, props.editorAnalyticsAPI);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
}), props.children);
|
|
@@ -12,7 +12,6 @@ var _view = require("@atlaskit/editor-prosemirror/view");
|
|
|
12
12
|
var themeColors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
|
|
13
13
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
14
14
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
15
|
-
var _utils2 = require("../analytics/utils");
|
|
16
15
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
17
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
18
17
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -127,7 +126,7 @@ var replaceDocument = exports.replaceDocument = function replaceDocument(doc, st
|
|
|
127
126
|
}
|
|
128
127
|
return tr;
|
|
129
128
|
};
|
|
130
|
-
var scrollToCollabCursor = exports.scrollToCollabCursor = function scrollToCollabCursor(editorView, participants, sessionId, index) {
|
|
129
|
+
var scrollToCollabCursor = exports.scrollToCollabCursor = function scrollToCollabCursor(editorView, participants, sessionId, index, editorAnalyticsAPI) {
|
|
131
130
|
var selectedUser = participants[index];
|
|
132
131
|
if (selectedUser && selectedUser.cursorPos !== undefined && selectedUser.sessionId !== sessionId) {
|
|
133
132
|
var state = editorView.state;
|
|
@@ -138,7 +137,7 @@ var scrollToCollabCursor = exports.scrollToCollabCursor = function scrollToColla
|
|
|
138
137
|
eventType: _analytics.EVENT_TYPE.TRACK
|
|
139
138
|
};
|
|
140
139
|
tr.setSelection(_state.Selection.near(tr.doc.resolve(selectedUser.cursorPos)));
|
|
141
|
-
|
|
140
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent(analyticsPayload)(tr);
|
|
142
141
|
tr.scrollIntoView();
|
|
143
142
|
editorView.dispatch(tr);
|
|
144
143
|
if (!editorView.hasFocus()) {
|
|
@@ -18,7 +18,6 @@ var _state2 = require("@atlaskit/editor-prosemirror/state");
|
|
|
18
18
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
19
19
|
var _transforms = require("@atlaskit/editor-common/transforms");
|
|
20
20
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
21
|
-
var _extensionEvents = require("../analytics/types/extension-events");
|
|
22
21
|
var _utils2 = require("./utils");
|
|
23
22
|
var _main = require("./pm-plugins/main");
|
|
24
23
|
var _extensionApi = require("./extension-api");
|
|
@@ -56,7 +55,7 @@ var performNodeUpdate = exports.performNodeUpdate = function performNodeUpdate(e
|
|
|
56
55
|
bodiedExtension = _schema$nodes.bodiedExtension;
|
|
57
56
|
var isBodiedExtensionSelected = !!(0, _utils.findSelectedNodeOfType)([bodiedExtension])(selection);
|
|
58
57
|
var extensionState = (0, _main.getPluginState)(state);
|
|
59
|
-
var targetSelectionSource =
|
|
58
|
+
var targetSelectionSource = _analytics.TARGET_SELECTION_SOURCE.CURRENT_SELECTION;
|
|
60
59
|
var action = _analytics.ACTION.UPDATED;
|
|
61
60
|
var tr = state.tr;
|
|
62
61
|
|
|
@@ -81,7 +80,7 @@ var performNodeUpdate = exports.performNodeUpdate = function performNodeUpdate(e
|
|
|
81
80
|
if (pos > -1) {
|
|
82
81
|
tr = tr.replaceWith(pos, pos + (content.size || 0) + 1, newNode);
|
|
83
82
|
tr.setSelection(_state2.Selection.near(tr.doc.resolve(pos)));
|
|
84
|
-
targetSelectionSource =
|
|
83
|
+
targetSelectionSource = _analytics.TARGET_SELECTION_SOURCE.HTML_ELEMENT;
|
|
85
84
|
} else {
|
|
86
85
|
action = _analytics.ACTION.ERRORED;
|
|
87
86
|
}
|
|
@@ -10,12 +10,6 @@ Object.defineProperty(exports, "alignmentPlugin", {
|
|
|
10
10
|
return _alignment.default;
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
|
-
Object.defineProperty(exports, "analyticsPlugin", {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function get() {
|
|
16
|
-
return _analytics.default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
13
|
Object.defineProperty(exports, "annotationPlugin", {
|
|
20
14
|
enumerable: true,
|
|
21
15
|
get: function get() {
|
|
@@ -161,7 +155,6 @@ var _alignment = _interopRequireDefault(require("./alignment"));
|
|
|
161
155
|
var _dataConsumer = _interopRequireDefault(require("./data-consumer"));
|
|
162
156
|
var _indentation = _interopRequireDefault(require("./indentation"));
|
|
163
157
|
var _annotation = _interopRequireDefault(require("./annotation"));
|
|
164
|
-
var _analytics = _interopRequireDefault(require("./analytics"));
|
|
165
158
|
var _customAutoformat = _interopRequireDefault(require("./custom-autoformat"));
|
|
166
159
|
var _feedbackDialog = _interopRequireDefault(require("./feedback-dialog"));
|
|
167
160
|
var _mobileDimensions = _interopRequireDefault(require("./mobile-dimensions"));
|
|
@@ -23,7 +23,6 @@ var _editorPluginFeatureFlags = require("@atlaskit/editor-plugin-feature-flags")
|
|
|
23
23
|
var _editorPluginCopyButton = require("@atlaskit/editor-plugin-copy-button");
|
|
24
24
|
var _editorPluginFloatingToolbar = require("@atlaskit/editor-plugin-floating-toolbar");
|
|
25
25
|
var _editorPluginClipboard = require("@atlaskit/editor-plugin-clipboard");
|
|
26
|
-
var _plugins = require("../plugins");
|
|
27
26
|
var _editorPluginAnalytics = require("@atlaskit/editor-plugin-analytics");
|
|
28
27
|
var _editorPluginPlaceholder = require("@atlaskit/editor-plugin-placeholder");
|
|
29
28
|
var _annotation = _interopRequireDefault(require("../plugins/annotation"));
|
|
@@ -55,16 +54,6 @@ function createDefaultPreset(options) {
|
|
|
55
54
|
}]);
|
|
56
55
|
}
|
|
57
56
|
return builder;
|
|
58
|
-
}).maybeAdd(_plugins.analyticsPlugin, function (plugin, builder) {
|
|
59
|
-
if (options.allowAnalyticsGASV3) {
|
|
60
|
-
var performanceTracking = options.performanceTracking,
|
|
61
|
-
createAnalyticsEvent = options.createAnalyticsEvent;
|
|
62
|
-
return builder.add([plugin, {
|
|
63
|
-
createAnalyticsEvent: createAnalyticsEvent,
|
|
64
|
-
performanceTracking: performanceTracking
|
|
65
|
-
}]);
|
|
66
|
-
}
|
|
67
|
-
return builder;
|
|
68
57
|
}).add(_editorPluginBetterTypeHistory.betterTypeHistoryPlugin).add([_paste.default, options.paste]).add(_editorPluginClipboard.clipboardPlugin).add(_editorPluginFocus.focusPlugin).add(_editorPluginComposition.compositionPlugin).add([_editorPluginBase.basePlugin, options.base]).add(_editorPluginDecorations.decorationsPlugin).maybeAdd(_undoRedo.default, function (p, builder) {
|
|
69
58
|
var _options$featureFlags;
|
|
70
59
|
// The undo redo plugin needs to be add before the blockTypePlugin
|
package/dist/cjs/test-utils.js
CHANGED
|
@@ -22,9 +22,7 @@ Object.defineProperty(exports, "GapCursorSide", {
|
|
|
22
22
|
return _selection.Side;
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
|
-
exports.createPMSchemaAndPlugins = void 0;
|
|
26
|
-
exports.getFireAnalytics = getFireAnalytics;
|
|
27
|
-
exports.isElementBySelectorInDocument = void 0;
|
|
25
|
+
exports.isElementBySelectorInDocument = exports.createPMSchemaAndPlugins = void 0;
|
|
28
26
|
exports.setTextSelection = setTextSelection;
|
|
29
27
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
30
28
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
@@ -32,16 +30,11 @@ var _state = require("@atlaskit/editor-prosemirror/state");
|
|
|
32
30
|
var _preset = require("@atlaskit/editor-common/preset");
|
|
33
31
|
var _createSchema = require("./create-editor/create-schema");
|
|
34
32
|
var _sortByOrder = require("./create-editor/sort-by-order");
|
|
35
|
-
var _pluginKey = require("./plugins/analytics/plugin-key");
|
|
36
33
|
var _editorPluginBase = require("@atlaskit/editor-plugin-base");
|
|
37
34
|
var _eventDispatcher = require("./event-dispatcher");
|
|
38
35
|
var _selection = require("@atlaskit/editor-common/selection");
|
|
39
36
|
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; }
|
|
40
37
|
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) { (0, _defineProperty2.default)(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; }
|
|
41
|
-
function getFireAnalytics(editorView) {
|
|
42
|
-
var _analyticsPluginKey$g;
|
|
43
|
-
return _pluginKey.analyticsPluginKey === null || _pluginKey.analyticsPluginKey === void 0 || (_analyticsPluginKey$g = _pluginKey.analyticsPluginKey.getState(editorView.state)) === null || _analyticsPluginKey$g === void 0 ? void 0 : _analyticsPluginKey$g.fireAnalytics;
|
|
44
|
-
}
|
|
45
38
|
function lightProcessPluginsList(editorPlugins) {
|
|
46
39
|
/**
|
|
47
40
|
* First pass to collect pluginsOptions
|
|
@@ -24,7 +24,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
24
24
|
/** @jsx jsx */
|
|
25
25
|
|
|
26
26
|
var EditorToolbar = exports.EditorToolbar = /*#__PURE__*/_react.default.memo(function (props) {
|
|
27
|
-
var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$collabEdit, _props$collabEdit2, _props$collabEdit3, _editorAPI$analytics;
|
|
27
|
+
var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$collabEdit, _props$collabEdit2, _props$collabEdit3, _editorAPI$analytics, _editorAPI$analytics2;
|
|
28
28
|
var _useState = (0, _react.useState)(false),
|
|
29
29
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
30
30
|
shouldSplitToolbar = _useState2[0],
|
|
@@ -68,7 +68,8 @@ var EditorToolbar = exports.EditorToolbar = /*#__PURE__*/_react.default.memo(fun
|
|
|
68
68
|
inviteToEditComponent: (_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.inviteToEditComponent,
|
|
69
69
|
inviteToEditHandler: (_props$collabEdit2 = props.collabEdit) === null || _props$collabEdit2 === void 0 ? void 0 : _props$collabEdit2.inviteToEditHandler,
|
|
70
70
|
isInviteToEditButtonSelected: (_props$collabEdit3 = props.collabEdit) === null || _props$collabEdit3 === void 0 ? void 0 : _props$collabEdit3.isInviteToEditButtonSelected,
|
|
71
|
-
featureFlags: props.featureFlags || {}
|
|
71
|
+
featureFlags: props.featureFlags || {},
|
|
72
|
+
editorAnalyticsAPI: editorAPI === null || editorAPI === void 0 || (_editorAPI$analytics = editorAPI.analytics) === null || _editorAPI$analytics === void 0 ? void 0 : _editorAPI$analytics.actions
|
|
72
73
|
}), editorAPI !== null && editorAPI !== void 0 && editorAPI.findReplace && twoLineEditorToolbar ? (0, _react2.jsx)(_FindReplaceToolbarButtonWithState.default, {
|
|
73
74
|
popupsBoundariesElement: props.popupsBoundariesElement,
|
|
74
75
|
popupsMountPoint: props.popupsMountPoint,
|
|
@@ -77,7 +78,7 @@ var EditorToolbar = exports.EditorToolbar = /*#__PURE__*/_react.default.memo(fun
|
|
|
77
78
|
containerElement: props.containerElement,
|
|
78
79
|
dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
|
|
79
80
|
featureFlags: props.featureFlags,
|
|
80
|
-
editorAnalyticsAPI: editorAPI === null || editorAPI === void 0 || (_editorAPI$
|
|
81
|
+
editorAnalyticsAPI: editorAPI === null || editorAPI === void 0 || (_editorAPI$analytics2 = editorAPI.analytics) === null || _editorAPI$analytics2 === void 0 ? void 0 : _editorAPI$analytics2.actions
|
|
81
82
|
}) : null, !!props.customPrimaryToolbarComponents && 'after' in props.customPrimaryToolbarComponents ? props.customPrimaryToolbarComponents.after : props.customPrimaryToolbarComponents);
|
|
82
83
|
(0, _react.useEffect)(function () {
|
|
83
84
|
if (twoLineEditorToolbar) {
|
|
@@ -31,7 +31,7 @@ var _eventDispatcher = require("../../event-dispatcher");
|
|
|
31
31
|
var _feedbackDialog = require("../../plugins/feedback-dialog");
|
|
32
32
|
var _deprecationWarnings = _interopRequireDefault(require("../../utils/deprecation-warnings"));
|
|
33
33
|
var _pickBy = _interopRequireDefault(require("../../utils/pick-by"));
|
|
34
|
-
var
|
|
34
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
35
35
|
var _context2 = require("../../presets/context");
|
|
36
36
|
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; }
|
|
37
37
|
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) { (0, _defineProperty2.default)(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; }
|
|
@@ -130,7 +130,7 @@ var ToolbarFeedbackInternal = /*#__PURE__*/function (_PureComponent) {
|
|
|
130
130
|
})));
|
|
131
131
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "openFeedbackPopup", function () {
|
|
132
132
|
var dispatch = (0, _eventDispatcher.createDispatch)(_this.context.editorActions.eventDispatcher);
|
|
133
|
-
dispatch(
|
|
133
|
+
dispatch(_utils.analyticsEventKey, {
|
|
134
134
|
payload: {
|
|
135
135
|
action: _analytics.ACTION.CLICKED,
|
|
136
136
|
actionSubject: _analytics.ACTION_SUBJECT.BUTTON,
|
|
@@ -16,7 +16,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
16
16
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
17
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
18
18
|
var _eventDispatcher = require("../../event-dispatcher");
|
|
19
|
-
var
|
|
19
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
20
20
|
var _editorPluginHelpDialog = require("@atlaskit/editor-plugin-help-dialog");
|
|
21
21
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
22
22
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
@@ -33,7 +33,7 @@ var WithHelpTrigger = exports.default = /*#__PURE__*/function (_React$Component)
|
|
|
33
33
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "openHelp", function () {
|
|
34
34
|
var editorActions = _this.context.editorActions;
|
|
35
35
|
var dispatch = (0, _eventDispatcher.createDispatch)(editorActions.eventDispatcher);
|
|
36
|
-
dispatch(
|
|
36
|
+
dispatch(_utils.analyticsEventKey, {
|
|
37
37
|
payload: {
|
|
38
38
|
action: _analytics.ACTION.CLICKED,
|
|
39
39
|
actionSubject: _analytics.ACTION_SUBJECT.BUTTON,
|
|
@@ -18,13 +18,15 @@ const avatarGroup = ({
|
|
|
18
18
|
eventDispatcher,
|
|
19
19
|
dispatchAnalyticsEvent
|
|
20
20
|
}) {
|
|
21
|
+
var _api$analytics;
|
|
21
22
|
return /*#__PURE__*/React.createElement(AvatarGroupPluginWrapper, {
|
|
22
23
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
23
24
|
editorView: editorView,
|
|
24
25
|
eventDispatcher: eventDispatcher,
|
|
25
26
|
collabEdit: props === null || props === void 0 ? void 0 : props.collabEdit,
|
|
26
27
|
takeFullWidth: props === null || props === void 0 ? void 0 : props.takeFullWidth,
|
|
27
|
-
featureFlags: featureFlags
|
|
28
|
+
featureFlags: featureFlags,
|
|
29
|
+
editorAnalyticsAPI: api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions
|
|
28
30
|
});
|
|
29
31
|
}
|
|
30
32
|
};
|
|
@@ -45,7 +45,8 @@ const AvatarGroupPluginWrapper = props => {
|
|
|
45
45
|
inviteToEditComponent: props.collabEdit && props.collabEdit.inviteToEditComponent,
|
|
46
46
|
inviteToEditHandler: props.collabEdit && props.collabEdit.inviteToEditHandler,
|
|
47
47
|
isInviteToEditButtonSelected: props.collabEdit && props.collabEdit.isInviteToEditButtonSelected,
|
|
48
|
-
featureFlags: featureFlags
|
|
48
|
+
featureFlags: featureFlags,
|
|
49
|
+
editorAnalyticsAPI: props.editorAnalyticsAPI
|
|
49
50
|
}));
|
|
50
51
|
};
|
|
51
52
|
export default AvatarGroupPluginWrapper;
|
|
@@ -12,7 +12,8 @@ const AvatarsWithPluginState = props => {
|
|
|
12
12
|
inviteToEditHandler: onClick,
|
|
13
13
|
inviteToEditComponent: Component,
|
|
14
14
|
editorView,
|
|
15
|
-
featureFlags
|
|
15
|
+
featureFlags,
|
|
16
|
+
editorAnalyticsAPI
|
|
16
17
|
} = props;
|
|
17
18
|
const render = React.useCallback(({
|
|
18
19
|
data
|
|
@@ -24,14 +25,15 @@ const AvatarsWithPluginState = props => {
|
|
|
24
25
|
sessionId: data.sessionId,
|
|
25
26
|
participants: data.activeParticipants,
|
|
26
27
|
editorView: editorView,
|
|
27
|
-
featureFlags: featureFlags
|
|
28
|
+
featureFlags: featureFlags,
|
|
29
|
+
editorAnalyticsAPI: editorAnalyticsAPI
|
|
28
30
|
}, /*#__PURE__*/React.createElement(InviteToEditButton, {
|
|
29
31
|
title: title,
|
|
30
32
|
selected: selected,
|
|
31
33
|
onClick: onClick,
|
|
32
34
|
Component: Component
|
|
33
35
|
}));
|
|
34
|
-
}, [selected, onClick, Component, title, editorView, featureFlags]);
|
|
36
|
+
}, [selected, onClick, Component, title, editorView, featureFlags, editorAnalyticsAPI]);
|
|
35
37
|
return /*#__PURE__*/React.createElement(WithPluginState, {
|
|
36
38
|
plugins: {
|
|
37
39
|
data: collabEditPluginKey
|
|
@@ -31,7 +31,7 @@ export const Avatars = /*#__PURE__*/React.memo(props => {
|
|
|
31
31
|
|
|
32
32
|
// user does not need to scroll to their own position (index 0)
|
|
33
33
|
if (allowCollabAvatarScroll && index > 0) {
|
|
34
|
-
scrollToCollabCursor(editorView, participants, props.sessionId, index);
|
|
34
|
+
scrollToCollabCursor(editorView, participants, props.sessionId, index, props.editorAnalyticsAPI);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
}), props.children);
|
|
@@ -3,7 +3,6 @@ import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
|
3
3
|
import * as themeColors from '@atlaskit/theme/colors';
|
|
4
4
|
import { hexToRgba } from '@atlaskit/adf-schema';
|
|
5
5
|
import { ZERO_WIDTH_JOINER } from '@atlaskit/editor-common/utils';
|
|
6
|
-
import { addAnalytics } from '../analytics/utils';
|
|
7
6
|
import { EVENT_TYPE, ACTION, ACTION_SUBJECT } from '@atlaskit/editor-common/analytics';
|
|
8
7
|
// TODO: https://product-fabric.atlassian.net/browse/DSP-7269
|
|
9
8
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
@@ -110,7 +109,7 @@ export const replaceDocument = (doc, state, version, options, reserveCursor) =>
|
|
|
110
109
|
}
|
|
111
110
|
return tr;
|
|
112
111
|
};
|
|
113
|
-
export const scrollToCollabCursor = (editorView, participants, sessionId, index) => {
|
|
112
|
+
export const scrollToCollabCursor = (editorView, participants, sessionId, index, editorAnalyticsAPI) => {
|
|
114
113
|
const selectedUser = participants[index];
|
|
115
114
|
if (selectedUser && selectedUser.cursorPos !== undefined && selectedUser.sessionId !== sessionId) {
|
|
116
115
|
const {
|
|
@@ -123,7 +122,7 @@ export const scrollToCollabCursor = (editorView, participants, sessionId, index)
|
|
|
123
122
|
eventType: EVENT_TYPE.TRACK
|
|
124
123
|
};
|
|
125
124
|
tr.setSelection(Selection.near(tr.doc.resolve(selectedUser.cursorPos)));
|
|
126
|
-
|
|
125
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent(analyticsPayload)(tr);
|
|
127
126
|
tr.scrollIntoView();
|
|
128
127
|
editorView.dispatch(tr);
|
|
129
128
|
if (!editorView.hasFocus()) {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Selection, NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
import { replaceSelectedNode, findSelectedNodeOfType, replaceParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
3
3
|
export { transformSliceToRemoveOpenBodiedExtension } from '@atlaskit/editor-common/transforms';
|
|
4
|
-
import { ACTION, ACTION_SUBJECT, INPUT_METHOD, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
5
|
-
import { TARGET_SELECTION_SOURCE } from '../analytics/types/extension-events';
|
|
4
|
+
import { ACTION, ACTION_SUBJECT, INPUT_METHOD, EVENT_TYPE, TARGET_SELECTION_SOURCE } from '@atlaskit/editor-common/analytics';
|
|
6
5
|
import { findExtensionWithLocalId } from './utils';
|
|
7
6
|
import { getPluginState } from './pm-plugins/main';
|
|
8
7
|
import { getEditInLegacyMacroBrowser, createExtensionAPI } from './extension-api';
|
|
@@ -11,7 +11,6 @@ export { default as alignmentPlugin } from './alignment';
|
|
|
11
11
|
export { default as dataConsumerMarkPlugin } from './data-consumer';
|
|
12
12
|
export { default as indentationPlugin } from './indentation';
|
|
13
13
|
export { default as annotationPlugin } from './annotation';
|
|
14
|
-
export { default as analyticsPlugin } from './analytics';
|
|
15
14
|
export { default as customAutoformatPlugin } from './custom-autoformat';
|
|
16
15
|
export { default as feedbackDialogPlugin } from './feedback-dialog';
|
|
17
16
|
export { default as mobileDimensionsPlugin } from './mobile-dimensions';
|
|
@@ -17,7 +17,6 @@ import { featureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
|
17
17
|
import { copyButtonPlugin } from '@atlaskit/editor-plugin-copy-button';
|
|
18
18
|
import { floatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-toolbar';
|
|
19
19
|
import { clipboardPlugin } from '@atlaskit/editor-plugin-clipboard';
|
|
20
|
-
import { analyticsPlugin as deprecatedAnalyticsPlugin } from '../plugins';
|
|
21
20
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
22
21
|
import { placeholderPlugin } from '@atlaskit/editor-plugin-placeholder';
|
|
23
22
|
import annotationPlugin from '../plugins/annotation';
|
|
@@ -49,18 +48,6 @@ export function createDefaultPreset(options) {
|
|
|
49
48
|
}]);
|
|
50
49
|
}
|
|
51
50
|
return builder;
|
|
52
|
-
}).maybeAdd(deprecatedAnalyticsPlugin, (plugin, builder) => {
|
|
53
|
-
if (options.allowAnalyticsGASV3) {
|
|
54
|
-
const {
|
|
55
|
-
performanceTracking,
|
|
56
|
-
createAnalyticsEvent
|
|
57
|
-
} = options;
|
|
58
|
-
return builder.add([plugin, {
|
|
59
|
-
createAnalyticsEvent,
|
|
60
|
-
performanceTracking
|
|
61
|
-
}]);
|
|
62
|
-
}
|
|
63
|
-
return builder;
|
|
64
51
|
}).add(betterTypeHistoryPlugin).add([pastePlugin, options.paste]).add(clipboardPlugin).add(focusPlugin).add(compositionPlugin).add([basePlugin, options.base]).add(decorationsPlugin).maybeAdd(undoRedoPlugin, (p, builder) => {
|
|
65
52
|
var _options$featureFlags;
|
|
66
53
|
// The undo redo plugin needs to be add before the blockTypePlugin
|
|
@@ -2,12 +2,7 @@ import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
|
2
2
|
import { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
|
|
3
3
|
import { createSchema } from './create-editor/create-schema';
|
|
4
4
|
import { sortByOrder } from './create-editor/sort-by-order';
|
|
5
|
-
import { analyticsPluginKey } from './plugins/analytics/plugin-key';
|
|
6
5
|
import { basePlugin } from '@atlaskit/editor-plugin-base';
|
|
7
|
-
export function getFireAnalytics(editorView) {
|
|
8
|
-
var _analyticsPluginKey$g;
|
|
9
|
-
return analyticsPluginKey === null || analyticsPluginKey === void 0 ? void 0 : (_analyticsPluginKey$g = analyticsPluginKey.getState(editorView.state)) === null || _analyticsPluginKey$g === void 0 ? void 0 : _analyticsPluginKey$g.fireAnalytics;
|
|
10
|
-
}
|
|
11
6
|
function lightProcessPluginsList(editorPlugins) {
|
|
12
7
|
/**
|
|
13
8
|
* First pass to collect pluginsOptions
|
|
@@ -13,7 +13,7 @@ import { fullPageMessages as messages } from '@atlaskit/editor-common/messages';
|
|
|
13
13
|
import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
|
|
14
14
|
import { usePresetContext } from '../../../presets/context';
|
|
15
15
|
export const EditorToolbar = /*#__PURE__*/React.memo(props => {
|
|
16
|
-
var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$collabEdit, _props$collabEdit2, _props$collabEdit3, _editorAPI$analytics;
|
|
16
|
+
var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$collabEdit, _props$collabEdit2, _props$collabEdit3, _editorAPI$analytics, _editorAPI$analytics2;
|
|
17
17
|
const [shouldSplitToolbar, setShouldSplitToolbar] = useState(false);
|
|
18
18
|
const editorAPI = usePresetContext();
|
|
19
19
|
|
|
@@ -54,7 +54,8 @@ export const EditorToolbar = /*#__PURE__*/React.memo(props => {
|
|
|
54
54
|
inviteToEditComponent: (_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.inviteToEditComponent,
|
|
55
55
|
inviteToEditHandler: (_props$collabEdit2 = props.collabEdit) === null || _props$collabEdit2 === void 0 ? void 0 : _props$collabEdit2.inviteToEditHandler,
|
|
56
56
|
isInviteToEditButtonSelected: (_props$collabEdit3 = props.collabEdit) === null || _props$collabEdit3 === void 0 ? void 0 : _props$collabEdit3.isInviteToEditButtonSelected,
|
|
57
|
-
featureFlags: props.featureFlags || {}
|
|
57
|
+
featureFlags: props.featureFlags || {},
|
|
58
|
+
editorAnalyticsAPI: editorAPI === null || editorAPI === void 0 ? void 0 : (_editorAPI$analytics = editorAPI.analytics) === null || _editorAPI$analytics === void 0 ? void 0 : _editorAPI$analytics.actions
|
|
58
59
|
}), editorAPI !== null && editorAPI !== void 0 && editorAPI.findReplace && twoLineEditorToolbar ? jsx(FindReplaceToolbarButtonWithState, {
|
|
59
60
|
popupsBoundariesElement: props.popupsBoundariesElement,
|
|
60
61
|
popupsMountPoint: props.popupsMountPoint,
|
|
@@ -63,7 +64,7 @@ export const EditorToolbar = /*#__PURE__*/React.memo(props => {
|
|
|
63
64
|
containerElement: props.containerElement,
|
|
64
65
|
dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
|
|
65
66
|
featureFlags: props.featureFlags,
|
|
66
|
-
editorAnalyticsAPI: editorAPI === null || editorAPI === void 0 ? void 0 : (_editorAPI$
|
|
67
|
+
editorAnalyticsAPI: editorAPI === null || editorAPI === void 0 ? void 0 : (_editorAPI$analytics2 = editorAPI.analytics) === null || _editorAPI$analytics2 === void 0 ? void 0 : _editorAPI$analytics2.actions
|
|
67
68
|
}) : null, !!props.customPrimaryToolbarComponents && 'after' in props.customPrimaryToolbarComponents ? props.customPrimaryToolbarComponents.after : props.customPrimaryToolbarComponents);
|
|
68
69
|
useEffect(() => {
|
|
69
70
|
if (twoLineEditorToolbar) {
|
|
@@ -17,7 +17,7 @@ import { createDispatch } from '../../event-dispatcher';
|
|
|
17
17
|
import { openFeedbackDialog } from '../../plugins/feedback-dialog';
|
|
18
18
|
import deprecationWarnings from '../../utils/deprecation-warnings';
|
|
19
19
|
import pickBy from '../../utils/pick-by';
|
|
20
|
-
import { analyticsEventKey } from '
|
|
20
|
+
import { analyticsEventKey } from '@atlaskit/editor-common/utils';
|
|
21
21
|
import { usePresetContext } from '../../presets/context';
|
|
22
22
|
const PopupWithOutsideListeners = withOuterListeners(Popup);
|
|
23
23
|
const POPUP_HEIGHT = 388;
|
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { ACTION, ACTION_SUBJECT, INPUT_METHOD, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { createDispatch } from '../../event-dispatcher';
|
|
6
|
-
import { analyticsEventKey } from '
|
|
6
|
+
import { analyticsEventKey } from '@atlaskit/editor-common/utils';
|
|
7
7
|
import { deprecatedOpenHelpCommand } from '@atlaskit/editor-plugin-help-dialog';
|
|
8
8
|
export default class WithHelpTrigger extends React.Component {
|
|
9
9
|
constructor(...args) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "189.3.
|
|
2
|
+
export const version = "189.3.19";
|
|
@@ -8,6 +8,7 @@ var avatarGroup = function avatarGroup(_ref) {
|
|
|
8
8
|
return {
|
|
9
9
|
name: 'avatarGroup',
|
|
10
10
|
primaryToolbarComponent: function primaryToolbarComponent(_ref2) {
|
|
11
|
+
var _api$analytics;
|
|
11
12
|
var editorView = _ref2.editorView,
|
|
12
13
|
popupsMountPoint = _ref2.popupsMountPoint,
|
|
13
14
|
popupsBoundariesElement = _ref2.popupsBoundariesElement,
|
|
@@ -22,7 +23,8 @@ var avatarGroup = function avatarGroup(_ref) {
|
|
|
22
23
|
eventDispatcher: eventDispatcher,
|
|
23
24
|
collabEdit: props === null || props === void 0 ? void 0 : props.collabEdit,
|
|
24
25
|
takeFullWidth: props === null || props === void 0 ? void 0 : props.takeFullWidth,
|
|
25
|
-
featureFlags: featureFlags
|
|
26
|
+
featureFlags: featureFlags,
|
|
27
|
+
editorAnalyticsAPI: api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions
|
|
26
28
|
});
|
|
27
29
|
}
|
|
28
30
|
};
|
|
@@ -34,7 +34,8 @@ var AvatarGroupPluginWrapper = function AvatarGroupPluginWrapper(props) {
|
|
|
34
34
|
inviteToEditComponent: props.collabEdit && props.collabEdit.inviteToEditComponent,
|
|
35
35
|
inviteToEditHandler: props.collabEdit && props.collabEdit.inviteToEditHandler,
|
|
36
36
|
isInviteToEditButtonSelected: props.collabEdit && props.collabEdit.isInviteToEditButtonSelected,
|
|
37
|
-
featureFlags: featureFlags
|
|
37
|
+
featureFlags: featureFlags,
|
|
38
|
+
editorAnalyticsAPI: props.editorAnalyticsAPI
|
|
38
39
|
}));
|
|
39
40
|
};
|
|
40
41
|
export default AvatarGroupPluginWrapper;
|
|
@@ -11,7 +11,8 @@ var AvatarsWithPluginState = function AvatarsWithPluginState(props) {
|
|
|
11
11
|
onClick = props.inviteToEditHandler,
|
|
12
12
|
Component = props.inviteToEditComponent,
|
|
13
13
|
editorView = props.editorView,
|
|
14
|
-
featureFlags = props.featureFlags
|
|
14
|
+
featureFlags = props.featureFlags,
|
|
15
|
+
editorAnalyticsAPI = props.editorAnalyticsAPI;
|
|
15
16
|
var render = React.useCallback(function (_ref) {
|
|
16
17
|
var data = _ref.data;
|
|
17
18
|
if (!data) {
|
|
@@ -21,14 +22,15 @@ var AvatarsWithPluginState = function AvatarsWithPluginState(props) {
|
|
|
21
22
|
sessionId: data.sessionId,
|
|
22
23
|
participants: data.activeParticipants,
|
|
23
24
|
editorView: editorView,
|
|
24
|
-
featureFlags: featureFlags
|
|
25
|
+
featureFlags: featureFlags,
|
|
26
|
+
editorAnalyticsAPI: editorAnalyticsAPI
|
|
25
27
|
}, /*#__PURE__*/React.createElement(InviteToEditButton, {
|
|
26
28
|
title: title,
|
|
27
29
|
selected: selected,
|
|
28
30
|
onClick: onClick,
|
|
29
31
|
Component: Component
|
|
30
32
|
}));
|
|
31
|
-
}, [selected, onClick, Component, title, editorView, featureFlags]);
|
|
33
|
+
}, [selected, onClick, Component, title, editorView, featureFlags, editorAnalyticsAPI]);
|
|
32
34
|
return /*#__PURE__*/React.createElement(WithPluginState, {
|
|
33
35
|
plugins: {
|
|
34
36
|
data: collabEditPluginKey
|
|
@@ -31,7 +31,7 @@ export var Avatars = /*#__PURE__*/React.memo(function (props) {
|
|
|
31
31
|
|
|
32
32
|
// user does not need to scroll to their own position (index 0)
|
|
33
33
|
if (allowCollabAvatarScroll && index > 0) {
|
|
34
|
-
scrollToCollabCursor(editorView, participants, props.sessionId, index);
|
|
34
|
+
scrollToCollabCursor(editorView, participants, props.sessionId, index, props.editorAnalyticsAPI);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
}), props.children);
|
|
@@ -4,7 +4,6 @@ import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
|
4
4
|
import * as themeColors from '@atlaskit/theme/colors';
|
|
5
5
|
import { hexToRgba } from '@atlaskit/adf-schema';
|
|
6
6
|
import { ZERO_WIDTH_JOINER } from '@atlaskit/editor-common/utils';
|
|
7
|
-
import { addAnalytics } from '../analytics/utils';
|
|
8
7
|
import { EVENT_TYPE, ACTION, ACTION_SUBJECT } from '@atlaskit/editor-common/analytics';
|
|
9
8
|
// TODO: https://product-fabric.atlassian.net/browse/DSP-7269
|
|
10
9
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
@@ -117,7 +116,7 @@ export var replaceDocument = function replaceDocument(doc, state, version, optio
|
|
|
117
116
|
}
|
|
118
117
|
return tr;
|
|
119
118
|
};
|
|
120
|
-
export var scrollToCollabCursor = function scrollToCollabCursor(editorView, participants, sessionId, index) {
|
|
119
|
+
export var scrollToCollabCursor = function scrollToCollabCursor(editorView, participants, sessionId, index, editorAnalyticsAPI) {
|
|
121
120
|
var selectedUser = participants[index];
|
|
122
121
|
if (selectedUser && selectedUser.cursorPos !== undefined && selectedUser.sessionId !== sessionId) {
|
|
123
122
|
var state = editorView.state;
|
|
@@ -128,7 +127,7 @@ export var scrollToCollabCursor = function scrollToCollabCursor(editorView, part
|
|
|
128
127
|
eventType: EVENT_TYPE.TRACK
|
|
129
128
|
};
|
|
130
129
|
tr.setSelection(Selection.near(tr.doc.resolve(selectedUser.cursorPos)));
|
|
131
|
-
|
|
130
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent(analyticsPayload)(tr);
|
|
132
131
|
tr.scrollIntoView();
|
|
133
132
|
editorView.dispatch(tr);
|
|
134
133
|
if (!editorView.hasFocus()) {
|
|
@@ -6,8 +6,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
6
6
|
import { Selection, NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
7
7
|
import { replaceSelectedNode, findSelectedNodeOfType, replaceParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
8
8
|
export { transformSliceToRemoveOpenBodiedExtension } from '@atlaskit/editor-common/transforms';
|
|
9
|
-
import { ACTION, ACTION_SUBJECT, INPUT_METHOD, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
10
|
-
import { TARGET_SELECTION_SOURCE } from '../analytics/types/extension-events';
|
|
9
|
+
import { ACTION, ACTION_SUBJECT, INPUT_METHOD, EVENT_TYPE, TARGET_SELECTION_SOURCE } from '@atlaskit/editor-common/analytics';
|
|
11
10
|
import { findExtensionWithLocalId } from './utils';
|
|
12
11
|
import { getPluginState } from './pm-plugins/main';
|
|
13
12
|
import { getEditInLegacyMacroBrowser, createExtensionAPI } from './extension-api';
|
|
@@ -11,7 +11,6 @@ export { default as alignmentPlugin } from './alignment';
|
|
|
11
11
|
export { default as dataConsumerMarkPlugin } from './data-consumer';
|
|
12
12
|
export { default as indentationPlugin } from './indentation';
|
|
13
13
|
export { default as annotationPlugin } from './annotation';
|
|
14
|
-
export { default as analyticsPlugin } from './analytics';
|
|
15
14
|
export { default as customAutoformatPlugin } from './custom-autoformat';
|
|
16
15
|
export { default as feedbackDialogPlugin } from './feedback-dialog';
|
|
17
16
|
export { default as mobileDimensionsPlugin } from './mobile-dimensions';
|