@atlaskit/editor-plugin-paste 11.1.5 → 11.1.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 +15 -0
- package/dist/cjs/pm-plugins/main.js +2 -1
- package/dist/cjs/pm-plugins/util/edge-cases/handleVSCodeBlock.js +3 -2
- package/dist/es2019/pm-plugins/main.js +2 -1
- package/dist/es2019/pm-plugins/util/edge-cases/handleVSCodeBlock.js +3 -2
- package/dist/esm/pm-plugins/main.js +2 -1
- package/dist/esm/pm-plugins/util/edge-cases/handleVSCodeBlock.js +3 -2
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-paste
|
|
2
2
|
|
|
3
|
+
## 11.1.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`ded95ac7efcc4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ded95ac7efcc4) -
|
|
8
|
+
Persist code block wrap state in ADF, default code blocks created across editor runtime paths to
|
|
9
|
+
wrapped, and update the wrap toolbar tooltip behind platform_editor_code_block_q4_lovability.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 11.1.6
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 11.1.5
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -12,6 +12,7 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
12
12
|
var _uuid = _interopRequireDefault(require("uuid"));
|
|
13
13
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
14
14
|
var _card = require("@atlaskit/editor-common/card");
|
|
15
|
+
var _codeBlock = require("@atlaskit/editor-common/code-block");
|
|
15
16
|
var _coreUtils = require("@atlaskit/editor-common/core-utils");
|
|
16
17
|
var _extensions = require("@atlaskit/editor-common/extensions");
|
|
17
18
|
var _nesting = require("@atlaskit/editor-common/nesting");
|
|
@@ -90,7 +91,7 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
|
|
|
90
91
|
var escapedTextInput = (0, _util.escapeBackslashAndLinksExceptCodeBlock)(text);
|
|
91
92
|
var doc = atlassianMarkDownParser.parse(escapedTextInput);
|
|
92
93
|
if (doc && doc.content) {
|
|
93
|
-
return new _model.Slice(doc.content, openStart, openEnd);
|
|
94
|
+
return (0, _codeBlock.defaultWrapForMarkdownCodeBlocksInSlice)(new _model.Slice(doc.content, openStart, openEnd), schema);
|
|
94
95
|
}
|
|
95
96
|
return;
|
|
96
97
|
}
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.handleVSCodeBlock = handleVSCodeBlock;
|
|
7
7
|
var _constants = require("@atlaskit/code/constants");
|
|
8
|
+
var _codeBlock = require("@atlaskit/editor-common/code-block");
|
|
8
9
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
9
10
|
function safelyGetVSCodeLanguage(editorData) {
|
|
10
11
|
try {
|
|
@@ -27,9 +28,9 @@ function handleVSCodeBlock(_ref) {
|
|
|
27
28
|
slice = (0, _utils.mapSlice)(slice, function (node) {
|
|
28
29
|
var _schema$nodes$codeBlo;
|
|
29
30
|
if (node.type.name === ((_schema$nodes$codeBlo = schema.nodes.codeBlock) === null || _schema$nodes$codeBlo === void 0 ? void 0 : _schema$nodes$codeBlo.name)) {
|
|
30
|
-
return schema.nodes.codeBlock.createChecked({
|
|
31
|
+
return schema.nodes.codeBlock.createChecked((0, _codeBlock.getDefaultCodeBlockAttrs)({
|
|
31
32
|
language: language
|
|
32
|
-
}, schema.text(text));
|
|
33
|
+
}), schema.text(text));
|
|
33
34
|
}
|
|
34
35
|
return node;
|
|
35
36
|
});
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import uuid from 'uuid';
|
|
3
3
|
import { ACTION, INPUT_METHOD, PasteTypes } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { addLinkMetadata } from '@atlaskit/editor-common/card';
|
|
5
|
+
import { defaultWrapForMarkdownCodeBlocksInSlice } from '@atlaskit/editor-common/code-block';
|
|
5
6
|
import { insideTable } from '@atlaskit/editor-common/core-utils';
|
|
6
7
|
import { getExtensionAutoConvertersFromProvider } from '@atlaskit/editor-common/extensions';
|
|
7
8
|
import { isNestedTablesSupported } from '@atlaskit/editor-common/nesting';
|
|
@@ -79,7 +80,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
79
80
|
const escapedTextInput = escapeBackslashAndLinksExceptCodeBlock(text);
|
|
80
81
|
const doc = atlassianMarkDownParser.parse(escapedTextInput);
|
|
81
82
|
if (doc && doc.content) {
|
|
82
|
-
return new Slice(doc.content, openStart, openEnd);
|
|
83
|
+
return defaultWrapForMarkdownCodeBlocksInSlice(new Slice(doc.content, openStart, openEnd), schema);
|
|
83
84
|
}
|
|
84
85
|
return;
|
|
85
86
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SUPPORTED_LANGUAGES } from '@atlaskit/code/constants';
|
|
2
|
+
import { getDefaultCodeBlockAttrs } from '@atlaskit/editor-common/code-block';
|
|
2
3
|
import { mapSlice } from '@atlaskit/editor-common/utils';
|
|
3
4
|
function safelyGetVSCodeLanguage(editorData) {
|
|
4
5
|
try {
|
|
@@ -22,9 +23,9 @@ export function handleVSCodeBlock({
|
|
|
22
23
|
slice = mapSlice(slice, node => {
|
|
23
24
|
var _schema$nodes$codeBlo;
|
|
24
25
|
if (node.type.name === ((_schema$nodes$codeBlo = schema.nodes.codeBlock) === null || _schema$nodes$codeBlo === void 0 ? void 0 : _schema$nodes$codeBlo.name)) {
|
|
25
|
-
return schema.nodes.codeBlock.createChecked({
|
|
26
|
+
return schema.nodes.codeBlock.createChecked(getDefaultCodeBlockAttrs({
|
|
26
27
|
language
|
|
27
|
-
}, schema.text(text));
|
|
28
|
+
}), schema.text(text));
|
|
28
29
|
}
|
|
29
30
|
return node;
|
|
30
31
|
});
|
|
@@ -7,6 +7,7 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
|
|
|
7
7
|
import uuid from 'uuid';
|
|
8
8
|
import { ACTION, INPUT_METHOD, PasteTypes } from '@atlaskit/editor-common/analytics';
|
|
9
9
|
import { addLinkMetadata } from '@atlaskit/editor-common/card';
|
|
10
|
+
import { defaultWrapForMarkdownCodeBlocksInSlice } from '@atlaskit/editor-common/code-block';
|
|
10
11
|
import { insideTable } from '@atlaskit/editor-common/core-utils';
|
|
11
12
|
import { getExtensionAutoConvertersFromProvider } from '@atlaskit/editor-common/extensions';
|
|
12
13
|
import { isNestedTablesSupported } from '@atlaskit/editor-common/nesting';
|
|
@@ -82,7 +83,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
82
83
|
var escapedTextInput = escapeBackslashAndLinksExceptCodeBlock(text);
|
|
83
84
|
var doc = atlassianMarkDownParser.parse(escapedTextInput);
|
|
84
85
|
if (doc && doc.content) {
|
|
85
|
-
return new Slice(doc.content, openStart, openEnd);
|
|
86
|
+
return defaultWrapForMarkdownCodeBlocksInSlice(new Slice(doc.content, openStart, openEnd), schema);
|
|
86
87
|
}
|
|
87
88
|
return;
|
|
88
89
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SUPPORTED_LANGUAGES } from '@atlaskit/code/constants';
|
|
2
|
+
import { getDefaultCodeBlockAttrs } from '@atlaskit/editor-common/code-block';
|
|
2
3
|
import { mapSlice } from '@atlaskit/editor-common/utils';
|
|
3
4
|
function safelyGetVSCodeLanguage(editorData) {
|
|
4
5
|
try {
|
|
@@ -21,9 +22,9 @@ export function handleVSCodeBlock(_ref) {
|
|
|
21
22
|
slice = mapSlice(slice, function (node) {
|
|
22
23
|
var _schema$nodes$codeBlo;
|
|
23
24
|
if (node.type.name === ((_schema$nodes$codeBlo = schema.nodes.codeBlock) === null || _schema$nodes$codeBlo === void 0 ? void 0 : _schema$nodes$codeBlo.name)) {
|
|
24
|
-
return schema.nodes.codeBlock.createChecked({
|
|
25
|
+
return schema.nodes.codeBlock.createChecked(getDefaultCodeBlockAttrs({
|
|
25
26
|
language: language
|
|
26
|
-
}, schema.text(text));
|
|
27
|
+
}), schema.text(text));
|
|
27
28
|
}
|
|
28
29
|
return node;
|
|
29
30
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-paste",
|
|
3
|
-
"version": "11.1.
|
|
3
|
+
"version": "11.1.7",
|
|
4
4
|
"description": "Paste plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -42,20 +42,20 @@
|
|
|
42
42
|
"@atlaskit/editor-prosemirror": "^7.3.0",
|
|
43
43
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
44
44
|
"@atlaskit/flag": "^17.11.0",
|
|
45
|
-
"@atlaskit/icon": "^34.
|
|
45
|
+
"@atlaskit/icon": "^34.4.0",
|
|
46
46
|
"@atlaskit/insm": "^0.4.0",
|
|
47
|
-
"@atlaskit/media-client": "^36.
|
|
48
|
-
"@atlaskit/media-common": "^13.
|
|
47
|
+
"@atlaskit/media-client": "^36.2.0",
|
|
48
|
+
"@atlaskit/media-common": "^13.3.0",
|
|
49
49
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
50
50
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
51
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
51
|
+
"@atlaskit/tmp-editor-statsig": "^77.2.0",
|
|
52
52
|
"@atlaskit/tokens": "^13.0.0",
|
|
53
53
|
"@babel/runtime": "^7.0.0",
|
|
54
54
|
"lodash": "^4.17.21",
|
|
55
55
|
"uuid": "^3.1.0"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"@atlaskit/editor-common": "^114.
|
|
58
|
+
"@atlaskit/editor-common": "^114.25.0",
|
|
59
59
|
"react": "^18.2.0",
|
|
60
60
|
"react-dom": "^18.2.0",
|
|
61
61
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|