@atlaskit/editor-plugin-tasks-and-decisions 25.0.2 → 25.0.3
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 +8 -0
- package/dist/cjs/ui/TaskListMenuItem/TaskListMenuItem.js +5 -26
- package/dist/es2019/ui/TaskListMenuItem/TaskListMenuItem.js +5 -26
- package/dist/esm/ui/TaskListMenuItem/TaskListMenuItem.js +5 -26
- package/dist/types/tasksAndDecisionsPluginType.d.ts +1 -2
- package/package.json +2 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-tasks-and-decisions
|
|
2
2
|
|
|
3
|
+
## 25.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`85394203c5e0a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/85394203c5e0a) -
|
|
8
|
+
Cleanup `platform_editor_markdown_compatible_toolbar`.
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 25.0.2
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -11,39 +11,19 @@ var _hooks = require("@atlaskit/editor-common/hooks");
|
|
|
11
11
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
12
12
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
13
13
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
14
|
-
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
15
|
-
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
16
14
|
var TaskListMenuItem = exports.TaskListMenuItem = function TaskListMenuItem(_ref) {
|
|
17
15
|
var api = _ref.api;
|
|
18
16
|
var _useIntl = (0, _reactIntl.useIntl)(),
|
|
19
17
|
formatMessage = _useIntl.formatMessage;
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
var _states$taskDecisionS, _states$markdownModeS, _states$markdownModeS2, _states$markdownModeS3;
|
|
18
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['taskDecision'], function (states) {
|
|
19
|
+
var _states$taskDecisionS;
|
|
23
20
|
return {
|
|
24
|
-
isInsideTask: (_states$taskDecisionS = states.taskDecisionState) === null || _states$taskDecisionS === void 0 ? void 0 : _states$taskDecisionS.isInsideTask
|
|
25
|
-
markdownView: isMarkdownToolbarEnabled ? (_states$markdownModeS = states.markdownModeState) === null || _states$markdownModeS === void 0 ? void 0 : _states$markdownModeS.view : undefined,
|
|
26
|
-
sourceBlockFormatState: isMarkdownToolbarEnabled ? (_states$markdownModeS2 = states.markdownModeState) === null || _states$markdownModeS2 === void 0 ? void 0 : _states$markdownModeS2.sourceBlockFormatState : null,
|
|
27
|
-
sourceListFormatState: isMarkdownToolbarEnabled ? (_states$markdownModeS3 = states.markdownModeState) === null || _states$markdownModeS3 === void 0 ? void 0 : _states$markdownModeS3.sourceListFormatState : null
|
|
21
|
+
isInsideTask: (_states$taskDecisionS = states.taskDecisionState) === null || _states$taskDecisionS === void 0 ? void 0 : _states$taskDecisionS.isInsideTask
|
|
28
22
|
};
|
|
29
23
|
}),
|
|
30
|
-
isInsideTask = _useSharedPluginState.isInsideTask
|
|
31
|
-
markdownView = _useSharedPluginState.markdownView,
|
|
32
|
-
sourceBlockFormatState = _useSharedPluginState.sourceBlockFormatState,
|
|
33
|
-
sourceListFormatState = _useSharedPluginState.sourceListFormatState;
|
|
34
|
-
var isInSourceView = isMarkdownToolbarEnabled && markdownView === 'syntax';
|
|
35
|
-
var isSelected = isInSourceView ? sourceListFormatState === null || sourceListFormatState === void 0 ? void 0 : sourceListFormatState.inTaskList : isInsideTask;
|
|
36
|
-
var isDisabled = Boolean(isInSourceView && (sourceBlockFormatState === null || sourceBlockFormatState === void 0 ? void 0 : sourceBlockFormatState.inCodeBlock));
|
|
24
|
+
isInsideTask = _useSharedPluginState.isInsideTask;
|
|
37
25
|
var handleClick = function handleClick() {
|
|
38
26
|
var _api$taskDecision;
|
|
39
|
-
if (isDisabled) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
if (isInSourceView) {
|
|
43
|
-
var _api$markdownMode;
|
|
44
|
-
api === null || api === void 0 || (_api$markdownMode = api.markdownMode) === null || _api$markdownMode === void 0 || _api$markdownMode.actions.toggleSourceTaskList();
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
27
|
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$taskDecision = api.taskDecision) === null || _api$taskDecision === void 0 ? void 0 : _api$taskDecision.commands.toggleTaskList());
|
|
48
28
|
};
|
|
49
29
|
return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItem, {
|
|
@@ -54,8 +34,7 @@ var TaskListMenuItem = exports.TaskListMenuItem = function TaskListMenuItem(_ref
|
|
|
54
34
|
elemAfter: /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarKeyboardShortcutHint, {
|
|
55
35
|
shortcut: (0, _keymaps.formatShortcut)(_keymaps.toggleTaskList)
|
|
56
36
|
}),
|
|
57
|
-
isSelected:
|
|
58
|
-
isDisabled: isDisabled,
|
|
37
|
+
isSelected: isInsideTask,
|
|
59
38
|
onClick: handleClick,
|
|
60
39
|
ariaKeyshortcuts: (0, _keymaps.formatShortcut)(_keymaps.toggleTaskList)
|
|
61
40
|
}, formatMessage(_messages.tasksAndDecisionsMessages.taskList));
|
|
@@ -4,42 +4,22 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
|
|
|
4
4
|
import { formatShortcut, toggleTaskList } from '@atlaskit/editor-common/keymaps';
|
|
5
5
|
import { tasksAndDecisionsMessages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { ToolbarDropdownItem, ToolbarKeyboardShortcutHint, TaskIcon } from '@atlaskit/editor-toolbar';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
8
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
9
7
|
export const TaskListMenuItem = ({
|
|
10
8
|
api
|
|
11
9
|
}) => {
|
|
12
10
|
const {
|
|
13
11
|
formatMessage
|
|
14
12
|
} = useIntl();
|
|
15
|
-
const isMarkdownToolbarEnabled = expValEqualsNoExposure('cc-markdown-mode', 'isEnabled', true) && fg('platform_editor_markdown_compatible_toolbar');
|
|
16
13
|
const {
|
|
17
|
-
isInsideTask
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
sourceListFormatState
|
|
21
|
-
} = useSharedPluginStateWithSelector(api, ['taskDecision', 'markdownMode'], states => {
|
|
22
|
-
var _states$taskDecisionS, _states$markdownModeS, _states$markdownModeS2, _states$markdownModeS3;
|
|
14
|
+
isInsideTask
|
|
15
|
+
} = useSharedPluginStateWithSelector(api, ['taskDecision'], states => {
|
|
16
|
+
var _states$taskDecisionS;
|
|
23
17
|
return {
|
|
24
|
-
isInsideTask: (_states$taskDecisionS = states.taskDecisionState) === null || _states$taskDecisionS === void 0 ? void 0 : _states$taskDecisionS.isInsideTask
|
|
25
|
-
markdownView: isMarkdownToolbarEnabled ? (_states$markdownModeS = states.markdownModeState) === null || _states$markdownModeS === void 0 ? void 0 : _states$markdownModeS.view : undefined,
|
|
26
|
-
sourceBlockFormatState: isMarkdownToolbarEnabled ? (_states$markdownModeS2 = states.markdownModeState) === null || _states$markdownModeS2 === void 0 ? void 0 : _states$markdownModeS2.sourceBlockFormatState : null,
|
|
27
|
-
sourceListFormatState: isMarkdownToolbarEnabled ? (_states$markdownModeS3 = states.markdownModeState) === null || _states$markdownModeS3 === void 0 ? void 0 : _states$markdownModeS3.sourceListFormatState : null
|
|
18
|
+
isInsideTask: (_states$taskDecisionS = states.taskDecisionState) === null || _states$taskDecisionS === void 0 ? void 0 : _states$taskDecisionS.isInsideTask
|
|
28
19
|
};
|
|
29
20
|
});
|
|
30
|
-
const isInSourceView = isMarkdownToolbarEnabled && markdownView === 'syntax';
|
|
31
|
-
const isSelected = isInSourceView ? sourceListFormatState === null || sourceListFormatState === void 0 ? void 0 : sourceListFormatState.inTaskList : isInsideTask;
|
|
32
|
-
const isDisabled = Boolean(isInSourceView && (sourceBlockFormatState === null || sourceBlockFormatState === void 0 ? void 0 : sourceBlockFormatState.inCodeBlock));
|
|
33
21
|
const handleClick = () => {
|
|
34
22
|
var _api$taskDecision;
|
|
35
|
-
if (isDisabled) {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
if (isInSourceView) {
|
|
39
|
-
var _api$markdownMode;
|
|
40
|
-
api === null || api === void 0 ? void 0 : (_api$markdownMode = api.markdownMode) === null || _api$markdownMode === void 0 ? void 0 : _api$markdownMode.actions.toggleSourceTaskList();
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
23
|
api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$taskDecision = api.taskDecision) === null || _api$taskDecision === void 0 ? void 0 : _api$taskDecision.commands.toggleTaskList());
|
|
44
24
|
};
|
|
45
25
|
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
@@ -50,8 +30,7 @@ export const TaskListMenuItem = ({
|
|
|
50
30
|
elemAfter: /*#__PURE__*/React.createElement(ToolbarKeyboardShortcutHint, {
|
|
51
31
|
shortcut: formatShortcut(toggleTaskList)
|
|
52
32
|
}),
|
|
53
|
-
isSelected:
|
|
54
|
-
isDisabled: isDisabled,
|
|
33
|
+
isSelected: isInsideTask,
|
|
55
34
|
onClick: handleClick,
|
|
56
35
|
ariaKeyshortcuts: formatShortcut(toggleTaskList)
|
|
57
36
|
}, formatMessage(tasksAndDecisionsMessages.taskList));
|
|
@@ -4,39 +4,19 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
|
|
|
4
4
|
import { formatShortcut, toggleTaskList } from '@atlaskit/editor-common/keymaps';
|
|
5
5
|
import { tasksAndDecisionsMessages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { ToolbarDropdownItem, ToolbarKeyboardShortcutHint, TaskIcon } from '@atlaskit/editor-toolbar';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
8
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
9
7
|
export var TaskListMenuItem = function TaskListMenuItem(_ref) {
|
|
10
8
|
var api = _ref.api;
|
|
11
9
|
var _useIntl = useIntl(),
|
|
12
10
|
formatMessage = _useIntl.formatMessage;
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
var _states$taskDecisionS, _states$markdownModeS, _states$markdownModeS2, _states$markdownModeS3;
|
|
11
|
+
var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['taskDecision'], function (states) {
|
|
12
|
+
var _states$taskDecisionS;
|
|
16
13
|
return {
|
|
17
|
-
isInsideTask: (_states$taskDecisionS = states.taskDecisionState) === null || _states$taskDecisionS === void 0 ? void 0 : _states$taskDecisionS.isInsideTask
|
|
18
|
-
markdownView: isMarkdownToolbarEnabled ? (_states$markdownModeS = states.markdownModeState) === null || _states$markdownModeS === void 0 ? void 0 : _states$markdownModeS.view : undefined,
|
|
19
|
-
sourceBlockFormatState: isMarkdownToolbarEnabled ? (_states$markdownModeS2 = states.markdownModeState) === null || _states$markdownModeS2 === void 0 ? void 0 : _states$markdownModeS2.sourceBlockFormatState : null,
|
|
20
|
-
sourceListFormatState: isMarkdownToolbarEnabled ? (_states$markdownModeS3 = states.markdownModeState) === null || _states$markdownModeS3 === void 0 ? void 0 : _states$markdownModeS3.sourceListFormatState : null
|
|
14
|
+
isInsideTask: (_states$taskDecisionS = states.taskDecisionState) === null || _states$taskDecisionS === void 0 ? void 0 : _states$taskDecisionS.isInsideTask
|
|
21
15
|
};
|
|
22
16
|
}),
|
|
23
|
-
isInsideTask = _useSharedPluginState.isInsideTask
|
|
24
|
-
markdownView = _useSharedPluginState.markdownView,
|
|
25
|
-
sourceBlockFormatState = _useSharedPluginState.sourceBlockFormatState,
|
|
26
|
-
sourceListFormatState = _useSharedPluginState.sourceListFormatState;
|
|
27
|
-
var isInSourceView = isMarkdownToolbarEnabled && markdownView === 'syntax';
|
|
28
|
-
var isSelected = isInSourceView ? sourceListFormatState === null || sourceListFormatState === void 0 ? void 0 : sourceListFormatState.inTaskList : isInsideTask;
|
|
29
|
-
var isDisabled = Boolean(isInSourceView && (sourceBlockFormatState === null || sourceBlockFormatState === void 0 ? void 0 : sourceBlockFormatState.inCodeBlock));
|
|
17
|
+
isInsideTask = _useSharedPluginState.isInsideTask;
|
|
30
18
|
var handleClick = function handleClick() {
|
|
31
19
|
var _api$taskDecision;
|
|
32
|
-
if (isDisabled) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
if (isInSourceView) {
|
|
36
|
-
var _api$markdownMode;
|
|
37
|
-
api === null || api === void 0 || (_api$markdownMode = api.markdownMode) === null || _api$markdownMode === void 0 || _api$markdownMode.actions.toggleSourceTaskList();
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
20
|
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$taskDecision = api.taskDecision) === null || _api$taskDecision === void 0 ? void 0 : _api$taskDecision.commands.toggleTaskList());
|
|
41
21
|
};
|
|
42
22
|
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
@@ -47,8 +27,7 @@ export var TaskListMenuItem = function TaskListMenuItem(_ref) {
|
|
|
47
27
|
elemAfter: /*#__PURE__*/React.createElement(ToolbarKeyboardShortcutHint, {
|
|
48
28
|
shortcut: formatShortcut(toggleTaskList)
|
|
49
29
|
}),
|
|
50
|
-
isSelected:
|
|
51
|
-
isDisabled: isDisabled,
|
|
30
|
+
isSelected: isInsideTask,
|
|
52
31
|
onClick: handleClick,
|
|
53
32
|
ariaKeyshortcuts: formatShortcut(toggleTaskList)
|
|
54
33
|
}, formatMessage(tasksAndDecisionsMessages.taskList));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
3
3
|
import type { BlockMenuPlugin } from '@atlaskit/editor-plugin-block-menu';
|
|
4
4
|
import type { ContextIdentifierPlugin } from '@atlaskit/editor-plugin-context-identifier';
|
|
@@ -19,7 +19,6 @@ export type TasksAndDecisionsPluginDependencies = [
|
|
|
19
19
|
OptionalPlugin<BlockMenuPlugin>,
|
|
20
20
|
OptionalPlugin<SelectionPlugin>,
|
|
21
21
|
OptionalPlugin<ToolbarPlugin>,
|
|
22
|
-
OptionalPlugin<_MarkdownModePluginStub>,
|
|
23
22
|
OptionalPlugin<UiControlRegistryPlugin>
|
|
24
23
|
];
|
|
25
24
|
export type TasksAndDecisionsPlugin = NextEditorPlugin<'taskDecision', {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-tasks-and-decisions",
|
|
3
|
-
"version": "25.0.
|
|
3
|
+
"version": "25.0.3",
|
|
4
4
|
"description": "Tasks and decisions plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@atlaskit/primitives": "^22.5.0",
|
|
48
48
|
"@atlaskit/prosemirror-input-rules": "^4.1.0",
|
|
49
49
|
"@atlaskit/task-decision": "^21.11.0",
|
|
50
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
50
|
+
"@atlaskit/tmp-editor-statsig": "^212.0.0",
|
|
51
51
|
"@atlaskit/tokens": "^20.1.0",
|
|
52
52
|
"@babel/runtime": "^7.0.0",
|
|
53
53
|
"@compiled/react": "^1.0.2",
|
|
@@ -72,9 +72,6 @@
|
|
|
72
72
|
"platform-dst-motion-uplift-custom-button": {
|
|
73
73
|
"type": "boolean",
|
|
74
74
|
"referenceOnly": true
|
|
75
|
-
},
|
|
76
|
-
"platform_editor_markdown_compatible_toolbar": {
|
|
77
|
-
"type": "boolean"
|
|
78
75
|
}
|
|
79
76
|
}
|
|
80
77
|
}
|