@atlaskit/editor-plugin-list 3.8.0 → 3.8.2

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,19 @@
1
1
  # @atlaskit/editor-plugin-list
2
2
 
3
+ ## 3.8.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 3.8.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#129252](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/129252)
14
+ [`d4ea158a91fde`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d4ea158a91fde) -
15
+ Cleaned up FF platform.editor.allow-action-in-list
16
+
3
17
  ## 3.8.0
4
18
 
5
19
  ### Minor Changes
@@ -120,11 +120,9 @@ var toggleList = exports.toggleList = function toggleList(editorAnalyticsAPI) {
120
120
  return function (inputMethod, listType) {
121
121
  return function (_ref) {
122
122
  var tr = _ref.tr;
123
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.allow-action-in-list')) {
124
- var taskList = tr.doc.type.schema.nodes.taskList;
125
- if ((0, _utils2.hasParentNodeOfType)(taskList)(tr.selection)) {
126
- return tr;
127
- }
123
+ var taskList = tr.doc.type.schema.nodes.taskList;
124
+ if ((0, _utils2.hasParentNodeOfType)(taskList)(tr.selection)) {
125
+ return tr;
128
126
  }
129
127
  var listInsideSelection = (0, _selection2.selectionContainsList)(tr);
130
128
  var listNodeType = tr.doc.type.schema.nodes[listType];
@@ -335,7 +333,7 @@ var joinToPreviousListItem = function joinToPreviousListItem(state, dispatch) {
335
333
  if ($postCut.nodeBefore && $postCut.nodeAfter && $postCut.nodeBefore.type === $postCut.nodeAfter.type && [bulletList, orderedList].indexOf($postCut.nodeBefore.type) > -1) {
336
334
  var firstList = $postCut.nodeBefore;
337
335
  var secondList = $postCut.nodeAfter;
338
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.ordered-list-auto-join-improvements_mrlv5')) {
336
+ if ((0, _platformFeatureFlags.fg)('platform.editor.ordered-list-auto-join-improvements_mrlv5')) {
339
337
  // If lists are ordered, only join if second list continues from the first
340
338
  if (!(0, _utils.isOrderedList)(firstList) ||
341
339
  // both lists have the same type so one check is sufficient
@@ -11,7 +11,6 @@ var _analytics = require("@atlaskit/editor-common/analytics");
11
11
  var _keymaps = require("@atlaskit/editor-common/keymaps");
12
12
  var _messages = require("@atlaskit/editor-common/messages");
13
13
  var _quickInsert = require("@atlaskit/editor-common/quick-insert");
14
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
15
14
  var _commands = require("./commands");
16
15
  var _inputRules = _interopRequireDefault(require("./pm-plugins/input-rules"));
17
16
  var _keymap = _interopRequireDefault(require("./pm-plugins/keymap"));
@@ -54,7 +53,7 @@ var listPlugin = exports.listPlugin = function listPlugin(_ref) {
54
53
  return _main.pluginKey.getState(editorState);
55
54
  },
56
55
  nodes: function nodes() {
57
- var listItemNode = (0, _platformFeatureFlags.getBooleanFF)('platform.editor.allow-action-in-list') ? _adfSchema.listItemWithTask : _adfSchema.listItem;
56
+ var listItemNode = _adfSchema.listItemWithTask;
58
57
  return [{
59
58
  name: 'bulletList',
60
59
  node: _adfSchema.bulletList
@@ -8,7 +8,7 @@ import { chainCommands } from '@atlaskit/editor-prosemirror/commands';
8
8
  import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
9
9
  import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
10
10
  import { findPositionOfNodeBefore, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
11
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
11
+ import { fg } from '@atlaskit/platform-feature-flags';
12
12
  import { convertListType } from '../actions/conversions';
13
13
  import { wrapInListAndJoin } from '../actions/wrap-and-join-lists';
14
14
  import { liftFollowingList, liftNodeSelectionList, liftTextSelectionList } from '../transforms';
@@ -92,13 +92,11 @@ export const toggleList = editorAnalyticsAPI => (inputMethod, listType) => {
92
92
  return function ({
93
93
  tr
94
94
  }) {
95
- if (getBooleanFF('platform.editor.allow-action-in-list')) {
96
- const {
97
- taskList
98
- } = tr.doc.type.schema.nodes;
99
- if (hasParentNodeOfType(taskList)(tr.selection)) {
100
- return tr;
101
- }
95
+ const {
96
+ taskList
97
+ } = tr.doc.type.schema.nodes;
98
+ if (hasParentNodeOfType(taskList)(tr.selection)) {
99
+ return tr;
102
100
  }
103
101
  const listInsideSelection = selectionContainsList(tr);
104
102
  const listNodeType = tr.doc.type.schema.nodes[listType];
@@ -317,7 +315,7 @@ const joinToPreviousListItem = (state, dispatch) => {
317
315
  if ($postCut.nodeBefore && $postCut.nodeAfter && $postCut.nodeBefore.type === $postCut.nodeAfter.type && [bulletList, orderedList].indexOf($postCut.nodeBefore.type) > -1) {
318
316
  const firstList = $postCut.nodeBefore;
319
317
  const secondList = $postCut.nodeAfter;
320
- if (getBooleanFF('platform.editor.ordered-list-auto-join-improvements_mrlv5')) {
318
+ if (fg('platform.editor.ordered-list-auto-join-improvements_mrlv5')) {
321
319
  // If lists are ordered, only join if second list continues from the first
322
320
  if (!isOrderedList(firstList) ||
323
321
  // both lists have the same type so one check is sufficient
@@ -1,10 +1,9 @@
1
1
  import React from 'react';
2
- import { bulletList, listItem, listItemWithTask, orderedListWithOrder } from '@atlaskit/adf-schema';
2
+ import { bulletList, listItemWithTask, orderedListWithOrder } from '@atlaskit/adf-schema';
3
3
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
4
4
  import { toggleBulletList, toggleOrderedList, tooltip } from '@atlaskit/editor-common/keymaps';
5
5
  import { listMessages as messages } from '@atlaskit/editor-common/messages';
6
6
  import { IconList, IconListNumber } from '@atlaskit/editor-common/quick-insert';
7
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
8
7
  import { indentList, outdentList, toggleBulletList as toggleBulletListCommand, toggleOrderedList as toggleOrderedListCommand } from './commands';
9
8
  import inputRulePlugin from './pm-plugins/input-rules';
10
9
  import keymapPlugin from './pm-plugins/keymap';
@@ -47,7 +46,7 @@ export const listPlugin = ({
47
46
  return listPluginKey.getState(editorState);
48
47
  },
49
48
  nodes() {
50
- const listItemNode = getBooleanFF('platform.editor.allow-action-in-list') ? listItemWithTask : listItem;
49
+ const listItemNode = listItemWithTask;
51
50
  return [{
52
51
  name: 'bulletList',
53
52
  node: bulletList
@@ -11,7 +11,7 @@ import { chainCommands } from '@atlaskit/editor-prosemirror/commands';
11
11
  import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
12
12
  import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
13
13
  import { findPositionOfNodeBefore, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
14
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
14
+ import { fg } from '@atlaskit/platform-feature-flags';
15
15
  import { convertListType } from '../actions/conversions';
16
16
  import { wrapInListAndJoin } from '../actions/wrap-and-join-lists';
17
17
  import { liftFollowingList, liftNodeSelectionList, liftTextSelectionList } from '../transforms';
@@ -101,11 +101,9 @@ export var toggleList = function toggleList(editorAnalyticsAPI) {
101
101
  return function (inputMethod, listType) {
102
102
  return function (_ref) {
103
103
  var tr = _ref.tr;
104
- if (getBooleanFF('platform.editor.allow-action-in-list')) {
105
- var taskList = tr.doc.type.schema.nodes.taskList;
106
- if (hasParentNodeOfType(taskList)(tr.selection)) {
107
- return tr;
108
- }
104
+ var taskList = tr.doc.type.schema.nodes.taskList;
105
+ if (hasParentNodeOfType(taskList)(tr.selection)) {
106
+ return tr;
109
107
  }
110
108
  var listInsideSelection = selectionContainsList(tr);
111
109
  var listNodeType = tr.doc.type.schema.nodes[listType];
@@ -316,7 +314,7 @@ var joinToPreviousListItem = function joinToPreviousListItem(state, dispatch) {
316
314
  if ($postCut.nodeBefore && $postCut.nodeAfter && $postCut.nodeBefore.type === $postCut.nodeAfter.type && [bulletList, orderedList].indexOf($postCut.nodeBefore.type) > -1) {
317
315
  var firstList = $postCut.nodeBefore;
318
316
  var secondList = $postCut.nodeAfter;
319
- if (getBooleanFF('platform.editor.ordered-list-auto-join-improvements_mrlv5')) {
317
+ if (fg('platform.editor.ordered-list-auto-join-improvements_mrlv5')) {
320
318
  // If lists are ordered, only join if second list continues from the first
321
319
  if (!isOrderedList(firstList) ||
322
320
  // both lists have the same type so one check is sufficient
@@ -1,10 +1,9 @@
1
1
  import React from 'react';
2
- import { bulletList, listItem, listItemWithTask, orderedListWithOrder } from '@atlaskit/adf-schema';
2
+ import { bulletList, listItemWithTask, orderedListWithOrder } from '@atlaskit/adf-schema';
3
3
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
4
4
  import { toggleBulletList, toggleOrderedList, tooltip } from '@atlaskit/editor-common/keymaps';
5
5
  import { listMessages as messages } from '@atlaskit/editor-common/messages';
6
6
  import { IconList, IconListNumber } from '@atlaskit/editor-common/quick-insert';
7
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
8
7
  import { indentList, outdentList as _outdentList, toggleBulletList as toggleBulletListCommand, toggleOrderedList as toggleOrderedListCommand } from './commands';
9
8
  import inputRulePlugin from './pm-plugins/input-rules';
10
9
  import keymapPlugin from './pm-plugins/keymap';
@@ -48,7 +47,7 @@ export var listPlugin = function listPlugin(_ref) {
48
47
  return listPluginKey.getState(editorState);
49
48
  },
50
49
  nodes: function nodes() {
51
- var listItemNode = getBooleanFF('platform.editor.allow-action-in-list') ? listItemWithTask : listItem;
50
+ var listItemNode = listItemWithTask;
52
51
  return [{
53
52
  name: 'bulletList',
54
53
  node: bulletList
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-list",
3
- "version": "3.8.0",
3
+ "version": "3.8.2",
4
4
  "description": "List plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,8 +33,8 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@atlaskit/adf-schema": "^40.8.1",
36
- "@atlaskit/editor-common": "^87.6.0",
37
- "@atlaskit/editor-plugin-analytics": "^1.7.0",
36
+ "@atlaskit/editor-common": "^88.0.0",
37
+ "@atlaskit/editor-plugin-analytics": "^1.8.0",
38
38
  "@atlaskit/editor-plugin-feature-flags": "^1.2.0",
39
39
  "@atlaskit/editor-prosemirror": "5.0.1",
40
40
  "@atlaskit/platform-feature-flags": "^0.3.0",
@@ -89,9 +89,6 @@
89
89
  "platform-feature-flags": {
90
90
  "platform.editor.ordered-list-auto-join-improvements_mrlv5": {
91
91
  "type": "boolean"
92
- },
93
- "platform.editor.allow-action-in-list": {
94
- "type": "boolean"
95
92
  }
96
93
  }
97
94
  }