@atlaskit/editor-plugin-toolbar-lists-indentation 12.0.1 → 12.1.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 CHANGED
@@ -1,5 +1,16 @@
1
1
  # @atlaskit/editor-plugin-toolbar-lists-indentation
2
2
 
3
+ ## 12.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`1c50b36642fde`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1c50b36642fde) -
8
+ Update toolbar indentation disabled states
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+
3
14
  ## 12.0.1
4
15
 
5
16
  ### Patch Changes
@@ -7,6 +7,7 @@ exports.getIndentationButtonsState = getIndentationButtonsState;
7
7
  var _indentation = require("@atlaskit/editor-common/indentation");
8
8
  var _lists = require("@atlaskit/editor-common/lists");
9
9
  var _utils = require("@atlaskit/editor-prosemirror/utils");
10
+ var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
10
11
  function getIndentationButtonsState(editorState, allowHeadingAndParagraphIndentation, taskDecisionState, indentationState, isInsideListItem) {
11
12
  var _indentationState$isI;
12
13
  var state = {
@@ -24,9 +25,10 @@ function getIndentationButtonsState(editorState, allowHeadingAndParagraphIndenta
24
25
  var _getListItemAttribute = (0, _lists.getListItemAttributes)(selection.$head),
25
26
  indentLevel = _getListItemAttribute.indentLevel,
26
27
  itemIndex = _getListItemAttribute.itemIndex;
28
+ var isFlexibleListIndentationEnabled = (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_flexible_list_indentation', 'isEnabled', true);
27
29
  return {
28
30
  // List indent levels are zero indexed so we need to subtract 1
29
- indentDisabled: itemIndex === 0 || indentLevel >= _indentation.MAX_INDENTATION_LEVEL - 1,
31
+ indentDisabled: !isFlexibleListIndentationEnabled && itemIndex === 0 || indentLevel >= _indentation.MAX_INDENTATION_LEVEL - 1,
30
32
  outdentDisabled: false,
31
33
  node: 'list'
32
34
  };
@@ -1,6 +1,7 @@
1
1
  import { MAX_INDENTATION_LEVEL } from '@atlaskit/editor-common/indentation';
2
2
  import { getListItemAttributes } from '@atlaskit/editor-common/lists';
3
3
  import { hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
4
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
4
5
  export function getIndentationButtonsState(editorState, allowHeadingAndParagraphIndentation, taskDecisionState, indentationState, isInsideListItem) {
5
6
  var _indentationState$isI;
6
7
  const state = {
@@ -21,9 +22,10 @@ export function getIndentationButtonsState(editorState, allowHeadingAndParagraph
21
22
  indentLevel,
22
23
  itemIndex
23
24
  } = getListItemAttributes(selection.$head);
25
+ const isFlexibleListIndentationEnabled = expValEqualsNoExposure('platform_editor_flexible_list_indentation', 'isEnabled', true);
24
26
  return {
25
27
  // List indent levels are zero indexed so we need to subtract 1
26
- indentDisabled: itemIndex === 0 || indentLevel >= MAX_INDENTATION_LEVEL - 1,
28
+ indentDisabled: !isFlexibleListIndentationEnabled && itemIndex === 0 || indentLevel >= MAX_INDENTATION_LEVEL - 1,
27
29
  outdentDisabled: false,
28
30
  node: 'list'
29
31
  };
@@ -1,6 +1,7 @@
1
1
  import { MAX_INDENTATION_LEVEL } from '@atlaskit/editor-common/indentation';
2
2
  import { getListItemAttributes } from '@atlaskit/editor-common/lists';
3
3
  import { hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
4
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
4
5
  export function getIndentationButtonsState(editorState, allowHeadingAndParagraphIndentation, taskDecisionState, indentationState, isInsideListItem) {
5
6
  var _indentationState$isI;
6
7
  var state = {
@@ -18,9 +19,10 @@ export function getIndentationButtonsState(editorState, allowHeadingAndParagraph
18
19
  var _getListItemAttribute = getListItemAttributes(selection.$head),
19
20
  indentLevel = _getListItemAttribute.indentLevel,
20
21
  itemIndex = _getListItemAttribute.itemIndex;
22
+ var isFlexibleListIndentationEnabled = expValEqualsNoExposure('platform_editor_flexible_list_indentation', 'isEnabled', true);
21
23
  return {
22
24
  // List indent levels are zero indexed so we need to subtract 1
23
- indentDisabled: itemIndex === 0 || indentLevel >= MAX_INDENTATION_LEVEL - 1,
25
+ indentDisabled: !isFlexibleListIndentationEnabled && itemIndex === 0 || indentLevel >= MAX_INDENTATION_LEVEL - 1,
24
26
  outdentDisabled: false,
25
27
  node: 'list'
26
28
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-toolbar-lists-indentation",
3
- "version": "12.0.1",
3
+ "version": "12.1.0",
4
4
  "description": "Toolbar lists and indentation plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -38,19 +38,19 @@
38
38
  "@atlaskit/editor-plugin-list": "^13.0.0",
39
39
  "@atlaskit/editor-plugin-primary-toolbar": "^12.0.0",
40
40
  "@atlaskit/editor-plugin-selection-toolbar": "^12.0.0",
41
- "@atlaskit/editor-plugin-tasks-and-decisions": "^14.0.0",
41
+ "@atlaskit/editor-plugin-tasks-and-decisions": "^14.1.0",
42
42
  "@atlaskit/editor-plugin-toolbar": "^8.0.0",
43
43
  "@atlaskit/editor-prosemirror": "^7.3.0",
44
44
  "@atlaskit/editor-toolbar": "^1.10.0",
45
45
  "@atlaskit/editor-toolbar-model": "^0.5.0",
46
46
  "@atlaskit/icon": "^35.4.0",
47
47
  "@atlaskit/platform-feature-flags": "^1.1.0",
48
- "@atlaskit/tmp-editor-statsig": "^89.0.0",
49
- "@atlaskit/tokens": "^13.1.0",
48
+ "@atlaskit/tmp-editor-statsig": "^89.4.0",
49
+ "@atlaskit/tokens": "^13.3.0",
50
50
  "@babel/runtime": "^7.0.0"
51
51
  },
52
52
  "peerDependencies": {
53
- "@atlaskit/editor-common": "^115.2.0",
53
+ "@atlaskit/editor-common": "^115.7.0",
54
54
  "react": "^18.2.0",
55
55
  "react-dom": "^18.2.0",
56
56
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"