@atlaskit/editor-plugin-status 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/actions.js +14 -1
- package/dist/cjs/plugin.js +1 -0
- package/dist/cjs/pm-plugins/keymap.js +15 -1
- package/dist/cjs/pm-plugins/plugin.js +4 -2
- package/dist/cjs/ui/statusPicker.js +3 -11
- package/dist/es2019/actions.js +11 -0
- package/dist/es2019/plugin.js +1 -0
- package/dist/es2019/pm-plugins/keymap.js +15 -1
- package/dist/es2019/pm-plugins/plugin.js +4 -2
- package/dist/es2019/ui/statusPicker.js +3 -10
- package/dist/esm/actions.js +13 -0
- package/dist/esm/plugin.js +1 -0
- package/dist/esm/pm-plugins/keymap.js +15 -1
- package/dist/esm/pm-plugins/plugin.js +4 -2
- package/dist/esm/ui/statusPicker.js +3 -11
- package/dist/types/actions.d.ts +2 -1
- package/dist/types/types.d.ts +1 -0
- package/dist/types/ui/statusPicker.d.ts +1 -0
- package/dist/types-ts4.5/actions.d.ts +2 -1
- package/dist/types-ts4.5/types.d.ts +1 -0
- package/dist/types-ts4.5/ui/statusPicker.d.ts +1 -0
- package/package.json +4 -4
- package/report.api.md +1 -0
- package/tmp/api-report-tmp.d.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-status
|
|
2
2
|
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#42325](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42325) [`58f1fd91d09`](https://bitbucket.org/atlassian/atlassian-frontend/commits/58f1fd91d09) - ED-20512 Set Focus on status input field when tab is pressed
|
|
8
|
+
|
|
9
|
+
## 0.1.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 0.1.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/cjs/actions.js
CHANGED
|
@@ -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.updateStatusWithAnalytics = exports.updateStatus = exports.setStatusPickerAt = exports.removeStatus = exports.createStatus = exports.commitStatusPicker = exports.DEFAULT_STATUS = void 0;
|
|
7
|
+
exports.updateStatusWithAnalytics = exports.updateStatus = exports.setStatusPickerAt = exports.setFocusOnStatusInput = exports.removeStatus = exports.createStatus = exports.commitStatusPicker = exports.DEFAULT_STATUS = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
10
10
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
@@ -108,6 +108,18 @@ var removeStatus = exports.removeStatus = function removeStatus(showStatusPicker
|
|
|
108
108
|
return tr;
|
|
109
109
|
};
|
|
110
110
|
};
|
|
111
|
+
var setFocusOnStatusInput = exports.setFocusOnStatusInput = function setFocusOnStatusInput() {
|
|
112
|
+
return function (state, dispatch) {
|
|
113
|
+
if (!dispatch) {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
var tr = state.tr.setMeta(_pluginKey.pluginKey, {
|
|
117
|
+
focusStatusInput: true
|
|
118
|
+
});
|
|
119
|
+
dispatch(tr);
|
|
120
|
+
return true;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
111
123
|
var handleClosingByArrows = function handleClosingByArrows(closingMethod, state, showStatusPickerAt, tr) {
|
|
112
124
|
if (closingMethod === 'arrowLeft') {
|
|
113
125
|
// put cursor right before status Lozenge
|
|
@@ -135,6 +147,7 @@ var commitStatusPicker = exports.commitStatusPicker = function commitStatusPicke
|
|
|
135
147
|
var tr = state.tr;
|
|
136
148
|
tr = tr.setMeta(_pluginKey.pluginKey, {
|
|
137
149
|
showStatusPickerAt: null,
|
|
150
|
+
focusStatusInput: false,
|
|
138
151
|
isNew: false
|
|
139
152
|
});
|
|
140
153
|
if (closingMethod) {
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -75,6 +75,7 @@ var baseStatusPlugin = function baseStatusPlugin(_ref) {
|
|
|
75
75
|
localId = _statusNode$attrs.localId;
|
|
76
76
|
return /*#__PURE__*/_react.default.createElement(_statusPicker.default, {
|
|
77
77
|
isNew: statusState.isNew,
|
|
78
|
+
focusStatusInput: statusState.focusStatusInput,
|
|
78
79
|
target: target,
|
|
79
80
|
defaultText: text,
|
|
80
81
|
defaultColor: color,
|
|
@@ -7,11 +7,25 @@ exports.default = void 0;
|
|
|
7
7
|
exports.keymapPlugin = keymapPlugin;
|
|
8
8
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
9
9
|
var _keymap = require("@atlaskit/editor-prosemirror/keymap");
|
|
10
|
+
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
11
|
+
var _actions = require("../actions");
|
|
10
12
|
var _utils = require("../utils");
|
|
13
|
+
var _pluginKey = require("./plugin-key");
|
|
11
14
|
function keymapPlugin() {
|
|
12
15
|
var list = {};
|
|
13
16
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.enter.common, consumeKeyEvent, list);
|
|
14
|
-
(0, _keymaps.bindKeymapWithCommand)(_keymaps.tab.common,
|
|
17
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.tab.common, function (state, dispatch) {
|
|
18
|
+
var statusPluginState = _pluginKey.pluginKey.getState(state);
|
|
19
|
+
var isStatusNode = state.selection instanceof _state.NodeSelection ? state.selection.node.type === state.schema.nodes.status : false;
|
|
20
|
+
if (!isStatusNode) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
if (statusPluginState !== null && statusPluginState !== void 0 && statusPluginState.showStatusPickerAt) {
|
|
24
|
+
(0, _actions.setFocusOnStatusInput)()(state, dispatch);
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
return false;
|
|
28
|
+
}, list);
|
|
15
29
|
return (0, _keymap.keymap)(list);
|
|
16
30
|
}
|
|
17
31
|
|
|
@@ -33,7 +33,8 @@ var createPlugin = function createPlugin(pmPluginFactoryParams, options) {
|
|
|
33
33
|
init: function init() {
|
|
34
34
|
return {
|
|
35
35
|
isNew: false,
|
|
36
|
-
showStatusPickerAt: null
|
|
36
|
+
showStatusPickerAt: null,
|
|
37
|
+
focusStatusInput: false
|
|
37
38
|
};
|
|
38
39
|
},
|
|
39
40
|
apply: function apply(tr, state, oldEditorState) {
|
|
@@ -67,7 +68,8 @@ var createPlugin = function createPlugin(pmPluginFactoryParams, options) {
|
|
|
67
68
|
if (_showStatusPickerAt !== state.showStatusPickerAt) {
|
|
68
69
|
var _newState2 = _objectSpread(_objectSpread({}, state), {}, {
|
|
69
70
|
isNew: false,
|
|
70
|
-
showStatusPickerAt: _showStatusPickerAt
|
|
71
|
+
showStatusPickerAt: _showStatusPickerAt,
|
|
72
|
+
focusStatusInput: false
|
|
71
73
|
});
|
|
72
74
|
pmPluginFactoryParams.dispatch(_pluginKey.pluginKey, _newState2);
|
|
73
75
|
return _newState2;
|
|
@@ -235,17 +235,8 @@ var StatusPickerWithoutAnalytcs = exports.StatusPickerWithoutAnalytcs = /*#__PUR
|
|
|
235
235
|
}, {
|
|
236
236
|
key: "componentDidMount",
|
|
237
237
|
value: function componentDidMount() {
|
|
238
|
-
var _this2 = this;
|
|
239
238
|
this.reset();
|
|
240
239
|
this.fireStatusPopupOpenedAnalytics(this.state);
|
|
241
|
-
if (typeof this.props.isNew === 'boolean' && this.props.isNew === false) {
|
|
242
|
-
// Wrapper should be focused only if status already exists otherwise input field will receive focus
|
|
243
|
-
this.focusTimeout = requestAnimationFrame(function () {
|
|
244
|
-
var _this2$popupBodyWrapp;
|
|
245
|
-
// Defer to prevent editor scrolling to top. See https://product-fabric.atlassian.net/browse/DTR-1952
|
|
246
|
-
(_this2$popupBodyWrapp = _this2.popupBodyWrapper) === null || _this2$popupBodyWrapp === void 0 || (_this2$popupBodyWrapp = _this2$popupBodyWrapp.current) === null || _this2$popupBodyWrapp === void 0 || _this2$popupBodyWrapp.focus();
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
240
|
}
|
|
250
241
|
}, {
|
|
251
242
|
key: "componentWillUnmount",
|
|
@@ -288,7 +279,8 @@ var StatusPickerWithoutAnalytcs = exports.StatusPickerWithoutAnalytcs = /*#__PUR
|
|
|
288
279
|
target = _this$props.target,
|
|
289
280
|
mountTo = _this$props.mountTo,
|
|
290
281
|
boundariesElement = _this$props.boundariesElement,
|
|
291
|
-
scrollableElement = _this$props.scrollableElement
|
|
282
|
+
scrollableElement = _this$props.scrollableElement,
|
|
283
|
+
focusStatusInput = _this$props.focusStatusInput;
|
|
292
284
|
var _this$state3 = this.state,
|
|
293
285
|
color = _this$state3.color,
|
|
294
286
|
text = _this$state3.text;
|
|
@@ -310,7 +302,7 @@ var StatusPickerWithoutAnalytcs = exports.StatusPickerWithoutAnalytcs = /*#__PUR
|
|
|
310
302
|
onClick: this.handlePopupClick,
|
|
311
303
|
onKeyDown: this.onKeyDown
|
|
312
304
|
}, (0, _react2.jsx)(_picker.StatusPicker, {
|
|
313
|
-
autoFocus: isNew,
|
|
305
|
+
autoFocus: isNew || focusStatusInput,
|
|
314
306
|
selectedColor: color,
|
|
315
307
|
text: text,
|
|
316
308
|
onColorClick: this.onColorClick,
|
package/dist/es2019/actions.js
CHANGED
|
@@ -93,6 +93,16 @@ export const removeStatus = showStatusPickerAt => ({
|
|
|
93
93
|
tr.replace(showStatusPickerAt, showStatusPickerAt + 1);
|
|
94
94
|
return tr;
|
|
95
95
|
};
|
|
96
|
+
export const setFocusOnStatusInput = () => (state, dispatch) => {
|
|
97
|
+
if (!dispatch) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
const tr = state.tr.setMeta(pluginKey, {
|
|
101
|
+
focusStatusInput: true
|
|
102
|
+
});
|
|
103
|
+
dispatch(tr);
|
|
104
|
+
return true;
|
|
105
|
+
};
|
|
96
106
|
const handleClosingByArrows = (closingMethod, state, showStatusPickerAt, tr) => {
|
|
97
107
|
if (closingMethod === 'arrowLeft') {
|
|
98
108
|
// put cursor right before status Lozenge
|
|
@@ -123,6 +133,7 @@ export const commitStatusPicker = closingPayload => editorView => {
|
|
|
123
133
|
let tr = state.tr;
|
|
124
134
|
tr = tr.setMeta(pluginKey, {
|
|
125
135
|
showStatusPickerAt: null,
|
|
136
|
+
focusStatusInput: false,
|
|
126
137
|
isNew: false
|
|
127
138
|
});
|
|
128
139
|
if (closingMethod) {
|
package/dist/es2019/plugin.js
CHANGED
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
import { bindKeymapWithCommand, enter, tab } from '@atlaskit/editor-common/keymaps';
|
|
2
2
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
3
|
+
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import { setFocusOnStatusInput } from '../actions';
|
|
3
5
|
import { mayGetStatusAtSelection } from '../utils';
|
|
6
|
+
import { pluginKey } from './plugin-key';
|
|
4
7
|
export function keymapPlugin() {
|
|
5
8
|
const list = {};
|
|
6
9
|
bindKeymapWithCommand(enter.common, consumeKeyEvent, list);
|
|
7
|
-
bindKeymapWithCommand(tab.common,
|
|
10
|
+
bindKeymapWithCommand(tab.common, (state, dispatch) => {
|
|
11
|
+
const statusPluginState = pluginKey.getState(state);
|
|
12
|
+
const isStatusNode = state.selection instanceof NodeSelection ? state.selection.node.type === state.schema.nodes.status : false;
|
|
13
|
+
if (!isStatusNode) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
if (statusPluginState !== null && statusPluginState !== void 0 && statusPluginState.showStatusPickerAt) {
|
|
17
|
+
setFocusOnStatusInput()(state, dispatch);
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
return false;
|
|
21
|
+
}, list);
|
|
8
22
|
return keymap(list);
|
|
9
23
|
}
|
|
10
24
|
|
|
@@ -10,7 +10,8 @@ const createPlugin = (pmPluginFactoryParams, options) => new SafePlugin({
|
|
|
10
10
|
state: {
|
|
11
11
|
init: () => ({
|
|
12
12
|
isNew: false,
|
|
13
|
-
showStatusPickerAt: null
|
|
13
|
+
showStatusPickerAt: null,
|
|
14
|
+
focusStatusInput: false
|
|
14
15
|
}),
|
|
15
16
|
apply(tr, state, oldEditorState) {
|
|
16
17
|
const meta = tr.getMeta(pluginKey);
|
|
@@ -49,7 +50,8 @@ const createPlugin = (pmPluginFactoryParams, options) => new SafePlugin({
|
|
|
49
50
|
const newState = {
|
|
50
51
|
...state,
|
|
51
52
|
isNew: false,
|
|
52
|
-
showStatusPickerAt
|
|
53
|
+
showStatusPickerAt,
|
|
54
|
+
focusStatusInput: false
|
|
53
55
|
};
|
|
54
56
|
pmPluginFactoryParams.dispatch(pluginKey, newState);
|
|
55
57
|
return newState;
|
|
@@ -215,14 +215,6 @@ export class StatusPickerWithoutAnalytcs extends React.Component {
|
|
|
215
215
|
componentDidMount() {
|
|
216
216
|
this.reset();
|
|
217
217
|
this.fireStatusPopupOpenedAnalytics(this.state);
|
|
218
|
-
if (typeof this.props.isNew === 'boolean' && this.props.isNew === false) {
|
|
219
|
-
// Wrapper should be focused only if status already exists otherwise input field will receive focus
|
|
220
|
-
this.focusTimeout = requestAnimationFrame(() => {
|
|
221
|
-
var _this$popupBodyWrappe3, _this$popupBodyWrappe4;
|
|
222
|
-
// Defer to prevent editor scrolling to top. See https://product-fabric.atlassian.net/browse/DTR-1952
|
|
223
|
-
(_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();
|
|
224
|
-
});
|
|
225
|
-
}
|
|
226
218
|
}
|
|
227
219
|
componentWillUnmount() {
|
|
228
220
|
this.focusTimeout && cancelAnimationFrame(this.focusTimeout);
|
|
@@ -259,7 +251,8 @@ export class StatusPickerWithoutAnalytcs extends React.Component {
|
|
|
259
251
|
target,
|
|
260
252
|
mountTo,
|
|
261
253
|
boundariesElement,
|
|
262
|
-
scrollableElement
|
|
254
|
+
scrollableElement,
|
|
255
|
+
focusStatusInput
|
|
263
256
|
} = this.props;
|
|
264
257
|
const {
|
|
265
258
|
color,
|
|
@@ -283,7 +276,7 @@ export class StatusPickerWithoutAnalytcs extends React.Component {
|
|
|
283
276
|
onClick: this.handlePopupClick,
|
|
284
277
|
onKeyDown: this.onKeyDown
|
|
285
278
|
}, jsx(AkStatusPicker, {
|
|
286
|
-
autoFocus: isNew,
|
|
279
|
+
autoFocus: isNew || focusStatusInput,
|
|
287
280
|
selectedColor: color,
|
|
288
281
|
text: text,
|
|
289
282
|
onColorClick: this.onColorClick,
|
package/dist/esm/actions.js
CHANGED
|
@@ -101,6 +101,18 @@ export var removeStatus = function removeStatus(showStatusPickerAt) {
|
|
|
101
101
|
return tr;
|
|
102
102
|
};
|
|
103
103
|
};
|
|
104
|
+
export var setFocusOnStatusInput = function setFocusOnStatusInput() {
|
|
105
|
+
return function (state, dispatch) {
|
|
106
|
+
if (!dispatch) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
var tr = state.tr.setMeta(pluginKey, {
|
|
110
|
+
focusStatusInput: true
|
|
111
|
+
});
|
|
112
|
+
dispatch(tr);
|
|
113
|
+
return true;
|
|
114
|
+
};
|
|
115
|
+
};
|
|
104
116
|
var handleClosingByArrows = function handleClosingByArrows(closingMethod, state, showStatusPickerAt, tr) {
|
|
105
117
|
if (closingMethod === 'arrowLeft') {
|
|
106
118
|
// put cursor right before status Lozenge
|
|
@@ -128,6 +140,7 @@ export var commitStatusPicker = function commitStatusPicker(closingPayload) {
|
|
|
128
140
|
var tr = state.tr;
|
|
129
141
|
tr = tr.setMeta(pluginKey, {
|
|
130
142
|
showStatusPickerAt: null,
|
|
143
|
+
focusStatusInput: false,
|
|
131
144
|
isNew: false
|
|
132
145
|
});
|
|
133
146
|
if (closingMethod) {
|
package/dist/esm/plugin.js
CHANGED
|
@@ -68,6 +68,7 @@ var baseStatusPlugin = function baseStatusPlugin(_ref) {
|
|
|
68
68
|
localId = _statusNode$attrs.localId;
|
|
69
69
|
return /*#__PURE__*/React.createElement(StatusPicker, {
|
|
70
70
|
isNew: statusState.isNew,
|
|
71
|
+
focusStatusInput: statusState.focusStatusInput,
|
|
71
72
|
target: target,
|
|
72
73
|
defaultText: text,
|
|
73
74
|
defaultColor: color,
|
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
import { bindKeymapWithCommand, enter, tab } from '@atlaskit/editor-common/keymaps';
|
|
2
2
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
3
|
+
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import { setFocusOnStatusInput } from '../actions';
|
|
3
5
|
import { mayGetStatusAtSelection } from '../utils';
|
|
6
|
+
import { pluginKey } from './plugin-key';
|
|
4
7
|
export function keymapPlugin() {
|
|
5
8
|
var list = {};
|
|
6
9
|
bindKeymapWithCommand(enter.common, consumeKeyEvent, list);
|
|
7
|
-
bindKeymapWithCommand(tab.common,
|
|
10
|
+
bindKeymapWithCommand(tab.common, function (state, dispatch) {
|
|
11
|
+
var statusPluginState = pluginKey.getState(state);
|
|
12
|
+
var isStatusNode = state.selection instanceof NodeSelection ? state.selection.node.type === state.schema.nodes.status : false;
|
|
13
|
+
if (!isStatusNode) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
if (statusPluginState !== null && statusPluginState !== void 0 && statusPluginState.showStatusPickerAt) {
|
|
17
|
+
setFocusOnStatusInput()(state, dispatch);
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
return false;
|
|
21
|
+
}, list);
|
|
8
22
|
return keymap(list);
|
|
9
23
|
}
|
|
10
24
|
|
|
@@ -15,7 +15,8 @@ var createPlugin = function createPlugin(pmPluginFactoryParams, options) {
|
|
|
15
15
|
init: function init() {
|
|
16
16
|
return {
|
|
17
17
|
isNew: false,
|
|
18
|
-
showStatusPickerAt: null
|
|
18
|
+
showStatusPickerAt: null,
|
|
19
|
+
focusStatusInput: false
|
|
19
20
|
};
|
|
20
21
|
},
|
|
21
22
|
apply: function apply(tr, state, oldEditorState) {
|
|
@@ -49,7 +50,8 @@ var createPlugin = function createPlugin(pmPluginFactoryParams, options) {
|
|
|
49
50
|
if (_showStatusPickerAt !== state.showStatusPickerAt) {
|
|
50
51
|
var _newState2 = _objectSpread(_objectSpread({}, state), {}, {
|
|
51
52
|
isNew: false,
|
|
52
|
-
showStatusPickerAt: _showStatusPickerAt
|
|
53
|
+
showStatusPickerAt: _showStatusPickerAt,
|
|
54
|
+
focusStatusInput: false
|
|
53
55
|
});
|
|
54
56
|
pmPluginFactoryParams.dispatch(pluginKey, _newState2);
|
|
55
57
|
return _newState2;
|
|
@@ -230,17 +230,8 @@ export var StatusPickerWithoutAnalytcs = /*#__PURE__*/function (_React$Component
|
|
|
230
230
|
}, {
|
|
231
231
|
key: "componentDidMount",
|
|
232
232
|
value: function componentDidMount() {
|
|
233
|
-
var _this2 = this;
|
|
234
233
|
this.reset();
|
|
235
234
|
this.fireStatusPopupOpenedAnalytics(this.state);
|
|
236
|
-
if (typeof this.props.isNew === 'boolean' && this.props.isNew === false) {
|
|
237
|
-
// Wrapper should be focused only if status already exists otherwise input field will receive focus
|
|
238
|
-
this.focusTimeout = requestAnimationFrame(function () {
|
|
239
|
-
var _this2$popupBodyWrapp;
|
|
240
|
-
// Defer to prevent editor scrolling to top. See https://product-fabric.atlassian.net/browse/DTR-1952
|
|
241
|
-
(_this2$popupBodyWrapp = _this2.popupBodyWrapper) === null || _this2$popupBodyWrapp === void 0 || (_this2$popupBodyWrapp = _this2$popupBodyWrapp.current) === null || _this2$popupBodyWrapp === void 0 || _this2$popupBodyWrapp.focus();
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
235
|
}
|
|
245
236
|
}, {
|
|
246
237
|
key: "componentWillUnmount",
|
|
@@ -283,7 +274,8 @@ export var StatusPickerWithoutAnalytcs = /*#__PURE__*/function (_React$Component
|
|
|
283
274
|
target = _this$props.target,
|
|
284
275
|
mountTo = _this$props.mountTo,
|
|
285
276
|
boundariesElement = _this$props.boundariesElement,
|
|
286
|
-
scrollableElement = _this$props.scrollableElement
|
|
277
|
+
scrollableElement = _this$props.scrollableElement,
|
|
278
|
+
focusStatusInput = _this$props.focusStatusInput;
|
|
287
279
|
var _this$state3 = this.state,
|
|
288
280
|
color = _this$state3.color,
|
|
289
281
|
text = _this$state3.text;
|
|
@@ -305,7 +297,7 @@ export var StatusPickerWithoutAnalytcs = /*#__PURE__*/function (_React$Component
|
|
|
305
297
|
onClick: this.handlePopupClick,
|
|
306
298
|
onKeyDown: this.onKeyDown
|
|
307
299
|
}, jsx(AkStatusPicker, {
|
|
308
|
-
autoFocus: isNew,
|
|
300
|
+
autoFocus: isNew || focusStatusInput,
|
|
309
301
|
selectedColor: color,
|
|
310
302
|
text: text,
|
|
311
303
|
onColorClick: this.onColorClick,
|
package/dist/types/actions.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import type { Command, EditorCommand, TOOLBAR_MENU_TYPE } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { Command, CommandDispatch, EditorCommand, TOOLBAR_MENU_TYPE } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
import type { ClosingPayload, StatusType } from './types';
|
|
@@ -12,4 +12,5 @@ export type UpdateStatus = (inputMethod: TOOLBAR_MENU_TYPE, status?: StatusType)
|
|
|
12
12
|
export declare const updateStatusWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod: TOOLBAR_MENU_TYPE, status?: StatusType) => Command;
|
|
13
13
|
export declare const setStatusPickerAt: (showStatusPickerAt: number | null) => (state: EditorState, dispatch: (tr: Transaction) => void) => boolean;
|
|
14
14
|
export declare const removeStatus: (showStatusPickerAt: number) => EditorCommand;
|
|
15
|
+
export declare const setFocusOnStatusInput: () => (state: EditorState, dispatch: CommandDispatch | undefined) => boolean;
|
|
15
16
|
export declare const commitStatusPicker: (closingPayload?: ClosingPayload) => (editorView: EditorView) => void;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import type { Command, EditorCommand, TOOLBAR_MENU_TYPE } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { Command, CommandDispatch, EditorCommand, TOOLBAR_MENU_TYPE } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
import type { ClosingPayload, StatusType } from './types';
|
|
@@ -12,4 +12,5 @@ export type UpdateStatus = (inputMethod: TOOLBAR_MENU_TYPE, status?: StatusType)
|
|
|
12
12
|
export declare const updateStatusWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod: TOOLBAR_MENU_TYPE, status?: StatusType) => Command;
|
|
13
13
|
export declare const setStatusPickerAt: (showStatusPickerAt: number | null) => (state: EditorState, dispatch: (tr: Transaction) => void) => boolean;
|
|
14
14
|
export declare const removeStatus: (showStatusPickerAt: number) => EditorCommand;
|
|
15
|
+
export declare const setFocusOnStatusInput: () => (state: EditorState, dispatch: CommandDispatch | undefined) => boolean;
|
|
15
16
|
export declare const commitStatusPicker: (closingPayload?: ClosingPayload) => (editorView: EditorView) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-status",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Status plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/adf-schema": "^32.0.0",
|
|
35
35
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
36
|
-
"@atlaskit/editor-common": "^76.
|
|
37
|
-
"@atlaskit/editor-plugin-analytics": "^0.
|
|
36
|
+
"@atlaskit/editor-common": "^76.17.0",
|
|
37
|
+
"@atlaskit/editor-plugin-analytics": "^0.3.0",
|
|
38
38
|
"@atlaskit/editor-prosemirror": "1.1.0",
|
|
39
39
|
"@atlaskit/editor-shared-styles": "^2.8.0",
|
|
40
40
|
"@atlaskit/status": "^1.4.0",
|
|
41
41
|
"@atlaskit/theme": "^12.6.0",
|
|
42
|
-
"@atlaskit/tokens": "^1.
|
|
42
|
+
"@atlaskit/tokens": "^1.28.0",
|
|
43
43
|
"@babel/runtime": "^7.0.0",
|
|
44
44
|
"@emotion/react": "^11.7.1"
|
|
45
45
|
},
|
package/report.api.md
CHANGED