@atlaskit/editor-core 189.1.2 → 189.1.5
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/create-editor/ErrorBoundary.js +2 -3
- package/dist/cjs/plugins/analytics/index.js +1 -160
- package/dist/cjs/plugins/annotation/commands/index.js +1 -1
- package/dist/cjs/plugins/annotation/pm-plugins/inline-comment.js +2 -2
- package/dist/cjs/plugins/annotation/pm-plugins/keymap.js +1 -1
- package/dist/cjs/plugins/annotation/ui/InlineCommentView.js +3 -5
- package/dist/cjs/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +1 -1
- package/dist/cjs/plugins/collab-edit/utils.js +4 -4
- package/dist/cjs/plugins/extension/actions.js +3 -2
- package/dist/cjs/plugins/extension/extension-api.js +6 -5
- package/dist/cjs/plugins/find-replace/FindReplaceToolbarButtonWithState.js +1 -1
- package/dist/cjs/plugins/find-replace/commands-with-analytics.js +23 -22
- package/dist/cjs/plugins/find-replace/keymap.js +1 -1
- package/dist/cjs/plugins/find-replace/ui/Find.js +6 -6
- package/dist/cjs/plugins/find-replace/ui/FindReplaceToolbarButton.js +3 -3
- package/dist/cjs/plugins/find-replace/ui/Replace.js +6 -6
- package/dist/cjs/plugins/indentation/commands/index.js +24 -16
- package/dist/cjs/plugins/indentation/commands/utils.js +4 -3
- package/dist/cjs/plugins/indentation/index.js +4 -2
- package/dist/cjs/plugins/indentation/pm-plugins/keymap.js +4 -4
- package/dist/cjs/plugins/insert-block/index.js +1 -1
- package/dist/cjs/plugins/layout/actions.js +6 -7
- package/dist/cjs/plugins/macro/actions.js +3 -2
- package/dist/cjs/plugins/paste/pm-plugins/main.js +2 -5
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/onItemActivated.js +9 -7
- package/dist/cjs/plugins/undo-redo/enums.js +3 -3
- package/dist/cjs/ui/ConfigPanel/FormErrorBoundary.js +3 -4
- package/dist/cjs/ui/ErrorBoundary/index.js +1 -1
- package/dist/cjs/ui/ToolbarFeedback/index.js +1 -1
- package/dist/cjs/ui/WithHelpTrigger/index.js +1 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/create-editor/ErrorBoundary.js +1 -2
- package/dist/es2019/plugins/analytics/index.js +0 -3
- package/dist/es2019/plugins/annotation/commands/index.js +1 -1
- package/dist/es2019/plugins/annotation/pm-plugins/inline-comment.js +1 -1
- package/dist/es2019/plugins/annotation/pm-plugins/keymap.js +1 -1
- package/dist/es2019/plugins/annotation/ui/InlineCommentView.js +3 -3
- package/dist/es2019/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +1 -1
- package/dist/es2019/plugins/collab-edit/utils.js +1 -1
- package/dist/es2019/plugins/extension/actions.js +2 -1
- package/dist/es2019/plugins/extension/extension-api.js +2 -1
- package/dist/es2019/plugins/find-replace/FindReplaceToolbarButtonWithState.js +1 -1
- package/dist/es2019/plugins/find-replace/commands-with-analytics.js +2 -1
- package/dist/es2019/plugins/find-replace/keymap.js +1 -1
- package/dist/es2019/plugins/find-replace/ui/Find.js +1 -1
- package/dist/es2019/plugins/find-replace/ui/FindReplaceToolbarButton.js +1 -1
- package/dist/es2019/plugins/find-replace/ui/Replace.js +1 -1
- package/dist/es2019/plugins/indentation/commands/index.js +10 -6
- package/dist/es2019/plugins/indentation/commands/utils.js +4 -3
- package/dist/es2019/plugins/indentation/index.js +7 -2
- package/dist/es2019/plugins/indentation/pm-plugins/keymap.js +4 -4
- package/dist/es2019/plugins/insert-block/index.js +1 -1
- package/dist/es2019/plugins/layout/actions.js +1 -2
- package/dist/es2019/plugins/macro/actions.js +2 -1
- package/dist/es2019/plugins/paste/pm-plugins/main.js +2 -4
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/onItemActivated.js +9 -7
- package/dist/es2019/plugins/undo-redo/enums.js +1 -1
- package/dist/es2019/ui/ConfigPanel/FormErrorBoundary.js +1 -2
- package/dist/es2019/ui/ErrorBoundary/index.js +1 -1
- 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/create-editor/ErrorBoundary.js +1 -2
- package/dist/esm/plugins/analytics/index.js +0 -3
- package/dist/esm/plugins/annotation/commands/index.js +1 -1
- package/dist/esm/plugins/annotation/pm-plugins/inline-comment.js +1 -1
- package/dist/esm/plugins/annotation/pm-plugins/keymap.js +1 -1
- package/dist/esm/plugins/annotation/ui/InlineCommentView.js +3 -3
- package/dist/esm/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +1 -1
- package/dist/esm/plugins/collab-edit/utils.js +1 -1
- package/dist/esm/plugins/extension/actions.js +2 -1
- package/dist/esm/plugins/extension/extension-api.js +2 -1
- package/dist/esm/plugins/find-replace/FindReplaceToolbarButtonWithState.js +1 -1
- package/dist/esm/plugins/find-replace/commands-with-analytics.js +2 -1
- package/dist/esm/plugins/find-replace/keymap.js +1 -1
- package/dist/esm/plugins/find-replace/ui/Find.js +1 -1
- package/dist/esm/plugins/find-replace/ui/FindReplaceToolbarButton.js +1 -1
- package/dist/esm/plugins/find-replace/ui/Replace.js +1 -1
- package/dist/esm/plugins/indentation/commands/index.js +24 -16
- package/dist/esm/plugins/indentation/commands/utils.js +4 -3
- package/dist/esm/plugins/indentation/index.js +4 -2
- package/dist/esm/plugins/indentation/pm-plugins/keymap.js +4 -4
- package/dist/esm/plugins/insert-block/index.js +1 -1
- package/dist/esm/plugins/layout/actions.js +1 -2
- package/dist/esm/plugins/macro/actions.js +2 -1
- package/dist/esm/plugins/paste/pm-plugins/main.js +2 -4
- package/dist/esm/plugins/toolbar-lists-indentation/ui/onItemActivated.js +9 -7
- package/dist/esm/plugins/undo-redo/enums.js +1 -1
- package/dist/esm/ui/ConfigPanel/FormErrorBoundary.js +1 -2
- package/dist/esm/ui/ErrorBoundary/index.js +1 -1
- 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/analytics/index.d.ts +0 -5
- package/dist/types/plugins/annotation/commands/index.d.ts +2 -3
- package/dist/types/plugins/annotation/commands/transform.d.ts +1 -2
- package/dist/types/plugins/annotation/ui/InlineCommentView.d.ts +1 -1
- package/dist/types/plugins/annotation/utils.d.ts +1 -1
- package/dist/types/plugins/avatar-group/ui/AvatarGroupPluginWrapper.d.ts +1 -1
- package/dist/types/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +1 -1
- package/dist/types/plugins/find-replace/commands-with-analytics.d.ts +1 -1
- package/dist/types/plugins/find-replace/ui/Find.d.ts +1 -1
- package/dist/types/plugins/find-replace/ui/FindReplace.d.ts +2 -2
- package/dist/types/plugins/find-replace/ui/FindReplaceToolbarButton.d.ts +1 -1
- package/dist/types/plugins/find-replace/ui/Replace.d.ts +3 -2
- package/dist/types/plugins/indentation/commands/index.d.ts +3 -2
- package/dist/types/plugins/indentation/commands/utils.d.ts +3 -2
- package/dist/types/plugins/indentation/index.d.ts +5 -2
- package/dist/types/plugins/indentation/pm-plugins/keymap.d.ts +2 -1
- package/dist/types/plugins/macro/actions.d.ts +1 -1
- package/dist/types/plugins/paste/util/index.d.ts +1 -2
- package/dist/types/presets/default.d.ts +20 -0
- package/dist/types/ui/Appearance/FullPage/FullPageToolbar.d.ts +2 -2
- package/dist/types/ui/ConfigPanel/FormErrorBoundary.d.ts +3 -3
- package/dist/types/ui/ErrorBoundary/index.d.ts +2 -3
- package/dist/types/ui/Toolbar/toolbar-types.d.ts +2 -2
- package/dist/types-ts4.5/plugins/analytics/index.d.ts +0 -5
- package/dist/types-ts4.5/plugins/annotation/commands/index.d.ts +2 -3
- package/dist/types-ts4.5/plugins/annotation/commands/transform.d.ts +1 -2
- package/dist/types-ts4.5/plugins/annotation/ui/InlineCommentView.d.ts +1 -1
- package/dist/types-ts4.5/plugins/annotation/utils.d.ts +1 -1
- package/dist/types-ts4.5/plugins/avatar-group/ui/AvatarGroupPluginWrapper.d.ts +1 -1
- package/dist/types-ts4.5/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +1 -1
- package/dist/types-ts4.5/plugins/find-replace/commands-with-analytics.d.ts +1 -1
- package/dist/types-ts4.5/plugins/find-replace/ui/Find.d.ts +1 -1
- package/dist/types-ts4.5/plugins/find-replace/ui/FindReplace.d.ts +2 -2
- package/dist/types-ts4.5/plugins/find-replace/ui/FindReplaceToolbarButton.d.ts +1 -1
- package/dist/types-ts4.5/plugins/find-replace/ui/Replace.d.ts +3 -2
- package/dist/types-ts4.5/plugins/indentation/commands/index.d.ts +3 -2
- package/dist/types-ts4.5/plugins/indentation/commands/utils.d.ts +3 -2
- package/dist/types-ts4.5/plugins/indentation/index.d.ts +7 -2
- package/dist/types-ts4.5/plugins/indentation/pm-plugins/keymap.d.ts +2 -1
- package/dist/types-ts4.5/plugins/macro/actions.d.ts +1 -1
- package/dist/types-ts4.5/plugins/paste/util/index.d.ts +1 -2
- package/dist/types-ts4.5/presets/default.d.ts +20 -0
- package/dist/types-ts4.5/ui/Appearance/FullPage/FullPageToolbar.d.ts +2 -2
- package/dist/types-ts4.5/ui/ConfigPanel/FormErrorBoundary.d.ts +3 -3
- package/dist/types-ts4.5/ui/ErrorBoundary/index.d.ts +2 -3
- package/dist/types-ts4.5/ui/Toolbar/toolbar-types.d.ts +2 -2
- package/package.json +3 -3
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.removeIndentation = exports.isIndentationAllowed = exports.getOutdentCommand = exports.getIndentCommand = exports.MAX_INDENTATION_LEVEL = void 0;
|
|
8
8
|
var _commands = require("../../../commands");
|
|
9
9
|
var _utils = require("./utils");
|
|
10
|
-
var _analytics = require("
|
|
10
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
11
11
|
var _getAttrsWithChangesRecorder = _interopRequireDefault(require("../../../utils/getAttrsWithChangesRecorder"));
|
|
12
12
|
var MAX_INDENTATION_LEVEL = exports.MAX_INDENTATION_LEVEL = 6;
|
|
13
13
|
var isIndentationAllowed = exports.isIndentationAllowed = function isIndentationAllowed(schema, node) {
|
|
@@ -40,7 +40,8 @@ function createIndentationCommand(getNewIndentationAttrs) {
|
|
|
40
40
|
function createIndentationCommandWithAnalytics(_ref) {
|
|
41
41
|
var getNewIndentationAttrs = _ref.getNewIndentationAttrs,
|
|
42
42
|
direction = _ref.direction,
|
|
43
|
-
inputMethod = _ref.inputMethod
|
|
43
|
+
inputMethod = _ref.inputMethod,
|
|
44
|
+
editorAnalyticsAPI = _ref.editorAnalyticsAPI;
|
|
44
45
|
// Create a new getAttrs function to record the changes
|
|
45
46
|
var _getAttrsWithChangesR = (0, _getAttrsWithChangesRecorder.default)(getNewIndentationAttrs, {
|
|
46
47
|
direction: direction
|
|
@@ -56,6 +57,7 @@ function createIndentationCommandWithAnalytics(_ref) {
|
|
|
56
57
|
return indentationCommand(state, (0, _utils.createAnalyticsDispatch)({
|
|
57
58
|
getAttrsChanges: getAndResetAttrsChanges,
|
|
58
59
|
inputMethod: inputMethod,
|
|
60
|
+
editorAnalyticsAPI: editorAnalyticsAPI,
|
|
59
61
|
state: state,
|
|
60
62
|
dispatch: dispatch
|
|
61
63
|
}));
|
|
@@ -86,13 +88,16 @@ var getIndentAttrs = function getIndentAttrs(oldAttr) {
|
|
|
86
88
|
}; // Otherwise, increase the level by one
|
|
87
89
|
};
|
|
88
90
|
|
|
89
|
-
var getIndentCommand = exports.getIndentCommand = function getIndentCommand() {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
91
|
+
var getIndentCommand = exports.getIndentCommand = function getIndentCommand(editorAnalyticsAPI) {
|
|
92
|
+
return function () {
|
|
93
|
+
var inputMethod = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _analytics.INPUT_METHOD.KEYBOARD;
|
|
94
|
+
return createIndentationCommandWithAnalytics({
|
|
95
|
+
getNewIndentationAttrs: getIndentAttrs,
|
|
96
|
+
direction: _analytics.INDENT_DIRECTION.INDENT,
|
|
97
|
+
inputMethod: inputMethod,
|
|
98
|
+
editorAnalyticsAPI: editorAnalyticsAPI
|
|
99
|
+
});
|
|
100
|
+
};
|
|
96
101
|
};
|
|
97
102
|
|
|
98
103
|
/**
|
|
@@ -117,13 +122,16 @@ var getOutdentAttrs = function getOutdentAttrs(oldAttr) {
|
|
|
117
122
|
}; // Decrease the level on other cases
|
|
118
123
|
};
|
|
119
124
|
|
|
120
|
-
var getOutdentCommand = exports.getOutdentCommand = function getOutdentCommand() {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
var getOutdentCommand = exports.getOutdentCommand = function getOutdentCommand(editorAnalyticsAPI) {
|
|
126
|
+
return function () {
|
|
127
|
+
var inputMethod = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _analytics.INPUT_METHOD.KEYBOARD;
|
|
128
|
+
return createIndentationCommandWithAnalytics({
|
|
129
|
+
getNewIndentationAttrs: getOutdentAttrs,
|
|
130
|
+
direction: _analytics.INDENT_DIRECTION.OUTDENT,
|
|
131
|
+
inputMethod: inputMethod,
|
|
132
|
+
editorAnalyticsAPI: editorAnalyticsAPI
|
|
133
|
+
});
|
|
134
|
+
};
|
|
127
135
|
};
|
|
128
136
|
var removeIndentation = exports.removeIndentation = function removeIndentation(state, dispatch) {
|
|
129
137
|
return (0, _commands.toggleBlockMark)(state.schema.marks.indentation, function () {
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.createAnalyticsDispatch = createAnalyticsDispatch;
|
|
7
7
|
exports.getNewIndentLevel = getNewIndentLevel;
|
|
8
8
|
exports.getPrevIndentLevel = getPrevIndentLevel;
|
|
9
|
-
var _analytics = require("
|
|
9
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
10
10
|
// Analytics GAS v3 Utils
|
|
11
11
|
|
|
12
12
|
var indentTypes = {
|
|
@@ -51,6 +51,7 @@ function getPrevIndentLevel(prevAttrs) {
|
|
|
51
51
|
function createAnalyticsDispatch(_ref) {
|
|
52
52
|
var getAttrsChanges = _ref.getAttrsChanges,
|
|
53
53
|
inputMethod = _ref.inputMethod,
|
|
54
|
+
editorAnalyticsAPI = _ref.editorAnalyticsAPI,
|
|
54
55
|
state = _ref.state,
|
|
55
56
|
dispatch = _ref.dispatch;
|
|
56
57
|
return function (tr) {
|
|
@@ -68,7 +69,7 @@ function createAnalyticsDispatch(_ref) {
|
|
|
68
69
|
return; // If no valid indent type continue
|
|
69
70
|
}
|
|
70
71
|
|
|
71
|
-
|
|
72
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
|
|
72
73
|
action: _analytics.ACTION.FORMATTED,
|
|
73
74
|
actionSubject: _analytics.ACTION_SUBJECT.TEXT,
|
|
74
75
|
actionSubjectId: _analytics.ACTION_SUBJECT_ID.FORMAT_INDENT,
|
|
@@ -80,7 +81,7 @@ function createAnalyticsDispatch(_ref) {
|
|
|
80
81
|
direction: direction,
|
|
81
82
|
indentType: indentType
|
|
82
83
|
}
|
|
83
|
-
});
|
|
84
|
+
})(currentTr);
|
|
84
85
|
});
|
|
85
86
|
|
|
86
87
|
// Dispatch analytics if exist
|
|
@@ -6,7 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
8
8
|
var _keymap = require("./pm-plugins/keymap");
|
|
9
|
-
var indentationPlugin = function indentationPlugin() {
|
|
9
|
+
var indentationPlugin = function indentationPlugin(_ref) {
|
|
10
|
+
var api = _ref.api;
|
|
10
11
|
return {
|
|
11
12
|
name: 'indentation',
|
|
12
13
|
marks: function marks() {
|
|
@@ -19,7 +20,8 @@ var indentationPlugin = function indentationPlugin() {
|
|
|
19
20
|
return [{
|
|
20
21
|
name: 'indentationKeymap',
|
|
21
22
|
plugin: function plugin() {
|
|
22
|
-
|
|
23
|
+
var _api$analytics;
|
|
24
|
+
return (0, _keymap.keymapPlugin)(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions);
|
|
23
25
|
}
|
|
24
26
|
}];
|
|
25
27
|
}
|
|
@@ -10,14 +10,14 @@ var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
|
10
10
|
var _utils = require("../../../utils");
|
|
11
11
|
var _commands = require("../commands");
|
|
12
12
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
13
|
-
function keymapPlugin() {
|
|
13
|
+
function keymapPlugin(editorAnalyticsAPI) {
|
|
14
14
|
var list = {};
|
|
15
|
-
(0, _keymaps.bindKeymapWithCommand)((0, _keymaps.findShortcutByKeymap)(_keymaps.indent), (0, _commands.getIndentCommand)(_analytics.INPUT_METHOD.KEYBOARD), list);
|
|
16
|
-
(0, _keymaps.bindKeymapWithCommand)((0, _keymaps.findShortcutByKeymap)(_keymaps.outdent), (0, _commands.getOutdentCommand)(_analytics.INPUT_METHOD.KEYBOARD), list);
|
|
15
|
+
(0, _keymaps.bindKeymapWithCommand)((0, _keymaps.findShortcutByKeymap)(_keymaps.indent), (0, _commands.getIndentCommand)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.KEYBOARD), list);
|
|
16
|
+
(0, _keymaps.bindKeymapWithCommand)((0, _keymaps.findShortcutByKeymap)(_keymaps.outdent), (0, _commands.getOutdentCommand)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.KEYBOARD), list);
|
|
17
17
|
(0, _keymaps.bindKeymapWithCommand)((0, _keymaps.findShortcutByKeymap)(_keymaps.backspace), function (state, dispatch) {
|
|
18
18
|
var selection = state.selection;
|
|
19
19
|
if ((0, _utils.isTextSelection)(selection) && selection.$cursor && selection.$cursor.parentOffset === 0) {
|
|
20
|
-
return dispatch ? (0, _commands.getOutdentCommand)(_analytics.INPUT_METHOD.KEYBOARD)(state, dispatch) : false;
|
|
20
|
+
return dispatch ? (0, _commands.getOutdentCommand)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.KEYBOARD)(state, dispatch) : false;
|
|
21
21
|
}
|
|
22
22
|
return false;
|
|
23
23
|
}, list);
|
|
@@ -12,7 +12,7 @@ var _macro = require("../macro");
|
|
|
12
12
|
var _WithPluginState = _interopRequireDefault(require("../../ui/WithPluginState"));
|
|
13
13
|
var _ToolbarInsertBlock = _interopRequireDefault(require("./ui/ToolbarInsertBlock"));
|
|
14
14
|
var _consts = require("@atlaskit/editor-plugin-block-type/consts");
|
|
15
|
-
var _analytics = require("
|
|
15
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
16
16
|
var _pluginKey = require("../placeholder-text/plugin-key");
|
|
17
17
|
var _pluginKey2 = require("../macro/plugin-key");
|
|
18
18
|
var _types = require("../../ui/Toolbar/types");
|
|
@@ -15,7 +15,6 @@ var _slice = require("../../utils/slice");
|
|
|
15
15
|
var _utils2 = require("@atlaskit/editor-common/utils");
|
|
16
16
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
17
17
|
var _editorAnalytics = require("@atlaskit/editor-common/editor-analytics");
|
|
18
|
-
var _nodeEvents = require("../analytics/types/node-events");
|
|
19
18
|
var _pluginKey = require("./pm-plugins/plugin-key");
|
|
20
19
|
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; }
|
|
21
20
|
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; }
|
|
@@ -332,16 +331,16 @@ var deleteActiveLayoutNode = exports.deleteActiveLayoutNode = function deleteAct
|
|
|
332
331
|
var formatLayoutName = function formatLayoutName(layout) {
|
|
333
332
|
switch (layout) {
|
|
334
333
|
case 'single':
|
|
335
|
-
return
|
|
334
|
+
return _analytics.LAYOUT_TYPE.SINGLE_COL;
|
|
336
335
|
case 'two_equal':
|
|
337
|
-
return
|
|
336
|
+
return _analytics.LAYOUT_TYPE.TWO_COLS_EQUAL;
|
|
338
337
|
case 'three_equal':
|
|
339
|
-
return
|
|
338
|
+
return _analytics.LAYOUT_TYPE.THREE_COLS_EQUAL;
|
|
340
339
|
case 'two_left_sidebar':
|
|
341
|
-
return
|
|
340
|
+
return _analytics.LAYOUT_TYPE.LEFT_SIDEBAR;
|
|
342
341
|
case 'two_right_sidebar':
|
|
343
|
-
return
|
|
342
|
+
return _analytics.LAYOUT_TYPE.RIGHT_SIDEBAR;
|
|
344
343
|
case 'three_with_sidebars':
|
|
345
|
-
return
|
|
344
|
+
return _analytics.LAYOUT_TYPE.THREE_WITH_SIDEBARS;
|
|
346
345
|
}
|
|
347
346
|
};
|
|
@@ -14,7 +14,8 @@ var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
|
14
14
|
var _validator = require("@atlaskit/editor-common/validator");
|
|
15
15
|
var _insert = require("@atlaskit/editor-common/insert");
|
|
16
16
|
var _pluginFactory = require("../extension/plugin-factory");
|
|
17
|
-
var _analytics = require("
|
|
17
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
18
|
+
var _analytics2 = require("../analytics");
|
|
18
19
|
var _extensionEvents = require("../analytics/types/extension-events");
|
|
19
20
|
var _pluginKey = require("./plugin-key");
|
|
20
21
|
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; }
|
|
@@ -83,7 +84,7 @@ var insertMacroFromMacroBrowser = exports.insertMacroFromMacroBrowser = function
|
|
|
83
84
|
// Only scroll if we have anything to update, best to avoid surprise scroll
|
|
84
85
|
if (dispatch && tr.docChanged) {
|
|
85
86
|
_macroNode$attrs = macroNode.attrs, extensionType = _macroNode$attrs.extensionType, extensionKey = _macroNode$attrs.extensionKey, layout = _macroNode$attrs.layout, localId = _macroNode$attrs.localId;
|
|
86
|
-
(0,
|
|
87
|
+
(0, _analytics2.addAnalytics)(state, tr, {
|
|
87
88
|
action: _analytics.ACTION.UPDATED,
|
|
88
89
|
actionSubject: _analytics.ACTION_SUBJECT.EXTENSION,
|
|
89
90
|
actionSubjectId: macroNode.type.name,
|
|
@@ -28,7 +28,6 @@ var _util = require("../util");
|
|
|
28
28
|
var _transforms = require("@atlaskit/editor-common/transforms");
|
|
29
29
|
var _handlers = require("../handlers");
|
|
30
30
|
var _analytics2 = require("./analytics");
|
|
31
|
-
var _analytics3 = require("../../analytics");
|
|
32
31
|
var _utils3 = require("../../../utils");
|
|
33
32
|
var _commands = require("../commands");
|
|
34
33
|
var _utils4 = require("../../annotation/utils");
|
|
@@ -37,8 +36,6 @@ var _tinyMCE = require("../util/tinyMCE");
|
|
|
37
36
|
var _pluginFactory = require("./plugin-factory");
|
|
38
37
|
var _utils5 = require("@atlaskit/editor-prosemirror/utils");
|
|
39
38
|
var _actions = require("../actions");
|
|
40
|
-
// TODO: ED-20519 It requires full analytics extraction to use the plugin injection API
|
|
41
|
-
|
|
42
39
|
// TODO: ED-20519 It requires annotation extraction to use the plugin injection API
|
|
43
40
|
|
|
44
41
|
function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pluginInjectionApi, cardOptions, sanitizePrivateContent, providerFactory) {
|
|
@@ -116,7 +113,7 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
|
|
|
116
113
|
}
|
|
117
114
|
},
|
|
118
115
|
handlePaste: function handlePaste(view, rawEvent, slice) {
|
|
119
|
-
var _text, _analyticsPlugin$perf, _schema$nodes, _schema$nodes2, _schema$nodes3, _pluginInjectionApi$m;
|
|
116
|
+
var _text, _pluginInjectionApi$a2, _analyticsPlugin$perf, _schema$nodes, _schema$nodes2, _schema$nodes3, _pluginInjectionApi$m;
|
|
120
117
|
var event = rawEvent;
|
|
121
118
|
if (!event.clipboardData) {
|
|
122
119
|
return false;
|
|
@@ -162,7 +159,7 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
|
|
|
162
159
|
event.stopPropagation();
|
|
163
160
|
}
|
|
164
161
|
var state = view.state;
|
|
165
|
-
var analyticsPlugin =
|
|
162
|
+
var analyticsPlugin = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 || (_pluginInjectionApi$a2 = _pluginInjectionApi$a2.sharedState) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.currentState();
|
|
166
163
|
var pasteTrackingEnabled = analyticsPlugin === null || analyticsPlugin === void 0 || (_analyticsPlugin$perf = analyticsPlugin.performanceTracking) === null || _analyticsPlugin$perf === void 0 || (_analyticsPlugin$perf = _analyticsPlugin$perf.pasteTracking) === null || _analyticsPlugin$perf === void 0 ? void 0 : _analyticsPlugin$perf.enabled;
|
|
167
164
|
if (pasteTrackingEnabled) {
|
|
168
165
|
var content = (0, _analytics2.getContentNodeTypes)(slice.content);
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.onItemActivated = void 0;
|
|
7
7
|
var _commands = require("../../indentation/commands");
|
|
8
8
|
var _keymaps = require("../../tasks-and-decisions/pm-plugins/keymaps");
|
|
9
|
-
var _analytics = require("
|
|
9
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
10
10
|
var _indentationButtons = require("../pm-plugins/indentation-buttons");
|
|
11
11
|
var onItemActivated = exports.onItemActivated = function onItemActivated(pluginInjectionApi) {
|
|
12
12
|
return function (_ref) {
|
|
@@ -24,14 +24,15 @@ var onItemActivated = exports.onItemActivated = function onItemActivated(pluginI
|
|
|
24
24
|
var _indentationButtonsPl;
|
|
25
25
|
var node = (_indentationButtonsPl = _indentationButtons.pluginKey.getState(editorView.state)) === null || _indentationButtonsPl === void 0 ? void 0 : _indentationButtonsPl.node;
|
|
26
26
|
if (node === 'paragraph_heading') {
|
|
27
|
-
|
|
27
|
+
var _pluginInjectionApi$a;
|
|
28
|
+
(0, _commands.getIndentCommand)(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions)(_analytics.INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
28
29
|
}
|
|
29
30
|
if (node === 'list') {
|
|
30
31
|
pluginInjectionApi === null || pluginInjectionApi === void 0 || pluginInjectionApi.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.list.commands.indentList(_analytics.INPUT_METHOD.TOOLBAR));
|
|
31
32
|
}
|
|
32
33
|
if (node === 'taskList') {
|
|
33
|
-
var _pluginInjectionApi$
|
|
34
|
-
(0, _keymaps.getIndentCommand)(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$
|
|
34
|
+
var _pluginInjectionApi$a2;
|
|
35
|
+
(0, _keymaps.getIndentCommand)(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.actions)(_analytics.INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
35
36
|
}
|
|
36
37
|
break;
|
|
37
38
|
}
|
|
@@ -40,14 +41,15 @@ var onItemActivated = exports.onItemActivated = function onItemActivated(pluginI
|
|
|
40
41
|
var _indentationButtonsPl2;
|
|
41
42
|
var _node = (_indentationButtonsPl2 = _indentationButtons.pluginKey.getState(editorView.state)) === null || _indentationButtonsPl2 === void 0 ? void 0 : _indentationButtonsPl2.node;
|
|
42
43
|
if (_node === 'paragraph_heading') {
|
|
43
|
-
|
|
44
|
+
var _pluginInjectionApi$a3;
|
|
45
|
+
(0, _commands.getOutdentCommand)(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a3 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : _pluginInjectionApi$a3.actions)(_analytics.INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
44
46
|
}
|
|
45
47
|
if (_node === 'list') {
|
|
46
48
|
pluginInjectionApi === null || pluginInjectionApi === void 0 || pluginInjectionApi.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.list.commands.outdentList(_analytics.INPUT_METHOD.TOOLBAR));
|
|
47
49
|
}
|
|
48
50
|
if (_node === 'taskList') {
|
|
49
|
-
var _pluginInjectionApi$
|
|
50
|
-
(0, _keymaps.getUnindentCommand)(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$
|
|
51
|
+
var _pluginInjectionApi$a4;
|
|
52
|
+
(0, _keymaps.getUnindentCommand)(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a4 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a4 === void 0 ? void 0 : _pluginInjectionApi$a4.actions)(_analytics.INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
51
53
|
}
|
|
52
54
|
break;
|
|
53
55
|
}
|
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.InputSource = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
8
8
|
var InputSource = exports.InputSource = function (InputSource) {
|
|
9
|
-
InputSource[InputSource["TOOLBAR"] =
|
|
10
|
-
InputSource[InputSource["KEYBOARD"] =
|
|
9
|
+
InputSource[InputSource["TOOLBAR"] = _analytics.INPUT_METHOD.TOOLBAR] = "TOOLBAR";
|
|
10
|
+
InputSource[InputSource["KEYBOARD"] = _analytics.INPUT_METHOD.KEYBOARD] = "KEYBOARD";
|
|
11
11
|
return InputSource;
|
|
12
12
|
}({});
|
|
@@ -18,8 +18,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
18
18
|
var _reactIntlNext = require("react-intl-next");
|
|
19
19
|
var _sectionMessage = _interopRequireDefault(require("@atlaskit/section-message"));
|
|
20
20
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
21
|
-
var _analytics = require("
|
|
22
|
-
var _consts = require("../../plugins/analytics/consts");
|
|
21
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
23
22
|
var _messages = require("./messages");
|
|
24
23
|
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); }; }
|
|
25
24
|
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; } }
|
|
@@ -73,7 +72,7 @@ var FormErrorBoundaryInner = /*#__PURE__*/function (_React$Component) {
|
|
|
73
72
|
if (!createAnalyticsEvent) {
|
|
74
73
|
// eslint-disable-next-line no-console
|
|
75
74
|
console.error('ConfigPanel FormErrorBoundary: Missing `createAnalyticsEvent`', {
|
|
76
|
-
channel:
|
|
75
|
+
channel: _analytics.editorAnalyticsChannel,
|
|
77
76
|
product: product,
|
|
78
77
|
error: analyticsErrorPayload
|
|
79
78
|
});
|
|
@@ -96,7 +95,7 @@ var FormErrorBoundaryInner = /*#__PURE__*/function (_React$Component) {
|
|
|
96
95
|
errorStack: errorStack
|
|
97
96
|
}
|
|
98
97
|
};
|
|
99
|
-
createAnalyticsEvent(payload).fire(
|
|
98
|
+
createAnalyticsEvent(payload).fire(_analytics.editorAnalyticsChannel);
|
|
100
99
|
}).catch(function (e) {
|
|
101
100
|
// eslint-disable-next-line no-console
|
|
102
101
|
console.error('Failed to resolve product name from contextIdentifierProvider.', e);
|
|
@@ -14,7 +14,7 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
15
|
var _react = _interopRequireDefault(require("react"));
|
|
16
16
|
var _monitoring = require("@atlaskit/editor-common/monitoring");
|
|
17
|
-
var _analytics = require("
|
|
17
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
18
18
|
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); }; }
|
|
19
19
|
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; } }
|
|
20
20
|
var ErrorBoundary = exports.ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
@@ -26,7 +26,7 @@ var _customThemeButton = _interopRequireDefault(require("@atlaskit/button/custom
|
|
|
26
26
|
var _ToolbarButton = _interopRequireDefault(require("../ToolbarButton"));
|
|
27
27
|
var _withOuterListeners = _interopRequireDefault(require("../with-outer-listeners"));
|
|
28
28
|
var _styles = require("./styles");
|
|
29
|
-
var _analytics = require("
|
|
29
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
30
30
|
var _eventDispatcher = require("../../event-dispatcher");
|
|
31
31
|
var _feedbackDialog = require("../../plugins/feedback-dialog");
|
|
32
32
|
var _deprecationWarnings = _interopRequireDefault(require("../../utils/deprecation-warnings"));
|
|
@@ -14,7 +14,7 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
15
|
var _react = _interopRequireDefault(require("react"));
|
|
16
16
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
|
-
var _analytics = require("
|
|
17
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
18
18
|
var _eventDispatcher = require("../../event-dispatcher");
|
|
19
19
|
var _consts = require("../../plugins/analytics/consts");
|
|
20
20
|
var _editorPluginHelpDialog = require("@atlaskit/editor-plugin-help-dialog");
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.version = exports.nextMajorVersion = exports.name = void 0;
|
|
7
7
|
var name = exports.name = "@atlaskit/editor-core";
|
|
8
|
-
var version = exports.version = "189.1.
|
|
8
|
+
var version = exports.version = "189.1.5";
|
|
9
9
|
var nextMajorVersion = exports.nextMajorVersion = function nextMajorVersion() {
|
|
10
10
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
|
11
11
|
};
|
|
@@ -4,8 +4,7 @@ import uuid from 'uuid';
|
|
|
4
4
|
import { ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
5
5
|
import { IntlErrorBoundary } from '@atlaskit/editor-common/ui';
|
|
6
6
|
import { sniffUserBrowserExtensions } from '@atlaskit/editor-common/utils';
|
|
7
|
-
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '
|
|
8
|
-
import { editorAnalyticsChannel } from '../plugins/analytics/consts';
|
|
7
|
+
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, editorAnalyticsChannel } from '@atlaskit/editor-common/analytics';
|
|
9
8
|
import { getDocStructure } from '../utils/document-logger';
|
|
10
9
|
import { WithEditorView } from './WithEditorView';
|
|
11
10
|
import { isOutdatedBrowser } from '@atlaskit/editor-common/utils';
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import analyticsPlugin from './plugin';
|
|
2
|
-
import { analyticsPluginKey as pluginKey } from './plugin-key';
|
|
3
|
-
export { ACTION_SUBJECT_ID, ACTION_SUBJECT, ACTION, BROWSER_FREEZE_INTERACTION_TYPE, EVENT_TYPE, FULL_WIDTH_MODE, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, MODE, PasteContents, PasteSources, PasteTypes, PLATFORMS, PUNC, SYMBOL, TABLE_ACTION, TABLE_BREAKOUT, TRIGGER_METHOD, USER_CONTEXT, DELETE_DIRECTION, fireAnalyticsEvent, getAnalyticsEventsFromTransaction } from '@atlaskit/editor-common/analytics';
|
|
4
2
|
export { withAnalytics, addAnalytics } from './utils';
|
|
5
|
-
export const analyticsPluginKey = pluginKey;
|
|
6
3
|
export default analyticsPlugin;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
2
2
|
import { createCommand } from '../pm-plugins/plugin-factory';
|
|
3
|
-
import { INPUT_METHOD } from '
|
|
3
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { isSelectionValid, getPluginState } from '../utils';
|
|
5
5
|
import { ACTIONS } from '../pm-plugins/types';
|
|
6
6
|
import transform from './transform';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RESOLVE_METHOD } from '
|
|
1
|
+
import { RESOLVE_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
3
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
import { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
2
2
|
import { bindKeymapWithCommand, addInlineComment } from '../../../keymaps';
|
|
3
3
|
import { setInlineCommentDraftState } from '../commands';
|
|
4
|
-
import { INPUT_METHOD } from '
|
|
4
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
export function keymapPlugin(editorAnalyticsAPI) {
|
|
6
6
|
const list = {};
|
|
7
7
|
bindKeymapWithCommand(addInlineComment.common, setInlineCommentDraftState(editorAnalyticsAPI)(true, INPUT_METHOD.SHORTCUT), list);
|
|
@@ -4,9 +4,9 @@ import { AnnotationViewWrapper } from './AnnotationViewWrapper';
|
|
|
4
4
|
import { AnnotationTestIds } from '../types';
|
|
5
5
|
import { getAnnotationViewKey, getSelectionPositions, getPluginState, getAllAnnotations } from '../utils';
|
|
6
6
|
import { removeInlineCommentNearSelection, updateInlineCommentResolvedState, setInlineCommentDraftState, createAnnotation, closeComponent } from '../commands';
|
|
7
|
-
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '
|
|
8
|
-
import { CONTENT_COMPONENT } from '
|
|
9
|
-
import { RESOLVE_METHOD } from '
|
|
7
|
+
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
|
|
8
|
+
import { CONTENT_COMPONENT } from '@atlaskit/editor-common/analytics';
|
|
9
|
+
import { RESOLVE_METHOD } from '@atlaskit/editor-common/analytics';
|
|
10
10
|
const findPosForDOM = sel => {
|
|
11
11
|
const {
|
|
12
12
|
$from,
|
|
@@ -4,7 +4,7 @@ import { css, jsx } from '@emotion/react';
|
|
|
4
4
|
import AvatarsWithPluginState from '../../collab-edit/ui/avatars-with-plugin-state';
|
|
5
5
|
import { useIntl } from 'react-intl-next';
|
|
6
6
|
import { avatarGroupMessages } from '../messages';
|
|
7
|
-
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '
|
|
7
|
+
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
|
|
8
8
|
const toolbarButtonWrapper = css`
|
|
9
9
|
display: flex;
|
|
10
10
|
justify-content: flex-end;
|
|
@@ -4,7 +4,7 @@ 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
6
|
import { addAnalytics } from '../analytics/utils';
|
|
7
|
-
import { EVENT_TYPE, ACTION, ACTION_SUBJECT } from '
|
|
7
|
+
import { EVENT_TYPE, ACTION, ACTION_SUBJECT } from '@atlaskit/editor-common/analytics';
|
|
8
8
|
// TODO: https://product-fabric.atlassian.net/browse/DSP-7269
|
|
9
9
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
10
10
|
export const colors = [themeColors.R100, themeColors.R300, themeColors.R500, themeColors.Y100, themeColors.Y300, themeColors.Y500, themeColors.G100, themeColors.G300, themeColors.G500, themeColors.T100, themeColors.T300, themeColors.T500, themeColors.B100, themeColors.B300, themeColors.B500, themeColors.P100, themeColors.P300, themeColors.P500, themeColors.N70, themeColors.N200, themeColors.N800].map(solid => ({
|
|
@@ -1,7 +1,8 @@
|
|
|
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
|
|
4
|
+
import { ACTION, ACTION_SUBJECT, INPUT_METHOD, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
5
|
+
import { addAnalytics } from '../analytics';
|
|
5
6
|
import { TARGET_SELECTION_SOURCE } from '../analytics/types/extension-events';
|
|
6
7
|
import { findExtensionWithLocalId } from './utils';
|
|
7
8
|
import { getPluginState } from './pm-plugins/main';
|
|
@@ -7,7 +7,8 @@ import { pluginKey as macroPluginKey } from '../macro/plugin-key';
|
|
|
7
7
|
import { nodeToJSON } from '../../utils';
|
|
8
8
|
import { setEditingContextToContextPanel } from './commands';
|
|
9
9
|
import { findNodePosWithLocalId, getDataConsumerMark, getNodeTypesReferenced, getSelectedExtension } from './utils';
|
|
10
|
-
import {
|
|
10
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
11
|
+
import { addAnalytics } from '../analytics';
|
|
11
12
|
import { setTextSelection } from '@atlaskit/editor-prosemirror/utils';
|
|
12
13
|
export const getEditInLegacyMacroBrowser = ({
|
|
13
14
|
view,
|
|
@@ -4,7 +4,7 @@ import WithPluginState from '../../ui/WithPluginState';
|
|
|
4
4
|
import { cancelSearchWithAnalytics, replaceWithAnalytics, replaceAllWithAnalytics, findWithAnalytics, findNextWithAnalytics, findPrevWithAnalytics, activateWithAnalytics } from './commands-with-analytics';
|
|
5
5
|
import { blur, toggleMatchCase } from './commands';
|
|
6
6
|
import FindReplaceToolbarButton from './ui/FindReplaceToolbarButton';
|
|
7
|
-
import { TRIGGER_METHOD } from '
|
|
7
|
+
import { TRIGGER_METHOD } from '@atlaskit/editor-common/analytics';
|
|
8
8
|
const FindReplaceToolbarButtonWithState = props => {
|
|
9
9
|
const {
|
|
10
10
|
popupsBoundariesElement,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import { withAnalytics
|
|
2
|
+
import { withAnalytics } from '../analytics';
|
|
3
|
+
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
4
|
import { activate, find, findNext, findPrevious, replace, replaceAll, cancelSearch } from './commands';
|
|
4
5
|
export const activateWithAnalytics = ({
|
|
5
6
|
triggerMethod
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
2
2
|
import { bindKeymapWithCommand, find as findKeymap } from '../../keymaps';
|
|
3
3
|
import { activateWithAnalytics } from './commands-with-analytics';
|
|
4
|
-
import { TRIGGER_METHOD } from '
|
|
4
|
+
import { TRIGGER_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
const activateFindReplace = () => (state, dispatch) => {
|
|
6
6
|
activateWithAnalytics({
|
|
7
7
|
triggerMethod: TRIGGER_METHOD.SHORTCUT
|
|
@@ -10,7 +10,7 @@ import ChevronUpIcon from '@atlaskit/icon/glyph/hipchat/chevron-up';
|
|
|
10
10
|
import MatchCaseIcon from '@atlaskit/icon/glyph/emoji/keyboard';
|
|
11
11
|
import Textfield from '@atlaskit/textfield';
|
|
12
12
|
import { countStyles, sectionWrapperStyles } from './styles';
|
|
13
|
-
import { TRIGGER_METHOD } from '
|
|
13
|
+
import { TRIGGER_METHOD } from '@atlaskit/editor-common/analytics';
|
|
14
14
|
import { FindReplaceTooltipButton } from './FindReplaceTooltipButton';
|
|
15
15
|
import rafSchd from 'raf-schd';
|
|
16
16
|
export const FIND_DEBOUNCE_MS = 100;
|
|
@@ -9,7 +9,7 @@ import ToolbarButton, { TOOLBAR_BUTTON } from '../../../ui/ToolbarButton';
|
|
|
9
9
|
import { Dropdown, ArrowKeyNavigationType } from '@atlaskit/editor-common/ui-menu';
|
|
10
10
|
import EditorSearchIcon from '@atlaskit/icon/glyph/editor/search';
|
|
11
11
|
import FindReplace from './FindReplace';
|
|
12
|
-
import { TRIGGER_METHOD } from '
|
|
12
|
+
import { TRIGGER_METHOD } from '@atlaskit/editor-common/analytics';
|
|
13
13
|
import { ToolTipContent, findKeymapByDescription, tooltip } from '../../../keymaps';
|
|
14
14
|
import { getAriaKeyshortcuts } from '@atlaskit/editor-common/keymaps';
|
|
15
15
|
const toolbarButtonWrapper = css`
|
|
@@ -6,7 +6,7 @@ import Button from '@atlaskit/button/standard-button';
|
|
|
6
6
|
import { defineMessages, injectIntl } from 'react-intl-next';
|
|
7
7
|
import Textfield from '@atlaskit/textfield';
|
|
8
8
|
import { sectionWrapperStyles, replaceSectionButtonStyles } from './styles';
|
|
9
|
-
import { EVENT_TYPE, ACTION, ACTION_SUBJECT, TRIGGER_METHOD } from '
|
|
9
|
+
import { EVENT_TYPE, ACTION, ACTION_SUBJECT, TRIGGER_METHOD } from '@atlaskit/editor-common/analytics';
|
|
10
10
|
const messages = defineMessages({
|
|
11
11
|
replaceWith: {
|
|
12
12
|
id: 'fabric.editor.replaceWith',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { toggleBlockMark } from '../../../commands';
|
|
2
2
|
import { createAnalyticsDispatch } from './utils';
|
|
3
|
-
import { INDENT_DIRECTION, INPUT_METHOD } from '
|
|
3
|
+
import { INDENT_DIRECTION, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import getAttrsWithChangesRecorder from '../../../utils/getAttrsWithChangesRecorder';
|
|
5
5
|
export const MAX_INDENTATION_LEVEL = 6;
|
|
6
6
|
export const isIndentationAllowed = (schema, node) => {
|
|
@@ -38,7 +38,8 @@ function createIndentationCommand(getNewIndentationAttrs) {
|
|
|
38
38
|
function createIndentationCommandWithAnalytics({
|
|
39
39
|
getNewIndentationAttrs,
|
|
40
40
|
direction,
|
|
41
|
-
inputMethod
|
|
41
|
+
inputMethod,
|
|
42
|
+
editorAnalyticsAPI
|
|
42
43
|
}) {
|
|
43
44
|
// Create a new getAttrs function to record the changes
|
|
44
45
|
const {
|
|
@@ -56,6 +57,7 @@ function createIndentationCommandWithAnalytics({
|
|
|
56
57
|
return indentationCommand(state, createAnalyticsDispatch({
|
|
57
58
|
getAttrsChanges: getAndResetAttrsChanges,
|
|
58
59
|
inputMethod,
|
|
60
|
+
editorAnalyticsAPI,
|
|
59
61
|
state,
|
|
60
62
|
dispatch
|
|
61
63
|
}));
|
|
@@ -88,10 +90,11 @@ const getIndentAttrs = oldAttr => {
|
|
|
88
90
|
}; // Otherwise, increase the level by one
|
|
89
91
|
};
|
|
90
92
|
|
|
91
|
-
export const getIndentCommand = (inputMethod = INPUT_METHOD.KEYBOARD) => createIndentationCommandWithAnalytics({
|
|
93
|
+
export const getIndentCommand = editorAnalyticsAPI => (inputMethod = INPUT_METHOD.KEYBOARD) => createIndentationCommandWithAnalytics({
|
|
92
94
|
getNewIndentationAttrs: getIndentAttrs,
|
|
93
95
|
direction: INDENT_DIRECTION.INDENT,
|
|
94
|
-
inputMethod
|
|
96
|
+
inputMethod,
|
|
97
|
+
editorAnalyticsAPI
|
|
95
98
|
});
|
|
96
99
|
|
|
97
100
|
/**
|
|
@@ -118,9 +121,10 @@ const getOutdentAttrs = oldAttr => {
|
|
|
118
121
|
}; // Decrease the level on other cases
|
|
119
122
|
};
|
|
120
123
|
|
|
121
|
-
export const getOutdentCommand = (inputMethod = INPUT_METHOD.KEYBOARD) => createIndentationCommandWithAnalytics({
|
|
124
|
+
export const getOutdentCommand = editorAnalyticsAPI => (inputMethod = INPUT_METHOD.KEYBOARD) => createIndentationCommandWithAnalytics({
|
|
122
125
|
getNewIndentationAttrs: getOutdentAttrs,
|
|
123
126
|
direction: INDENT_DIRECTION.OUTDENT,
|
|
124
|
-
inputMethod
|
|
127
|
+
inputMethod,
|
|
128
|
+
editorAnalyticsAPI
|
|
125
129
|
});
|
|
126
130
|
export const removeIndentation = (state, dispatch) => toggleBlockMark(state.schema.marks.indentation, () => false)(state, dispatch);
|