@atlaskit/editor-plugin-code-block 3.3.5 → 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 +19 -0
- package/dist/cjs/actions.js +1 -20
- package/dist/es2019/actions.js +1 -21
- package/dist/esm/actions.js +1 -20
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
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
|
+
|
|
16
|
+
## 3.3.6
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 3.3.5
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
package/dist/cjs/actions.js
CHANGED
|
@@ -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,
|
package/dist/es2019/actions.js
CHANGED
|
@@ -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,
|
package/dist/esm/actions.js
CHANGED
|
@@ -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.
|
|
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,13 +35,13 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@atlaskit/adf-schema": "^40.8.1",
|
|
37
37
|
"@atlaskit/code": "^15.5.0",
|
|
38
|
-
"@atlaskit/editor-common": "^
|
|
39
|
-
"@atlaskit/editor-plugin-analytics": "^1.
|
|
38
|
+
"@atlaskit/editor-common": "^88.1.0",
|
|
39
|
+
"@atlaskit/editor-plugin-analytics": "^1.8.0",
|
|
40
40
|
"@atlaskit/editor-plugin-composition": "^1.2.0",
|
|
41
|
-
"@atlaskit/editor-plugin-decorations": "^1.
|
|
42
|
-
"@atlaskit/editor-plugin-editor-disabled": "^1.
|
|
41
|
+
"@atlaskit/editor-plugin-decorations": "^1.3.0",
|
|
42
|
+
"@atlaskit/editor-plugin-editor-disabled": "^1.3.0",
|
|
43
43
|
"@atlaskit/editor-prosemirror": "5.0.1",
|
|
44
|
-
"@atlaskit/icon": "^22.
|
|
44
|
+
"@atlaskit/icon": "^22.14.0",
|
|
45
45
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
46
46
|
"@atlaskit/prosemirror-input-rules": "^3.2.0",
|
|
47
47
|
"@babel/runtime": "^7.0.0",
|