@atlaskit/editor-plugin-highlight 1.11.3 → 1.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/cjs/commands/change-color.js +6 -4
- package/dist/cjs/commands/index.js +3 -4
- package/dist/cjs/commands/palette.js +56 -0
- package/dist/cjs/pm-plugins/keymap.js +4 -1
- package/dist/cjs/pm-plugins/main.js +2 -2
- package/dist/cjs/ui/FloatingToolbarHighlightColor.js +21 -4
- package/dist/cjs/ui/PrimaryToolbarHighlightColor.js +11 -4
- package/dist/cjs/ui/ToolbarHighlightColor.js +8 -3
- package/dist/cjs/ui/shared/useDropdownEvents.js +5 -2
- package/dist/es2019/commands/change-color.js +6 -4
- package/dist/es2019/commands/index.js +1 -2
- package/dist/es2019/commands/palette.js +44 -0
- package/dist/es2019/pm-plugins/keymap.js +4 -1
- package/dist/es2019/pm-plugins/main.js +2 -2
- package/dist/es2019/ui/FloatingToolbarHighlightColor.js +20 -3
- package/dist/es2019/ui/PrimaryToolbarHighlightColor.js +11 -4
- package/dist/es2019/ui/ToolbarHighlightColor.js +8 -3
- package/dist/es2019/ui/shared/useDropdownEvents.js +6 -2
- package/dist/esm/commands/change-color.js +6 -4
- package/dist/esm/commands/index.js +1 -2
- package/dist/esm/commands/palette.js +50 -0
- package/dist/esm/pm-plugins/keymap.js +4 -1
- package/dist/esm/pm-plugins/main.js +2 -2
- package/dist/esm/ui/FloatingToolbarHighlightColor.js +21 -4
- package/dist/esm/ui/PrimaryToolbarHighlightColor.js +11 -4
- package/dist/esm/ui/ToolbarHighlightColor.js +8 -3
- package/dist/esm/ui/shared/useDropdownEvents.js +5 -2
- package/dist/types/commands/change-color.d.ts +3 -2
- package/dist/types/commands/index.d.ts +1 -2
- package/dist/types/commands/palette.d.ts +10 -0
- package/dist/types/plugin.d.ts +2 -0
- package/dist/types/pm-plugins/main.d.ts +1 -1
- package/dist/types/ui/FloatingToolbarHighlightColor.d.ts +1 -1
- package/dist/types/ui/ToolbarHighlightColor.d.ts +1 -1
- package/dist/types/ui/shared/useDropdownEvents.d.ts +7 -3
- package/dist/types-ts4.5/commands/change-color.d.ts +3 -2
- package/dist/types-ts4.5/commands/index.d.ts +1 -2
- package/dist/types-ts4.5/commands/palette.d.ts +10 -0
- package/dist/types-ts4.5/plugin.d.ts +2 -0
- package/dist/types-ts4.5/pm-plugins/main.d.ts +1 -1
- package/dist/types-ts4.5/ui/FloatingToolbarHighlightColor.d.ts +1 -1
- package/dist/types-ts4.5/ui/ToolbarHighlightColor.d.ts +1 -1
- package/dist/types-ts4.5/ui/shared/useDropdownEvents.d.ts +7 -3
- package/package.json +2 -2
- package/dist/cjs/commands/set-palette.js +0 -39
- package/dist/cjs/commands/toggle-palette.js +0 -40
- package/dist/es2019/commands/set-palette.js +0 -31
- package/dist/es2019/commands/toggle-palette.js +0 -32
- package/dist/esm/commands/set-palette.js +0 -33
- package/dist/esm/commands/toggle-palette.js +0 -34
- package/dist/types/commands/set-palette.d.ts +0 -3
- package/dist/types/commands/toggle-palette.d.ts +0 -3
- package/dist/types-ts4.5/commands/set-palette.d.ts +0 -3
- package/dist/types-ts4.5/commands/toggle-palette.d.ts +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-highlight
|
|
2
2
|
|
|
3
|
+
## 1.12.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 1.12.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#116586](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/116586)
|
|
14
|
+
[`3e6333e4a0fbd`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3e6333e4a0fbd) -
|
|
15
|
+
[ED-23761] Add analytics for floating toolbar text highlighting experiment
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 1.11.3
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -11,14 +11,15 @@ var _main = require("../pm-plugins/main");
|
|
|
11
11
|
var _color = require("../utils/color");
|
|
12
12
|
var changeColor = exports.changeColor = function changeColor(editorAnalyticsAPI) {
|
|
13
13
|
return function (_ref) {
|
|
14
|
-
var color = _ref.color
|
|
14
|
+
var color = _ref.color,
|
|
15
|
+
inputMethod = _ref.inputMethod;
|
|
15
16
|
return function (_ref2) {
|
|
16
17
|
var tr = _ref2.tr;
|
|
17
18
|
var backgroundColor = tr.doc.type.schema.marks.backgroundColor;
|
|
18
19
|
if (!backgroundColor) {
|
|
19
20
|
return null;
|
|
20
21
|
}
|
|
21
|
-
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent(createAnalyticsEvent(color, tr))(tr);
|
|
22
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent(createAnalyticsEvent(color, inputMethod, tr))(tr);
|
|
22
23
|
tr.scrollIntoView();
|
|
23
24
|
if (color === _uiColor.REMOVE_HIGHLIGHT_COLOR) {
|
|
24
25
|
(0, _mark.removeMark)(backgroundColor)({
|
|
@@ -39,7 +40,7 @@ var changeColor = exports.changeColor = function changeColor(editorAnalyticsAPI)
|
|
|
39
40
|
};
|
|
40
41
|
};
|
|
41
42
|
};
|
|
42
|
-
var createAnalyticsEvent = function createAnalyticsEvent(color, tr) {
|
|
43
|
+
var createAnalyticsEvent = function createAnalyticsEvent(color, inputMethod, tr) {
|
|
43
44
|
var _getActiveColor;
|
|
44
45
|
var previousColor = (_getActiveColor = (0, _color.getActiveColor)(tr)) !== null && _getActiveColor !== void 0 ? _getActiveColor : _uiColor.REMOVE_HIGHLIGHT_COLOR;
|
|
45
46
|
// get color names from palette
|
|
@@ -60,7 +61,8 @@ var createAnalyticsEvent = function createAnalyticsEvent(color, tr) {
|
|
|
60
61
|
eventType: _analytics.EVENT_TYPE.TRACK,
|
|
61
62
|
attributes: {
|
|
62
63
|
newColor: newColorLabel.toLowerCase(),
|
|
63
|
-
previousColor: previousColorLabel ? previousColorLabel.toLowerCase() : ''
|
|
64
|
+
previousColor: previousColorLabel ? previousColorLabel.toLowerCase() : '',
|
|
65
|
+
inputMethod: inputMethod
|
|
64
66
|
}
|
|
65
67
|
};
|
|
66
68
|
};
|
|
@@ -12,15 +12,14 @@ Object.defineProperty(exports, "changeColor", {
|
|
|
12
12
|
Object.defineProperty(exports, "setPalette", {
|
|
13
13
|
enumerable: true,
|
|
14
14
|
get: function get() {
|
|
15
|
-
return
|
|
15
|
+
return _palette.setPalette;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "togglePalette", {
|
|
19
19
|
enumerable: true,
|
|
20
20
|
get: function get() {
|
|
21
|
-
return
|
|
21
|
+
return _palette.togglePalette;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
var _changeColor = require("./change-color");
|
|
25
|
-
var
|
|
26
|
-
var _setPalette = require("./set-palette");
|
|
25
|
+
var _palette = require("./palette");
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.togglePalette = exports.setPalette = void 0;
|
|
7
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
8
|
+
var _main = require("../pm-plugins/main");
|
|
9
|
+
var togglePalette = exports.togglePalette = function togglePalette(api) {
|
|
10
|
+
return function (_ref) {
|
|
11
|
+
var inputMethod = _ref.inputMethod;
|
|
12
|
+
return function (state, dispatch) {
|
|
13
|
+
var _highlightPluginKey$g;
|
|
14
|
+
var isPaletteOpen = (_highlightPluginKey$g = _main.highlightPluginKey.getState(state)) === null || _highlightPluginKey$g === void 0 ? void 0 : _highlightPluginKey$g.isPaletteOpen;
|
|
15
|
+
return setPalette(api)({
|
|
16
|
+
isPaletteOpen: !isPaletteOpen,
|
|
17
|
+
inputMethod: inputMethod
|
|
18
|
+
})(state, dispatch);
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
var setPalette = exports.setPalette = function setPalette(api) {
|
|
23
|
+
return function (_ref2) {
|
|
24
|
+
var isPaletteOpen = _ref2.isPaletteOpen,
|
|
25
|
+
inputMethod = _ref2.inputMethod;
|
|
26
|
+
return function (state, dispatch) {
|
|
27
|
+
var _highlightPluginKey$g2;
|
|
28
|
+
var isDisabled = (_highlightPluginKey$g2 = _main.highlightPluginKey.getState(state)) === null || _highlightPluginKey$g2 === void 0 ? void 0 : _highlightPluginKey$g2.disabled;
|
|
29
|
+
if (!isDisabled) {
|
|
30
|
+
var _api$analytics;
|
|
31
|
+
var tr = state.tr;
|
|
32
|
+
tr.setMeta(_main.highlightPluginKey, {
|
|
33
|
+
type: _main.HighlightPluginAction.SET_PALETTE,
|
|
34
|
+
isPaletteOpen: isPaletteOpen
|
|
35
|
+
});
|
|
36
|
+
(_api$analytics = api.analytics) === null || _api$analytics === void 0 || _api$analytics.actions.attachAnalyticsEvent(createAnalyticsEvent(isPaletteOpen, inputMethod))(tr);
|
|
37
|
+
if (dispatch) {
|
|
38
|
+
dispatch(tr);
|
|
39
|
+
}
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
return false;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
var createAnalyticsEvent = function createAnalyticsEvent(isPaletteOpen, inputMethod) {
|
|
47
|
+
return {
|
|
48
|
+
action: isPaletteOpen ? _analytics.ACTION.OPENED : _analytics.ACTION.CLOSED,
|
|
49
|
+
actionSubject: _analytics.ACTION_SUBJECT.TOOLBAR,
|
|
50
|
+
actionSubjectId: _analytics.ACTION_SUBJECT_ID.FORMAT_BACKGROUND_COLOR,
|
|
51
|
+
eventType: _analytics.EVENT_TYPE.TRACK,
|
|
52
|
+
attributes: {
|
|
53
|
+
inputMethod: inputMethod
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
};
|
|
@@ -4,11 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.keymapPlugin = keymapPlugin;
|
|
7
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
7
8
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
8
9
|
var _commands = require("../commands");
|
|
9
10
|
function keymapPlugin(_ref) {
|
|
10
11
|
var api = _ref.api;
|
|
11
12
|
var list = {};
|
|
12
|
-
(0, _keymaps.bindKeymapWithCommand)(_keymaps.toggleHighlightPalette.common, (0, _commands.togglePalette)(api)
|
|
13
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.toggleHighlightPalette.common, (0, _commands.togglePalette)(api)({
|
|
14
|
+
inputMethod: _analytics.INPUT_METHOD.SHORTCUT
|
|
15
|
+
}), list);
|
|
13
16
|
return (0, _keymaps.keymap)(list);
|
|
14
17
|
}
|
|
@@ -15,7 +15,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
15
15
|
var highlightPluginKey = exports.highlightPluginKey = new _state.PluginKey('highlight');
|
|
16
16
|
var HighlightPluginAction = exports.HighlightPluginAction = /*#__PURE__*/function (HighlightPluginAction) {
|
|
17
17
|
HighlightPluginAction[HighlightPluginAction["CHANGE_COLOR"] = 0] = "CHANGE_COLOR";
|
|
18
|
-
HighlightPluginAction[HighlightPluginAction["
|
|
18
|
+
HighlightPluginAction[HighlightPluginAction["SET_PALETTE"] = 1] = "SET_PALETTE";
|
|
19
19
|
return HighlightPluginAction;
|
|
20
20
|
}({});
|
|
21
21
|
var createPlugin = exports.createPlugin = function createPlugin(_ref) {
|
|
@@ -40,7 +40,7 @@ var createPlugin = exports.createPlugin = function createPlugin(_ref) {
|
|
|
40
40
|
return _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
41
41
|
activeColor: color
|
|
42
42
|
});
|
|
43
|
-
case HighlightPluginAction.
|
|
43
|
+
case HighlightPluginAction.SET_PALETTE:
|
|
44
44
|
var _tr$getMeta3 = tr.getMeta(highlightPluginKey),
|
|
45
45
|
isPaletteOpen = _tr$getMeta3.isPaletteOpen;
|
|
46
46
|
return _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
@@ -9,6 +9,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
9
9
|
var _react = require("react");
|
|
10
10
|
var _react2 = require("@emotion/react");
|
|
11
11
|
var _reactIntlNext = require("react-intl-next");
|
|
12
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
12
13
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
13
14
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
14
15
|
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
@@ -31,15 +32,28 @@ var FloatingToolbarHighlightColor = function FloatingToolbarHighlightColor(_ref)
|
|
|
31
32
|
var pluginInjectionApi = _ref.pluginInjectionApi,
|
|
32
33
|
formatMessage = _ref.intl.formatMessage;
|
|
33
34
|
var toolbarItemRef = (0, _react.useRef)(null);
|
|
34
|
-
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['highlight']),
|
|
35
|
-
highlightState = _useSharedPluginState.highlightState;
|
|
36
35
|
var _useState = (0, _react.useState)(false),
|
|
37
36
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
38
37
|
isDropdownOpen = _useState2[0],
|
|
39
38
|
setIsDropdownOpen = _useState2[1];
|
|
39
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['highlight']),
|
|
40
|
+
highlightState = _useSharedPluginState.highlightState;
|
|
41
|
+
var setDropdownOpen = function setDropdownOpen(isOpen) {
|
|
42
|
+
var _pluginInjectionApi$a;
|
|
43
|
+
setIsDropdownOpen(isOpen);
|
|
44
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 || _pluginInjectionApi$a.actions.fireAnalyticsEvent({
|
|
45
|
+
action: isOpen ? _analytics.ACTION.OPENED : _analytics.ACTION.CLOSED,
|
|
46
|
+
actionSubject: _analytics.ACTION_SUBJECT.TOOLBAR,
|
|
47
|
+
actionSubjectId: _analytics.ACTION_SUBJECT_ID.FORMAT_BACKGROUND_COLOR,
|
|
48
|
+
eventType: _analytics.EVENT_TYPE.TRACK,
|
|
49
|
+
attributes: {
|
|
50
|
+
inputMethod: _analytics.INPUT_METHOD.FLOATING_TB
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
};
|
|
40
54
|
var _useDropdownEvents = (0, _useDropdownEvents2.useDropdownEvents)({
|
|
41
55
|
toolbarItemRef: toolbarItemRef,
|
|
42
|
-
setIsDropdownOpen:
|
|
56
|
+
setIsDropdownOpen: setDropdownOpen,
|
|
43
57
|
isDropdownOpen: isDropdownOpen,
|
|
44
58
|
pluginInjectionApi: pluginInjectionApi
|
|
45
59
|
}),
|
|
@@ -87,7 +101,10 @@ var FloatingToolbarHighlightColor = function FloatingToolbarHighlightColor(_ref)
|
|
|
87
101
|
}))
|
|
88
102
|
}, formatMessage(_messages.highlightMessages.highlightFloatingToolbar)),
|
|
89
103
|
onColorChange: function onColorChange(color) {
|
|
90
|
-
return handleColorChange(
|
|
104
|
+
return handleColorChange({
|
|
105
|
+
color: color,
|
|
106
|
+
inputMethod: _analytics.INPUT_METHOD.FLOATING_TB
|
|
107
|
+
});
|
|
91
108
|
},
|
|
92
109
|
isOpenedByKeyboard: isOpenedByKeyboard,
|
|
93
110
|
handleClickOutside: handleClickOutside,
|
|
@@ -8,6 +8,7 @@ exports.PrimaryToolbarHighlightColorWithIntl = void 0;
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _react2 = require("@emotion/react");
|
|
10
10
|
var _reactIntlNext = require("react-intl-next");
|
|
11
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
11
12
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
12
13
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
13
14
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
@@ -36,17 +37,20 @@ var PrimaryToolbarHighlightColor = function PrimaryToolbarHighlightColor(_ref) {
|
|
|
36
37
|
var toolbarItemRef = (0, _react.useRef)(null);
|
|
37
38
|
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['highlight']),
|
|
38
39
|
highlightState = _useSharedPluginState.highlightState;
|
|
39
|
-
var
|
|
40
|
+
var setIsDropdownOpen = function setIsDropdownOpen(isOpen) {
|
|
40
41
|
if (!(highlightState !== null && highlightState !== void 0 && highlightState.disabled)) {
|
|
41
42
|
var state = editorView.state,
|
|
42
43
|
dispatch = editorView.dispatch;
|
|
43
|
-
(0, _commands.setPalette)(pluginInjectionApi
|
|
44
|
+
(0, _commands.setPalette)(pluginInjectionApi)({
|
|
45
|
+
isPaletteOpen: isOpen,
|
|
46
|
+
inputMethod: _analytics.INPUT_METHOD.TOOLBAR
|
|
47
|
+
})(state, dispatch);
|
|
44
48
|
}
|
|
45
49
|
};
|
|
46
50
|
var isDropdownOpen = !!(highlightState !== null && highlightState !== void 0 && highlightState.isPaletteOpen);
|
|
47
51
|
var _useDropdownEvents = (0, _useDropdownEvents2.useDropdownEvents)({
|
|
48
52
|
toolbarItemRef: toolbarItemRef,
|
|
49
|
-
setIsDropdownOpen:
|
|
53
|
+
setIsDropdownOpen: setIsDropdownOpen,
|
|
50
54
|
isDropdownOpen: isDropdownOpen,
|
|
51
55
|
pluginInjectionApi: pluginInjectionApi
|
|
52
56
|
}),
|
|
@@ -97,7 +101,10 @@ var PrimaryToolbarHighlightColor = function PrimaryToolbarHighlightColor(_ref) {
|
|
|
97
101
|
})))
|
|
98
102
|
}),
|
|
99
103
|
onColorChange: function onColorChange(color) {
|
|
100
|
-
return handleColorChange(
|
|
104
|
+
return handleColorChange({
|
|
105
|
+
color: color,
|
|
106
|
+
inputMethod: _analytics.INPUT_METHOD.TOOLBAR
|
|
107
|
+
});
|
|
101
108
|
},
|
|
102
109
|
isOpenedByKeyboard: isOpenedByKeyboard,
|
|
103
110
|
handleClickOutside: handleClickOutside,
|
|
@@ -10,6 +10,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _react2 = require("@emotion/react");
|
|
12
12
|
var _reactIntlNext = require("react-intl-next");
|
|
13
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
13
14
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
14
15
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
15
16
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
@@ -45,14 +46,17 @@ var ToolbarHighlightColor = function ToolbarHighlightColor(_ref) {
|
|
|
45
46
|
setIsOpenedByKeyboard = _useState2[1];
|
|
46
47
|
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['highlight']),
|
|
47
48
|
highlightState = _useSharedPluginState.highlightState;
|
|
48
|
-
var isDropdownOpen = !!(highlightState !== null && highlightState !== void 0 && highlightState.isPaletteOpen);
|
|
49
49
|
var setDropdownOpen = function setDropdownOpen(isOpen) {
|
|
50
50
|
if (!(highlightState !== null && highlightState !== void 0 && highlightState.disabled)) {
|
|
51
51
|
var state = editorView.state,
|
|
52
52
|
dispatch = editorView.dispatch;
|
|
53
|
-
(0, _commands.setPalette)(pluginInjectionApi
|
|
53
|
+
(0, _commands.setPalette)(pluginInjectionApi)({
|
|
54
|
+
isPaletteOpen: isOpen,
|
|
55
|
+
inputMethod: _analytics.INPUT_METHOD.TOOLBAR
|
|
56
|
+
})(state, dispatch);
|
|
54
57
|
}
|
|
55
58
|
};
|
|
59
|
+
var isDropdownOpen = !!(highlightState !== null && highlightState !== void 0 && highlightState.isPaletteOpen);
|
|
56
60
|
var toggleDropdown = function toggleDropdown() {
|
|
57
61
|
return setDropdownOpen(!isDropdownOpen);
|
|
58
62
|
};
|
|
@@ -84,7 +88,8 @@ var ToolbarHighlightColor = function ToolbarHighlightColor(_ref) {
|
|
|
84
88
|
var handleColorChange = function handleColorChange(color) {
|
|
85
89
|
var _pluginInjectionApi$c, _pluginInjectionApi$a;
|
|
86
90
|
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c = pluginInjectionApi.core) === null || _pluginInjectionApi$c === void 0 || _pluginInjectionApi$c.actions.execute((0, _commands.changeColor)(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions)({
|
|
87
|
-
color: color
|
|
91
|
+
color: color,
|
|
92
|
+
inputMethod: _analytics.INPUT_METHOD.TOOLBAR
|
|
88
93
|
}));
|
|
89
94
|
setDropdownOpen(false);
|
|
90
95
|
};
|
|
@@ -43,10 +43,13 @@ var useDropdownEvents = exports.useDropdownEvents = function useDropdownEvents(a
|
|
|
43
43
|
toolbarItemRef === null || toolbarItemRef === void 0 || (_toolbarItemRef$curre = toolbarItemRef.current) === null || _toolbarItemRef$curre === void 0 || _toolbarItemRef$curre.focus();
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
|
-
handleColorChange: function handleColorChange(
|
|
46
|
+
handleColorChange: function handleColorChange(_ref) {
|
|
47
47
|
var _pluginInjectionApi$c, _pluginInjectionApi$a;
|
|
48
|
+
var color = _ref.color,
|
|
49
|
+
inputMethod = _ref.inputMethod;
|
|
48
50
|
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c = pluginInjectionApi.core) === null || _pluginInjectionApi$c === void 0 || _pluginInjectionApi$c.actions.execute((0, _commands.changeColor)(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions)({
|
|
49
|
-
color: color
|
|
51
|
+
color: color,
|
|
52
|
+
inputMethod: inputMethod
|
|
50
53
|
}));
|
|
51
54
|
setIsDropdownOpen(false);
|
|
52
55
|
},
|
|
@@ -4,7 +4,8 @@ import { highlightColorPalette, REMOVE_HIGHLIGHT_COLOR } from '@atlaskit/editor-
|
|
|
4
4
|
import { HighlightPluginAction, highlightPluginKey } from '../pm-plugins/main';
|
|
5
5
|
import { getActiveColor } from '../utils/color';
|
|
6
6
|
export const changeColor = editorAnalyticsAPI => ({
|
|
7
|
-
color
|
|
7
|
+
color,
|
|
8
|
+
inputMethod
|
|
8
9
|
}) => ({
|
|
9
10
|
tr
|
|
10
11
|
}) => {
|
|
@@ -14,7 +15,7 @@ export const changeColor = editorAnalyticsAPI => ({
|
|
|
14
15
|
if (!backgroundColor) {
|
|
15
16
|
return null;
|
|
16
17
|
}
|
|
17
|
-
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent(createAnalyticsEvent(color, tr))(tr);
|
|
18
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent(createAnalyticsEvent(color, inputMethod, tr))(tr);
|
|
18
19
|
tr.scrollIntoView();
|
|
19
20
|
if (color === REMOVE_HIGHLIGHT_COLOR) {
|
|
20
21
|
removeMark(backgroundColor)({
|
|
@@ -33,7 +34,7 @@ export const changeColor = editorAnalyticsAPI => ({
|
|
|
33
34
|
}
|
|
34
35
|
return tr;
|
|
35
36
|
};
|
|
36
|
-
const createAnalyticsEvent = (color, tr) => {
|
|
37
|
+
const createAnalyticsEvent = (color, inputMethod, tr) => {
|
|
37
38
|
var _getActiveColor;
|
|
38
39
|
const previousColor = (_getActiveColor = getActiveColor(tr)) !== null && _getActiveColor !== void 0 ? _getActiveColor : REMOVE_HIGHLIGHT_COLOR;
|
|
39
40
|
// get color names from palette
|
|
@@ -52,7 +53,8 @@ const createAnalyticsEvent = (color, tr) => {
|
|
|
52
53
|
eventType: EVENT_TYPE.TRACK,
|
|
53
54
|
attributes: {
|
|
54
55
|
newColor: newColorLabel.toLowerCase(),
|
|
55
|
-
previousColor: previousColorLabel ? previousColorLabel.toLowerCase() : ''
|
|
56
|
+
previousColor: previousColorLabel ? previousColorLabel.toLowerCase() : '',
|
|
57
|
+
inputMethod
|
|
56
58
|
}
|
|
57
59
|
};
|
|
58
60
|
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { HighlightPluginAction, highlightPluginKey } from '../pm-plugins/main';
|
|
3
|
+
export const togglePalette = api => ({
|
|
4
|
+
inputMethod
|
|
5
|
+
}) => (state, dispatch) => {
|
|
6
|
+
var _highlightPluginKey$g;
|
|
7
|
+
const isPaletteOpen = (_highlightPluginKey$g = highlightPluginKey.getState(state)) === null || _highlightPluginKey$g === void 0 ? void 0 : _highlightPluginKey$g.isPaletteOpen;
|
|
8
|
+
return setPalette(api)({
|
|
9
|
+
isPaletteOpen: !isPaletteOpen,
|
|
10
|
+
inputMethod
|
|
11
|
+
})(state, dispatch);
|
|
12
|
+
};
|
|
13
|
+
export const setPalette = api => ({
|
|
14
|
+
isPaletteOpen,
|
|
15
|
+
inputMethod
|
|
16
|
+
}) => (state, dispatch) => {
|
|
17
|
+
var _highlightPluginKey$g2;
|
|
18
|
+
const isDisabled = (_highlightPluginKey$g2 = highlightPluginKey.getState(state)) === null || _highlightPluginKey$g2 === void 0 ? void 0 : _highlightPluginKey$g2.disabled;
|
|
19
|
+
if (!isDisabled) {
|
|
20
|
+
var _api$analytics;
|
|
21
|
+
const tr = state.tr;
|
|
22
|
+
tr.setMeta(highlightPluginKey, {
|
|
23
|
+
type: HighlightPluginAction.SET_PALETTE,
|
|
24
|
+
isPaletteOpen
|
|
25
|
+
});
|
|
26
|
+
(_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions.attachAnalyticsEvent(createAnalyticsEvent(isPaletteOpen, inputMethod))(tr);
|
|
27
|
+
if (dispatch) {
|
|
28
|
+
dispatch(tr);
|
|
29
|
+
}
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
return false;
|
|
33
|
+
};
|
|
34
|
+
const createAnalyticsEvent = (isPaletteOpen, inputMethod) => {
|
|
35
|
+
return {
|
|
36
|
+
action: isPaletteOpen ? ACTION.OPENED : ACTION.CLOSED,
|
|
37
|
+
actionSubject: ACTION_SUBJECT.TOOLBAR,
|
|
38
|
+
actionSubjectId: ACTION_SUBJECT_ID.FORMAT_BACKGROUND_COLOR,
|
|
39
|
+
eventType: EVENT_TYPE.TRACK,
|
|
40
|
+
attributes: {
|
|
41
|
+
inputMethod
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
1
2
|
import { bindKeymapWithCommand, keymap, toggleHighlightPalette } from '@atlaskit/editor-common/keymaps';
|
|
2
3
|
import { togglePalette } from '../commands';
|
|
3
4
|
export function keymapPlugin({
|
|
4
5
|
api
|
|
5
6
|
}) {
|
|
6
7
|
const list = {};
|
|
7
|
-
bindKeymapWithCommand(toggleHighlightPalette.common, togglePalette(api)
|
|
8
|
+
bindKeymapWithCommand(toggleHighlightPalette.common, togglePalette(api)({
|
|
9
|
+
inputMethod: INPUT_METHOD.SHORTCUT
|
|
10
|
+
}), list);
|
|
8
11
|
return keymap(list);
|
|
9
12
|
}
|
|
@@ -5,7 +5,7 @@ import { getDisabledState } from '../utils/disabled';
|
|
|
5
5
|
export const highlightPluginKey = new PluginKey('highlight');
|
|
6
6
|
export let HighlightPluginAction = /*#__PURE__*/function (HighlightPluginAction) {
|
|
7
7
|
HighlightPluginAction[HighlightPluginAction["CHANGE_COLOR"] = 0] = "CHANGE_COLOR";
|
|
8
|
-
HighlightPluginAction[HighlightPluginAction["
|
|
8
|
+
HighlightPluginAction[HighlightPluginAction["SET_PALETTE"] = 1] = "SET_PALETTE";
|
|
9
9
|
return HighlightPluginAction;
|
|
10
10
|
}({});
|
|
11
11
|
export const createPlugin = ({
|
|
@@ -31,7 +31,7 @@ export const createPlugin = ({
|
|
|
31
31
|
...pluginState,
|
|
32
32
|
activeColor: color
|
|
33
33
|
};
|
|
34
|
-
case HighlightPluginAction.
|
|
34
|
+
case HighlightPluginAction.SET_PALETTE:
|
|
35
35
|
const {
|
|
36
36
|
isPaletteOpen
|
|
37
37
|
} = tr.getMeta(highlightPluginKey);
|
|
@@ -4,6 +4,7 @@ import { useRef, useState } from 'react';
|
|
|
4
4
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
5
5
|
import { css, jsx } from '@emotion/react';
|
|
6
6
|
import { injectIntl } from 'react-intl-next';
|
|
7
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
7
8
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
8
9
|
import { highlightMessages as messages } from '@atlaskit/editor-common/messages';
|
|
9
10
|
import { TOOLBAR_BUTTON, ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
@@ -25,10 +26,23 @@ const FloatingToolbarHighlightColor = ({
|
|
|
25
26
|
}
|
|
26
27
|
}) => {
|
|
27
28
|
const toolbarItemRef = useRef(null);
|
|
29
|
+
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
|
|
28
30
|
const {
|
|
29
31
|
highlightState
|
|
30
32
|
} = useSharedPluginState(pluginInjectionApi, ['highlight']);
|
|
31
|
-
const
|
|
33
|
+
const setDropdownOpen = isOpen => {
|
|
34
|
+
var _pluginInjectionApi$a;
|
|
35
|
+
setIsDropdownOpen(isOpen);
|
|
36
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions.fireAnalyticsEvent({
|
|
37
|
+
action: isOpen ? ACTION.OPENED : ACTION.CLOSED,
|
|
38
|
+
actionSubject: ACTION_SUBJECT.TOOLBAR,
|
|
39
|
+
actionSubjectId: ACTION_SUBJECT_ID.FORMAT_BACKGROUND_COLOR,
|
|
40
|
+
eventType: EVENT_TYPE.TRACK,
|
|
41
|
+
attributes: {
|
|
42
|
+
inputMethod: INPUT_METHOD.FLOATING_TB
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
};
|
|
32
46
|
const {
|
|
33
47
|
handleClick,
|
|
34
48
|
handleKeyDown,
|
|
@@ -38,7 +52,7 @@ const FloatingToolbarHighlightColor = ({
|
|
|
38
52
|
isOpenedByKeyboard
|
|
39
53
|
} = useDropdownEvents({
|
|
40
54
|
toolbarItemRef,
|
|
41
|
-
setIsDropdownOpen,
|
|
55
|
+
setIsDropdownOpen: setDropdownOpen,
|
|
42
56
|
isDropdownOpen,
|
|
43
57
|
pluginInjectionApi
|
|
44
58
|
});
|
|
@@ -79,7 +93,10 @@ const FloatingToolbarHighlightColor = ({
|
|
|
79
93
|
label: ""
|
|
80
94
|
}))
|
|
81
95
|
}, formatMessage(messages.highlightFloatingToolbar)),
|
|
82
|
-
onColorChange: color => handleColorChange(
|
|
96
|
+
onColorChange: color => handleColorChange({
|
|
97
|
+
color,
|
|
98
|
+
inputMethod: INPUT_METHOD.FLOATING_TB
|
|
99
|
+
}),
|
|
83
100
|
isOpenedByKeyboard: isOpenedByKeyboard,
|
|
84
101
|
handleClickOutside: handleClickOutside,
|
|
85
102
|
handleEscapeKeydown: handleEscapeKeydown
|
|
@@ -4,6 +4,7 @@ import { useRef } from 'react';
|
|
|
4
4
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
5
5
|
import { jsx } from '@emotion/react';
|
|
6
6
|
import { injectIntl } from 'react-intl-next';
|
|
7
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
7
8
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
8
9
|
import { getAriaKeyshortcuts, toggleHighlightPalette, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
9
10
|
import { highlightMessages as messages } from '@atlaskit/editor-common/messages';
|
|
@@ -32,13 +33,16 @@ const PrimaryToolbarHighlightColor = ({
|
|
|
32
33
|
const {
|
|
33
34
|
highlightState
|
|
34
35
|
} = useSharedPluginState(pluginInjectionApi, ['highlight']);
|
|
35
|
-
const
|
|
36
|
+
const setIsDropdownOpen = isOpen => {
|
|
36
37
|
if (!(highlightState !== null && highlightState !== void 0 && highlightState.disabled)) {
|
|
37
38
|
const {
|
|
38
39
|
state,
|
|
39
40
|
dispatch
|
|
40
41
|
} = editorView;
|
|
41
|
-
setPalette(pluginInjectionApi
|
|
42
|
+
setPalette(pluginInjectionApi)({
|
|
43
|
+
isPaletteOpen: isOpen,
|
|
44
|
+
inputMethod: INPUT_METHOD.TOOLBAR
|
|
45
|
+
})(state, dispatch);
|
|
42
46
|
}
|
|
43
47
|
};
|
|
44
48
|
const isDropdownOpen = !!(highlightState !== null && highlightState !== void 0 && highlightState.isPaletteOpen);
|
|
@@ -51,7 +55,7 @@ const PrimaryToolbarHighlightColor = ({
|
|
|
51
55
|
isOpenedByKeyboard
|
|
52
56
|
} = useDropdownEvents({
|
|
53
57
|
toolbarItemRef,
|
|
54
|
-
setIsDropdownOpen
|
|
58
|
+
setIsDropdownOpen,
|
|
55
59
|
isDropdownOpen,
|
|
56
60
|
pluginInjectionApi
|
|
57
61
|
});
|
|
@@ -95,7 +99,10 @@ const PrimaryToolbarHighlightColor = ({
|
|
|
95
99
|
label: ""
|
|
96
100
|
})))
|
|
97
101
|
}),
|
|
98
|
-
onColorChange: color => handleColorChange(
|
|
102
|
+
onColorChange: color => handleColorChange({
|
|
103
|
+
color,
|
|
104
|
+
inputMethod: INPUT_METHOD.TOOLBAR
|
|
105
|
+
}),
|
|
99
106
|
isOpenedByKeyboard: isOpenedByKeyboard,
|
|
100
107
|
handleClickOutside: handleClickOutside,
|
|
101
108
|
handleEscapeKeydown: handleEscapeKeydown
|
|
@@ -4,6 +4,7 @@ import React, { useRef, useState } from 'react';
|
|
|
4
4
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
5
5
|
import { jsx } from '@emotion/react';
|
|
6
6
|
import { injectIntl } from 'react-intl-next';
|
|
7
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
7
8
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
8
9
|
import { getAriaKeyshortcuts, toggleHighlightPalette, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
9
10
|
import { highlightMessages as messages } from '@atlaskit/editor-common/messages';
|
|
@@ -34,16 +35,19 @@ const ToolbarHighlightColor = ({
|
|
|
34
35
|
const {
|
|
35
36
|
highlightState
|
|
36
37
|
} = useSharedPluginState(pluginInjectionApi, ['highlight']);
|
|
37
|
-
const isDropdownOpen = !!(highlightState !== null && highlightState !== void 0 && highlightState.isPaletteOpen);
|
|
38
38
|
const setDropdownOpen = isOpen => {
|
|
39
39
|
if (!(highlightState !== null && highlightState !== void 0 && highlightState.disabled)) {
|
|
40
40
|
const {
|
|
41
41
|
state,
|
|
42
42
|
dispatch
|
|
43
43
|
} = editorView;
|
|
44
|
-
setPalette(pluginInjectionApi
|
|
44
|
+
setPalette(pluginInjectionApi)({
|
|
45
|
+
isPaletteOpen: isOpen,
|
|
46
|
+
inputMethod: INPUT_METHOD.TOOLBAR
|
|
47
|
+
})(state, dispatch);
|
|
45
48
|
}
|
|
46
49
|
};
|
|
50
|
+
const isDropdownOpen = !!(highlightState !== null && highlightState !== void 0 && highlightState.isPaletteOpen);
|
|
47
51
|
const toggleDropdown = () => setDropdownOpen(!isDropdownOpen);
|
|
48
52
|
const handleClick = () => {
|
|
49
53
|
setIsOpenedByKeyboard(false);
|
|
@@ -73,7 +77,8 @@ const ToolbarHighlightColor = ({
|
|
|
73
77
|
const handleColorChange = color => {
|
|
74
78
|
var _pluginInjectionApi$c, _pluginInjectionApi$a;
|
|
75
79
|
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c = pluginInjectionApi.core) === null || _pluginInjectionApi$c === void 0 ? void 0 : _pluginInjectionApi$c.actions.execute(changeColor(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions)({
|
|
76
|
-
color
|
|
80
|
+
color,
|
|
81
|
+
inputMethod: INPUT_METHOD.TOOLBAR
|
|
77
82
|
}));
|
|
78
83
|
setDropdownOpen(false);
|
|
79
84
|
};
|
|
@@ -34,10 +34,14 @@ export const useDropdownEvents = args => {
|
|
|
34
34
|
toolbarItemRef === null || toolbarItemRef === void 0 ? void 0 : (_toolbarItemRef$curre = toolbarItemRef.current) === null || _toolbarItemRef$curre === void 0 ? void 0 : _toolbarItemRef$curre.focus();
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
|
-
handleColorChange:
|
|
37
|
+
handleColorChange: ({
|
|
38
|
+
color,
|
|
39
|
+
inputMethod
|
|
40
|
+
}) => {
|
|
38
41
|
var _pluginInjectionApi$c, _pluginInjectionApi$a;
|
|
39
42
|
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c = pluginInjectionApi.core) === null || _pluginInjectionApi$c === void 0 ? void 0 : _pluginInjectionApi$c.actions.execute(changeColor(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions)({
|
|
40
|
-
color
|
|
43
|
+
color,
|
|
44
|
+
inputMethod
|
|
41
45
|
}));
|
|
42
46
|
setIsDropdownOpen(false);
|
|
43
47
|
},
|
|
@@ -5,14 +5,15 @@ import { HighlightPluginAction, highlightPluginKey } from '../pm-plugins/main';
|
|
|
5
5
|
import { getActiveColor } from '../utils/color';
|
|
6
6
|
export var changeColor = function changeColor(editorAnalyticsAPI) {
|
|
7
7
|
return function (_ref) {
|
|
8
|
-
var color = _ref.color
|
|
8
|
+
var color = _ref.color,
|
|
9
|
+
inputMethod = _ref.inputMethod;
|
|
9
10
|
return function (_ref2) {
|
|
10
11
|
var tr = _ref2.tr;
|
|
11
12
|
var backgroundColor = tr.doc.type.schema.marks.backgroundColor;
|
|
12
13
|
if (!backgroundColor) {
|
|
13
14
|
return null;
|
|
14
15
|
}
|
|
15
|
-
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent(createAnalyticsEvent(color, tr))(tr);
|
|
16
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent(createAnalyticsEvent(color, inputMethod, tr))(tr);
|
|
16
17
|
tr.scrollIntoView();
|
|
17
18
|
if (color === REMOVE_HIGHLIGHT_COLOR) {
|
|
18
19
|
removeMark(backgroundColor)({
|
|
@@ -33,7 +34,7 @@ export var changeColor = function changeColor(editorAnalyticsAPI) {
|
|
|
33
34
|
};
|
|
34
35
|
};
|
|
35
36
|
};
|
|
36
|
-
var createAnalyticsEvent = function createAnalyticsEvent(color, tr) {
|
|
37
|
+
var createAnalyticsEvent = function createAnalyticsEvent(color, inputMethod, tr) {
|
|
37
38
|
var _getActiveColor;
|
|
38
39
|
var previousColor = (_getActiveColor = getActiveColor(tr)) !== null && _getActiveColor !== void 0 ? _getActiveColor : REMOVE_HIGHLIGHT_COLOR;
|
|
39
40
|
// get color names from palette
|
|
@@ -54,7 +55,8 @@ var createAnalyticsEvent = function createAnalyticsEvent(color, tr) {
|
|
|
54
55
|
eventType: EVENT_TYPE.TRACK,
|
|
55
56
|
attributes: {
|
|
56
57
|
newColor: newColorLabel.toLowerCase(),
|
|
57
|
-
previousColor: previousColorLabel ? previousColorLabel.toLowerCase() : ''
|
|
58
|
+
previousColor: previousColorLabel ? previousColorLabel.toLowerCase() : '',
|
|
59
|
+
inputMethod: inputMethod
|
|
58
60
|
}
|
|
59
61
|
};
|
|
60
62
|
};
|