@atlaskit/editor-plugin-toolbar-lists-indentation 7.0.16 → 7.0.18
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 +14 -0
- package/dist/cjs/ui/toolbar-components/BulletedListMenuItem.js +2 -4
- package/dist/cjs/ui/toolbar-components/ListsIndentationHeroButton.js +9 -11
- package/dist/cjs/ui/toolbar-components/ListsIndentationMenu.js +1 -2
- package/dist/cjs/ui/toolbar-components/ListsIndentationMenuGroup.js +2 -2
- package/dist/cjs/ui/toolbar-components/NumberedListMenuItem.js +2 -4
- package/dist/es2019/ui/toolbar-components/BulletedListMenuItem.js +2 -4
- package/dist/es2019/ui/toolbar-components/ListsIndentationHeroButton.js +9 -11
- package/dist/es2019/ui/toolbar-components/ListsIndentationMenu.js +1 -2
- package/dist/es2019/ui/toolbar-components/ListsIndentationMenuGroup.js +2 -2
- package/dist/es2019/ui/toolbar-components/NumberedListMenuItem.js +2 -4
- package/dist/esm/ui/toolbar-components/BulletedListMenuItem.js +2 -4
- package/dist/esm/ui/toolbar-components/ListsIndentationHeroButton.js +9 -11
- package/dist/esm/ui/toolbar-components/ListsIndentationMenu.js +1 -2
- package/dist/esm/ui/toolbar-components/ListsIndentationMenuGroup.js +2 -2
- package/dist/esm/ui/toolbar-components/NumberedListMenuItem.js +2 -4
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-toolbar-lists-indentation
|
|
2
2
|
|
|
3
|
+
## 7.0.18
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 7.0.17
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`68059d62a8bbc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/68059d62a8bbc) -
|
|
14
|
+
ED-29461 Clean up platform_editor_toolbar_task_list_menu_item
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 7.0.16
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -12,14 +12,12 @@ var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
|
12
12
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
13
13
|
var _toolbar = require("@atlaskit/editor-common/toolbar");
|
|
14
14
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
15
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
16
15
|
var useBulletedListInfo = exports.useBulletedListInfo = function useBulletedListInfo(_ref) {
|
|
17
16
|
var api = _ref.api,
|
|
18
17
|
parents = _ref.parents;
|
|
19
18
|
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
20
19
|
formatMessage = _useIntl.formatMessage;
|
|
21
20
|
var bulletMessage = formatMessage(_messages.listMessages.bulletedList);
|
|
22
|
-
var isTaskListItemEnabled = (0, _expValEquals.expValEquals)('platform_editor_toolbar_task_list_menu_item', 'isEnabled', true);
|
|
23
21
|
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['list', 'taskDecision'], function (states) {
|
|
24
22
|
var _states$listState, _states$listState2, _states$taskDecisionS;
|
|
25
23
|
return {
|
|
@@ -33,9 +31,9 @@ var useBulletedListInfo = exports.useBulletedListInfo = function useBulletedList
|
|
|
33
31
|
taskListActive = _useSharedPluginState.taskListActive;
|
|
34
32
|
var onClick = function onClick() {
|
|
35
33
|
var _api$taskDecision;
|
|
36
|
-
api === null || api === void 0 || api.core.actions.execute(
|
|
34
|
+
api === null || api === void 0 || api.core.actions.execute(taskListActive ? api === null || api === void 0 || (_api$taskDecision = api.taskDecision) === null || _api$taskDecision === void 0 ? void 0 : _api$taskDecision.commands.toggleTaskList('bulletList') : api === null || api === void 0 ? void 0 : api.list.commands.toggleBulletList((0, _toolbar.getInputMethodFromParentKeys)(parents)));
|
|
37
35
|
};
|
|
38
|
-
var isDisabled =
|
|
36
|
+
var isDisabled = bulletListDisabled && !taskListActive;
|
|
39
37
|
var shortcut = (0, _keymaps.formatShortcut)(_keymaps.toggleBulletList);
|
|
40
38
|
return {
|
|
41
39
|
bulletMessage: bulletMessage,
|
|
@@ -20,7 +20,6 @@ function useListsIndentationHeroButtonInfo(_ref) {
|
|
|
20
20
|
defaultListType = _ref.defaultListType;
|
|
21
21
|
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
22
22
|
formatMessage = _useIntl.formatMessage;
|
|
23
|
-
var isTaskListItemEnabled = (0, _expValEquals.expValEquals)('platform_editor_toolbar_task_list_menu_item', 'isEnabled', true);
|
|
24
23
|
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['list', 'taskDecision'], function (states) {
|
|
25
24
|
var _states$listState, _states$listState2, _states$listState3, _states$taskDecisionS;
|
|
26
25
|
return {
|
|
@@ -34,7 +33,7 @@ function useListsIndentationHeroButtonInfo(_ref) {
|
|
|
34
33
|
bulletListDisabled = _useSharedPluginState.bulletListDisabled,
|
|
35
34
|
orderedListActive = _useSharedPluginState.orderedListActive,
|
|
36
35
|
taskListActive = _useSharedPluginState.taskListActive;
|
|
37
|
-
var getListType =
|
|
36
|
+
var getListType = taskListActive ? 'taskList' : orderedListActive ? 'orderedList' : defaultListType;
|
|
38
37
|
var taskListKeymap = (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) ? _keymaps.toggleTaskList : _keymaps.toggleTaskItemCheckbox;
|
|
39
38
|
var getKeymap = getListType === 'taskList' ? taskListKeymap : getListType === 'orderedList' ? _keymaps.toggleOrderedList : _keymaps.toggleBulletList;
|
|
40
39
|
var shortcut = (0, _keymaps.formatShortcut)(getKeymap);
|
|
@@ -61,8 +60,8 @@ function useListsIndentationHeroButtonInfo(_ref) {
|
|
|
61
60
|
label: formatMessage(_messages.listMessages.bulletedList),
|
|
62
61
|
size: "small"
|
|
63
62
|
});
|
|
64
|
-
var isSelected = getListType === 'bulletList' ? bulletListActive : getListType === 'orderedList' ? orderedListActive :
|
|
65
|
-
var isDisabled = !orderedListActive && !
|
|
63
|
+
var isSelected = getListType === 'bulletList' ? bulletListActive : getListType === 'orderedList' ? orderedListActive : taskListActive;
|
|
64
|
+
var isDisabled = !orderedListActive && !taskListActive && bulletListDisabled;
|
|
66
65
|
return {
|
|
67
66
|
shortcut: shortcut,
|
|
68
67
|
keymap: keymap,
|
|
@@ -134,7 +133,6 @@ var ListsIndentationHeroButton = exports.ListsIndentationHeroButton = function L
|
|
|
134
133
|
parents = _ref4.parents;
|
|
135
134
|
var _useIntl2 = (0, _reactIntlNext.useIntl)(),
|
|
136
135
|
formatMessage = _useIntl2.formatMessage;
|
|
137
|
-
var isTaskListItemEnabled = (0, _expValEquals.expValEquals)('platform_editor_toolbar_task_list_menu_item', 'isEnabled', true);
|
|
138
136
|
var _useSharedPluginState2 = (0, _hooks.useSharedPluginStateWithSelector)(api, ['list', 'taskDecision'], function (states) {
|
|
139
137
|
var _states$listState4, _states$listState5, _states$listState6, _states$taskDecisionS2;
|
|
140
138
|
return {
|
|
@@ -149,10 +147,10 @@ var ListsIndentationHeroButton = exports.ListsIndentationHeroButton = function L
|
|
|
149
147
|
orderedListActive = _useSharedPluginState2.orderedListActive,
|
|
150
148
|
taskListActive = _useSharedPluginState2.taskListActive;
|
|
151
149
|
var taskListKeymap = (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) ? _keymaps.toggleTaskList : _keymaps.toggleTaskItemCheckbox;
|
|
152
|
-
var shortcut =
|
|
150
|
+
var shortcut = taskListActive ? (0, _keymaps.formatShortcut)(taskListKeymap) : orderedListActive ? (0, _keymaps.formatShortcut)(_keymaps.toggleOrderedList) : (0, _keymaps.formatShortcut)(_keymaps.toggleBulletList);
|
|
153
151
|
var onClick = function onClick() {
|
|
154
152
|
var inputMethod = (0, _toolbar.getInputMethodFromParentKeys)(parents);
|
|
155
|
-
if (
|
|
153
|
+
if (taskListActive) {
|
|
156
154
|
var _api$taskDecision2;
|
|
157
155
|
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$taskDecision2 = api.taskDecision) === null || _api$taskDecision2 === void 0 ? void 0 : _api$taskDecision2.commands.toggleTaskList());
|
|
158
156
|
} else if (orderedListActive) {
|
|
@@ -162,9 +160,9 @@ var ListsIndentationHeroButton = exports.ListsIndentationHeroButton = function L
|
|
|
162
160
|
}
|
|
163
161
|
};
|
|
164
162
|
return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarTooltip, {
|
|
165
|
-
content:
|
|
163
|
+
content: taskListActive ? formatMessage(_messages.tasksAndDecisionsMessages.taskList) : orderedListActive ? formatMessage(_messages.listMessages.orderedList) : formatMessage(_messages.listMessages.bulletedList)
|
|
166
164
|
}, /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarButton, {
|
|
167
|
-
iconBefore:
|
|
165
|
+
iconBefore: taskListActive ? /*#__PURE__*/_react.default.createElement(_task.default, {
|
|
168
166
|
label: formatMessage(_messages.tasksAndDecisionsMessages.taskList),
|
|
169
167
|
size: "small"
|
|
170
168
|
}) : orderedListActive ? /*#__PURE__*/_react.default.createElement(_editorToolbar.ListNumberedIcon, {
|
|
@@ -174,8 +172,8 @@ var ListsIndentationHeroButton = exports.ListsIndentationHeroButton = function L
|
|
|
174
172
|
label: formatMessage(_messages.listMessages.bulletedList),
|
|
175
173
|
size: "small"
|
|
176
174
|
}),
|
|
177
|
-
isSelected: bulletListActive || orderedListActive ||
|
|
178
|
-
isDisabled: !orderedListActive && !
|
|
175
|
+
isSelected: bulletListActive || orderedListActive || taskListActive,
|
|
176
|
+
isDisabled: !orderedListActive && !taskListActive && bulletListDisabled,
|
|
179
177
|
ariaKeyshortcuts: shortcut,
|
|
180
178
|
onClick: onClick
|
|
181
179
|
}));
|
|
@@ -19,7 +19,6 @@ var ListsIndentationMenu = exports.ListsIndentationMenu = function ListsIndentat
|
|
|
19
19
|
allowHeadingAndParagraphIndentation = _ref.allowHeadingAndParagraphIndentation;
|
|
20
20
|
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
21
21
|
formatMessage = _useIntl.formatMessage;
|
|
22
|
-
var isTaskListItemEnabled = (0, _expValEquals.expValEquals)('platform_editor_toolbar_task_list_menu_item', 'isEnabled', true);
|
|
23
22
|
var _useEditorToolbar = (0, _toolbar.useEditorToolbar)(),
|
|
24
23
|
editorView = _useEditorToolbar.editorView;
|
|
25
24
|
var indentationState = (0, _hooks2.useIndentationState)({
|
|
@@ -38,7 +37,7 @@ var ListsIndentationMenu = exports.ListsIndentationMenu = function ListsIndentat
|
|
|
38
37
|
bulletListDisabled = _useSharedPluginState.bulletListDisabled,
|
|
39
38
|
orderedListDisabled = _useSharedPluginState.orderedListDisabled,
|
|
40
39
|
taskListActive = _useSharedPluginState.taskListActive;
|
|
41
|
-
var allItemsDisabled = bulletListDisabled && orderedListDisabled && (indentationState === null || indentationState === void 0 ? void 0 : indentationState.indentDisabled) && (indentationState === null || indentationState === void 0 ? void 0 : indentationState.outdentDisabled) && !
|
|
40
|
+
var allItemsDisabled = bulletListDisabled && orderedListDisabled && (indentationState === null || indentationState === void 0 ? void 0 : indentationState.indentDisabled) && (indentationState === null || indentationState === void 0 ? void 0 : indentationState.outdentDisabled) && !taskListActive;
|
|
42
41
|
return (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) ? /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarTooltip, {
|
|
43
42
|
content: formatMessage(_lists.messages.lists)
|
|
44
43
|
}, /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownMenu, {
|
|
@@ -91,13 +91,13 @@ var getListsIndentationMenu = exports.getListsIndentationMenu = function getList
|
|
|
91
91
|
key: _toolbar.LISTS_INDENTATION_MENU_SECTION.key,
|
|
92
92
|
rank: _toolbar.LISTS_INDENTATION_MENU_SECTION_RANK[_toolbar.TASK_LIST_MENU_ITEM.key]
|
|
93
93
|
}],
|
|
94
|
-
component:
|
|
94
|
+
component: function component(_ref4) {
|
|
95
95
|
var parents = _ref4.parents;
|
|
96
96
|
return /*#__PURE__*/_react.default.createElement(_TaskListMenuItem.TaskListMenuItem, {
|
|
97
97
|
api: api,
|
|
98
98
|
parents: parents
|
|
99
99
|
});
|
|
100
|
-
}
|
|
100
|
+
}
|
|
101
101
|
}] : []), [{
|
|
102
102
|
type: _toolbar.OUTDENT_MENU_ITEM.type,
|
|
103
103
|
key: _toolbar.OUTDENT_MENU_ITEM.key,
|
|
@@ -12,13 +12,11 @@ var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
|
12
12
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
13
13
|
var _toolbar = require("@atlaskit/editor-common/toolbar");
|
|
14
14
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
15
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
16
15
|
var NumberedListMenuItem = exports.NumberedListMenuItem = function NumberedListMenuItem(_ref) {
|
|
17
16
|
var api = _ref.api,
|
|
18
17
|
parents = _ref.parents;
|
|
19
18
|
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
20
19
|
formatMessage = _useIntl.formatMessage;
|
|
21
|
-
var isTaskListItemEnabled = (0, _expValEquals.expValEquals)('platform_editor_toolbar_task_list_menu_item', 'isEnabled', true);
|
|
22
20
|
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['list', 'taskDecision'], function (states) {
|
|
23
21
|
var _states$listState, _states$listState2, _states$taskDecisionS;
|
|
24
22
|
return {
|
|
@@ -32,7 +30,7 @@ var NumberedListMenuItem = exports.NumberedListMenuItem = function NumberedListM
|
|
|
32
30
|
taskListActive = _useSharedPluginState.taskListActive;
|
|
33
31
|
var onClick = function onClick() {
|
|
34
32
|
var _api$taskDecision;
|
|
35
|
-
api === null || api === void 0 || api.core.actions.execute(
|
|
33
|
+
api === null || api === void 0 || api.core.actions.execute(taskListActive ? api === null || api === void 0 || (_api$taskDecision = api.taskDecision) === null || _api$taskDecision === void 0 ? void 0 : _api$taskDecision.commands.toggleTaskList('orderedList') : api === null || api === void 0 ? void 0 : api.list.commands.toggleOrderedList((0, _toolbar.getInputMethodFromParentKeys)(parents)));
|
|
36
34
|
};
|
|
37
35
|
var shortcut = (0, _keymaps.formatShortcut)(_keymaps.toggleOrderedList);
|
|
38
36
|
return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItem, {
|
|
@@ -44,7 +42,7 @@ var NumberedListMenuItem = exports.NumberedListMenuItem = function NumberedListM
|
|
|
44
42
|
shortcut: shortcut
|
|
45
43
|
}) : undefined,
|
|
46
44
|
isSelected: orderedListActive,
|
|
47
|
-
isDisabled:
|
|
45
|
+
isDisabled: orderedListDisabled && !taskListActive,
|
|
48
46
|
onClick: onClick,
|
|
49
47
|
ariaKeyshortcuts: shortcut
|
|
50
48
|
}, formatMessage(_messages.listMessages.orderedList));
|
|
@@ -5,7 +5,6 @@ import { toggleBulletList as toggleBulletListKeymap, formatShortcut } from '@atl
|
|
|
5
5
|
import { listMessages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { getInputMethodFromParentKeys } from '@atlaskit/editor-common/toolbar';
|
|
7
7
|
import { ListBulletedIcon, ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
|
|
8
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
9
8
|
export const useBulletedListInfo = ({
|
|
10
9
|
api,
|
|
11
10
|
parents
|
|
@@ -14,7 +13,6 @@ export const useBulletedListInfo = ({
|
|
|
14
13
|
formatMessage
|
|
15
14
|
} = useIntl();
|
|
16
15
|
const bulletMessage = formatMessage(listMessages.bulletedList);
|
|
17
|
-
const isTaskListItemEnabled = expValEquals('platform_editor_toolbar_task_list_menu_item', 'isEnabled', true);
|
|
18
16
|
const {
|
|
19
17
|
bulletListActive,
|
|
20
18
|
bulletListDisabled,
|
|
@@ -29,9 +27,9 @@ export const useBulletedListInfo = ({
|
|
|
29
27
|
});
|
|
30
28
|
const onClick = () => {
|
|
31
29
|
var _api$taskDecision;
|
|
32
|
-
api === null || api === void 0 ? void 0 : api.core.actions.execute(
|
|
30
|
+
api === null || api === void 0 ? void 0 : api.core.actions.execute(taskListActive ? api === null || api === void 0 ? void 0 : (_api$taskDecision = api.taskDecision) === null || _api$taskDecision === void 0 ? void 0 : _api$taskDecision.commands.toggleTaskList('bulletList') : api === null || api === void 0 ? void 0 : api.list.commands.toggleBulletList(getInputMethodFromParentKeys(parents)));
|
|
33
31
|
};
|
|
34
|
-
const isDisabled =
|
|
32
|
+
const isDisabled = bulletListDisabled && !taskListActive;
|
|
35
33
|
const shortcut = formatShortcut(toggleBulletListKeymap);
|
|
36
34
|
return {
|
|
37
35
|
bulletMessage,
|
|
@@ -15,7 +15,6 @@ function useListsIndentationHeroButtonInfo({
|
|
|
15
15
|
const {
|
|
16
16
|
formatMessage
|
|
17
17
|
} = useIntl();
|
|
18
|
-
const isTaskListItemEnabled = expValEquals('platform_editor_toolbar_task_list_menu_item', 'isEnabled', true);
|
|
19
18
|
const {
|
|
20
19
|
bulletListActive,
|
|
21
20
|
bulletListDisabled,
|
|
@@ -30,7 +29,7 @@ function useListsIndentationHeroButtonInfo({
|
|
|
30
29
|
taskListActive: (_states$taskDecisionS = states.taskDecisionState) === null || _states$taskDecisionS === void 0 ? void 0 : _states$taskDecisionS.isInsideTask
|
|
31
30
|
};
|
|
32
31
|
});
|
|
33
|
-
const getListType =
|
|
32
|
+
const getListType = taskListActive ? 'taskList' : orderedListActive ? 'orderedList' : defaultListType;
|
|
34
33
|
const taskListKeymap = expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) ? toggleTaskListKeymap : toggleTaskItemCheckboxKeymap;
|
|
35
34
|
const getKeymap = getListType === 'taskList' ? taskListKeymap : getListType === 'orderedList' ? toggleOrderedListKeymap : toggleBulletListKeymap;
|
|
36
35
|
const shortcut = formatShortcut(getKeymap);
|
|
@@ -57,8 +56,8 @@ function useListsIndentationHeroButtonInfo({
|
|
|
57
56
|
label: formatMessage(listMessages.bulletedList),
|
|
58
57
|
size: "small"
|
|
59
58
|
});
|
|
60
|
-
const isSelected = getListType === 'bulletList' ? bulletListActive : getListType === 'orderedList' ? orderedListActive :
|
|
61
|
-
const isDisabled = !orderedListActive && !
|
|
59
|
+
const isSelected = getListType === 'bulletList' ? bulletListActive : getListType === 'orderedList' ? orderedListActive : taskListActive;
|
|
60
|
+
const isDisabled = !orderedListActive && !taskListActive && bulletListDisabled;
|
|
62
61
|
return {
|
|
63
62
|
shortcut,
|
|
64
63
|
keymap,
|
|
@@ -136,7 +135,6 @@ export const ListsIndentationHeroButton = ({
|
|
|
136
135
|
const {
|
|
137
136
|
formatMessage
|
|
138
137
|
} = useIntl();
|
|
139
|
-
const isTaskListItemEnabled = expValEquals('platform_editor_toolbar_task_list_menu_item', 'isEnabled', true);
|
|
140
138
|
const {
|
|
141
139
|
bulletListActive,
|
|
142
140
|
bulletListDisabled,
|
|
@@ -152,10 +150,10 @@ export const ListsIndentationHeroButton = ({
|
|
|
152
150
|
};
|
|
153
151
|
});
|
|
154
152
|
const taskListKeymap = expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) ? toggleTaskListKeymap : toggleTaskItemCheckboxKeymap;
|
|
155
|
-
const shortcut =
|
|
153
|
+
const shortcut = taskListActive ? formatShortcut(taskListKeymap) : orderedListActive ? formatShortcut(toggleOrderedListKeymap) : formatShortcut(toggleBulletListKeymap);
|
|
156
154
|
const onClick = () => {
|
|
157
155
|
const inputMethod = getInputMethodFromParentKeys(parents);
|
|
158
|
-
if (
|
|
156
|
+
if (taskListActive) {
|
|
159
157
|
var _api$taskDecision2;
|
|
160
158
|
api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$taskDecision2 = api.taskDecision) === null || _api$taskDecision2 === void 0 ? void 0 : _api$taskDecision2.commands.toggleTaskList());
|
|
161
159
|
} else if (orderedListActive) {
|
|
@@ -165,9 +163,9 @@ export const ListsIndentationHeroButton = ({
|
|
|
165
163
|
}
|
|
166
164
|
};
|
|
167
165
|
return /*#__PURE__*/React.createElement(ToolbarTooltip, {
|
|
168
|
-
content:
|
|
166
|
+
content: taskListActive ? formatMessage(tasksAndDecisionsMessages.taskList) : orderedListActive ? formatMessage(listMessages.orderedList) : formatMessage(listMessages.bulletedList)
|
|
169
167
|
}, /*#__PURE__*/React.createElement(ToolbarButton, {
|
|
170
|
-
iconBefore:
|
|
168
|
+
iconBefore: taskListActive ? /*#__PURE__*/React.createElement(TaskIcon, {
|
|
171
169
|
label: formatMessage(tasksAndDecisionsMessages.taskList),
|
|
172
170
|
size: "small"
|
|
173
171
|
}) : orderedListActive ? /*#__PURE__*/React.createElement(ListNumberedIcon, {
|
|
@@ -177,8 +175,8 @@ export const ListsIndentationHeroButton = ({
|
|
|
177
175
|
label: formatMessage(listMessages.bulletedList),
|
|
178
176
|
size: "small"
|
|
179
177
|
}),
|
|
180
|
-
isSelected: bulletListActive || orderedListActive ||
|
|
181
|
-
isDisabled: !orderedListActive && !
|
|
178
|
+
isSelected: bulletListActive || orderedListActive || taskListActive,
|
|
179
|
+
isDisabled: !orderedListActive && !taskListActive && bulletListDisabled,
|
|
182
180
|
ariaKeyshortcuts: shortcut,
|
|
183
181
|
onClick: onClick
|
|
184
182
|
}));
|
|
@@ -14,7 +14,6 @@ export const ListsIndentationMenu = ({
|
|
|
14
14
|
const {
|
|
15
15
|
formatMessage
|
|
16
16
|
} = useIntl();
|
|
17
|
-
const isTaskListItemEnabled = expValEquals('platform_editor_toolbar_task_list_menu_item', 'isEnabled', true);
|
|
18
17
|
const {
|
|
19
18
|
editorView
|
|
20
19
|
} = useEditorToolbar();
|
|
@@ -35,7 +34,7 @@ export const ListsIndentationMenu = ({
|
|
|
35
34
|
taskListActive: (_states$taskDecisionS = states.taskDecisionState) === null || _states$taskDecisionS === void 0 ? void 0 : _states$taskDecisionS.isInsideTask
|
|
36
35
|
};
|
|
37
36
|
});
|
|
38
|
-
const allItemsDisabled = bulletListDisabled && orderedListDisabled && (indentationState === null || indentationState === void 0 ? void 0 : indentationState.indentDisabled) && (indentationState === null || indentationState === void 0 ? void 0 : indentationState.outdentDisabled) && !
|
|
37
|
+
const allItemsDisabled = bulletListDisabled && orderedListDisabled && (indentationState === null || indentationState === void 0 ? void 0 : indentationState.indentDisabled) && (indentationState === null || indentationState === void 0 ? void 0 : indentationState.outdentDisabled) && !taskListActive;
|
|
39
38
|
return expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) ? /*#__PURE__*/React.createElement(ToolbarTooltip, {
|
|
40
39
|
content: formatMessage(messages.lists)
|
|
41
40
|
}, /*#__PURE__*/React.createElement(ToolbarDropdownMenu, {
|
|
@@ -80,12 +80,12 @@ export const getListsIndentationMenu = (allowHeadingAndParagraphIndentation, sho
|
|
|
80
80
|
key: LISTS_INDENTATION_MENU_SECTION.key,
|
|
81
81
|
rank: LISTS_INDENTATION_MENU_SECTION_RANK[TASK_LIST_MENU_ITEM.key]
|
|
82
82
|
}],
|
|
83
|
-
component:
|
|
83
|
+
component: ({
|
|
84
84
|
parents
|
|
85
85
|
}) => /*#__PURE__*/React.createElement(TaskListMenuItem, {
|
|
86
86
|
api: api,
|
|
87
87
|
parents: parents
|
|
88
|
-
})
|
|
88
|
+
})
|
|
89
89
|
}] : []), {
|
|
90
90
|
type: OUTDENT_MENU_ITEM.type,
|
|
91
91
|
key: OUTDENT_MENU_ITEM.key,
|
|
@@ -5,7 +5,6 @@ import { toggleOrderedList as toggleOrderedListKeymap, formatShortcut } from '@a
|
|
|
5
5
|
import { listMessages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { getInputMethodFromParentKeys } from '@atlaskit/editor-common/toolbar';
|
|
7
7
|
import { ListNumberedIcon, ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
|
|
8
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
9
8
|
export const NumberedListMenuItem = ({
|
|
10
9
|
api,
|
|
11
10
|
parents
|
|
@@ -13,7 +12,6 @@ export const NumberedListMenuItem = ({
|
|
|
13
12
|
const {
|
|
14
13
|
formatMessage
|
|
15
14
|
} = useIntl();
|
|
16
|
-
const isTaskListItemEnabled = expValEquals('platform_editor_toolbar_task_list_menu_item', 'isEnabled', true);
|
|
17
15
|
const {
|
|
18
16
|
orderedListActive,
|
|
19
17
|
orderedListDisabled,
|
|
@@ -28,7 +26,7 @@ export const NumberedListMenuItem = ({
|
|
|
28
26
|
});
|
|
29
27
|
const onClick = () => {
|
|
30
28
|
var _api$taskDecision;
|
|
31
|
-
api === null || api === void 0 ? void 0 : api.core.actions.execute(
|
|
29
|
+
api === null || api === void 0 ? void 0 : api.core.actions.execute(taskListActive ? api === null || api === void 0 ? void 0 : (_api$taskDecision = api.taskDecision) === null || _api$taskDecision === void 0 ? void 0 : _api$taskDecision.commands.toggleTaskList('orderedList') : api === null || api === void 0 ? void 0 : api.list.commands.toggleOrderedList(getInputMethodFromParentKeys(parents)));
|
|
32
30
|
};
|
|
33
31
|
const shortcut = formatShortcut(toggleOrderedListKeymap);
|
|
34
32
|
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
@@ -40,7 +38,7 @@ export const NumberedListMenuItem = ({
|
|
|
40
38
|
shortcut: shortcut
|
|
41
39
|
}) : undefined,
|
|
42
40
|
isSelected: orderedListActive,
|
|
43
|
-
isDisabled:
|
|
41
|
+
isDisabled: orderedListDisabled && !taskListActive,
|
|
44
42
|
onClick: onClick,
|
|
45
43
|
ariaKeyshortcuts: shortcut
|
|
46
44
|
}, formatMessage(listMessages.orderedList));
|
|
@@ -5,14 +5,12 @@ import { toggleBulletList as toggleBulletListKeymap, formatShortcut } from '@atl
|
|
|
5
5
|
import { listMessages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { getInputMethodFromParentKeys } from '@atlaskit/editor-common/toolbar';
|
|
7
7
|
import { ListBulletedIcon, ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
|
|
8
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
9
8
|
export var useBulletedListInfo = function useBulletedListInfo(_ref) {
|
|
10
9
|
var api = _ref.api,
|
|
11
10
|
parents = _ref.parents;
|
|
12
11
|
var _useIntl = useIntl(),
|
|
13
12
|
formatMessage = _useIntl.formatMessage;
|
|
14
13
|
var bulletMessage = formatMessage(listMessages.bulletedList);
|
|
15
|
-
var isTaskListItemEnabled = expValEquals('platform_editor_toolbar_task_list_menu_item', 'isEnabled', true);
|
|
16
14
|
var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['list', 'taskDecision'], function (states) {
|
|
17
15
|
var _states$listState, _states$listState2, _states$taskDecisionS;
|
|
18
16
|
return {
|
|
@@ -26,9 +24,9 @@ export var useBulletedListInfo = function useBulletedListInfo(_ref) {
|
|
|
26
24
|
taskListActive = _useSharedPluginState.taskListActive;
|
|
27
25
|
var onClick = function onClick() {
|
|
28
26
|
var _api$taskDecision;
|
|
29
|
-
api === null || api === void 0 || api.core.actions.execute(
|
|
27
|
+
api === null || api === void 0 || api.core.actions.execute(taskListActive ? api === null || api === void 0 || (_api$taskDecision = api.taskDecision) === null || _api$taskDecision === void 0 ? void 0 : _api$taskDecision.commands.toggleTaskList('bulletList') : api === null || api === void 0 ? void 0 : api.list.commands.toggleBulletList(getInputMethodFromParentKeys(parents)));
|
|
30
28
|
};
|
|
31
|
-
var isDisabled =
|
|
29
|
+
var isDisabled = bulletListDisabled && !taskListActive;
|
|
32
30
|
var shortcut = formatShortcut(toggleBulletListKeymap);
|
|
33
31
|
return {
|
|
34
32
|
bulletMessage: bulletMessage,
|
|
@@ -13,7 +13,6 @@ function useListsIndentationHeroButtonInfo(_ref) {
|
|
|
13
13
|
defaultListType = _ref.defaultListType;
|
|
14
14
|
var _useIntl = useIntl(),
|
|
15
15
|
formatMessage = _useIntl.formatMessage;
|
|
16
|
-
var isTaskListItemEnabled = expValEquals('platform_editor_toolbar_task_list_menu_item', 'isEnabled', true);
|
|
17
16
|
var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['list', 'taskDecision'], function (states) {
|
|
18
17
|
var _states$listState, _states$listState2, _states$listState3, _states$taskDecisionS;
|
|
19
18
|
return {
|
|
@@ -27,7 +26,7 @@ function useListsIndentationHeroButtonInfo(_ref) {
|
|
|
27
26
|
bulletListDisabled = _useSharedPluginState.bulletListDisabled,
|
|
28
27
|
orderedListActive = _useSharedPluginState.orderedListActive,
|
|
29
28
|
taskListActive = _useSharedPluginState.taskListActive;
|
|
30
|
-
var getListType =
|
|
29
|
+
var getListType = taskListActive ? 'taskList' : orderedListActive ? 'orderedList' : defaultListType;
|
|
31
30
|
var taskListKeymap = expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) ? toggleTaskListKeymap : toggleTaskItemCheckboxKeymap;
|
|
32
31
|
var getKeymap = getListType === 'taskList' ? taskListKeymap : getListType === 'orderedList' ? toggleOrderedListKeymap : toggleBulletListKeymap;
|
|
33
32
|
var shortcut = formatShortcut(getKeymap);
|
|
@@ -54,8 +53,8 @@ function useListsIndentationHeroButtonInfo(_ref) {
|
|
|
54
53
|
label: formatMessage(listMessages.bulletedList),
|
|
55
54
|
size: "small"
|
|
56
55
|
});
|
|
57
|
-
var isSelected = getListType === 'bulletList' ? bulletListActive : getListType === 'orderedList' ? orderedListActive :
|
|
58
|
-
var isDisabled = !orderedListActive && !
|
|
56
|
+
var isSelected = getListType === 'bulletList' ? bulletListActive : getListType === 'orderedList' ? orderedListActive : taskListActive;
|
|
57
|
+
var isDisabled = !orderedListActive && !taskListActive && bulletListDisabled;
|
|
59
58
|
return {
|
|
60
59
|
shortcut: shortcut,
|
|
61
60
|
keymap: keymap,
|
|
@@ -127,7 +126,6 @@ export var ListsIndentationHeroButton = function ListsIndentationHeroButton(_ref
|
|
|
127
126
|
parents = _ref4.parents;
|
|
128
127
|
var _useIntl2 = useIntl(),
|
|
129
128
|
formatMessage = _useIntl2.formatMessage;
|
|
130
|
-
var isTaskListItemEnabled = expValEquals('platform_editor_toolbar_task_list_menu_item', 'isEnabled', true);
|
|
131
129
|
var _useSharedPluginState2 = useSharedPluginStateWithSelector(api, ['list', 'taskDecision'], function (states) {
|
|
132
130
|
var _states$listState4, _states$listState5, _states$listState6, _states$taskDecisionS2;
|
|
133
131
|
return {
|
|
@@ -142,10 +140,10 @@ export var ListsIndentationHeroButton = function ListsIndentationHeroButton(_ref
|
|
|
142
140
|
orderedListActive = _useSharedPluginState2.orderedListActive,
|
|
143
141
|
taskListActive = _useSharedPluginState2.taskListActive;
|
|
144
142
|
var taskListKeymap = expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) ? toggleTaskListKeymap : toggleTaskItemCheckboxKeymap;
|
|
145
|
-
var shortcut =
|
|
143
|
+
var shortcut = taskListActive ? formatShortcut(taskListKeymap) : orderedListActive ? formatShortcut(toggleOrderedListKeymap) : formatShortcut(toggleBulletListKeymap);
|
|
146
144
|
var onClick = function onClick() {
|
|
147
145
|
var inputMethod = getInputMethodFromParentKeys(parents);
|
|
148
|
-
if (
|
|
146
|
+
if (taskListActive) {
|
|
149
147
|
var _api$taskDecision2;
|
|
150
148
|
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$taskDecision2 = api.taskDecision) === null || _api$taskDecision2 === void 0 ? void 0 : _api$taskDecision2.commands.toggleTaskList());
|
|
151
149
|
} else if (orderedListActive) {
|
|
@@ -155,9 +153,9 @@ export var ListsIndentationHeroButton = function ListsIndentationHeroButton(_ref
|
|
|
155
153
|
}
|
|
156
154
|
};
|
|
157
155
|
return /*#__PURE__*/React.createElement(ToolbarTooltip, {
|
|
158
|
-
content:
|
|
156
|
+
content: taskListActive ? formatMessage(tasksAndDecisionsMessages.taskList) : orderedListActive ? formatMessage(listMessages.orderedList) : formatMessage(listMessages.bulletedList)
|
|
159
157
|
}, /*#__PURE__*/React.createElement(ToolbarButton, {
|
|
160
|
-
iconBefore:
|
|
158
|
+
iconBefore: taskListActive ? /*#__PURE__*/React.createElement(TaskIcon, {
|
|
161
159
|
label: formatMessage(tasksAndDecisionsMessages.taskList),
|
|
162
160
|
size: "small"
|
|
163
161
|
}) : orderedListActive ? /*#__PURE__*/React.createElement(ListNumberedIcon, {
|
|
@@ -167,8 +165,8 @@ export var ListsIndentationHeroButton = function ListsIndentationHeroButton(_ref
|
|
|
167
165
|
label: formatMessage(listMessages.bulletedList),
|
|
168
166
|
size: "small"
|
|
169
167
|
}),
|
|
170
|
-
isSelected: bulletListActive || orderedListActive ||
|
|
171
|
-
isDisabled: !orderedListActive && !
|
|
168
|
+
isSelected: bulletListActive || orderedListActive || taskListActive,
|
|
169
|
+
isDisabled: !orderedListActive && !taskListActive && bulletListDisabled,
|
|
172
170
|
ariaKeyshortcuts: shortcut,
|
|
173
171
|
onClick: onClick
|
|
174
172
|
}));
|
|
@@ -12,7 +12,6 @@ export var ListsIndentationMenu = function ListsIndentationMenu(_ref) {
|
|
|
12
12
|
allowHeadingAndParagraphIndentation = _ref.allowHeadingAndParagraphIndentation;
|
|
13
13
|
var _useIntl = useIntl(),
|
|
14
14
|
formatMessage = _useIntl.formatMessage;
|
|
15
|
-
var isTaskListItemEnabled = expValEquals('platform_editor_toolbar_task_list_menu_item', 'isEnabled', true);
|
|
16
15
|
var _useEditorToolbar = useEditorToolbar(),
|
|
17
16
|
editorView = _useEditorToolbar.editorView;
|
|
18
17
|
var indentationState = useIndentationState({
|
|
@@ -31,7 +30,7 @@ export var ListsIndentationMenu = function ListsIndentationMenu(_ref) {
|
|
|
31
30
|
bulletListDisabled = _useSharedPluginState.bulletListDisabled,
|
|
32
31
|
orderedListDisabled = _useSharedPluginState.orderedListDisabled,
|
|
33
32
|
taskListActive = _useSharedPluginState.taskListActive;
|
|
34
|
-
var allItemsDisabled = bulletListDisabled && orderedListDisabled && (indentationState === null || indentationState === void 0 ? void 0 : indentationState.indentDisabled) && (indentationState === null || indentationState === void 0 ? void 0 : indentationState.outdentDisabled) && !
|
|
33
|
+
var allItemsDisabled = bulletListDisabled && orderedListDisabled && (indentationState === null || indentationState === void 0 ? void 0 : indentationState.indentDisabled) && (indentationState === null || indentationState === void 0 ? void 0 : indentationState.outdentDisabled) && !taskListActive;
|
|
35
34
|
return expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) ? /*#__PURE__*/React.createElement(ToolbarTooltip, {
|
|
36
35
|
content: formatMessage(messages.lists)
|
|
37
36
|
}, /*#__PURE__*/React.createElement(ToolbarDropdownMenu, {
|
|
@@ -84,13 +84,13 @@ export var getListsIndentationMenu = function getListsIndentationMenu(allowHeadi
|
|
|
84
84
|
key: LISTS_INDENTATION_MENU_SECTION.key,
|
|
85
85
|
rank: LISTS_INDENTATION_MENU_SECTION_RANK[TASK_LIST_MENU_ITEM.key]
|
|
86
86
|
}],
|
|
87
|
-
component:
|
|
87
|
+
component: function component(_ref4) {
|
|
88
88
|
var parents = _ref4.parents;
|
|
89
89
|
return /*#__PURE__*/React.createElement(TaskListMenuItem, {
|
|
90
90
|
api: api,
|
|
91
91
|
parents: parents
|
|
92
92
|
});
|
|
93
|
-
}
|
|
93
|
+
}
|
|
94
94
|
}] : []), [{
|
|
95
95
|
type: OUTDENT_MENU_ITEM.type,
|
|
96
96
|
key: OUTDENT_MENU_ITEM.key,
|
|
@@ -5,13 +5,11 @@ import { toggleOrderedList as toggleOrderedListKeymap, formatShortcut } from '@a
|
|
|
5
5
|
import { listMessages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { getInputMethodFromParentKeys } from '@atlaskit/editor-common/toolbar';
|
|
7
7
|
import { ListNumberedIcon, ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
|
|
8
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
9
8
|
export var NumberedListMenuItem = function NumberedListMenuItem(_ref) {
|
|
10
9
|
var api = _ref.api,
|
|
11
10
|
parents = _ref.parents;
|
|
12
11
|
var _useIntl = useIntl(),
|
|
13
12
|
formatMessage = _useIntl.formatMessage;
|
|
14
|
-
var isTaskListItemEnabled = expValEquals('platform_editor_toolbar_task_list_menu_item', 'isEnabled', true);
|
|
15
13
|
var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['list', 'taskDecision'], function (states) {
|
|
16
14
|
var _states$listState, _states$listState2, _states$taskDecisionS;
|
|
17
15
|
return {
|
|
@@ -25,7 +23,7 @@ export var NumberedListMenuItem = function NumberedListMenuItem(_ref) {
|
|
|
25
23
|
taskListActive = _useSharedPluginState.taskListActive;
|
|
26
24
|
var onClick = function onClick() {
|
|
27
25
|
var _api$taskDecision;
|
|
28
|
-
api === null || api === void 0 || api.core.actions.execute(
|
|
26
|
+
api === null || api === void 0 || api.core.actions.execute(taskListActive ? api === null || api === void 0 || (_api$taskDecision = api.taskDecision) === null || _api$taskDecision === void 0 ? void 0 : _api$taskDecision.commands.toggleTaskList('orderedList') : api === null || api === void 0 ? void 0 : api.list.commands.toggleOrderedList(getInputMethodFromParentKeys(parents)));
|
|
29
27
|
};
|
|
30
28
|
var shortcut = formatShortcut(toggleOrderedListKeymap);
|
|
31
29
|
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
@@ -37,7 +35,7 @@ export var NumberedListMenuItem = function NumberedListMenuItem(_ref) {
|
|
|
37
35
|
shortcut: shortcut
|
|
38
36
|
}) : undefined,
|
|
39
37
|
isSelected: orderedListActive,
|
|
40
|
-
isDisabled:
|
|
38
|
+
isDisabled: orderedListDisabled && !taskListActive,
|
|
41
39
|
onClick: onClick,
|
|
42
40
|
ariaKeyshortcuts: shortcut
|
|
43
41
|
}, formatMessage(listMessages.orderedList));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-toolbar-lists-indentation",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.18",
|
|
4
4
|
"description": "Toolbar lists and indentation plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
"@atlaskit/editor-toolbar-model": "^0.2.0",
|
|
46
46
|
"@atlaskit/icon": "^28.5.0",
|
|
47
47
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
48
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
49
|
-
"@atlaskit/tokens": "^
|
|
48
|
+
"@atlaskit/tmp-editor-statsig": "^13.32.0",
|
|
49
|
+
"@atlaskit/tokens": "^8.0.0",
|
|
50
50
|
"@babel/runtime": "^7.0.0"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"@atlaskit/editor-common": "^110.
|
|
53
|
+
"@atlaskit/editor-common": "^110.24.0",
|
|
54
54
|
"react": "^18.2.0",
|
|
55
55
|
"react-dom": "^18.2.0",
|
|
56
56
|
"react-intl-next": "npm:react-intl@^5.18.1"
|