@atlaskit/editor-plugin-paste 3.1.3 → 3.1.4
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 +8 -0
- package/dist/cjs/pm-plugins/main.js +1 -3
- package/dist/cjs/pm-plugins/move-analytics/plugin.js +4 -4
- package/dist/es2019/pm-plugins/main.js +1 -3
- package/dist/es2019/pm-plugins/move-analytics/plugin.js +4 -4
- package/dist/esm/pm-plugins/main.js +1 -3
- package/dist/esm/pm-plugins/move-analytics/plugin.js +4 -4
- package/package.json +3 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-paste
|
|
2
2
|
|
|
3
|
+
## 3.1.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#128182](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/128182)
|
|
8
|
+
[`7ff8302c0c02e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7ff8302c0c02e) -
|
|
9
|
+
Replace experiment with gate
|
|
10
|
+
|
|
3
11
|
## 3.1.3
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -508,9 +508,7 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
|
|
|
508
508
|
if (slice.content.childCount && slice.content.lastChild.type === schema.nodes.codeBlock) {
|
|
509
509
|
slice = new _model.Slice(slice.content, 0, 0);
|
|
510
510
|
}
|
|
511
|
-
|
|
512
|
-
slice = (0, _transforms.transformSingleColumnLayout)(slice, schema);
|
|
513
|
-
}
|
|
511
|
+
slice = (0, _transforms.transformSingleColumnLayout)(slice, schema);
|
|
514
512
|
if ((0, _platformFeatureFlags.fg)('platform_editor_macroid_reset_for_ext_on_paste')) {
|
|
515
513
|
slice = (0, _transforms.transformSliceToRemoveMacroId)(slice, schema);
|
|
516
514
|
}
|
|
@@ -8,7 +8,7 @@ exports.createPlugin = void 0;
|
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
10
10
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
11
|
-
var
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
12
|
var _commands = require("./commands");
|
|
13
13
|
var _pluginFactory = require("./plugin-factory");
|
|
14
14
|
var _pluginKey = require("./plugin-key");
|
|
@@ -91,12 +91,12 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, editor
|
|
|
91
91
|
// the paragraph below the node. Visually only the node in between is selected, in reality, three nodes are
|
|
92
92
|
// in the slice.
|
|
93
93
|
// These cases are ignored and moveContent event won't be counted.
|
|
94
|
-
var
|
|
94
|
+
var isMultiSelectTrackingEnabled = (0, _platformFeatureFlags.fg)('platform_editor_track_node_types');
|
|
95
95
|
var nodeName = ((_content$firstChild2 = content.firstChild) === null || _content$firstChild2 === void 0 ? void 0 : _content$firstChild2.type.name) || '';
|
|
96
96
|
var nodeTypes,
|
|
97
97
|
hasSelectedMultipleNodes = false;
|
|
98
98
|
if (content.childCount > 1) {
|
|
99
|
-
if (
|
|
99
|
+
if (isMultiSelectTrackingEnabled) {
|
|
100
100
|
if ((0, _utils.containsExcludedNode)(content)) {
|
|
101
101
|
resetState = true;
|
|
102
102
|
} else {
|
|
@@ -134,7 +134,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, editor
|
|
|
134
134
|
nodeName: nodeName,
|
|
135
135
|
nodeDepth: (0, _utils.getParentNodeDepth)(selection)
|
|
136
136
|
};
|
|
137
|
-
if (
|
|
137
|
+
if (isMultiSelectTrackingEnabled) {
|
|
138
138
|
var _nodeTypes;
|
|
139
139
|
newState = _objectSpread(_objectSpread({}, newState), {}, {
|
|
140
140
|
nodeTypes: (_nodeTypes = nodeTypes) !== null && _nodeTypes !== void 0 ? _nodeTypes : nodeName,
|
|
@@ -482,9 +482,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
482
482
|
if (slice.content.childCount && slice.content.lastChild.type === schema.nodes.codeBlock) {
|
|
483
483
|
slice = new Slice(slice.content, 0, 0);
|
|
484
484
|
}
|
|
485
|
-
|
|
486
|
-
slice = transformSingleColumnLayout(slice, schema);
|
|
487
|
-
}
|
|
485
|
+
slice = transformSingleColumnLayout(slice, schema);
|
|
488
486
|
if (fg('platform_editor_macroid_reset_for_ext_on_paste')) {
|
|
489
487
|
slice = transformSliceToRemoveMacroId(slice, schema);
|
|
490
488
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
-
import {
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
4
|
import { resetContentMoved, resetContentMovedTransform, updateContentMoved } from './commands';
|
|
5
5
|
import { createPluginState, getPluginState } from './plugin-factory';
|
|
6
6
|
import { pluginKey } from './plugin-key';
|
|
@@ -93,12 +93,12 @@ export const createPlugin = (dispatch, editorAnalyticsAPI) => {
|
|
|
93
93
|
// the paragraph below the node. Visually only the node in between is selected, in reality, three nodes are
|
|
94
94
|
// in the slice.
|
|
95
95
|
// These cases are ignored and moveContent event won't be counted.
|
|
96
|
-
const
|
|
96
|
+
const isMultiSelectTrackingEnabled = fg('platform_editor_track_node_types');
|
|
97
97
|
const nodeName = ((_content$firstChild2 = content.firstChild) === null || _content$firstChild2 === void 0 ? void 0 : _content$firstChild2.type.name) || '';
|
|
98
98
|
let nodeTypes,
|
|
99
99
|
hasSelectedMultipleNodes = false;
|
|
100
100
|
if (content.childCount > 1) {
|
|
101
|
-
if (
|
|
101
|
+
if (isMultiSelectTrackingEnabled) {
|
|
102
102
|
if (containsExcludedNode(content)) {
|
|
103
103
|
resetState = true;
|
|
104
104
|
} else {
|
|
@@ -136,7 +136,7 @@ export const createPlugin = (dispatch, editorAnalyticsAPI) => {
|
|
|
136
136
|
nodeName: nodeName,
|
|
137
137
|
nodeDepth: getParentNodeDepth(selection)
|
|
138
138
|
};
|
|
139
|
-
if (
|
|
139
|
+
if (isMultiSelectTrackingEnabled) {
|
|
140
140
|
var _nodeTypes;
|
|
141
141
|
newState = {
|
|
142
142
|
...newState,
|
|
@@ -500,9 +500,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
500
500
|
if (slice.content.childCount && slice.content.lastChild.type === schema.nodes.codeBlock) {
|
|
501
501
|
slice = new Slice(slice.content, 0, 0);
|
|
502
502
|
}
|
|
503
|
-
|
|
504
|
-
slice = transformSingleColumnLayout(slice, schema);
|
|
505
|
-
}
|
|
503
|
+
slice = transformSingleColumnLayout(slice, schema);
|
|
506
504
|
if (fg('platform_editor_macroid_reset_for_ext_on_paste')) {
|
|
507
505
|
slice = transformSliceToRemoveMacroId(slice, schema);
|
|
508
506
|
}
|
|
@@ -3,7 +3,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
6
|
-
import {
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
7
|
import { resetContentMoved, resetContentMovedTransform, updateContentMoved } from './commands';
|
|
8
8
|
import { createPluginState, getPluginState } from './plugin-factory';
|
|
9
9
|
import { pluginKey } from './plugin-key';
|
|
@@ -85,12 +85,12 @@ export var createPlugin = function createPlugin(dispatch, editorAnalyticsAPI) {
|
|
|
85
85
|
// the paragraph below the node. Visually only the node in between is selected, in reality, three nodes are
|
|
86
86
|
// in the slice.
|
|
87
87
|
// These cases are ignored and moveContent event won't be counted.
|
|
88
|
-
var
|
|
88
|
+
var isMultiSelectTrackingEnabled = fg('platform_editor_track_node_types');
|
|
89
89
|
var nodeName = ((_content$firstChild2 = content.firstChild) === null || _content$firstChild2 === void 0 ? void 0 : _content$firstChild2.type.name) || '';
|
|
90
90
|
var nodeTypes,
|
|
91
91
|
hasSelectedMultipleNodes = false;
|
|
92
92
|
if (content.childCount > 1) {
|
|
93
|
-
if (
|
|
93
|
+
if (isMultiSelectTrackingEnabled) {
|
|
94
94
|
if (containsExcludedNode(content)) {
|
|
95
95
|
resetState = true;
|
|
96
96
|
} else {
|
|
@@ -128,7 +128,7 @@ export var createPlugin = function createPlugin(dispatch, editorAnalyticsAPI) {
|
|
|
128
128
|
nodeName: nodeName,
|
|
129
129
|
nodeDepth: getParentNodeDepth(selection)
|
|
130
130
|
};
|
|
131
|
-
if (
|
|
131
|
+
if (isMultiSelectTrackingEnabled) {
|
|
132
132
|
var _nodeTypes;
|
|
133
133
|
newState = _objectSpread(_objectSpread({}, newState), {}, {
|
|
134
134
|
nodeTypes: (_nodeTypes = nodeTypes) !== null && _nodeTypes !== void 0 ? _nodeTypes : nodeName,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-paste",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.4",
|
|
4
4
|
"description": "Paste plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/adf-schema": "^47.6.0",
|
|
35
35
|
"@atlaskit/code": "^16.0.0",
|
|
36
|
-
"@atlaskit/editor-common": "^102.
|
|
36
|
+
"@atlaskit/editor-common": "^102.10.0",
|
|
37
37
|
"@atlaskit/editor-markdown-transformer": "^5.16.0",
|
|
38
38
|
"@atlaskit/editor-plugin-analytics": "^2.2.0",
|
|
39
39
|
"@atlaskit/editor-plugin-annotation": "^2.1.0",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@atlaskit/media-client": "^32.0.0",
|
|
49
49
|
"@atlaskit/media-common": "^12.0.0",
|
|
50
50
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
51
|
-
"@atlaskit/tmp-editor-statsig": "^4.
|
|
51
|
+
"@atlaskit/tmp-editor-statsig": "^4.1.0",
|
|
52
52
|
"@babel/runtime": "^7.0.0",
|
|
53
53
|
"lodash": "^4.17.21",
|
|
54
54
|
"uuid": "^3.1.0"
|
|
@@ -120,9 +120,6 @@
|
|
|
120
120
|
"platform_editor_vs_code_block_paste": {
|
|
121
121
|
"type": "boolean"
|
|
122
122
|
},
|
|
123
|
-
"platform_editor_advanced_layouts_post_fix_patch_2": {
|
|
124
|
-
"type": "boolean"
|
|
125
|
-
},
|
|
126
123
|
"platform_editor_fix_captions_on_copy": {
|
|
127
124
|
"type": "boolean"
|
|
128
125
|
},
|