@atlaskit/editor-plugin-paste 1.5.0 → 1.5.2

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,20 @@
1
1
  # @atlaskit/editor-plugin-paste
2
2
 
3
+ ## 1.5.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#117897](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/117897)
8
+ [`0856aa2920fe2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0856aa2920fe2) -
9
+ Remove feature flag for bug fix: Copying table content in a multi bodied extension and then
10
+ pasting creates a new table
11
+
12
+ ## 1.5.1
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+
3
18
  ## 1.5.0
4
19
 
5
20
  ### Minor Changes
@@ -182,7 +182,7 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
182
182
  * stopImmediatePropagation will run the first event attached to the same element
183
183
  * Which chould have race condition issue
184
184
  */
185
- (0, _platformFeatureFlags.getBooleanFF)('platform.editor.media.fix-copy-paste-excel_62g4s') ? event.stopPropagation() : event.stopImmediatePropagation();
185
+ (0, _platformFeatureFlags.fg)('platform.editor.media.fix-copy-paste-excel_62g4s') ? event.stopPropagation() : event.stopImmediatePropagation();
186
186
  }
187
187
  var state = view.state;
188
188
  var analyticsPlugin = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 || (_pluginInjectionApi$a2 = _pluginInjectionApi$a2.sharedState) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.currentState();
@@ -336,7 +336,7 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
336
336
  return true;
337
337
  }
338
338
  var isNestedMarkdownTable = false;
339
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.paste-markdown-table-in-a-table')) {
339
+ if ((0, _platformFeatureFlags.fg)('platform.editor.paste-markdown-table-in-a-table')) {
340
340
  // if paste a markdown table inside a table cell, we should treat it as a table slice
341
341
  var isParentNodeTdOrTh = selectionParentType === schema.nodes.tableCell || selectionParentType === schema.nodes.tableHeader;
342
342
  isNestedMarkdownTable = !!(markdownSlice && isPlainText && isParentNodeTdOrTh && (0, _analytics2.getContentNodeTypes)(markdownSlice.content).includes(schema.nodes.table.name));
@@ -396,10 +396,8 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
396
396
  }
397
397
 
398
398
  // handle the case when copy content from a table cell inside bodied extension
399
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.copy-paste-in-bodied-extension')) {
400
- if ((0, _handlers.handleTableContentPasteInBodiedExtension)(slice)(state, dispatch)) {
401
- return true;
402
- }
399
+ if ((0, _handlers.handleTableContentPasteInBodiedExtension)(slice)(state, dispatch)) {
400
+ return true;
403
401
  }
404
402
  // remove annotation marks from the pasted data if they are not present in the document
405
403
  // for the cases when they are pasted from external pages
@@ -11,7 +11,7 @@ import { MarkdownTransformer } from '@atlaskit/editor-markdown-transformer';
11
11
  import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
12
12
  import { contains, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
13
13
  import { handlePaste as handlePasteTable } from '@atlaskit/editor-tables/utils';
14
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
14
+ import { fg } from '@atlaskit/platform-feature-flags';
15
15
  import { PastePluginActionTypes } from '../actions';
16
16
  import { splitParagraphs, upgradeTextToLists } from '../commands';
17
17
  import { handleMacroAutoConvert, handleMention, handleParagraphBlockMarks, handleTableContentPasteInBodiedExtension } from '../handlers';
@@ -146,7 +146,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
146
146
  * stopImmediatePropagation will run the first event attached to the same element
147
147
  * Which chould have race condition issue
148
148
  */
149
- getBooleanFF('platform.editor.media.fix-copy-paste-excel_62g4s') ? event.stopPropagation() : event.stopImmediatePropagation();
149
+ fg('platform.editor.media.fix-copy-paste-excel_62g4s') ? event.stopPropagation() : event.stopImmediatePropagation();
150
150
  }
151
151
  const {
152
152
  state
@@ -305,7 +305,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
305
305
  return true;
306
306
  }
307
307
  let isNestedMarkdownTable = false;
308
- if (getBooleanFF('platform.editor.paste-markdown-table-in-a-table')) {
308
+ if (fg('platform.editor.paste-markdown-table-in-a-table')) {
309
309
  // if paste a markdown table inside a table cell, we should treat it as a table slice
310
310
  const isParentNodeTdOrTh = selectionParentType === schema.nodes.tableCell || selectionParentType === schema.nodes.tableHeader;
311
311
  isNestedMarkdownTable = !!(markdownSlice && isPlainText && isParentNodeTdOrTh && getContentNodeTypes(markdownSlice.content).includes(schema.nodes.table.name));
@@ -367,10 +367,8 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
367
367
  }
368
368
 
369
369
  // handle the case when copy content from a table cell inside bodied extension
370
- if (getBooleanFF('platform.editor.table.copy-paste-in-bodied-extension')) {
371
- if (handleTableContentPasteInBodiedExtension(slice)(state, dispatch)) {
372
- return true;
373
- }
370
+ if (handleTableContentPasteInBodiedExtension(slice)(state, dispatch)) {
371
+ return true;
374
372
  }
375
373
  // remove annotation marks from the pasted data if they are not present in the document
376
374
  // for the cases when they are pasted from external pages
@@ -13,7 +13,7 @@ import { MarkdownTransformer } from '@atlaskit/editor-markdown-transformer';
13
13
  import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
14
14
  import { contains, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
15
15
  import { handlePaste as handlePasteTable } from '@atlaskit/editor-tables/utils';
16
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
16
+ import { fg } from '@atlaskit/platform-feature-flags';
17
17
  import { PastePluginActionTypes } from '../actions';
18
18
  import { splitParagraphs, upgradeTextToLists } from '../commands';
19
19
  import { handleMacroAutoConvert, handleMention, handleParagraphBlockMarks, handleTableContentPasteInBodiedExtension } from '../handlers';
@@ -169,7 +169,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
169
169
  * stopImmediatePropagation will run the first event attached to the same element
170
170
  * Which chould have race condition issue
171
171
  */
172
- getBooleanFF('platform.editor.media.fix-copy-paste-excel_62g4s') ? event.stopPropagation() : event.stopImmediatePropagation();
172
+ fg('platform.editor.media.fix-copy-paste-excel_62g4s') ? event.stopPropagation() : event.stopImmediatePropagation();
173
173
  }
174
174
  var state = view.state;
175
175
  var analyticsPlugin = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 || (_pluginInjectionApi$a2 = _pluginInjectionApi$a2.sharedState) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.currentState();
@@ -323,7 +323,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
323
323
  return true;
324
324
  }
325
325
  var isNestedMarkdownTable = false;
326
- if (getBooleanFF('platform.editor.paste-markdown-table-in-a-table')) {
326
+ if (fg('platform.editor.paste-markdown-table-in-a-table')) {
327
327
  // if paste a markdown table inside a table cell, we should treat it as a table slice
328
328
  var isParentNodeTdOrTh = selectionParentType === schema.nodes.tableCell || selectionParentType === schema.nodes.tableHeader;
329
329
  isNestedMarkdownTable = !!(markdownSlice && isPlainText && isParentNodeTdOrTh && getContentNodeTypes(markdownSlice.content).includes(schema.nodes.table.name));
@@ -383,10 +383,8 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
383
383
  }
384
384
 
385
385
  // handle the case when copy content from a table cell inside bodied extension
386
- if (getBooleanFF('platform.editor.table.copy-paste-in-bodied-extension')) {
387
- if (handleTableContentPasteInBodiedExtension(slice)(state, dispatch)) {
388
- return true;
389
- }
386
+ if (handleTableContentPasteInBodiedExtension(slice)(state, dispatch)) {
387
+ return true;
390
388
  }
391
389
  // remove annotation marks from the pasted data if they are not present in the document
392
390
  // for the cases when they are pasted from external pages
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-paste",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "description": "Paste plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,12 +33,12 @@
33
33
  ".": "./src/index.ts"
34
34
  },
35
35
  "dependencies": {
36
- "@atlaskit/editor-common": "^83.6.0",
36
+ "@atlaskit/editor-common": "^84.3.0",
37
37
  "@atlaskit/editor-markdown-transformer": "^5.8.0",
38
38
  "@atlaskit/editor-plugin-analytics": "^1.4.0",
39
39
  "@atlaskit/editor-plugin-annotation": "^1.14.0",
40
40
  "@atlaskit/editor-plugin-better-type-history": "^1.4.0",
41
- "@atlaskit/editor-plugin-card": "^2.3.0",
41
+ "@atlaskit/editor-plugin-card": "^2.4.0",
42
42
  "@atlaskit/editor-plugin-feature-flags": "^1.1.0",
43
43
  "@atlaskit/editor-plugin-list": "^3.5.0",
44
44
  "@atlaskit/editor-plugin-media": "^1.22.0",
@@ -128,9 +128,6 @@
128
128
  "platform.editor.multi-bodied-extension_0rygg": {
129
129
  "type": "boolean"
130
130
  },
131
- "platform.editor.table.copy-paste-in-bodied-extension": {
132
- "type": "boolean"
133
- },
134
131
  "platform.editor.paste-markdown-table-in-a-table": {
135
132
  "type": "boolean"
136
133
  },