@atlaskit/editor-core 187.44.6 → 187.44.7
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 +7 -0
- package/dist/cjs/plugins/status/actions.js +15 -2
- package/dist/cjs/plugins/status/index.js +2 -2
- package/dist/cjs/plugins/status/ui/statusPicker.js +69 -4
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/plugins/status/actions.js +16 -2
- package/dist/es2019/plugins/status/index.js +2 -2
- package/dist/es2019/plugins/status/ui/statusPicker.js +70 -2
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/plugins/status/actions.js +15 -2
- package/dist/esm/plugins/status/index.js +2 -2
- package/dist/esm/plugins/status/ui/statusPicker.js +68 -3
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/plugins/status/actions.d.ts +2 -2
- package/dist/types/plugins/status/plugin.d.ts +1 -1
- package/dist/types/plugins/status/types.d.ts +5 -1
- package/dist/types/plugins/status/ui/statusPicker.d.ts +12 -5
- package/dist/types-ts4.5/plugins/status/actions.d.ts +2 -2
- package/dist/types-ts4.5/plugins/status/plugin.d.ts +1 -1
- package/dist/types-ts4.5/plugins/status/types.d.ts +5 -1
- package/dist/types-ts4.5/plugins/status/ui/statusPicker.d.ts +12 -5
- package/package.json +8 -4
- package/report.api.md +17 -2
- package/tmp/api-report-tmp.d.ts +15 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 187.44.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`beb32df5147`](https://bitbucket.org/atlassian/atlassian-frontend/commits/beb32df5147) - [ECA11Y-45] [ECA11Y-22] Change the tab key handling the status popup to improve accessibility.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
3
10
|
## 187.44.6
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -114,12 +114,23 @@ var removeStatus = function removeStatus(showStatusPickerAt) {
|
|
|
114
114
|
};
|
|
115
115
|
};
|
|
116
116
|
exports.removeStatus = removeStatus;
|
|
117
|
-
var
|
|
117
|
+
var handleClosingByArrows = function handleClosingByArrows(closingMethod, state, showStatusPickerAt, tr) {
|
|
118
|
+
if (closingMethod === 'arrowLeft') {
|
|
119
|
+
// put cursor right before status Lozenge
|
|
120
|
+
tr = tr.setSelection(_state.Selection.near(state.tr.doc.resolve(showStatusPickerAt), -1));
|
|
121
|
+
} else if (closingMethod === 'arrowRight') {
|
|
122
|
+
// put cursor right after status Lozenge
|
|
123
|
+
tr = tr.setSelection(_state.Selection.near(state.tr.doc.resolve(showStatusPickerAt + 1)));
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
var commitStatusPicker = function commitStatusPicker(closingPayload) {
|
|
118
127
|
return function (editorView) {
|
|
119
128
|
var state = editorView.state,
|
|
120
129
|
dispatch = editorView.dispatch;
|
|
121
130
|
var _ref2 = _pluginKey.pluginKey.getState(state) || {},
|
|
122
131
|
showStatusPickerAt = _ref2.showStatusPickerAt;
|
|
132
|
+
var _ref3 = closingPayload || {},
|
|
133
|
+
closingMethod = _ref3.closingMethod;
|
|
123
134
|
if (!showStatusPickerAt) {
|
|
124
135
|
return;
|
|
125
136
|
}
|
|
@@ -132,7 +143,9 @@ var commitStatusPicker = function commitStatusPicker() {
|
|
|
132
143
|
showStatusPickerAt: null,
|
|
133
144
|
isNew: false
|
|
134
145
|
});
|
|
135
|
-
if (
|
|
146
|
+
if (closingMethod) {
|
|
147
|
+
handleClosingByArrows(closingMethod, state, showStatusPickerAt, tr);
|
|
148
|
+
} else if (statusNode.attrs.text) {
|
|
136
149
|
// still has content - keep content
|
|
137
150
|
// move selection after status if selection did not change
|
|
138
151
|
if (tr.selection.from === showStatusPickerAt) {
|
|
@@ -79,8 +79,8 @@ var baseStatusPlugin = function baseStatusPlugin(_ref) {
|
|
|
79
79
|
onTextChanged: function onTextChanged(status) {
|
|
80
80
|
(0, _actions.updateStatus)(status)(editorView.state, editorView.dispatch);
|
|
81
81
|
},
|
|
82
|
-
closeStatusPicker: function closeStatusPicker() {
|
|
83
|
-
(0, _actions.commitStatusPicker)()(editorView);
|
|
82
|
+
closeStatusPicker: function closeStatusPicker(closingPayload) {
|
|
83
|
+
(0, _actions.commitStatusPicker)(closingPayload)(editorView);
|
|
84
84
|
},
|
|
85
85
|
onEnter: function onEnter() {
|
|
86
86
|
(0, _actions.commitStatusPicker)()(editorView);
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.default = exports.StatusPickerWithoutAnalytcs = exports.InputMethod = void 0;
|
|
7
|
+
exports.default = exports.closingMethods = exports.StatusPickerWithoutAnalytcs = exports.InputMethod = void 0;
|
|
8
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
10
|
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
@@ -36,7 +36,13 @@ var InputMethod = /*#__PURE__*/function (InputMethod) {
|
|
|
36
36
|
return InputMethod;
|
|
37
37
|
}({});
|
|
38
38
|
exports.InputMethod = InputMethod;
|
|
39
|
-
var
|
|
39
|
+
var closingMethods = /*#__PURE__*/function (closingMethods) {
|
|
40
|
+
closingMethods["ArrowLeft"] = "arrowLeft";
|
|
41
|
+
closingMethods["ArrowRight"] = "arrowRight";
|
|
42
|
+
return closingMethods;
|
|
43
|
+
}({});
|
|
44
|
+
exports.closingMethods = closingMethods;
|
|
45
|
+
var pickerContainer = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background: ", ";\n padding: ", " 0;\n border-radius: ", "px;\n box-shadow: ", ";\n :focus {\n outline: none;\n }\n input {\n text-transform: uppercase;\n }\n"])), "var(--ds-surface-overlay, ".concat(_colors.N0, ")"), "var(--ds-space-100, 8px)", (0, _constants.borderRadius)(), "var(--ds-shadow-overlay, 0 0 1px rgba(9, 30, 66, 0.31), 0 4px 8px -2px rgba(9, 30, 66, 0.25))");
|
|
40
46
|
var StatusPickerWithoutAnalytcs = /*#__PURE__*/function (_React$Component) {
|
|
41
47
|
(0, _inherits2.default)(StatusPickerWithoutAnalytcs, _React$Component);
|
|
42
48
|
var _super = _createSuper(StatusPickerWithoutAnalytcs);
|
|
@@ -57,6 +63,55 @@ var StatusPickerWithoutAnalytcs = /*#__PURE__*/function (_React$Component) {
|
|
|
57
63
|
_this.inputMethod = InputMethod.escKey;
|
|
58
64
|
_this.props.onEnter(_this.state);
|
|
59
65
|
});
|
|
66
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleTabPress", function (event) {
|
|
67
|
+
var colorButtons = event.currentTarget.querySelectorAll('button');
|
|
68
|
+
var inputField = event.currentTarget.querySelector('input');
|
|
69
|
+
var isInputFocussed = document.activeElement === inputField;
|
|
70
|
+
var isButtonFocussed = Array.from(colorButtons).some(function (buttonElement) {
|
|
71
|
+
var _document;
|
|
72
|
+
return ((_document = document) === null || _document === void 0 ? void 0 : _document.activeElement) === buttonElement;
|
|
73
|
+
});
|
|
74
|
+
if (event !== null && event !== void 0 && event.shiftKey) {
|
|
75
|
+
/* shift + tab */
|
|
76
|
+
if (isInputFocussed) {
|
|
77
|
+
colorButtons[0].focus();
|
|
78
|
+
event.preventDefault();
|
|
79
|
+
}
|
|
80
|
+
/* After the user presses shift + tab the color-palette component updates tab index for the first color to be 0.
|
|
81
|
+
To correctly set focus to the input field instead of the first color button we need to set focus manually
|
|
82
|
+
*/
|
|
83
|
+
if (isButtonFocussed) {
|
|
84
|
+
inputField === null || inputField === void 0 ? void 0 : inputField.focus();
|
|
85
|
+
event.preventDefault();
|
|
86
|
+
}
|
|
87
|
+
} else {
|
|
88
|
+
/* tab */
|
|
89
|
+
if (isButtonFocussed) {
|
|
90
|
+
inputField === null || inputField === void 0 ? void 0 : inputField.focus();
|
|
91
|
+
event.preventDefault();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleArrow", function (event, closingMethod) {
|
|
96
|
+
var _document2;
|
|
97
|
+
if (((_document2 = document) === null || _document2 === void 0 ? void 0 : _document2.activeElement) === _this.popupBodyWrapper.current) {
|
|
98
|
+
var _this$popupBodyWrappe, _this$popupBodyWrappe2;
|
|
99
|
+
event.preventDefault();
|
|
100
|
+
(_this$popupBodyWrappe = _this.popupBodyWrapper) === null || _this$popupBodyWrappe === void 0 ? void 0 : (_this$popupBodyWrappe2 = _this$popupBodyWrappe.current) === null || _this$popupBodyWrappe2 === void 0 ? void 0 : _this$popupBodyWrappe2.blur();
|
|
101
|
+
_this.props.closeStatusPicker({
|
|
102
|
+
closingMethod: closingMethod
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onKeyDown", function (event) {
|
|
107
|
+
var isTabPressed = event.key === 'Tab';
|
|
108
|
+
if (isTabPressed) {
|
|
109
|
+
return _this.handleTabPress(event);
|
|
110
|
+
}
|
|
111
|
+
if (event.key in closingMethods) {
|
|
112
|
+
return _this.handleArrow(event, closingMethods[event.key]);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
60
115
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onColorHover", function (color) {
|
|
61
116
|
_this.createStatusAnalyticsAndFireFunc({
|
|
62
117
|
action: 'hovered',
|
|
@@ -120,6 +175,7 @@ var StatusPickerWithoutAnalytcs = /*#__PURE__*/function (_React$Component) {
|
|
|
120
175
|
});
|
|
121
176
|
_this.state = _this.extractStateFromProps(props);
|
|
122
177
|
_this.createStatusAnalyticsAndFireFunc = (0, _analytics.createStatusAnalyticsAndFire)(props.createAnalyticsEvent);
|
|
178
|
+
_this.popupBodyWrapper = /*#__PURE__*/_react.default.createRef();
|
|
123
179
|
return _this;
|
|
124
180
|
}
|
|
125
181
|
(0, _createClass2.default)(StatusPickerWithoutAnalytcs, [{
|
|
@@ -172,6 +228,11 @@ var StatusPickerWithoutAnalytcs = /*#__PURE__*/function (_React$Component) {
|
|
|
172
228
|
value: function componentDidMount() {
|
|
173
229
|
this.reset();
|
|
174
230
|
this.fireStatusPopupOpenedAnalytics(this.state);
|
|
231
|
+
if (typeof this.props.isNew === 'boolean' && this.props.isNew === false) {
|
|
232
|
+
var _this$popupBodyWrappe3, _this$popupBodyWrappe4;
|
|
233
|
+
// Wrapper should be focused only if status already exists otherwise input field will receive focus
|
|
234
|
+
(_this$popupBodyWrappe3 = this.popupBodyWrapper) === null || _this$popupBodyWrappe3 === void 0 ? void 0 : (_this$popupBodyWrappe4 = _this$popupBodyWrappe3.current) === null || _this$popupBodyWrappe4 === void 0 ? void 0 : _this$popupBodyWrappe4.focus();
|
|
235
|
+
}
|
|
175
236
|
}
|
|
176
237
|
}, {
|
|
177
238
|
key: "componentWillUnmount",
|
|
@@ -226,10 +287,14 @@ var StatusPickerWithoutAnalytcs = /*#__PURE__*/function (_React$Component) {
|
|
|
226
287
|
fitHeight: 40,
|
|
227
288
|
mountTo: mountTo,
|
|
228
289
|
boundariesElement: boundariesElement,
|
|
229
|
-
scrollableElement: scrollableElement
|
|
290
|
+
scrollableElement: scrollableElement,
|
|
291
|
+
closeOnTab: false
|
|
230
292
|
}, (0, _react2.jsx)("div", {
|
|
231
293
|
css: pickerContainer,
|
|
232
|
-
|
|
294
|
+
tabIndex: -1,
|
|
295
|
+
ref: this.popupBodyWrapper,
|
|
296
|
+
onClick: this.handlePopupClick,
|
|
297
|
+
onKeyDown: this.onKeyDown
|
|
233
298
|
}, (0, _react2.jsx)(_picker.StatusPicker, {
|
|
234
299
|
autoFocus: isNew,
|
|
235
300
|
selectedColor: color,
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.version = exports.nextMajorVersion = exports.name = void 0;
|
|
7
7
|
var name = "@atlaskit/editor-core";
|
|
8
8
|
exports.name = name;
|
|
9
|
-
var version = "187.44.
|
|
9
|
+
var version = "187.44.7";
|
|
10
10
|
exports.version = version;
|
|
11
11
|
var nextMajorVersion = function nextMajorVersion() {
|
|
12
12
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
|
@@ -94,7 +94,16 @@ export const removeStatus = showStatusPickerAt => (state, dispatch) => {
|
|
|
94
94
|
}
|
|
95
95
|
return true;
|
|
96
96
|
};
|
|
97
|
-
|
|
97
|
+
const handleClosingByArrows = (closingMethod, state, showStatusPickerAt, tr) => {
|
|
98
|
+
if (closingMethod === 'arrowLeft') {
|
|
99
|
+
// put cursor right before status Lozenge
|
|
100
|
+
tr = tr.setSelection(Selection.near(state.tr.doc.resolve(showStatusPickerAt), -1));
|
|
101
|
+
} else if (closingMethod === 'arrowRight') {
|
|
102
|
+
// put cursor right after status Lozenge
|
|
103
|
+
tr = tr.setSelection(Selection.near(state.tr.doc.resolve(showStatusPickerAt + 1)));
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
export const commitStatusPicker = closingPayload => editorView => {
|
|
98
107
|
const {
|
|
99
108
|
state,
|
|
100
109
|
dispatch
|
|
@@ -102,6 +111,9 @@ export const commitStatusPicker = () => editorView => {
|
|
|
102
111
|
const {
|
|
103
112
|
showStatusPickerAt
|
|
104
113
|
} = pluginKey.getState(state) || {};
|
|
114
|
+
const {
|
|
115
|
+
closingMethod
|
|
116
|
+
} = closingPayload || {};
|
|
105
117
|
if (!showStatusPickerAt) {
|
|
106
118
|
return;
|
|
107
119
|
}
|
|
@@ -114,7 +126,9 @@ export const commitStatusPicker = () => editorView => {
|
|
|
114
126
|
showStatusPickerAt: null,
|
|
115
127
|
isNew: false
|
|
116
128
|
});
|
|
117
|
-
if (
|
|
129
|
+
if (closingMethod) {
|
|
130
|
+
handleClosingByArrows(closingMethod, state, showStatusPickerAt, tr);
|
|
131
|
+
} else if (statusNode.attrs.text) {
|
|
118
132
|
// still has content - keep content
|
|
119
133
|
// move selection after status if selection did not change
|
|
120
134
|
if (tr.selection.from === showStatusPickerAt) {
|
|
@@ -74,8 +74,8 @@ const baseStatusPlugin = ({
|
|
|
74
74
|
onTextChanged: status => {
|
|
75
75
|
updateStatus(status)(editorView.state, editorView.dispatch);
|
|
76
76
|
},
|
|
77
|
-
closeStatusPicker:
|
|
78
|
-
commitStatusPicker()(editorView);
|
|
77
|
+
closeStatusPicker: closingPayload => {
|
|
78
|
+
commitStatusPicker(closingPayload)(editorView);
|
|
79
79
|
},
|
|
80
80
|
onEnter: () => {
|
|
81
81
|
commitStatusPicker()(editorView);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
/** @jsx jsx */
|
|
3
|
+
|
|
3
4
|
import React from 'react';
|
|
4
5
|
import { css, jsx } from '@emotion/react';
|
|
5
6
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
@@ -18,11 +19,19 @@ export let InputMethod = /*#__PURE__*/function (InputMethod) {
|
|
|
18
19
|
InputMethod["enterKey"] = "enterKey";
|
|
19
20
|
return InputMethod;
|
|
20
21
|
}({});
|
|
22
|
+
export let closingMethods = /*#__PURE__*/function (closingMethods) {
|
|
23
|
+
closingMethods["ArrowLeft"] = "arrowLeft";
|
|
24
|
+
closingMethods["ArrowRight"] = "arrowRight";
|
|
25
|
+
return closingMethods;
|
|
26
|
+
}({});
|
|
21
27
|
const pickerContainer = css`
|
|
22
28
|
background: ${`var(--ds-surface-overlay, ${N0})`};
|
|
23
29
|
padding: ${"var(--ds-space-100, 8px)"} 0;
|
|
24
30
|
border-radius: ${borderRadius()}px;
|
|
25
31
|
box-shadow: ${"var(--ds-shadow-overlay, 0 0 1px rgba(9, 30, 66, 0.31), 0 4px 8px -2px rgba(9, 30, 66, 0.25))"};
|
|
32
|
+
:focus {
|
|
33
|
+
outline: none;
|
|
34
|
+
}
|
|
26
35
|
input {
|
|
27
36
|
text-transform: uppercase;
|
|
28
37
|
}
|
|
@@ -43,6 +52,55 @@ export class StatusPickerWithoutAnalytcs extends React.Component {
|
|
|
43
52
|
this.inputMethod = InputMethod.escKey;
|
|
44
53
|
this.props.onEnter(this.state);
|
|
45
54
|
});
|
|
55
|
+
_defineProperty(this, "handleTabPress", event => {
|
|
56
|
+
const colorButtons = event.currentTarget.querySelectorAll('button');
|
|
57
|
+
const inputField = event.currentTarget.querySelector('input');
|
|
58
|
+
const isInputFocussed = document.activeElement === inputField;
|
|
59
|
+
const isButtonFocussed = Array.from(colorButtons).some(buttonElement => {
|
|
60
|
+
var _document;
|
|
61
|
+
return ((_document = document) === null || _document === void 0 ? void 0 : _document.activeElement) === buttonElement;
|
|
62
|
+
});
|
|
63
|
+
if (event !== null && event !== void 0 && event.shiftKey) {
|
|
64
|
+
/* shift + tab */
|
|
65
|
+
if (isInputFocussed) {
|
|
66
|
+
colorButtons[0].focus();
|
|
67
|
+
event.preventDefault();
|
|
68
|
+
}
|
|
69
|
+
/* After the user presses shift + tab the color-palette component updates tab index for the first color to be 0.
|
|
70
|
+
To correctly set focus to the input field instead of the first color button we need to set focus manually
|
|
71
|
+
*/
|
|
72
|
+
if (isButtonFocussed) {
|
|
73
|
+
inputField === null || inputField === void 0 ? void 0 : inputField.focus();
|
|
74
|
+
event.preventDefault();
|
|
75
|
+
}
|
|
76
|
+
} else {
|
|
77
|
+
/* tab */
|
|
78
|
+
if (isButtonFocussed) {
|
|
79
|
+
inputField === null || inputField === void 0 ? void 0 : inputField.focus();
|
|
80
|
+
event.preventDefault();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
_defineProperty(this, "handleArrow", (event, closingMethod) => {
|
|
85
|
+
var _document2;
|
|
86
|
+
if (((_document2 = document) === null || _document2 === void 0 ? void 0 : _document2.activeElement) === this.popupBodyWrapper.current) {
|
|
87
|
+
var _this$popupBodyWrappe, _this$popupBodyWrappe2;
|
|
88
|
+
event.preventDefault();
|
|
89
|
+
(_this$popupBodyWrappe = this.popupBodyWrapper) === null || _this$popupBodyWrappe === void 0 ? void 0 : (_this$popupBodyWrappe2 = _this$popupBodyWrappe.current) === null || _this$popupBodyWrappe2 === void 0 ? void 0 : _this$popupBodyWrappe2.blur();
|
|
90
|
+
this.props.closeStatusPicker({
|
|
91
|
+
closingMethod
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
_defineProperty(this, "onKeyDown", event => {
|
|
96
|
+
const isTabPressed = event.key === 'Tab';
|
|
97
|
+
if (isTabPressed) {
|
|
98
|
+
return this.handleTabPress(event);
|
|
99
|
+
}
|
|
100
|
+
if (event.key in closingMethods) {
|
|
101
|
+
return this.handleArrow(event, closingMethods[event.key]);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
46
104
|
_defineProperty(this, "onColorHover", color => {
|
|
47
105
|
this.createStatusAnalyticsAndFireFunc({
|
|
48
106
|
action: 'hovered',
|
|
@@ -106,6 +164,7 @@ export class StatusPickerWithoutAnalytcs extends React.Component {
|
|
|
106
164
|
_defineProperty(this, "handlePopupClick", event => event.nativeEvent.stopImmediatePropagation());
|
|
107
165
|
this.state = this.extractStateFromProps(props);
|
|
108
166
|
this.createStatusAnalyticsAndFireFunc = createStatusAnalyticsAndFire(props.createAnalyticsEvent);
|
|
167
|
+
this.popupBodyWrapper = /*#__PURE__*/React.createRef();
|
|
109
168
|
}
|
|
110
169
|
fireStatusPopupOpenedAnalytics(state) {
|
|
111
170
|
const {
|
|
@@ -153,6 +212,11 @@ export class StatusPickerWithoutAnalytcs extends React.Component {
|
|
|
153
212
|
componentDidMount() {
|
|
154
213
|
this.reset();
|
|
155
214
|
this.fireStatusPopupOpenedAnalytics(this.state);
|
|
215
|
+
if (typeof this.props.isNew === 'boolean' && this.props.isNew === false) {
|
|
216
|
+
var _this$popupBodyWrappe3, _this$popupBodyWrappe4;
|
|
217
|
+
// Wrapper should be focused only if status already exists otherwise input field will receive focus
|
|
218
|
+
(_this$popupBodyWrappe3 = this.popupBodyWrapper) === null || _this$popupBodyWrappe3 === void 0 ? void 0 : (_this$popupBodyWrappe4 = _this$popupBodyWrappe3.current) === null || _this$popupBodyWrappe4 === void 0 ? void 0 : _this$popupBodyWrappe4.focus();
|
|
219
|
+
}
|
|
156
220
|
}
|
|
157
221
|
componentWillUnmount() {
|
|
158
222
|
this.fireStatusPopupClosedAnalytics(this.state);
|
|
@@ -203,10 +267,14 @@ export class StatusPickerWithoutAnalytcs extends React.Component {
|
|
|
203
267
|
fitHeight: 40,
|
|
204
268
|
mountTo: mountTo,
|
|
205
269
|
boundariesElement: boundariesElement,
|
|
206
|
-
scrollableElement: scrollableElement
|
|
270
|
+
scrollableElement: scrollableElement,
|
|
271
|
+
closeOnTab: false
|
|
207
272
|
}, jsx("div", {
|
|
208
273
|
css: pickerContainer,
|
|
209
|
-
|
|
274
|
+
tabIndex: -1,
|
|
275
|
+
ref: this.popupBodyWrapper,
|
|
276
|
+
onClick: this.handlePopupClick,
|
|
277
|
+
onKeyDown: this.onKeyDown
|
|
210
278
|
}, jsx(AkStatusPicker, {
|
|
211
279
|
autoFocus: isNew,
|
|
212
280
|
selectedColor: color,
|
|
@@ -101,12 +101,23 @@ export var removeStatus = function removeStatus(showStatusPickerAt) {
|
|
|
101
101
|
return true;
|
|
102
102
|
};
|
|
103
103
|
};
|
|
104
|
-
|
|
104
|
+
var handleClosingByArrows = function handleClosingByArrows(closingMethod, state, showStatusPickerAt, tr) {
|
|
105
|
+
if (closingMethod === 'arrowLeft') {
|
|
106
|
+
// put cursor right before status Lozenge
|
|
107
|
+
tr = tr.setSelection(Selection.near(state.tr.doc.resolve(showStatusPickerAt), -1));
|
|
108
|
+
} else if (closingMethod === 'arrowRight') {
|
|
109
|
+
// put cursor right after status Lozenge
|
|
110
|
+
tr = tr.setSelection(Selection.near(state.tr.doc.resolve(showStatusPickerAt + 1)));
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
export var commitStatusPicker = function commitStatusPicker(closingPayload) {
|
|
105
114
|
return function (editorView) {
|
|
106
115
|
var state = editorView.state,
|
|
107
116
|
dispatch = editorView.dispatch;
|
|
108
117
|
var _ref2 = pluginKey.getState(state) || {},
|
|
109
118
|
showStatusPickerAt = _ref2.showStatusPickerAt;
|
|
119
|
+
var _ref3 = closingPayload || {},
|
|
120
|
+
closingMethod = _ref3.closingMethod;
|
|
110
121
|
if (!showStatusPickerAt) {
|
|
111
122
|
return;
|
|
112
123
|
}
|
|
@@ -119,7 +130,9 @@ export var commitStatusPicker = function commitStatusPicker() {
|
|
|
119
130
|
showStatusPickerAt: null,
|
|
120
131
|
isNew: false
|
|
121
132
|
});
|
|
122
|
-
if (
|
|
133
|
+
if (closingMethod) {
|
|
134
|
+
handleClosingByArrows(closingMethod, state, showStatusPickerAt, tr);
|
|
135
|
+
} else if (statusNode.attrs.text) {
|
|
123
136
|
// still has content - keep content
|
|
124
137
|
// move selection after status if selection did not change
|
|
125
138
|
if (tr.selection.from === showStatusPickerAt) {
|
|
@@ -72,8 +72,8 @@ var baseStatusPlugin = function baseStatusPlugin(_ref) {
|
|
|
72
72
|
onTextChanged: function onTextChanged(status) {
|
|
73
73
|
updateStatus(status)(editorView.state, editorView.dispatch);
|
|
74
74
|
},
|
|
75
|
-
closeStatusPicker: function closeStatusPicker() {
|
|
76
|
-
commitStatusPicker()(editorView);
|
|
75
|
+
closeStatusPicker: function closeStatusPicker(closingPayload) {
|
|
76
|
+
commitStatusPicker(closingPayload)(editorView);
|
|
77
77
|
},
|
|
78
78
|
onEnter: function onEnter() {
|
|
79
79
|
commitStatusPicker()(editorView);
|
|
@@ -10,6 +10,7 @@ var _templateObject;
|
|
|
10
10
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
11
11
|
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; } }
|
|
12
12
|
/** @jsx jsx */
|
|
13
|
+
|
|
13
14
|
import React from 'react';
|
|
14
15
|
import { css, jsx } from '@emotion/react';
|
|
15
16
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
@@ -28,7 +29,12 @@ export var InputMethod = /*#__PURE__*/function (InputMethod) {
|
|
|
28
29
|
InputMethod["enterKey"] = "enterKey";
|
|
29
30
|
return InputMethod;
|
|
30
31
|
}({});
|
|
31
|
-
var
|
|
32
|
+
export var closingMethods = /*#__PURE__*/function (closingMethods) {
|
|
33
|
+
closingMethods["ArrowLeft"] = "arrowLeft";
|
|
34
|
+
closingMethods["ArrowRight"] = "arrowRight";
|
|
35
|
+
return closingMethods;
|
|
36
|
+
}({});
|
|
37
|
+
var pickerContainer = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background: ", ";\n padding: ", " 0;\n border-radius: ", "px;\n box-shadow: ", ";\n :focus {\n outline: none;\n }\n input {\n text-transform: uppercase;\n }\n"])), "var(--ds-surface-overlay, ".concat(N0, ")"), "var(--ds-space-100, 8px)", borderRadius(), "var(--ds-shadow-overlay, 0 0 1px rgba(9, 30, 66, 0.31), 0 4px 8px -2px rgba(9, 30, 66, 0.25))");
|
|
32
38
|
export var StatusPickerWithoutAnalytcs = /*#__PURE__*/function (_React$Component) {
|
|
33
39
|
_inherits(StatusPickerWithoutAnalytcs, _React$Component);
|
|
34
40
|
var _super = _createSuper(StatusPickerWithoutAnalytcs);
|
|
@@ -49,6 +55,55 @@ export var StatusPickerWithoutAnalytcs = /*#__PURE__*/function (_React$Component
|
|
|
49
55
|
_this.inputMethod = InputMethod.escKey;
|
|
50
56
|
_this.props.onEnter(_this.state);
|
|
51
57
|
});
|
|
58
|
+
_defineProperty(_assertThisInitialized(_this), "handleTabPress", function (event) {
|
|
59
|
+
var colorButtons = event.currentTarget.querySelectorAll('button');
|
|
60
|
+
var inputField = event.currentTarget.querySelector('input');
|
|
61
|
+
var isInputFocussed = document.activeElement === inputField;
|
|
62
|
+
var isButtonFocussed = Array.from(colorButtons).some(function (buttonElement) {
|
|
63
|
+
var _document;
|
|
64
|
+
return ((_document = document) === null || _document === void 0 ? void 0 : _document.activeElement) === buttonElement;
|
|
65
|
+
});
|
|
66
|
+
if (event !== null && event !== void 0 && event.shiftKey) {
|
|
67
|
+
/* shift + tab */
|
|
68
|
+
if (isInputFocussed) {
|
|
69
|
+
colorButtons[0].focus();
|
|
70
|
+
event.preventDefault();
|
|
71
|
+
}
|
|
72
|
+
/* After the user presses shift + tab the color-palette component updates tab index for the first color to be 0.
|
|
73
|
+
To correctly set focus to the input field instead of the first color button we need to set focus manually
|
|
74
|
+
*/
|
|
75
|
+
if (isButtonFocussed) {
|
|
76
|
+
inputField === null || inputField === void 0 ? void 0 : inputField.focus();
|
|
77
|
+
event.preventDefault();
|
|
78
|
+
}
|
|
79
|
+
} else {
|
|
80
|
+
/* tab */
|
|
81
|
+
if (isButtonFocussed) {
|
|
82
|
+
inputField === null || inputField === void 0 ? void 0 : inputField.focus();
|
|
83
|
+
event.preventDefault();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
_defineProperty(_assertThisInitialized(_this), "handleArrow", function (event, closingMethod) {
|
|
88
|
+
var _document2;
|
|
89
|
+
if (((_document2 = document) === null || _document2 === void 0 ? void 0 : _document2.activeElement) === _this.popupBodyWrapper.current) {
|
|
90
|
+
var _this$popupBodyWrappe, _this$popupBodyWrappe2;
|
|
91
|
+
event.preventDefault();
|
|
92
|
+
(_this$popupBodyWrappe = _this.popupBodyWrapper) === null || _this$popupBodyWrappe === void 0 ? void 0 : (_this$popupBodyWrappe2 = _this$popupBodyWrappe.current) === null || _this$popupBodyWrappe2 === void 0 ? void 0 : _this$popupBodyWrappe2.blur();
|
|
93
|
+
_this.props.closeStatusPicker({
|
|
94
|
+
closingMethod: closingMethod
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
_defineProperty(_assertThisInitialized(_this), "onKeyDown", function (event) {
|
|
99
|
+
var isTabPressed = event.key === 'Tab';
|
|
100
|
+
if (isTabPressed) {
|
|
101
|
+
return _this.handleTabPress(event);
|
|
102
|
+
}
|
|
103
|
+
if (event.key in closingMethods) {
|
|
104
|
+
return _this.handleArrow(event, closingMethods[event.key]);
|
|
105
|
+
}
|
|
106
|
+
});
|
|
52
107
|
_defineProperty(_assertThisInitialized(_this), "onColorHover", function (color) {
|
|
53
108
|
_this.createStatusAnalyticsAndFireFunc({
|
|
54
109
|
action: 'hovered',
|
|
@@ -112,6 +167,7 @@ export var StatusPickerWithoutAnalytcs = /*#__PURE__*/function (_React$Component
|
|
|
112
167
|
});
|
|
113
168
|
_this.state = _this.extractStateFromProps(props);
|
|
114
169
|
_this.createStatusAnalyticsAndFireFunc = createStatusAnalyticsAndFire(props.createAnalyticsEvent);
|
|
170
|
+
_this.popupBodyWrapper = /*#__PURE__*/React.createRef();
|
|
115
171
|
return _this;
|
|
116
172
|
}
|
|
117
173
|
_createClass(StatusPickerWithoutAnalytcs, [{
|
|
@@ -164,6 +220,11 @@ export var StatusPickerWithoutAnalytcs = /*#__PURE__*/function (_React$Component
|
|
|
164
220
|
value: function componentDidMount() {
|
|
165
221
|
this.reset();
|
|
166
222
|
this.fireStatusPopupOpenedAnalytics(this.state);
|
|
223
|
+
if (typeof this.props.isNew === 'boolean' && this.props.isNew === false) {
|
|
224
|
+
var _this$popupBodyWrappe3, _this$popupBodyWrappe4;
|
|
225
|
+
// Wrapper should be focused only if status already exists otherwise input field will receive focus
|
|
226
|
+
(_this$popupBodyWrappe3 = this.popupBodyWrapper) === null || _this$popupBodyWrappe3 === void 0 ? void 0 : (_this$popupBodyWrappe4 = _this$popupBodyWrappe3.current) === null || _this$popupBodyWrappe4 === void 0 ? void 0 : _this$popupBodyWrappe4.focus();
|
|
227
|
+
}
|
|
167
228
|
}
|
|
168
229
|
}, {
|
|
169
230
|
key: "componentWillUnmount",
|
|
@@ -218,10 +279,14 @@ export var StatusPickerWithoutAnalytcs = /*#__PURE__*/function (_React$Component
|
|
|
218
279
|
fitHeight: 40,
|
|
219
280
|
mountTo: mountTo,
|
|
220
281
|
boundariesElement: boundariesElement,
|
|
221
|
-
scrollableElement: scrollableElement
|
|
282
|
+
scrollableElement: scrollableElement,
|
|
283
|
+
closeOnTab: false
|
|
222
284
|
}, jsx("div", {
|
|
223
285
|
css: pickerContainer,
|
|
224
|
-
|
|
286
|
+
tabIndex: -1,
|
|
287
|
+
ref: this.popupBodyWrapper,
|
|
288
|
+
onClick: this.handlePopupClick,
|
|
289
|
+
onKeyDown: this.onKeyDown
|
|
225
290
|
}, jsx(AkStatusPicker, {
|
|
226
291
|
autoFocus: isNew,
|
|
227
292
|
selectedColor: color,
|
|
@@ -2,7 +2,7 @@ import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/stat
|
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import type { Command } from '../../types';
|
|
4
4
|
import type { TOOLBAR_MENU_TYPE } from '../insert-block/ui/ToolbarInsertBlock/types';
|
|
5
|
-
import type { StatusType } from './types';
|
|
5
|
+
import type { StatusType, ClosingPayload } from './types';
|
|
6
6
|
export declare const DEFAULT_STATUS: StatusType;
|
|
7
7
|
export declare const createStatus: (showStatusPickerAtOffset?: number) => (insert: (node: Node | Object | string, opts: {
|
|
8
8
|
selectInlineNode: boolean;
|
|
@@ -11,4 +11,4 @@ export declare const updateStatus: (status?: StatusType) => Command;
|
|
|
11
11
|
export declare const updateStatusWithAnalytics: (inputMethod: TOOLBAR_MENU_TYPE, status?: StatusType) => Command;
|
|
12
12
|
export declare const setStatusPickerAt: (showStatusPickerAt: number | null) => (state: EditorState, dispatch: (tr: Transaction) => void) => boolean;
|
|
13
13
|
export declare const removeStatus: (showStatusPickerAt: number) => Command;
|
|
14
|
-
export declare const commitStatusPicker: () => (editorView: EditorView) => void;
|
|
14
|
+
export declare const commitStatusPicker: (closingPayload?: ClosingPayload) => (editorView: EditorView) => void;
|
|
@@ -2,6 +2,6 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
2
2
|
import type { PMPluginFactoryParams } from '../../types';
|
|
3
3
|
import type { StatusPluginOptions } from './types';
|
|
4
4
|
export { pluginKey, pluginKeyName } from './plugin-key';
|
|
5
|
-
export type { StatusState, StatusType } from './types';
|
|
5
|
+
export type { StatusState, StatusType, ClosingPayload } from './types';
|
|
6
6
|
declare const createPlugin: (pmPluginFactoryParams: PMPluginFactoryParams, options?: StatusPluginOptions) => SafePlugin<any>;
|
|
7
7
|
export default createPlugin;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Color as ColorType } from '@atlaskit/status/element';
|
|
1
|
+
import type { Color as ColorType } from '@atlaskit/status/element';
|
|
2
|
+
import type { closingMethods } from './ui/statusPicker';
|
|
2
3
|
export type StatusType = {
|
|
3
4
|
color: ColorType;
|
|
4
5
|
text: string;
|
|
@@ -12,3 +13,6 @@ export interface StatusPluginOptions {
|
|
|
12
13
|
menuDisabled: boolean;
|
|
13
14
|
allowZeroWidthSpaceAfter?: boolean;
|
|
14
15
|
}
|
|
16
|
+
export type ClosingPayload = {
|
|
17
|
+
closingMethod: closingMethods;
|
|
18
|
+
};
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
5
|
-
import { ColorType as Color } from '@atlaskit/status/picker';
|
|
6
|
-
import { StatusType } from '../plugin';
|
|
3
|
+
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
|
+
import type { ColorType as Color } from '@atlaskit/status/picker';
|
|
5
|
+
import type { StatusType, ClosingPayload } from '../plugin';
|
|
7
6
|
export declare enum InputMethod {
|
|
8
7
|
blur = "blur",
|
|
9
8
|
escKey = "escKey",
|
|
10
9
|
enterKey = "enterKey"
|
|
11
10
|
}
|
|
11
|
+
export declare enum closingMethods {
|
|
12
|
+
ArrowLeft = "arrowLeft",
|
|
13
|
+
ArrowRight = "arrowRight"
|
|
14
|
+
}
|
|
12
15
|
export interface Props {
|
|
13
16
|
target: HTMLElement | null;
|
|
14
|
-
closeStatusPicker: () => void;
|
|
17
|
+
closeStatusPicker: (closingPayload?: ClosingPayload) => void;
|
|
15
18
|
onSelect: (status: StatusType) => void;
|
|
16
19
|
onTextChanged: (status: StatusType, isNew: boolean) => void;
|
|
17
20
|
onEnter: (status: StatusType) => void;
|
|
@@ -34,6 +37,7 @@ export declare class StatusPickerWithoutAnalytcs extends React.Component<Props,
|
|
|
34
37
|
private startTime;
|
|
35
38
|
private inputMethod?;
|
|
36
39
|
private createStatusAnalyticsAndFireFunc;
|
|
40
|
+
private popupBodyWrapper;
|
|
37
41
|
constructor(props: Props);
|
|
38
42
|
private fireStatusPopupOpenedAnalytics;
|
|
39
43
|
private fireStatusPopupClosedAnalytics;
|
|
@@ -44,6 +48,9 @@ export declare class StatusPickerWithoutAnalytcs extends React.Component<Props,
|
|
|
44
48
|
private extractStateFromProps;
|
|
45
49
|
handleClickOutside: (event: Event) => void;
|
|
46
50
|
private handleEscapeKeydown;
|
|
51
|
+
private handleTabPress;
|
|
52
|
+
private handleArrow;
|
|
53
|
+
private onKeyDown;
|
|
47
54
|
render(): jsx.JSX.Element | null;
|
|
48
55
|
private onColorHover;
|
|
49
56
|
private onColorClick;
|
|
@@ -2,7 +2,7 @@ import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/stat
|
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import type { Command } from '../../types';
|
|
4
4
|
import type { TOOLBAR_MENU_TYPE } from '../insert-block/ui/ToolbarInsertBlock/types';
|
|
5
|
-
import type { StatusType } from './types';
|
|
5
|
+
import type { StatusType, ClosingPayload } from './types';
|
|
6
6
|
export declare const DEFAULT_STATUS: StatusType;
|
|
7
7
|
export declare const createStatus: (showStatusPickerAtOffset?: number) => (insert: (node: Node | Object | string, opts: {
|
|
8
8
|
selectInlineNode: boolean;
|
|
@@ -11,4 +11,4 @@ export declare const updateStatus: (status?: StatusType) => Command;
|
|
|
11
11
|
export declare const updateStatusWithAnalytics: (inputMethod: TOOLBAR_MENU_TYPE, status?: StatusType) => Command;
|
|
12
12
|
export declare const setStatusPickerAt: (showStatusPickerAt: number | null) => (state: EditorState, dispatch: (tr: Transaction) => void) => boolean;
|
|
13
13
|
export declare const removeStatus: (showStatusPickerAt: number) => Command;
|
|
14
|
-
export declare const commitStatusPicker: () => (editorView: EditorView) => void;
|
|
14
|
+
export declare const commitStatusPicker: (closingPayload?: ClosingPayload) => (editorView: EditorView) => void;
|
|
@@ -2,6 +2,6 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
2
2
|
import type { PMPluginFactoryParams } from '../../types';
|
|
3
3
|
import type { StatusPluginOptions } from './types';
|
|
4
4
|
export { pluginKey, pluginKeyName } from './plugin-key';
|
|
5
|
-
export type { StatusState, StatusType } from './types';
|
|
5
|
+
export type { StatusState, StatusType, ClosingPayload } from './types';
|
|
6
6
|
declare const createPlugin: (pmPluginFactoryParams: PMPluginFactoryParams, options?: StatusPluginOptions) => SafePlugin<any>;
|
|
7
7
|
export default createPlugin;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Color as ColorType } from '@atlaskit/status/element';
|
|
1
|
+
import type { Color as ColorType } from '@atlaskit/status/element';
|
|
2
|
+
import type { closingMethods } from './ui/statusPicker';
|
|
2
3
|
export type StatusType = {
|
|
3
4
|
color: ColorType;
|
|
4
5
|
text: string;
|
|
@@ -12,3 +13,6 @@ export interface StatusPluginOptions {
|
|
|
12
13
|
menuDisabled: boolean;
|
|
13
14
|
allowZeroWidthSpaceAfter?: boolean;
|
|
14
15
|
}
|
|
16
|
+
export type ClosingPayload = {
|
|
17
|
+
closingMethod: closingMethods;
|
|
18
|
+
};
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
5
|
-
import { ColorType as Color } from '@atlaskit/status/picker';
|
|
6
|
-
import { StatusType } from '../plugin';
|
|
3
|
+
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
|
+
import type { ColorType as Color } from '@atlaskit/status/picker';
|
|
5
|
+
import type { StatusType, ClosingPayload } from '../plugin';
|
|
7
6
|
export declare enum InputMethod {
|
|
8
7
|
blur = "blur",
|
|
9
8
|
escKey = "escKey",
|
|
10
9
|
enterKey = "enterKey"
|
|
11
10
|
}
|
|
11
|
+
export declare enum closingMethods {
|
|
12
|
+
ArrowLeft = "arrowLeft",
|
|
13
|
+
ArrowRight = "arrowRight"
|
|
14
|
+
}
|
|
12
15
|
export interface Props {
|
|
13
16
|
target: HTMLElement | null;
|
|
14
|
-
closeStatusPicker: () => void;
|
|
17
|
+
closeStatusPicker: (closingPayload?: ClosingPayload) => void;
|
|
15
18
|
onSelect: (status: StatusType) => void;
|
|
16
19
|
onTextChanged: (status: StatusType, isNew: boolean) => void;
|
|
17
20
|
onEnter: (status: StatusType) => void;
|
|
@@ -34,6 +37,7 @@ export declare class StatusPickerWithoutAnalytcs extends React.Component<Props,
|
|
|
34
37
|
private startTime;
|
|
35
38
|
private inputMethod?;
|
|
36
39
|
private createStatusAnalyticsAndFireFunc;
|
|
40
|
+
private popupBodyWrapper;
|
|
37
41
|
constructor(props: Props);
|
|
38
42
|
private fireStatusPopupOpenedAnalytics;
|
|
39
43
|
private fireStatusPopupClosedAnalytics;
|
|
@@ -44,6 +48,9 @@ export declare class StatusPickerWithoutAnalytcs extends React.Component<Props,
|
|
|
44
48
|
private extractStateFromProps;
|
|
45
49
|
handleClickOutside: (event: Event) => void;
|
|
46
50
|
private handleEscapeKeydown;
|
|
51
|
+
private handleTabPress;
|
|
52
|
+
private handleArrow;
|
|
53
|
+
private onKeyDown;
|
|
47
54
|
render(): jsx.JSX.Element | null;
|
|
48
55
|
private onColorHover;
|
|
49
56
|
private onColorClick;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "187.44.
|
|
3
|
+
"version": "187.44.7",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@atlaskit/code": "^14.6.0",
|
|
56
56
|
"@atlaskit/date": "^0.10.0",
|
|
57
57
|
"@atlaskit/datetime-picker": "^12.10.0",
|
|
58
|
-
"@atlaskit/editor-common": "^75.
|
|
58
|
+
"@atlaskit/editor-common": "^75.5.0",
|
|
59
59
|
"@atlaskit/editor-json-transformer": "^8.10.0",
|
|
60
60
|
"@atlaskit/editor-markdown-transformer": "^5.2.5",
|
|
61
61
|
"@atlaskit/editor-palette": "1.5.1",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"@atlaskit/editor-plugin-placeholder": "^0.1.0",
|
|
82
82
|
"@atlaskit/editor-plugin-quick-insert": "^0.1.0",
|
|
83
83
|
"@atlaskit/editor-plugin-rule": "^0.1.0",
|
|
84
|
-
"@atlaskit/editor-plugin-table": "^3.
|
|
84
|
+
"@atlaskit/editor-plugin-table": "^3.1.0",
|
|
85
85
|
"@atlaskit/editor-plugin-text-formatting": "^0.4.0",
|
|
86
86
|
"@atlaskit/editor-plugin-type-ahead": "^0.3.0",
|
|
87
87
|
"@atlaskit/editor-plugin-unsupported-content": "^0.2.0",
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
"@atlaskit/collab-provider": "9.12.3",
|
|
157
157
|
"@atlaskit/dropdown-menu": "^11.14.0",
|
|
158
158
|
"@atlaskit/editor-extension-dropbox": "^0.4.0",
|
|
159
|
-
"@atlaskit/editor-plugin-table": "^3.
|
|
159
|
+
"@atlaskit/editor-plugin-table": "^3.1.0",
|
|
160
160
|
"@atlaskit/flag": "^15.2.0",
|
|
161
161
|
"@atlaskit/icon-object": "^6.3.0",
|
|
162
162
|
"@atlaskit/inline-dialog": "^13.6.0",
|
|
@@ -283,6 +283,10 @@
|
|
|
283
283
|
"platform.media-experience.cardv2_7zann": {
|
|
284
284
|
"type": "boolean",
|
|
285
285
|
"referenceOnly": "true"
|
|
286
|
+
},
|
|
287
|
+
"platform.editor.table.overflow-state-analytics": {
|
|
288
|
+
"type": "boolean",
|
|
289
|
+
"referenceOnly": "true"
|
|
286
290
|
}
|
|
287
291
|
}
|
|
288
292
|
}
|
package/report.api.md
CHANGED
|
@@ -35,7 +35,7 @@ import type { CardOptions } from '@atlaskit/editor-common/card';
|
|
|
35
35
|
import { CardProvider } from '@atlaskit/editor-common/provider-factory';
|
|
36
36
|
import { clearEditorContent } from '@atlaskit/editor-common/commands';
|
|
37
37
|
import type { CollabEditOptions } from '@atlaskit/editor-common/collab';
|
|
38
|
-
import { Color } from '@atlaskit/status/element';
|
|
38
|
+
import type { Color } from '@atlaskit/status/element';
|
|
39
39
|
import { Command as Command_2 } from '@atlaskit/editor-common/types';
|
|
40
40
|
import { ComponentType } from 'react';
|
|
41
41
|
import type { compositionPlugin } from '@atlaskit/editor-plugin-composition';
|
|
@@ -303,6 +303,19 @@ type CloseOptions = {
|
|
|
303
303
|
attachCommand?: Command_2;
|
|
304
304
|
};
|
|
305
305
|
|
|
306
|
+
// @public (undocumented)
|
|
307
|
+
enum closingMethods {
|
|
308
|
+
// (undocumented)
|
|
309
|
+
ArrowLeft = 'arrowLeft',
|
|
310
|
+
// (undocumented)
|
|
311
|
+
ArrowRight = 'arrowRight',
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// @public (undocumented)
|
|
315
|
+
type ClosingPayload = {
|
|
316
|
+
closingMethod: closingMethods;
|
|
317
|
+
};
|
|
318
|
+
|
|
306
319
|
// @public (undocumented)
|
|
307
320
|
interface CodeBlockOptions extends LongPressSelectionPluginOptions {
|
|
308
321
|
// (undocumented)
|
|
@@ -359,7 +372,9 @@ export type Command = (
|
|
|
359
372
|
export type CommandDispatch = (tr: Transaction) => void;
|
|
360
373
|
|
|
361
374
|
// @public (undocumented)
|
|
362
|
-
export const commitStatusPicker: (
|
|
375
|
+
export const commitStatusPicker: (
|
|
376
|
+
closingPayload?: ClosingPayload,
|
|
377
|
+
) => (editorView: EditorView) => void;
|
|
363
378
|
|
|
364
379
|
// @public (undocumented)
|
|
365
380
|
export function ContextPanel(props: Props_4): jsx.JSX.Element;
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ import type { CardOptions } from '@atlaskit/editor-common/card';
|
|
|
24
24
|
import { CardProvider } from '@atlaskit/editor-common/provider-factory';
|
|
25
25
|
import { clearEditorContent } from '@atlaskit/editor-common/commands';
|
|
26
26
|
import type { CollabEditOptions } from '@atlaskit/editor-common/collab';
|
|
27
|
-
import { Color } from '@atlaskit/status/element';
|
|
27
|
+
import type { Color } from '@atlaskit/status/element';
|
|
28
28
|
import { Command as Command_2 } from '@atlaskit/editor-common/types';
|
|
29
29
|
import { ComponentType } from 'react';
|
|
30
30
|
import type { compositionPlugin } from '@atlaskit/editor-plugin-composition';
|
|
@@ -289,6 +289,19 @@ type CloseOptions = {
|
|
|
289
289
|
attachCommand?: Command_2;
|
|
290
290
|
};
|
|
291
291
|
|
|
292
|
+
// @public (undocumented)
|
|
293
|
+
enum closingMethods {
|
|
294
|
+
// (undocumented)
|
|
295
|
+
ArrowLeft = "arrowLeft",
|
|
296
|
+
// (undocumented)
|
|
297
|
+
ArrowRight = "arrowRight"
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
// @public (undocumented)
|
|
301
|
+
type ClosingPayload = {
|
|
302
|
+
closingMethod: closingMethods;
|
|
303
|
+
};
|
|
304
|
+
|
|
292
305
|
// @public (undocumented)
|
|
293
306
|
interface CodeBlockOptions extends LongPressSelectionPluginOptions {
|
|
294
307
|
// (undocumented)
|
|
@@ -338,7 +351,7 @@ export type Command = (state: EditorState, dispatch?: CommandDispatch, view?: Ed
|
|
|
338
351
|
export type CommandDispatch = (tr: Transaction) => void;
|
|
339
352
|
|
|
340
353
|
// @public (undocumented)
|
|
341
|
-
export const commitStatusPicker: () => (editorView: EditorView) => void;
|
|
354
|
+
export const commitStatusPicker: (closingPayload?: ClosingPayload) => (editorView: EditorView) => void;
|
|
342
355
|
|
|
343
356
|
// @public (undocumented)
|
|
344
357
|
export function ContextPanel(props: Props_4): jsx.JSX.Element;
|