@atlaskit/editor-plugin-paste 15.1.0 → 15.1.1
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/pastePlugin.js +1 -3
- package/dist/cjs/pm-plugins/main.js +1 -3
- package/dist/cjs/pm-plugins/reducer.js +0 -5
- package/dist/cjs/pm-plugins/util/sync-block.js +1 -1
- package/dist/es2019/pastePlugin.js +1 -3
- package/dist/es2019/pm-plugins/main.js +1 -3
- package/dist/es2019/pm-plugins/reducer.js +0 -5
- package/dist/es2019/pm-plugins/util/sync-block.js +1 -1
- package/dist/esm/pastePlugin.js +1 -3
- package/dist/esm/pm-plugins/main.js +1 -3
- package/dist/esm/pm-plugins/reducer.js +0 -5
- package/dist/esm/pm-plugins/util/sync-block.js +1 -1
- package/package.json +1 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-paste
|
|
2
2
|
|
|
3
|
+
## 15.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`0b4753c0a8c07`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0b4753c0a8c07) -
|
|
8
|
+
Clean up feature gates from completed rollout
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 15.1.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
package/dist/cjs/pastePlugin.js
CHANGED
|
@@ -6,8 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.pastePlugin = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
|
-
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
11
9
|
var _main = require("./pm-plugins/main");
|
|
12
10
|
var _plugin = require("./pm-plugins/move-analytics/plugin");
|
|
13
11
|
var _pluginFactory = require("./pm-plugins/plugin-factory");
|
|
@@ -45,7 +43,7 @@ var pastePlugin = exports.pastePlugin = function pastePlugin(_ref) {
|
|
|
45
43
|
}
|
|
46
44
|
}];
|
|
47
45
|
},
|
|
48
|
-
contentComponent:
|
|
46
|
+
contentComponent: function contentComponent() {
|
|
49
47
|
if (!pasteWarningOptions) {
|
|
50
48
|
return null;
|
|
51
49
|
}
|
|
@@ -379,9 +379,7 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
|
|
|
379
379
|
event: event,
|
|
380
380
|
text: text
|
|
381
381
|
});
|
|
382
|
-
|
|
383
|
-
slice = (0, _syncBlock2.handleSyncBlocksPaste)(slice, schema, (0, _util.getPasteSource)(event), html, pasteWarningOptions, pluginInjectionApi);
|
|
384
|
-
}
|
|
382
|
+
slice = (0, _syncBlock2.handleSyncBlocksPaste)(slice, schema, (0, _util.getPasteSource)(event), html, pasteWarningOptions, pluginInjectionApi);
|
|
385
383
|
var plainTextPasteSlice = (0, _utils.linkifyContent)(state.schema)(slice);
|
|
386
384
|
if ((0, _analytics2.handlePasteAsPlainTextWithAnalytics)(editorAnalyticsAPI)(view, event, plainTextPasteSlice)(state, dispatch, view)) {
|
|
387
385
|
return true;
|
|
@@ -7,8 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.reducer = void 0;
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
|
-
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
12
10
|
var _actions = require("../editor-actions/actions");
|
|
13
11
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
12
|
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) { (0, _defineProperty2.default)(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; }
|
|
@@ -39,9 +37,6 @@ var reducer = exports.reducer = function reducer(state, action) {
|
|
|
39
37
|
}
|
|
40
38
|
case _actions.PastePluginActionTypes.SET_ACTIVE_FLAG:
|
|
41
39
|
{
|
|
42
|
-
if (!(0, _experiments.editorExperiment)('platform_synced_block', true) && !(0, _platformFeatureFlags.fg)('platform_synced_block_unsupported_products')) {
|
|
43
|
-
return state;
|
|
44
|
-
}
|
|
45
40
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
46
41
|
activeFlag: action.activeFlag
|
|
47
42
|
});
|
|
@@ -72,7 +72,7 @@ var showWarningFlag = function showWarningFlag(_ref) {
|
|
|
72
72
|
// Check if rawHtml contains a synced block
|
|
73
73
|
// example: "<meta charset='utf-8'><html><head></head><body><div data-sync-block=\"\" data-local-id=\"\" data-resource-id=\"d64883c8-1270-431d-a1d3-51d36a1ed5f4\" data-prosemirror-content-type=\"node\" data-prosemirror-node-name=\"syncBlock\" data-prosemirror-node-block=\"true\" data-pm-slice=\"0 0 []\"></div></body></html>"
|
|
74
74
|
var hasSyncedBlockInRawHtml = function hasSyncedBlockInRawHtml(rawHtml) {
|
|
75
|
-
return rawHtml.includes('data-sync-block="');
|
|
75
|
+
return Boolean(rawHtml === null || rawHtml === void 0 ? void 0 : rawHtml.includes('data-sync-block="'));
|
|
76
76
|
};
|
|
77
77
|
|
|
78
78
|
/**
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
4
2
|
import { createPlugin } from './pm-plugins/main';
|
|
5
3
|
import { createPlugin as createMoveAnalyticsPlugin } from './pm-plugins/move-analytics/plugin';
|
|
6
4
|
import { pluginKey } from './pm-plugins/plugin-factory';
|
|
@@ -40,7 +38,7 @@ export const pastePlugin = ({
|
|
|
40
38
|
}
|
|
41
39
|
}];
|
|
42
40
|
},
|
|
43
|
-
contentComponent:
|
|
41
|
+
contentComponent: () => {
|
|
44
42
|
if (!pasteWarningOptions) {
|
|
45
43
|
return null;
|
|
46
44
|
}
|
|
@@ -338,9 +338,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
338
338
|
event,
|
|
339
339
|
text
|
|
340
340
|
});
|
|
341
|
-
|
|
342
|
-
slice = handleSyncBlocksPaste(slice, schema, getPasteSource(event), html, pasteWarningOptions, pluginInjectionApi);
|
|
343
|
-
}
|
|
341
|
+
slice = handleSyncBlocksPaste(slice, schema, getPasteSource(event), html, pasteWarningOptions, pluginInjectionApi);
|
|
344
342
|
const plainTextPasteSlice = linkifyContent(state.schema)(slice);
|
|
345
343
|
if (handlePasteAsPlainTextWithAnalytics(editorAnalyticsAPI)(view, event, plainTextPasteSlice)(state, dispatch, view)) {
|
|
346
344
|
return true;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
3
1
|
import { PastePluginActionTypes as ActionTypes } from '../editor-actions/actions';
|
|
4
2
|
export const reducer = (state, action) => {
|
|
5
3
|
switch (action.type) {
|
|
@@ -30,9 +28,6 @@ export const reducer = (state, action) => {
|
|
|
30
28
|
}
|
|
31
29
|
case ActionTypes.SET_ACTIVE_FLAG:
|
|
32
30
|
{
|
|
33
|
-
if (!editorExperiment('platform_synced_block', true) && !fg('platform_synced_block_unsupported_products')) {
|
|
34
|
-
return state;
|
|
35
|
-
}
|
|
36
31
|
return {
|
|
37
32
|
...state,
|
|
38
33
|
activeFlag: action.activeFlag
|
|
@@ -65,7 +65,7 @@ const showWarningFlag = ({
|
|
|
65
65
|
// Check if rawHtml contains a synced block
|
|
66
66
|
// example: "<meta charset='utf-8'><html><head></head><body><div data-sync-block=\"\" data-local-id=\"\" data-resource-id=\"d64883c8-1270-431d-a1d3-51d36a1ed5f4\" data-prosemirror-content-type=\"node\" data-prosemirror-node-name=\"syncBlock\" data-prosemirror-node-block=\"true\" data-pm-slice=\"0 0 []\"></div></body></html>"
|
|
67
67
|
const hasSyncedBlockInRawHtml = rawHtml => {
|
|
68
|
-
return rawHtml.includes('data-sync-block="');
|
|
68
|
+
return Boolean(rawHtml === null || rawHtml === void 0 ? void 0 : rawHtml.includes('data-sync-block="'));
|
|
69
69
|
};
|
|
70
70
|
|
|
71
71
|
/**
|
package/dist/esm/pastePlugin.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
4
2
|
import { createPlugin } from './pm-plugins/main';
|
|
5
3
|
import { createPlugin as createMoveAnalyticsPlugin } from './pm-plugins/move-analytics/plugin';
|
|
6
4
|
import { pluginKey } from './pm-plugins/plugin-factory';
|
|
@@ -38,7 +36,7 @@ export var pastePlugin = function pastePlugin(_ref) {
|
|
|
38
36
|
}
|
|
39
37
|
}];
|
|
40
38
|
},
|
|
41
|
-
contentComponent:
|
|
39
|
+
contentComponent: function contentComponent() {
|
|
42
40
|
if (!pasteWarningOptions) {
|
|
43
41
|
return null;
|
|
44
42
|
}
|
|
@@ -371,9 +371,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
371
371
|
event: event,
|
|
372
372
|
text: text
|
|
373
373
|
});
|
|
374
|
-
|
|
375
|
-
slice = handleSyncBlocksPaste(slice, schema, getPasteSource(event), html, pasteWarningOptions, pluginInjectionApi);
|
|
376
|
-
}
|
|
374
|
+
slice = handleSyncBlocksPaste(slice, schema, getPasteSource(event), html, pasteWarningOptions, pluginInjectionApi);
|
|
377
375
|
var plainTextPasteSlice = linkifyContent(state.schema)(slice);
|
|
378
376
|
if (handlePasteAsPlainTextWithAnalytics(editorAnalyticsAPI)(view, event, plainTextPasteSlice)(state, dispatch, view)) {
|
|
379
377
|
return true;
|
|
@@ -2,8 +2,6 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
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; }
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
7
5
|
import { PastePluginActionTypes as ActionTypes } from '../editor-actions/actions';
|
|
8
6
|
export var reducer = function reducer(state, action) {
|
|
9
7
|
switch (action.type) {
|
|
@@ -32,9 +30,6 @@ export var reducer = function reducer(state, action) {
|
|
|
32
30
|
}
|
|
33
31
|
case ActionTypes.SET_ACTIVE_FLAG:
|
|
34
32
|
{
|
|
35
|
-
if (!editorExperiment('platform_synced_block', true) && !fg('platform_synced_block_unsupported_products')) {
|
|
36
|
-
return state;
|
|
37
|
-
}
|
|
38
33
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
39
34
|
activeFlag: action.activeFlag
|
|
40
35
|
});
|
|
@@ -66,7 +66,7 @@ var showWarningFlag = function showWarningFlag(_ref) {
|
|
|
66
66
|
// Check if rawHtml contains a synced block
|
|
67
67
|
// example: "<meta charset='utf-8'><html><head></head><body><div data-sync-block=\"\" data-local-id=\"\" data-resource-id=\"d64883c8-1270-431d-a1d3-51d36a1ed5f4\" data-prosemirror-content-type=\"node\" data-prosemirror-node-name=\"syncBlock\" data-prosemirror-node-block=\"true\" data-pm-slice=\"0 0 []\"></div></body></html>"
|
|
68
68
|
var hasSyncedBlockInRawHtml = function hasSyncedBlockInRawHtml(rawHtml) {
|
|
69
|
-
return rawHtml.includes('data-sync-block="');
|
|
69
|
+
return Boolean(rawHtml === null || rawHtml === void 0 ? void 0 : rawHtml.includes('data-sync-block="'));
|
|
70
70
|
};
|
|
71
71
|
|
|
72
72
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-paste",
|
|
3
|
-
"version": "15.1.
|
|
3
|
+
"version": "15.1.1",
|
|
4
4
|
"description": "Paste plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -116,9 +116,6 @@
|
|
|
116
116
|
"platform_media_cross_client_copy_with_auth": {
|
|
117
117
|
"type": "boolean"
|
|
118
118
|
},
|
|
119
|
-
"platform_synced_block_unsupported_products": {
|
|
120
|
-
"type": "boolean"
|
|
121
|
-
},
|
|
122
119
|
"platform_editor_agent_mentions": {
|
|
123
120
|
"type": "experiment"
|
|
124
121
|
},
|