@atlaskit/editor-plugin-block-type 4.0.9 → 4.0.10

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,14 @@
1
1
  # @atlaskit/editor-plugin-block-type
2
2
 
3
+ ## 4.0.10
4
+
5
+ ### Patch Changes
6
+
7
+ - [#176005](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/176005)
8
+ [`d4348ed45eed7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d4348ed45eed7) -
9
+ [ux] When text selection is inside media caption or decision nodes, Main and Floating toolbars
10
+ should have Lists and Text styles options disabled.
11
+
3
12
  ## 4.0.9
4
13
 
5
14
  ### Patch Changes
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.areBlockTypesDisabled = areBlockTypesDisabled;
7
7
  exports.isNodeAWrappingBlockNode = exports.createWrappingTextBlockRule = exports.createJoinNodesRule = void 0;
8
8
  var _utils = require("@atlaskit/editor-common/utils");
9
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
9
10
  var _blockTypes = require("./block-types");
10
11
  var isNodeAWrappingBlockNode = exports.isNodeAWrappingBlockNode = function isNodeAWrappingBlockNode(node) {
11
12
  if (!node) {
@@ -57,13 +58,18 @@ function getSelectedWrapperNodes(state) {
57
58
  orderedList = _state$schema$nodes.orderedList,
58
59
  bulletList = _state$schema$nodes.bulletList,
59
60
  listItem = _state$schema$nodes.listItem,
61
+ caption = _state$schema$nodes.caption,
60
62
  codeBlock = _state$schema$nodes.codeBlock,
61
63
  decisionItem = _state$schema$nodes.decisionItem,
62
64
  decisionList = _state$schema$nodes.decisionList,
63
65
  taskItem = _state$schema$nodes.taskItem,
64
66
  taskList = _state$schema$nodes.taskList;
67
+ var wrapperNodes = [blockquote, panel, orderedList, bulletList, listItem, codeBlock, decisionItem, decisionList, taskItem, taskList];
68
+ if ((0, _platformFeatureFlags.fg)('platform_editor_toolbar_fix_for_disabled_options')) {
69
+ wrapperNodes.push(caption);
70
+ }
65
71
  state.doc.nodesBetween($from.pos, $to.pos, function (node) {
66
- if (node.isBlock && [blockquote, panel, orderedList, bulletList, listItem, codeBlock, decisionItem, decisionList, taskItem, taskList].indexOf(node.type) >= 0) {
72
+ if (node.isBlock && wrapperNodes.indexOf(node.type) >= 0) {
67
73
  nodes.push(node.type);
68
74
  }
69
75
  });
@@ -1,4 +1,5 @@
1
1
  import { createRule, createWrappingJoinRule } from '@atlaskit/editor-common/utils';
2
+ import { fg } from '@atlaskit/platform-feature-flags';
2
3
  import { WRAPPER_BLOCK_TYPES } from './block-types';
3
4
  export const isNodeAWrappingBlockNode = node => {
4
5
  if (!node) {
@@ -48,14 +49,19 @@ function getSelectedWrapperNodes(state) {
48
49
  orderedList,
49
50
  bulletList,
50
51
  listItem,
52
+ caption,
51
53
  codeBlock,
52
54
  decisionItem,
53
55
  decisionList,
54
56
  taskItem,
55
57
  taskList
56
58
  } = state.schema.nodes;
59
+ const wrapperNodes = [blockquote, panel, orderedList, bulletList, listItem, codeBlock, decisionItem, decisionList, taskItem, taskList];
60
+ if (fg('platform_editor_toolbar_fix_for_disabled_options')) {
61
+ wrapperNodes.push(caption);
62
+ }
57
63
  state.doc.nodesBetween($from.pos, $to.pos, node => {
58
- if (node.isBlock && [blockquote, panel, orderedList, bulletList, listItem, codeBlock, decisionItem, decisionList, taskItem, taskList].indexOf(node.type) >= 0) {
64
+ if (node.isBlock && wrapperNodes.indexOf(node.type) >= 0) {
59
65
  nodes.push(node.type);
60
66
  }
61
67
  });
@@ -1,4 +1,5 @@
1
1
  import { createRule, createWrappingJoinRule } from '@atlaskit/editor-common/utils';
2
+ import { fg } from '@atlaskit/platform-feature-flags';
2
3
  import { WRAPPER_BLOCK_TYPES } from './block-types';
3
4
  export var isNodeAWrappingBlockNode = function isNodeAWrappingBlockNode(node) {
4
5
  if (!node) {
@@ -50,13 +51,18 @@ function getSelectedWrapperNodes(state) {
50
51
  orderedList = _state$schema$nodes.orderedList,
51
52
  bulletList = _state$schema$nodes.bulletList,
52
53
  listItem = _state$schema$nodes.listItem,
54
+ caption = _state$schema$nodes.caption,
53
55
  codeBlock = _state$schema$nodes.codeBlock,
54
56
  decisionItem = _state$schema$nodes.decisionItem,
55
57
  decisionList = _state$schema$nodes.decisionList,
56
58
  taskItem = _state$schema$nodes.taskItem,
57
59
  taskList = _state$schema$nodes.taskList;
60
+ var wrapperNodes = [blockquote, panel, orderedList, bulletList, listItem, codeBlock, decisionItem, decisionList, taskItem, taskList];
61
+ if (fg('platform_editor_toolbar_fix_for_disabled_options')) {
62
+ wrapperNodes.push(caption);
63
+ }
58
64
  state.doc.nodesBetween($from.pos, $to.pos, function (node) {
59
- if (node.isBlock && [blockquote, panel, orderedList, bulletList, listItem, codeBlock, decisionItem, decisionList, taskItem, taskList].indexOf(node.type) >= 0) {
65
+ if (node.isBlock && wrapperNodes.indexOf(node.type) >= 0) {
60
66
  nodes.push(node.type);
61
67
  }
62
68
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-type",
3
- "version": "4.0.9",
3
+ "version": "4.0.10",
4
4
  "description": "BlockType plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -34,18 +34,18 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@atlaskit/adf-schema": "^46.1.0",
37
- "@atlaskit/editor-common": "^96.1.0",
37
+ "@atlaskit/editor-common": "^96.3.0",
38
38
  "@atlaskit/editor-plugin-analytics": "^1.10.0",
39
39
  "@atlaskit/editor-plugin-primary-toolbar": "^2.0.0",
40
40
  "@atlaskit/editor-prosemirror": "6.2.1",
41
41
  "@atlaskit/editor-shared-styles": "^3.2.0",
42
42
  "@atlaskit/editor-tables": "^2.8.0",
43
- "@atlaskit/icon": "^23.0.0",
43
+ "@atlaskit/icon": "^23.1.0",
44
44
  "@atlaskit/platform-feature-flags": "^0.3.0",
45
45
  "@atlaskit/primitives": "^13.3.0",
46
46
  "@atlaskit/prosemirror-input-rules": "^3.2.0",
47
47
  "@atlaskit/theme": "^14.0.0",
48
- "@atlaskit/tmp-editor-statsig": "^2.22.0",
48
+ "@atlaskit/tmp-editor-statsig": "^2.23.0",
49
49
  "@atlaskit/tokens": "^2.4.0",
50
50
  "@babel/runtime": "^7.0.0",
51
51
  "@emotion/react": "^11.7.1"
@@ -58,7 +58,7 @@
58
58
  "devDependencies": {
59
59
  "@af/visual-regression": "*",
60
60
  "@atlaskit/analytics-next": "^10.1.0",
61
- "@atlaskit/editor-plugin-quick-insert": "^1.7.0",
61
+ "@atlaskit/editor-plugin-quick-insert": "^1.8.0",
62
62
  "@atlaskit/editor-plugin-type-ahead": "^1.11.0",
63
63
  "@atlaskit/ssr": "*",
64
64
  "@atlaskit/visual-regression": "*",
@@ -112,6 +112,9 @@
112
112
  },
113
113
  "platform_editor_nest_in_quotes_adf_change": {
114
114
  "type": "boolean"
115
+ },
116
+ "platform_editor_toolbar_fix_for_disabled_options": {
117
+ "type": "boolean"
115
118
  }
116
119
  }
117
120
  }