@atlaskit/editor-plugin-status 2.6.4 → 2.6.6
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/pm-plugins/actions.js +4 -1
- package/dist/cjs/pm-plugins/keymap.js +6 -1
- package/dist/cjs/ui/ContentComponent.js +5 -1
- package/dist/es2019/pm-plugins/actions.js +4 -1
- package/dist/es2019/pm-plugins/keymap.js +6 -1
- package/dist/es2019/pm-plugins/plugin.js +3 -3
- package/dist/es2019/ui/ContentComponent.js +4 -1
- package/dist/esm/pm-plugins/actions.js +4 -1
- package/dist/esm/pm-plugins/keymap.js +6 -1
- package/dist/esm/ui/ContentComponent.js +5 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -134,7 +134,10 @@ var setFocusOnStatusInput = exports.setFocusOnStatusInput = function setFocusOnS
|
|
|
134
134
|
return true;
|
|
135
135
|
};
|
|
136
136
|
};
|
|
137
|
-
var handleClosingByArrows = function handleClosingByArrows(closingMethod, state, showStatusPickerAt, tr
|
|
137
|
+
var handleClosingByArrows = function handleClosingByArrows(closingMethod, state, showStatusPickerAt, tr
|
|
138
|
+
// Ignored via go/ees005
|
|
139
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
140
|
+
) {
|
|
138
141
|
if (closingMethod === 'arrowLeft') {
|
|
139
142
|
// put cursor right before status Lozenge
|
|
140
143
|
tr = tr.setSelection(_state.Selection.near(state.tr.doc.resolve(showStatusPickerAt), -1));
|
|
@@ -13,8 +13,13 @@ var _pluginKey = require("./plugin-key");
|
|
|
13
13
|
var _utils = require("./utils");
|
|
14
14
|
function keymapPlugin() {
|
|
15
15
|
var list = {};
|
|
16
|
+
// Ignored via go/ees005
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
16
18
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.enter.common, consumeKeyEvent, list);
|
|
17
|
-
(0, _keymaps.bindKeymapWithCommand)(
|
|
19
|
+
(0, _keymaps.bindKeymapWithCommand)(
|
|
20
|
+
// Ignored via go/ees005
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
22
|
+
_keymaps.tab.common, function (state, dispatch) {
|
|
18
23
|
var statusPluginState = _pluginKey.pluginKey.getState(state);
|
|
19
24
|
var isStatusNode = state.selection instanceof _state.NodeSelection ? state.selection.node.type === state.schema.nodes.status : false;
|
|
20
25
|
if (!isStatusNode) {
|
|
@@ -25,7 +25,11 @@ function ContentComponent(_ref) {
|
|
|
25
25
|
var _ref2 = statusState !== null && statusState !== void 0 ? statusState : {},
|
|
26
26
|
showStatusPickerAt = _ref2.showStatusPickerAt;
|
|
27
27
|
var target = (0, _react.useMemo)(function () {
|
|
28
|
-
return
|
|
28
|
+
return (
|
|
29
|
+
// Ignored via go/ees005
|
|
30
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
31
|
+
showStatusPickerAt ? (0, _utils.findDomRefAtPos)(showStatusPickerAt, domAtPos) : null
|
|
32
|
+
);
|
|
29
33
|
}, [showStatusPickerAt, domAtPos]);
|
|
30
34
|
var statusNode = (0, _react.useMemo)(function () {
|
|
31
35
|
return showStatusPickerAt ? editorView.state.doc.nodeAt(showStatusPickerAt) : undefined;
|
|
@@ -116,7 +116,10 @@ export const setFocusOnStatusInput = () => (state, dispatch) => {
|
|
|
116
116
|
dispatch(tr);
|
|
117
117
|
return true;
|
|
118
118
|
};
|
|
119
|
-
const handleClosingByArrows = (closingMethod, state, showStatusPickerAt, tr
|
|
119
|
+
const handleClosingByArrows = (closingMethod, state, showStatusPickerAt, tr
|
|
120
|
+
// Ignored via go/ees005
|
|
121
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
122
|
+
) => {
|
|
120
123
|
if (closingMethod === 'arrowLeft') {
|
|
121
124
|
// put cursor right before status Lozenge
|
|
122
125
|
tr = tr.setSelection(Selection.near(state.tr.doc.resolve(showStatusPickerAt), -1));
|
|
@@ -6,8 +6,13 @@ import { pluginKey } from './plugin-key';
|
|
|
6
6
|
import { mayGetStatusAtSelection } from './utils';
|
|
7
7
|
export function keymapPlugin() {
|
|
8
8
|
const list = {};
|
|
9
|
+
// Ignored via go/ees005
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
9
11
|
bindKeymapWithCommand(enter.common, consumeKeyEvent, list);
|
|
10
|
-
bindKeymapWithCommand(
|
|
12
|
+
bindKeymapWithCommand(
|
|
13
|
+
// Ignored via go/ees005
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
15
|
+
tab.common, (state, dispatch) => {
|
|
11
16
|
const statusPluginState = pluginKey.getState(state);
|
|
12
17
|
const isStatusNode = state.selection instanceof NodeSelection ? state.selection.node.type === state.schema.nodes.status : false;
|
|
13
18
|
if (!isStatusNode) {
|
|
@@ -77,7 +77,7 @@ const createPlugin = (pmPluginFactoryParams, options) => new SafePlugin({
|
|
|
77
77
|
},
|
|
78
78
|
appendTransaction: (transactions, oldEditorState, newEditorState) => {
|
|
79
79
|
let changed = false;
|
|
80
|
-
|
|
80
|
+
const tr = newEditorState.tr;
|
|
81
81
|
|
|
82
82
|
/**
|
|
83
83
|
* When user start creating status, and, when users navigates away
|
|
@@ -86,8 +86,8 @@ const createPlugin = (pmPluginFactoryParams, options) => new SafePlugin({
|
|
|
86
86
|
* we don't want to remove it.
|
|
87
87
|
*/
|
|
88
88
|
if (transactions.find(tr => tr.selectionSet && !tr.getMeta(pmHistoryPluginKey))) {
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
const oldStatus = mayGetStatusAtSelection(oldEditorState.selection);
|
|
90
|
+
const newStatus = mayGetStatusAtSelection(newEditorState.selection);
|
|
91
91
|
if (oldStatus && (newStatus && oldStatus.localId !== newStatus.localId || !newStatus)) {
|
|
92
92
|
if (isEmptyStatus(oldStatus)) {
|
|
93
93
|
const pos = oldEditorState.selection.from;
|
|
@@ -17,7 +17,10 @@ export function ContentComponent({
|
|
|
17
17
|
const {
|
|
18
18
|
showStatusPickerAt
|
|
19
19
|
} = statusState !== null && statusState !== void 0 ? statusState : {};
|
|
20
|
-
const target = useMemo(() =>
|
|
20
|
+
const target = useMemo(() =>
|
|
21
|
+
// Ignored via go/ees005
|
|
22
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
23
|
+
showStatusPickerAt ? findDomRefAtPos(showStatusPickerAt, domAtPos) : null, [showStatusPickerAt, domAtPos]);
|
|
21
24
|
const statusNode = useMemo(() => showStatusPickerAt ? editorView.state.doc.nodeAt(showStatusPickerAt) : undefined, [showStatusPickerAt, editorView]);
|
|
22
25
|
const onSelect = useCallback(status => {
|
|
23
26
|
updateStatus(status)(editorView.state, editorView.dispatch);
|
|
@@ -127,7 +127,10 @@ export var setFocusOnStatusInput = function setFocusOnStatusInput() {
|
|
|
127
127
|
return true;
|
|
128
128
|
};
|
|
129
129
|
};
|
|
130
|
-
var handleClosingByArrows = function handleClosingByArrows(closingMethod, state, showStatusPickerAt, tr
|
|
130
|
+
var handleClosingByArrows = function handleClosingByArrows(closingMethod, state, showStatusPickerAt, tr
|
|
131
|
+
// Ignored via go/ees005
|
|
132
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
133
|
+
) {
|
|
131
134
|
if (closingMethod === 'arrowLeft') {
|
|
132
135
|
// put cursor right before status Lozenge
|
|
133
136
|
tr = tr.setSelection(Selection.near(state.tr.doc.resolve(showStatusPickerAt), -1));
|
|
@@ -6,8 +6,13 @@ import { pluginKey } from './plugin-key';
|
|
|
6
6
|
import { mayGetStatusAtSelection } from './utils';
|
|
7
7
|
export function keymapPlugin() {
|
|
8
8
|
var list = {};
|
|
9
|
+
// Ignored via go/ees005
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
9
11
|
bindKeymapWithCommand(enter.common, consumeKeyEvent, list);
|
|
10
|
-
bindKeymapWithCommand(
|
|
12
|
+
bindKeymapWithCommand(
|
|
13
|
+
// Ignored via go/ees005
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
15
|
+
tab.common, function (state, dispatch) {
|
|
11
16
|
var statusPluginState = pluginKey.getState(state);
|
|
12
17
|
var isStatusNode = state.selection instanceof NodeSelection ? state.selection.node.type === state.schema.nodes.status : false;
|
|
13
18
|
if (!isStatusNode) {
|
|
@@ -15,7 +15,11 @@ export function ContentComponent(_ref) {
|
|
|
15
15
|
var _ref2 = statusState !== null && statusState !== void 0 ? statusState : {},
|
|
16
16
|
showStatusPickerAt = _ref2.showStatusPickerAt;
|
|
17
17
|
var target = useMemo(function () {
|
|
18
|
-
return
|
|
18
|
+
return (
|
|
19
|
+
// Ignored via go/ees005
|
|
20
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
21
|
+
showStatusPickerAt ? findDomRefAtPos(showStatusPickerAt, domAtPos) : null
|
|
22
|
+
);
|
|
19
23
|
}, [showStatusPickerAt, domAtPos]);
|
|
20
24
|
var statusNode = useMemo(function () {
|
|
21
25
|
return showStatusPickerAt ? editorView.state.doc.nodeAt(showStatusPickerAt) : undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-status",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.6",
|
|
4
4
|
"description": "Status plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/adf-schema": "^46.1.0",
|
|
35
35
|
"@atlaskit/analytics-next": "^10.2.0",
|
|
36
|
-
"@atlaskit/editor-common": "^
|
|
36
|
+
"@atlaskit/editor-common": "^99.0.0",
|
|
37
37
|
"@atlaskit/editor-plugin-analytics": "^1.10.0",
|
|
38
38
|
"@atlaskit/editor-prosemirror": "6.2.1",
|
|
39
39
|
"@atlaskit/editor-shared-styles": "^3.2.0",
|
|
40
|
-
"@atlaskit/icon": "^23.
|
|
40
|
+
"@atlaskit/icon": "^23.3.0",
|
|
41
41
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
42
42
|
"@atlaskit/status": "^1.8.0",
|
|
43
43
|
"@atlaskit/theme": "^14.0.0",
|
|
44
|
-
"@atlaskit/tokens": "^
|
|
44
|
+
"@atlaskit/tokens": "^3.0.0",
|
|
45
45
|
"@babel/runtime": "^7.0.0",
|
|
46
46
|
"@emotion/react": "^11.7.1"
|
|
47
47
|
},
|