@atlaskit/editor-plugin-paste 31.0.2 → 31.0.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 CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/editor-plugin-paste
2
2
 
3
+ ## 31.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`4cbba92673860`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4cbba92673860) -
8
+ Preserve legacy content macros on paste when the dynamic config
9
+ `platform_editor_legacy_content_macro_insert_config` is enabled.
10
+ - Updated dependencies
11
+
12
+ ## 31.0.3
13
+
14
+ ### Patch Changes
15
+
16
+ - [`4cdaf1f75d6ad`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4cdaf1f75d6ad) -
17
+ Use const for stable local bindings
18
+ - Updated dependencies
19
+
3
20
  ## 31.0.2
4
21
 
5
22
  ### Patch Changes
@@ -37,6 +37,7 @@ var _handlePaste = require("@atlaskit/editor-tables/utils/handle-paste");
37
37
  var _api = require("@atlaskit/insm/api");
38
38
  var _clientIdCache = require("@atlaskit/media-common/clientIdCache");
39
39
  var _fg = require("@atlaskit/platform-feature-flags/fg");
40
+ var _dynamicConfigBooleanValue = require("@atlaskit/tmp-editor-statsig/dynamic-config-boolean-value");
40
41
  var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
41
42
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
42
43
  var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
@@ -202,7 +203,8 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
202
203
  }
203
204
 
204
205
  // Strip Legacy Content Macro (LCM) extensions on paste
