@atlaskit/editor-plugin-paste 8.1.7 → 8.1.9

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,19 @@
1
1
  # @atlaskit/editor-plugin-paste
2
2
 
3
+ ## 8.1.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [`7ba3979b92b42`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7ba3979b92b42) -
8
+ Remove platform_synced_block_dogfooding feature gate
9
+ - Updated dependencies
10
+
11
+ ## 8.1.8
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 8.1.7
4
18
 
5
19
  ### Patch Changes
@@ -6,7 +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
9
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
11
10
  var _main = require("./pm-plugins/main");
12
11
  var _plugin = require("./pm-plugins/move-analytics/plugin");
@@ -44,13 +43,13 @@ var pastePlugin = exports.pastePlugin = function pastePlugin(_ref) {
44
43
  }
45
44
  }];
46
45
  },
47
- contentComponent: !(0, _experiments.editorExperiment)('platform_synced_block', true) || !(0, _platformFeatureFlags.fg)('platform_synced_block_dogfooding') ? undefined : function () {
46
+ contentComponent: !(0, _experiments.editorExperiment)('platform_synced_block', true) ? undefined : function () {
48
47
  if (!pasteWarningOptions) {
49
48
  return null;
50
49
  }
51
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Flag.Flag, {
50
+ return /*#__PURE__*/_react.default.createElement(_Flag.Flag, {
52
51
  api: api
53
- }));
52
+ });
54
53
  },
55
54
  getSharedState: function getSharedState(editorState) {
56
55
  if (!editorState) {
@@ -7,7 +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
10
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
12
11
  var _actions = require("../editor-actions/actions");
13
12
  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; }
@@ -42,9 +41,6 @@ var reducer = exports.reducer = function reducer(state, action) {
42
41
  if (!(0, _experiments.editorExperiment)('platform_synced_block', true)) {
43
42
  return state;
44
43
  }
45
- if (!(0, _platformFeatureFlags.fg)('platform_synced_block_dogfooding')) {
46
- return state;
47
- }
48
44
  return _objectSpread(_objectSpread({}, state), {}, {
49
45
  activeFlag: action.activeFlag
50
46
  });
@@ -9,7 +9,6 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
9
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
10
  var _adfSchema = require("@atlaskit/adf-schema");
11
11
  var _utils = require("@atlaskit/editor-common/utils");
12
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
13
12
  var _actions = require("../../editor-actions/actions");
14
13
  var _pastePluginType = require("../../pastePluginType");
15
14
  var _pluginFactory = require("../../pm-plugins/plugin-factory");
@@ -77,7 +76,7 @@ var hasSyncedBlockInRawHtml = function hasSyncedBlockInRawHtml(rawHtml) {
77
76
  * Otherwise, (e.g. if copying from renderer), flatten out the content and remove the sync block
78
77
  * Also, show a warning flag if the pasted content contains a synced block and the paste warning options are configured.
79
78
  */
80
- var handleSyncBlocksPasteNew = function handleSyncBlocksPasteNew(slice, schema, pasteSource, rawHtml, pasteWarningOptions, api) {
79
+ var handleSyncBlocksPaste = exports.handleSyncBlocksPaste = function handleSyncBlocksPaste(slice, schema, pasteSource, rawHtml, pasteWarningOptions, api) {
81
80
  var isFromEditor = pasteSource === 'fabric-editor';
82
81
  var isSyncedBlockInRawHtml = hasSyncedBlockInRawHtml(rawHtml);
83
82
  var hasSyncedBlockInSlice = false;
@@ -102,28 +101,4 @@ var handleSyncBlocksPasteNew = function handleSyncBlocksPasteNew(slice, schema,
102
101
  });
103
102
  }
104
103
  return slice;
105
- };
106
-
107
- /**
108
- * If we are copying from editor, transform the copied source or reference sync block to a new reference sync block
109
- * Otherwise, (e.g. if copying from renderer), flatten out the content and remove the sync block
110
- */
111
- var handleSyncBlocksPasteOld = function handleSyncBlocksPasteOld(slice, schema, pasteSource) {
112
- var isFromEditor = pasteSource === 'fabric-editor';
113
- slice = (0, _utils.mapSlice)(slice, function (node) {
114
- if (node.type === schema.nodes.syncBlock) {
115
- return transformSyncBlockNode(node, schema, isFromEditor);
116
- } else if (node.type === schema.nodes.bodiedSyncBlock) {
117
- return transformBodiedSyncBlockNode(node, isFromEditor);
118
- }
119
- return node;
120
- });
121
- return slice;
122
- };
123
- var handleSyncBlocksPaste = exports.handleSyncBlocksPaste = function handleSyncBlocksPaste(slice, schema, pasteSource, rawHtml, pasteWarningOptions, api) {
124
- if ((0, _platformFeatureFlags.fg)('platform_synced_block_dogfooding')) {
125
- return handleSyncBlocksPasteNew(slice, schema, pasteSource, rawHtml, pasteWarningOptions, api);
126
- } else {
127
- return handleSyncBlocksPasteOld(slice, schema, pasteSource);
128
- }
129
104
  };
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import { fg } from '@atlaskit/platform-feature-flags';
3
2
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
4
3
  import { createPlugin } from './pm-plugins/main';
5
4
  import { createPlugin as createMoveAnalyticsPlugin } from './pm-plugins/move-analytics/plugin';
@@ -39,13 +38,13 @@ export const pastePlugin = ({
39
38
  }
40
39
  }];
41
40
  },
