@atlaskit/editor-plugin-code-block 3.3.6 → 3.3.7

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,18 @@
1
1
  # @atlaskit/editor-plugin-code-block
2
2
 
3
+ ## 3.3.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [`193f8c85e1a39`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/193f8c85e1a39) -
8
+ [ux] [ED-24635]
9
+
10
+ - Disable Turn into dropdown options when wrapping is not supported
11
+ - Update expand icon so that it can show disabled status
12
+ - Update Turn into icon to show active status when dropdown is open
13
+
14
+ - Updated dependencies
15
+
3
16
  ## 3.3.6
4
17
 
5
18
  ### Patch Changes
@@ -156,7 +156,7 @@ function createInsertCodeBlockTransaction(_ref) {
156
156
  parentNodeType: parentNodeType,
157
157
  grandParentNodeType: grandParentNodeType,
158
158
  content: codeBlock.createAndFill()
159
- }) && contentAllowedInCodeBlock(state);
159
+ }) && (0, _insert.contentAllowedInCodeBlock)(state);
160
160
  if (canInsertCodeBlock) {
161
161
  tr = (0, _transformToCodeBlock.transformToCodeBlockAction)(state, from);
162
162
  } else {
@@ -164,25 +164,6 @@ function createInsertCodeBlockTransaction(_ref) {
164
164
  }
165
165
  return tr;
166
166
  }
167
-
168
- /**
169
- * Check if the current selection contains any nodes that are not permitted
170
- * as codeBlock child nodes. Note that this allows paragraphs and inline nodes
171
- * as we extract their text content.
172
- */
173
- function contentAllowedInCodeBlock(state) {
174
- var _state$selection = state.selection,
175
- $from = _state$selection.$from,
176
- $to = _state$selection.$to;
177
- var isAllowedChild = true;
178
- state.doc.nodesBetween($from.pos, $to.pos, function (node) {
179
- if (!isAllowedChild) {
180
- return false;
181
- }
182
- return isAllowedChild = node.type === state.schema.nodes.listItem || node.type === state.schema.nodes.bulletList || node.type === state.schema.nodes.orderedList || node.type === state.schema.nodes.paragraph || node.isInline || node.type === state.schema.nodes.panel || node.isText;
183
- });
184
- return isAllowedChild;
185
- }
186
167
  function insertCodeBlockWithAnalytics(inputMethod, analyticsAPI) {
187
168
  return (0, _editorAnalytics.withAnalytics)(analyticsAPI, {
188
169
  action: _analytics.ACTION.INSERTED,
@@ -2,7 +2,7 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, MODE, PLATFORMS
2
2
  import { copyToClipboard } from '@atlaskit/editor-common/clipboard';
3
3
  import { codeBlockWrappedStates, isCodeBlockWordWrapEnabled } from '@atlaskit/editor-common/code-block';
4
4
  import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
5
- import { shouldSplitSelectedNodeOnNodeInsertion } from '@atlaskit/editor-common/insert';
5
+ import { contentAllowedInCodeBlock, shouldSplitSelectedNodeOnNodeInsertion } from '@atlaskit/editor-common/insert';
6
6
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
7
7
  import { findParentNodeOfType, findSelectedNodeOfType, isNodeSelection, removeParentNodeOfType, removeSelectedNode, safeInsert } from '@atlaskit/editor-prosemirror/utils';
8
8
  import { fg } from '@atlaskit/platform-feature-flags';
@@ -173,26 +173,6 @@ export function createInsertCodeBlockTransaction({
173
173
  }
174
174
  return tr;
175
175
  }
176
-
177
- /**
178
- * Check if the current selection contains any nodes that are not permitted
179
- * as codeBlock child nodes. Note that this allows paragraphs and inline nodes
180
- * as we extract their text content.
181
- */
182
- function contentAllowedInCodeBlock(state) {
183
- const {
184
- $from,
185
- $to
186
- } = state.selection;
187
- let isAllowedChild = true;
188
- state.doc.nodesBetween($from.pos, $to.pos, node => {
189
- if (!isAllowedChild) {
190
- return false;
191
- }
192
- return isAllowedChild = node.type === state.schema.nodes.listItem || node.type === state.schema.nodes.bulletList || node.type === state.schema.nodes.orderedList || node.type === state.schema.nodes.paragraph || node.isInline || node.type === state.schema.nodes.panel || node.isText;
193
- });
194
- return isAllowedChild;
195
- }
196
176
  export function insertCodeBlockWithAnalytics(inputMethod, analyticsAPI) {
197
177
  return withAnalytics(analyticsAPI, {
198
178
  action: ACTION.INSERTED,
@@ -2,7 +2,7 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, MODE, PLATFORMS
2
2
  import { copyToClipboard } from '@atlaskit/editor-common/clipboard';
3
3
  import { codeBlockWrappedStates, isCodeBlockWordWrapEnabled } from '@atlaskit/editor-common/code-block';
4
4
  import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
5
- import { shouldSplitSelectedNodeOnNodeInsertion } from '@atlaskit/editor-common/insert';
5
+ import { contentAllowedInCodeBlock, shouldSplitSelectedNodeOnNodeInsertion } from '@atlaskit/editor-common/insert';
6
6
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
7
7
  import { findParentNodeOfType, findSelectedNodeOfType, isNodeSelection, removeParentNodeOfType, removeSelectedNode, safeInsert } from '@atlaskit/editor-prosemirror/utils';
8
8
  import { fg } from '@atlaskit/platform-feature-flags';
@@ -154,25 +154,6 @@ export function createInsertCodeBlockTransaction(_ref) {
154
154
  }
155
155
  return tr;
156
156
  }
157
-
158
- /**
159
- * Check if the current selection contains any nodes that are not permitted
160
- * as codeBlock child nodes. Note that this allows paragraphs and inline nodes
161
- * as we extract their text content.
162
- */
163
- function contentAllowedInCodeBlock(state) {
164
- var _state$selection = state.selection,
165
- $from = _state$selection.$from,
166
- $to = _state$selection.$to;
167
- var isAllowedChild = true;
168
- state.doc.nodesBetween($from.pos, $to.pos, function (node) {
169
- if (!isAllowedChild) {
170
- return false;
171
- }
172
- return isAllowedChild = node.type === state.schema.nodes.listItem || node.type === state.schema.nodes.bulletList || node.type === state.schema.nodes.orderedList || node.type === state.schema.nodes.paragraph || node.isInline || node.type === state.schema.nodes.panel || node.isText;
173
- });
174
- return isAllowedChild;
175
- }
176
157
  export function insertCodeBlockWithAnalytics(inputMethod, analyticsAPI) {
177
158
  return withAnalytics(analyticsAPI, {
178
159
  action: ACTION.INSERTED,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-code-block",
3
- "version": "3.3.6",
3
+ "version": "3.3.7",
4
4
  "description": "Code block plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -35,7 +35,7 @@
35
35
  "dependencies": {
36
36
  "@atlaskit/adf-schema": "^40.8.1",
37
37
  "@atlaskit/code": "^15.5.0",
38
- "@atlaskit/editor-common": "^88.0.0",
38
+ "@atlaskit/editor-common": "^88.1.0",
39
39
  "@atlaskit/editor-plugin-analytics": "^1.8.0",
40
40
  "@atlaskit/editor-plugin-composition": "^1.2.0",
41
41
  "@atlaskit/editor-plugin-decorations": "^1.3.0",