205
- if (!(0, _fg.fg)('platform_editor_legacy_content_macro_insert')) {
206
+ var preserveLegacyContentMacroOnPaste = (0, _dynamicConfigBooleanValue.dynamicConfigBooleanValue)('platform_editor_legacy_content_macro_insert_config', false);
207
+ if (!preserveLegacyContentMacroOnPaste) {
206
208
  slice = (0, _extension.transformSliceToRemoveLegacyContentMacro)(slice, schema);
207
209
  }
208
210
  var isPastedFile = (0, _clipboard.isPastedFile)(event);
@@ -126,14 +126,13 @@ var fillIncompleteRowWithEmptyCells = function fillIncompleteRowWithEmptyCells(d
126
126
  * headers exist.
127
127
  */
128
128
  var tryReconstructTableRows = exports.tryReconstructTableRows = function tryReconstructTableRows(doc) {
129
- // Ignored via go/ees005
130
- // eslint-disable-next-line prefer-const
131
129
  var _getTableElementsInfo = getTableElementsInfo(doc),
132
- cellCount = _getTableElementsInfo.cellCount,
130
+ initialCellCount = _getTableElementsInfo.cellCount,
133
131
  thCount = _getTableElementsInfo.thCount,
134
132
  mergedCellCount = _getTableElementsInfo.mergedCellCount,
135
133
  hasThAfterTd = _getTableElementsInfo.hasThAfterTd,
136
134
  hasIncompleteRow = _getTableElementsInfo.hasIncompleteRow;
135
+ var cellCount = initialCellCount;
137
136
  if (mergedCellCount || hasThAfterTd) {
138
137
  // bail out to avoid handling more complex table structures
139
138
  return doc.body.innerHTML;
@@ -27,6 +27,7 @@ import { handlePaste as handlePasteTable } from '@atlaskit/editor-tables/utils/h
27
27
  import { insm } from '@atlaskit/insm/api';
28
28
  import { extractClientIdsFromHtml } from '@atlaskit/media-common/clientIdCache';
29
29
  import { fg } from '@atlaskit/platform-feature-flags/fg';
30
+ import { dynamicConfigBooleanValue } from '@atlaskit/tmp-editor-statsig/dynamic-config-boolean-value';
30
31
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
31
32
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
32
33
  import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
@@ -167,7 +168,8 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
167
168
  }
168
169
 
169
170
  // Strip Legacy Content Macro (LCM) extensions on paste
170
- if (!fg('platform_editor_legacy_content_macro_insert')) {
171
+ const preserveLegacyContentMacroOnPaste = dynamicConfigBooleanValue('platform_editor_legacy_content_macro_insert_config', false);
172
+ if (!preserveLegacyContentMacroOnPaste) {
171
173
  slice = transformSliceToRemoveLegacyContentMacro(slice, schema);
172
174
  }
173
175
  const isPastedFile = isPastedFileFromEvent(event);
@@ -108,15 +108,14 @@ const fillIncompleteRowWithEmptyCells = (doc, thCount, cellCount) => {
108
108
  * headers exist.
109
109
  */
110
110
  export const tryReconstructTableRows = doc => {
111
- // Ignored via go/ees005
112
- // eslint-disable-next-line prefer-const
113
- let {
114
- cellCount,
111
+ const {
112
+ cellCount: initialCellCount,
115
113
  thCount,
116
114
  mergedCellCount,
117
115
  hasThAfterTd,
118
116
  hasIncompleteRow
119
117
  } = getTableElementsInfo(doc);
118
+ let cellCount = initialCellCount;
120
119
  if (mergedCellCount || hasThAfterTd) {
121
120
  // bail out to avoid handling more complex table structures
122
121
  return doc.body.innerHTML;
@@ -32,6 +32,7 @@ import { handlePaste as handlePasteTable } from '@atlaskit/editor-tables/utils/h
32
32
  import { insm } from '@atlaskit/insm/api';
33
33
  import { extractClientIdsFromHtml } from '@atlaskit/media-common/clientIdCache';
34
34
  import { fg } from '@atlaskit/platform-feature-flags/fg';
35
+ import { dynamicConfigBooleanValue } from '@atlaskit/tmp-editor-statsig/dynamic-config-boolean-value';
35
36
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
36
37
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
37
38
  import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
@@ -194,7 +195,8 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
194
195
  }
195
196
 
196
197
  // Strip Legacy Content Macro (LCM) extensions on paste
197
- if (!fg('platform_editor_legacy_content_macro_insert')) {
198
+ var preserveLegacyContentMacroOnPaste = dynamicConfigBooleanValue('platform_editor_legacy_content_macro_insert_config', false);
199
+ if (!preserveLegacyContentMacroOnPaste) {
198
200
  slice = transformSliceToRemoveLegacyContentMacro(slice, schema);
199
201
  }
200
202
  var isPastedFile = isPastedFileFromEvent(event);
@@ -119,14 +119,13 @@ var fillIncompleteRowWithEmptyCells = function fillIncompleteRowWithEmptyCells(d
119
119
  * headers exist.
120
120
  */
121
121
  export var tryReconstructTableRows = function tryReconstructTableRows(doc) {
122
- // Ignored via go/ees005
123
- // eslint-disable-next-line prefer-const
124
122
  var _getTableElementsInfo = getTableElementsInfo(doc),
125
- cellCount = _getTableElementsInfo.cellCount,
123
+ initialCellCount = _getTableElementsInfo.cellCount,
126
124
  thCount = _getTableElementsInfo.thCount,
127
125
  mergedCellCount = _getTableElementsInfo.mergedCellCount,
128
126
  hasThAfterTd = _getTableElementsInfo.hasThAfterTd,
129
127
  hasIncompleteRow = _getTableElementsInfo.hasIncompleteRow;
128
+ var cellCount = initialCellCount;
130
129
  if (mergedCellCount || hasThAfterTd) {
131
130
  // bail out to avoid handling more complex table structures
132
131
  return doc.body.innerHTML;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-paste",
3
- "version": "31.0.2",
3
+ "version": "31.0.4",
4
4
  "description": "Paste plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -51,21 +51,17 @@
51
51
  "uuid": "^11.1.1"
52
52
  },
53
53
  "peerDependencies": {
54
- "@atlaskit/editor-common": "^134.1.0",
54
+ "@atlaskit/editor-common": "^134.2.0",
55
55
  "react": "^18.2.0 || ^19.2.0",
56
56
  "react-dom": "^18.2.0 || ^19.2.0",
57
57
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
58
58
  },
59
59
  "devDependencies": {
60
- "@testing-library/react": "^16.3.0",
61
60
  "react": "^19.2.0",
62
61
  "react-dom": "^19.2.0",
63
62
  "react-intl": "^7.0.0"
64
63
  },
65
64
  "platform-feature-flags": {
66
- "platform_editor_legacy_content_macro_insert": {
67
- "type": "boolean"
68
- },
69
65
  "platform_editor_sharepoint_url_smart_card_fallback": {
70
66
  "type": "boolean"
71
67
  },