42
- contentComponent: !editorExperiment('platform_synced_block', true) || !fg('platform_synced_block_dogfooding') ? undefined : () => {
41
+ contentComponent: !editorExperiment('platform_synced_block', true) ? undefined : () => {
43
42
  if (!pasteWarningOptions) {
44
43
  return null;
45
44
  }
46
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Flag, {
45
+ return /*#__PURE__*/React.createElement(Flag, {
47
46
  api: api
48
- }));
47
+ });
49
48
  },
50
49
  getSharedState: editorState => {
51
50
  if (!editorState) {
@@ -1,4 +1,3 @@
1
- import { fg } from '@atlaskit/platform-feature-flags';
2
1
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
3
2
  import { PastePluginActionTypes as ActionTypes } from '../editor-actions/actions';
4
3
  export const reducer = (state, action) => {
@@ -33,9 +32,6 @@ export const reducer = (state, action) => {
33
32
  if (!editorExperiment('platform_synced_block', true)) {
34
33
  return state;
35
34
  }
36
- if (!fg('platform_synced_block_dogfooding')) {
37
- return state;
38
- }
39
35
  return {
40
36
  ...state,
41
37
  activeFlag: action.activeFlag
@@ -1,6 +1,5 @@
1
1
  import { uuid } from '@atlaskit/adf-schema';
2
2
  import { mapSlice } from '@atlaskit/editor-common/utils';
3
- import { fg } from '@atlaskit/platform-feature-flags';
4
3
  import { PastePluginActionTypes } from '../../editor-actions/actions';
5
4
  import { FLAG_TYPE } from '../../pastePluginType';
6
5
  import { pluginKey } from '../../pm-plugins/plugin-factory';
@@ -69,7 +68,7 @@ const hasSyncedBlockInRawHtml = rawHtml => {
69
68
  * Otherwise, (e.g. if copying from renderer), flatten out the content and remove the sync block
70
69
  * Also, show a warning flag if the pasted content contains a synced block and the paste warning options are configured.
71
70
  */
72
- const handleSyncBlocksPasteNew = (slice, schema, pasteSource, rawHtml, pasteWarningOptions, api) => {
71
+ export const handleSyncBlocksPaste = (slice, schema, pasteSource, rawHtml, pasteWarningOptions, api) => {
73
72
  const isFromEditor = pasteSource === 'fabric-editor';
74
73
  const isSyncedBlockInRawHtml = hasSyncedBlockInRawHtml(rawHtml);
75
74
  let hasSyncedBlockInSlice = false;
@@ -94,28 +93,4 @@ const handleSyncBlocksPasteNew = (slice, schema, pasteSource, rawHtml, pasteWarn
94
93
  });
95
94
  }
96
95
  return slice;
97
- };
98
-
99
- /**
100
- * If we are copying from editor, transform the copied source or reference sync block to a new reference sync block
101
- * Otherwise, (e.g. if copying from renderer), flatten out the content and remove the sync block
102
- */
103
- const handleSyncBlocksPasteOld = (slice, schema, pasteSource) => {
104
- const isFromEditor = pasteSource === 'fabric-editor';
105
- slice = mapSlice(slice, node => {
106
- if (node.type === schema.nodes.syncBlock) {
107
- return transformSyncBlockNode(node, schema, isFromEditor);
108
- } else if (node.type === schema.nodes.bodiedSyncBlock) {
109
- return transformBodiedSyncBlockNode(node, isFromEditor);
110
- }
111
- return node;
112
- });
113
- return slice;
114
- };
115
- export const handleSyncBlocksPaste = (slice, schema, pasteSource, rawHtml, pasteWarningOptions, api) => {
116
- if (fg('platform_synced_block_dogfooding')) {
117
- return handleSyncBlocksPasteNew(slice, schema, pasteSource, rawHtml, pasteWarningOptions, api);
118
- } else {
119
- return handleSyncBlocksPasteOld(slice, schema, pasteSource);
120
- }
121
96
  };
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import { fg } from '@atlaskit/platform-feature-flags';
3
2
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
4
3
  import { createPlugin } from './pm-plugins/main';
5
4
  import { createPlugin as createMoveAnalyticsPlugin } from './pm-plugins/move-analytics/plugin';
@@ -37,13 +36,13 @@ export var pastePlugin = function pastePlugin(_ref) {
37
36
  }
38
37
  }];
39
38
  },
40
- contentComponent: !editorExperiment('platform_synced_block', true) || !fg('platform_synced_block_dogfooding') ? undefined : function () {
39
+ contentComponent: !editorExperiment('platform_synced_block', true) ? undefined : function () {
41
40
  if (!pasteWarningOptions) {
42
41
  return null;
43
42
  }
44
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Flag, {
43
+ return /*#__PURE__*/React.createElement(Flag, {
45
44
  api: api
46
- }));
45
+ });
47
46
  },
48
47
  getSharedState: function getSharedState(editorState) {
49
48
  if (!editorState) {
@@ -2,7 +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
5
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
7
6
  import { PastePluginActionTypes as ActionTypes } from '../editor-actions/actions';
8
7
  export var reducer = function reducer(state, action) {
@@ -35,9 +34,6 @@ export var reducer = function reducer(state, action) {
35
34
  if (!editorExperiment('platform_synced_block', true)) {
36
35
  return state;
37
36
  }
38
- if (!fg('platform_synced_block_dogfooding')) {
39
- return state;
40
- }
41
37
  return _objectSpread(_objectSpread({}, state), {}, {
42
38
  activeFlag: action.activeFlag
43
39
  });
@@ -4,7 +4,6 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
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
5
  import { uuid } from '@atlaskit/adf-schema';
6
6
  import { mapSlice } from '@atlaskit/editor-common/utils';
7
- import { fg } from '@atlaskit/platform-feature-flags';
8
7
  import { PastePluginActionTypes } from '../../editor-actions/actions';
9
8
  import { FLAG_TYPE } from '../../pastePluginType';
10
9
  import { pluginKey } from '../../pm-plugins/plugin-factory';
@@ -70,7 +69,7 @@ var hasSyncedBlockInRawHtml = function hasSyncedBlockInRawHtml(rawHtml) {
70
69
  * Otherwise, (e.g. if copying from renderer), flatten out the content and remove the sync block
71
70
  * Also, show a warning flag if the pasted content contains a synced block and the paste warning options are configured.
72
71
  */
73
- var handleSyncBlocksPasteNew = function handleSyncBlocksPasteNew(slice, schema, pasteSource, rawHtml, pasteWarningOptions, api) {
72
+ export var handleSyncBlocksPaste = function handleSyncBlocksPaste(slice, schema, pasteSource, rawHtml, pasteWarningOptions, api) {
74
73
  var isFromEditor = pasteSource === 'fabric-editor';
75
74
  var isSyncedBlockInRawHtml = hasSyncedBlockInRawHtml(rawHtml);
76
75
  var hasSyncedBlockInSlice = false;
@@ -95,28 +94,4 @@ var handleSyncBlocksPasteNew = function handleSyncBlocksPasteNew(slice, schema,
95
94
  });
96
95
  }
97
96
  return slice;
98
- };
99
-
100
- /**
101
- * If we are copying from editor, transform the copied source or reference sync block to a new reference sync block
102
- * Otherwise, (e.g. if copying from renderer), flatten out the content and remove the sync block
103
- */
104
- var handleSyncBlocksPasteOld = function handleSyncBlocksPasteOld(slice, schema, pasteSource) {
105
- var isFromEditor = pasteSource === 'fabric-editor';
106
- slice = mapSlice(slice, function (node) {
107
- if (node.type === schema.nodes.syncBlock) {
108
- return transformSyncBlockNode(node, schema, isFromEditor);
109
- } else if (node.type === schema.nodes.bodiedSyncBlock) {
110
- return transformBodiedSyncBlockNode(node, isFromEditor);
111
- }
112
- return node;
113
- });
114
- return slice;
115
- };
116
- export var handleSyncBlocksPaste = function handleSyncBlocksPaste(slice, schema, pasteSource, rawHtml, pasteWarningOptions, api) {
117
- if (fg('platform_synced_block_dogfooding')) {
118
- return handleSyncBlocksPasteNew(slice, schema, pasteSource, rawHtml, pasteWarningOptions, api);
119
- } else {
120
- return handleSyncBlocksPasteOld(slice, schema, pasteSource);
121
- }
122
97
  };
@@ -2,4 +2,9 @@ import type { PasteSource } from '@atlaskit/editor-common/analytics';
2
2
  import type { ExtractInjectionAPI, PasteWarningOptions } from '@atlaskit/editor-common/types';
3
3
  import type { Schema, Slice } from '@atlaskit/editor-prosemirror/model';
4
4
  import type { PastePlugin } from '../../pastePluginType';
5
+ /**
6
+ * If we are copying from editor, transform the copied source or reference sync block to a new reference sync block
7
+ * Otherwise, (e.g. if copying from renderer), flatten out the content and remove the sync block
8
+ * Also, show a warning flag if the pasted content contains a synced block and the paste warning options are configured.
9
+ */
5
10
  export declare const handleSyncBlocksPaste: (slice: Slice, schema: Schema, pasteSource: PasteSource, rawHtml: string, pasteWarningOptions: PasteWarningOptions | undefined, api: ExtractInjectionAPI<PastePlugin> | undefined) => Slice;
@@ -2,4 +2,9 @@ import type { PasteSource } from '@atlaskit/editor-common/analytics';
2
2
  import type { ExtractInjectionAPI, PasteWarningOptions } from '@atlaskit/editor-common/types';
3
3
  import type { Schema, Slice } from '@atlaskit/editor-prosemirror/model';
4
4
  import type { PastePlugin } from '../../pastePluginType';
5
+ /**
6
+ * If we are copying from editor, transform the copied source or reference sync block to a new reference sync block
7
+ * Otherwise, (e.g. if copying from renderer), flatten out the content and remove the sync block
8
+ * Also, show a warning flag if the pasted content contains a synced block and the paste warning options are configured.
9
+ */
5
10
  export declare const handleSyncBlocksPaste: (slice: Slice, schema: Schema, pasteSource: PasteSource, rawHtml: string, pasteWarningOptions: PasteWarningOptions | undefined, api: ExtractInjectionAPI<PastePlugin> | undefined) => Slice;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-paste",
3
- "version": "8.1.7",
3
+ "version": "8.1.9",
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
  "@atlaskit/editor-plugin-analytics": "^7.0.0",
34
34
  "@atlaskit/editor-plugin-annotation": "^7.1.0",
35
35
  "@atlaskit/editor-plugin-better-type-history": "^7.0.0",
36
- "@atlaskit/editor-plugin-card": "^12.2.0",
36
+ "@atlaskit/editor-plugin-card": "^12.3.0",
37
37
  "@atlaskit/editor-plugin-feature-flags": "^6.0.0",
38
38
  "@atlaskit/editor-plugin-list": "^9.0.0",
39
39
  "@atlaskit/editor-plugin-media": "^9.4.0",
@@ -47,7 +47,7 @@
47
47
  "@atlaskit/media-common": "^12.3.0",
48
48
  "@atlaskit/platform-feature-flags": "^1.1.0",
49
49
  "@atlaskit/prosemirror-history": "^0.2.0",
50
- "@atlaskit/tmp-editor-statsig": "^21.0.0",
50
+ "@atlaskit/tmp-editor-statsig": "^22.1.0",
51
51
  "@atlaskit/tokens": "^11.0.0",
52
52
  "@babel/runtime": "^7.0.0",
53
53
  "lodash": "^4.17.21",
@@ -120,9 +120,6 @@
120
120
  },
121
121
  "platform_editor_date_to_text": {
122
122
  "type": "boolean"
123
- },
124
- "platform_synced_block_dogfooding": {
125
- "type": "boolean"
126
123
  }
127
124
  }
128
125
  }