@atlaskit/editor-plugin-toolbar-lists-indentation 11.1.4 → 11.1.5
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 +9 -0
- package/dist/cjs/ui/toolbar-components/ListsIndentationHeroButton.js +7 -5
- package/dist/es2019/ui/toolbar-components/ListsIndentationHeroButton.js +7 -5
- package/dist/esm/ui/toolbar-components/ListsIndentationHeroButton.js +7 -5
- package/dist/types/toolbarListsIndentationPluginType.d.ts +3 -1
- package/dist/types-ts4.5/toolbarListsIndentationPluginType.d.ts +3 -1
- package/package.json +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-toolbar-lists-indentation
|
|
2
2
|
|
|
3
|
+
## 11.1.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`41962dd9dccb2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/41962dd9dccb2) -
|
|
8
|
+
NO-ISSUE: adds a default toolbar state so we can render the toolbar on initial load without
|
|
9
|
+
relying on editor state
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 11.1.4
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -13,19 +13,21 @@ 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
15
|
var _task = _interopRequireDefault(require("@atlaskit/icon/core/task"));
|
|
16
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
16
17
|
function useListsIndentationHeroButtonInfo(_ref) {
|
|
17
18
|
var api = _ref.api,
|
|
18
19
|
parents = _ref.parents,
|
|
19
20
|
defaultListType = _ref.defaultListType;
|
|
20
21
|
var _useIntl = (0, _reactIntl.useIntl)(),
|
|
21
22
|
formatMessage = _useIntl.formatMessage;
|
|
22
|
-
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['list', 'taskDecision'], function (states) {
|
|
23
|
-
var _states$listState, _states$listState2, _states$listState3, _states$taskDecisionS;
|
|
23
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['list', 'taskDecision', 'interaction'], function (states) {
|
|
24
|
+
var _states$interactionSt, _states$listState, _states$listState2, _states$listState3, _states$taskDecisionS;
|
|
25
|
+
var useDefaultToolbarState = ((_states$interactionSt = states.interactionState) === null || _states$interactionSt === void 0 ? void 0 : _states$interactionSt.interactionState) === 'hasNotHadInteraction' && (0, _expValEquals.expValEquals)('platform_editor_default_toolbar_state', 'isEnabled', true);
|
|
24
26
|
return {
|
|
25
|
-
bulletListActive: (_states$listState = states.listState) === null || _states$listState === void 0 ? void 0 : _states$listState.bulletListActive,
|
|
27
|
+
bulletListActive: useDefaultToolbarState ? false : (_states$listState = states.listState) === null || _states$listState === void 0 ? void 0 : _states$listState.bulletListActive,
|
|
26
28
|
bulletListDisabled: (_states$listState2 = states.listState) === null || _states$listState2 === void 0 ? void 0 : _states$listState2.bulletListDisabled,
|
|
27
|
-
orderedListActive: (_states$listState3 = states.listState) === null || _states$listState3 === void 0 ? void 0 : _states$listState3.orderedListActive,
|
|
28
|
-
taskListActive: (_states$taskDecisionS = states.taskDecisionState) === null || _states$taskDecisionS === void 0 ? void 0 : _states$taskDecisionS.isInsideTask
|
|
29
|
+
orderedListActive: useDefaultToolbarState ? false : (_states$listState3 = states.listState) === null || _states$listState3 === void 0 ? void 0 : _states$listState3.orderedListActive,
|
|
30
|
+
taskListActive: useDefaultToolbarState ? false : (_states$taskDecisionS = states.taskDecisionState) === null || _states$taskDecisionS === void 0 ? void 0 : _states$taskDecisionS.isInsideTask
|
|
29
31
|
};
|
|
30
32
|
}),
|
|
31
33
|
bulletListActive = _useSharedPluginState.bulletListActive,
|
|
@@ -6,6 +6,7 @@ import { listMessages, tasksAndDecisionsMessages } from '@atlaskit/editor-common
|
|
|
6
6
|
import { getInputMethodFromParentKeys } from '@atlaskit/editor-common/toolbar';
|
|
7
7
|
import { ListBulletedIcon, ListNumberedIcon, ToolbarButton, ToolbarTooltip } from '@atlaskit/editor-toolbar';
|
|
8
8
|
import TaskIcon from '@atlaskit/icon/core/task';
|
|
9
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
9
10
|
function useListsIndentationHeroButtonInfo({
|
|
10
11
|
api,
|
|
11
12
|
parents,
|
|
@@ -19,13 +20,14 @@ function useListsIndentationHeroButtonInfo({
|
|
|
19
20
|
bulletListDisabled,
|
|
20
21
|
orderedListActive,
|
|
21
22
|
taskListActive
|
|
22
|
-
} = useSharedPluginStateWithSelector(api, ['list', 'taskDecision'], states => {
|
|
23
|
-
var _states$listState, _states$listState2, _states$listState3, _states$taskDecisionS;
|
|
23
|
+
} = useSharedPluginStateWithSelector(api, ['list', 'taskDecision', 'interaction'], states => {
|
|
24
|
+
var _states$interactionSt, _states$listState, _states$listState2, _states$listState3, _states$taskDecisionS;
|
|
25
|
+
const useDefaultToolbarState = ((_states$interactionSt = states.interactionState) === null || _states$interactionSt === void 0 ? void 0 : _states$interactionSt.interactionState) === 'hasNotHadInteraction' && expValEquals('platform_editor_default_toolbar_state', 'isEnabled', true);
|
|
24
26
|
return {
|
|
25
|
-
bulletListActive: (_states$listState = states.listState) === null || _states$listState === void 0 ? void 0 : _states$listState.bulletListActive,
|
|
27
|
+
bulletListActive: useDefaultToolbarState ? false : (_states$listState = states.listState) === null || _states$listState === void 0 ? void 0 : _states$listState.bulletListActive,
|
|
26
28
|
bulletListDisabled: (_states$listState2 = states.listState) === null || _states$listState2 === void 0 ? void 0 : _states$listState2.bulletListDisabled,
|
|
27
|
-
orderedListActive: (_states$listState3 = states.listState) === null || _states$listState3 === void 0 ? void 0 : _states$listState3.orderedListActive,
|
|
28
|
-
taskListActive: (_states$taskDecisionS = states.taskDecisionState) === null || _states$taskDecisionS === void 0 ? void 0 : _states$taskDecisionS.isInsideTask
|
|
29
|
+
orderedListActive: useDefaultToolbarState ? false : (_states$listState3 = states.listState) === null || _states$listState3 === void 0 ? void 0 : _states$listState3.orderedListActive,
|
|
30
|
+
taskListActive: useDefaultToolbarState ? false : (_states$taskDecisionS = states.taskDecisionState) === null || _states$taskDecisionS === void 0 ? void 0 : _states$taskDecisionS.isInsideTask
|
|
29
31
|
};
|
|
30
32
|
});
|
|
31
33
|
const getListType = taskListActive ? 'taskList' : orderedListActive ? 'orderedList' : defaultListType;
|
|
@@ -6,19 +6,21 @@ import { listMessages, tasksAndDecisionsMessages } from '@atlaskit/editor-common
|
|
|
6
6
|
import { getInputMethodFromParentKeys } from '@atlaskit/editor-common/toolbar';
|
|
7
7
|
import { ListBulletedIcon, ListNumberedIcon, ToolbarButton, ToolbarTooltip } from '@atlaskit/editor-toolbar';
|
|
8
8
|
import TaskIcon from '@atlaskit/icon/core/task';
|
|
9
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
9
10
|
function useListsIndentationHeroButtonInfo(_ref) {
|
|
10
11
|
var api = _ref.api,
|
|
11
12
|
parents = _ref.parents,
|
|
12
13
|
defaultListType = _ref.defaultListType;
|
|
13
14
|
var _useIntl = useIntl(),
|
|
14
15
|
formatMessage = _useIntl.formatMessage;
|
|
15
|
-
var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['list', 'taskDecision'], function (states) {
|
|
16
|
-
var _states$listState, _states$listState2, _states$listState3, _states$taskDecisionS;
|
|
16
|
+
var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['list', 'taskDecision', 'interaction'], function (states) {
|
|
17
|
+
var _states$interactionSt, _states$listState, _states$listState2, _states$listState3, _states$taskDecisionS;
|
|
18
|
+
var useDefaultToolbarState = ((_states$interactionSt = states.interactionState) === null || _states$interactionSt === void 0 ? void 0 : _states$interactionSt.interactionState) === 'hasNotHadInteraction' && expValEquals('platform_editor_default_toolbar_state', 'isEnabled', true);
|
|
17
19
|
return {
|
|
18
|
-
bulletListActive: (_states$listState = states.listState) === null || _states$listState === void 0 ? void 0 : _states$listState.bulletListActive,
|
|
20
|
+
bulletListActive: useDefaultToolbarState ? false : (_states$listState = states.listState) === null || _states$listState === void 0 ? void 0 : _states$listState.bulletListActive,
|
|
19
21
|
bulletListDisabled: (_states$listState2 = states.listState) === null || _states$listState2 === void 0 ? void 0 : _states$listState2.bulletListDisabled,
|
|
20
|
-
orderedListActive: (_states$listState3 = states.listState) === null || _states$listState3 === void 0 ? void 0 : _states$listState3.orderedListActive,
|
|
21
|
-
taskListActive: (_states$taskDecisionS = states.taskDecisionState) === null || _states$taskDecisionS === void 0 ? void 0 : _states$taskDecisionS.isInsideTask
|
|
22
|
+
orderedListActive: useDefaultToolbarState ? false : (_states$listState3 = states.listState) === null || _states$listState3 === void 0 ? void 0 : _states$listState3.orderedListActive,
|
|
23
|
+
taskListActive: useDefaultToolbarState ? false : (_states$taskDecisionS = states.taskDecisionState) === null || _states$taskDecisionS === void 0 ? void 0 : _states$taskDecisionS.isInsideTask
|
|
22
24
|
};
|
|
23
25
|
}),
|
|
24
26
|
bulletListActive = _useSharedPluginState.bulletListActive,
|
|
@@ -2,6 +2,7 @@ import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/t
|
|
|
2
2
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
3
3
|
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
4
4
|
import type { IndentationPlugin } from '@atlaskit/editor-plugin-indentation';
|
|
5
|
+
import type { InteractionPlugin } from '@atlaskit/editor-plugin-interaction';
|
|
5
6
|
import type { ListPlugin } from '@atlaskit/editor-plugin-list';
|
|
6
7
|
import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
|
|
7
8
|
import type { SelectionToolbarPlugin } from '@atlaskit/editor-plugin-selection-toolbar';
|
|
@@ -21,7 +22,8 @@ export type ToolbarListsIndentationPluginDependencies = [
|
|
|
21
22
|
OptionalPlugin<PrimaryToolbarPlugin>,
|
|
22
23
|
OptionalPlugin<SelectionToolbarPlugin>,
|
|
23
24
|
OptionalPlugin<UserPreferencesPlugin>,
|
|
24
|
-
OptionalPlugin<ToolbarPlugin
|
|
25
|
+
OptionalPlugin<ToolbarPlugin>,
|
|
26
|
+
OptionalPlugin<InteractionPlugin>
|
|
25
27
|
];
|
|
26
28
|
export type ToolbarListsIndentationPlugin = NextEditorPlugin<'toolbarListsIndentation', {
|
|
27
29
|
dependencies: ToolbarListsIndentationPluginDependencies;
|
|
@@ -2,6 +2,7 @@ import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/t
|
|
|
2
2
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
3
3
|
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
4
4
|
import type { IndentationPlugin } from '@atlaskit/editor-plugin-indentation';
|
|
5
|
+
import type { InteractionPlugin } from '@atlaskit/editor-plugin-interaction';
|
|
5
6
|
import type { ListPlugin } from '@atlaskit/editor-plugin-list';
|
|
6
7
|
import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
|
|
7
8
|
import type { SelectionToolbarPlugin } from '@atlaskit/editor-plugin-selection-toolbar';
|
|
@@ -21,7 +22,8 @@ export type ToolbarListsIndentationPluginDependencies = [
|
|
|
21
22
|
OptionalPlugin<PrimaryToolbarPlugin>,
|
|
22
23
|
OptionalPlugin<SelectionToolbarPlugin>,
|
|
23
24
|
OptionalPlugin<UserPreferencesPlugin>,
|
|
24
|
-
OptionalPlugin<ToolbarPlugin
|
|
25
|
+
OptionalPlugin<ToolbarPlugin>,
|
|
26
|
+
OptionalPlugin<InteractionPlugin>
|
|
25
27
|
];
|
|
26
28
|
export type ToolbarListsIndentationPlugin = NextEditorPlugin<'toolbarListsIndentation', {
|
|
27
29
|
dependencies: ToolbarListsIndentationPluginDependencies;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-toolbar-lists-indentation",
|
|
3
|
-
"version": "11.1.
|
|
3
|
+
"version": "11.1.5",
|
|
4
4
|
"description": "Toolbar lists and indentation plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,22 +34,23 @@
|
|
|
34
34
|
"@atlaskit/editor-plugin-block-type": "^14.1.0",
|
|
35
35
|
"@atlaskit/editor-plugin-feature-flags": "^9.1.0",
|
|
36
36
|
"@atlaskit/editor-plugin-indentation": "^10.1.0",
|
|
37
|
+
"@atlaskit/editor-plugin-interaction": "^19.1.0",
|
|
37
38
|
"@atlaskit/editor-plugin-list": "^12.1.0",
|
|
38
39
|
"@atlaskit/editor-plugin-primary-toolbar": "^11.1.0",
|
|
39
40
|
"@atlaskit/editor-plugin-selection-toolbar": "^11.3.0",
|
|
40
41
|
"@atlaskit/editor-plugin-tasks-and-decisions": "^13.2.0",
|
|
41
42
|
"@atlaskit/editor-plugin-toolbar": "^7.3.0",
|
|
42
43
|
"@atlaskit/editor-prosemirror": "^7.3.0",
|
|
43
|
-
"@atlaskit/editor-toolbar": "^1.
|
|
44
|
+
"@atlaskit/editor-toolbar": "^1.7.0",
|
|
44
45
|
"@atlaskit/editor-toolbar-model": "^0.5.0",
|
|
45
46
|
"@atlaskit/icon": "^35.0.0",
|
|
46
47
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
47
|
-
"@atlaskit/tmp-editor-statsig": "^82.
|
|
48
|
+
"@atlaskit/tmp-editor-statsig": "^82.4.0",
|
|
48
49
|
"@atlaskit/tokens": "^13.0.0",
|
|
49
50
|
"@babel/runtime": "^7.0.0"
|
|
50
51
|
},
|
|
51
52
|
"peerDependencies": {
|
|
52
|
-
"@atlaskit/editor-common": "^114.
|
|
53
|
+
"@atlaskit/editor-common": "^114.41.0",
|
|
53
54
|
"react": "^18.2.0",
|
|
54
55
|
"react-dom": "^18.2.0",
|
|
55
56
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
@@ -57,6 +58,8 @@
|
|
|
57
58
|
"devDependencies": {
|
|
58
59
|
"@atlaskit/adf-schema": "^52.13.0",
|
|
59
60
|
"@testing-library/react": "^16.3.0",
|
|
61
|
+
"react": "^18.2.0",
|
|
62
|
+
"react-dom": "^18.2.0",
|
|
60
63
|
"react-intl": "^6.6.2",
|
|
61
64
|
"wait-for-expect": "^1.2.0"
|
|
62
65
|
},
|