@atlaskit/editor-plugin-paste 2.0.13 → 2.0.15

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,25 @@
1
1
  # @atlaskit/editor-plugin-paste
2
2
 
3
+ ## 2.0.15
4
+
5
+ ### Patch Changes
6
+
7
+ - [#102045](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/102045)
8
+ [`44f96aff22dd9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/44f96aff22dd9) -
9
+ [ED-26179] clean up platform_editor_elements_dnd_nested_table
10
+ - Updated dependencies
11
+
12
+ ## 2.0.14
13
+
14
+ ### Patch Changes
15
+
16
+ - [#102083](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/102083)
17
+ [`7dfb89f8b8a19`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/7dfb89f8b8a19) -
18
+ [ux] ED-26221 Changed order of paste handlers so that nested tables are handled before panels and
19
+ decisions. This prevents incorrect handling of nested tables when pasting a table into a panel
20
+ inside a table
21
+ - Updated dependencies
22
+
3
23
  ## 2.0.13
4
24
 
5
25
  ### Patch Changes
@@ -328,6 +328,11 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
328
328
  // @ts-ignore - [unblock prosemirror bump] assigning to readonly prop
329
329
  slice.openStart = 1;
330
330
  }
331
+
332
+ // handle paste of nested tables to ensure nesting limits are respected
333
+ if ((0, _analytics2.handleNestedTablePasteWithAnalytics)(editorAnalyticsAPI, (0, _platformFeatureFlags.fg)('platform_editor_use_nested_table_pm_nodes'))(view, event, slice)(state, dispatch)) {
334
+ return true;
335
+ }
331
336
  if ((0, _analytics2.handlePasteIntoTaskAndDecisionWithAnalytics)(view, event, slice, isPlainText ? _analytics.PasteTypes.plain : _analytics.PasteTypes.richText, pluginInjectionApi)(state, dispatch)) {
332
337
  return true;
333
338
  }
@@ -401,11 +406,6 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
401
406
  return true;
402
407
  }
403
408
 
404
- // handle paste of nested tables to ensure nesting limits are respected
405
- if ((0, _analytics2.handleNestedTablePasteWithAnalytics)(editorAnalyticsAPI, (0, _platformFeatureFlags.fg)('platform_editor_use_nested_table_pm_nodes'))(view, event, slice)(state, dispatch)) {
406
- return true;
407
- }
408
-
409
409
  // handle the case when copy content from a table cell inside bodied extension
410
410
  if ((0, _handlers.handleTableContentPasteInBodiedExtension)(slice)(state, dispatch)) {
411
411
  return true;
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.createPlugin = void 0;
7
7
  var _analytics = require("@atlaskit/editor-common/analytics");
8
8
  var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
9
- var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
10
9
  var _commands = require("./commands");
11
10
  var _pluginFactory = require("./plugin-factory");
12
11
  var _pluginKey = require("./plugin-key");
@@ -101,7 +100,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, editor
101
100
  if (!resetState && (0, _utils.isInlineNode)(nodeName) && (0, _utils.isNestedInlineNode)(selection)) {
102
101
  resetState = true;
103
102
  }
104
- if (!resetState && (0, _utils.isNestedInTable)(state) && (0, _experiments.editorExperiment)('table-nested-dnd', false)) {
103
+ if (!resetState && (0, _utils.isNestedInTable)(state)) {
105
104
  resetState = true;
106
105
  }
107
106
  if (resetState) {
@@ -302,6 +302,11 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
302
302
  // @ts-ignore - [unblock prosemirror bump] assigning to readonly prop
303
303
  slice.openStart = 1;
304
304
  }
305
+
306
+ // handle paste of nested tables to ensure nesting limits are respected
307
+ if (handleNestedTablePasteWithAnalytics(editorAnalyticsAPI, fg('platform_editor_use_nested_table_pm_nodes'))(view, event, slice)(state, dispatch)) {
308
+ return true;
309
+ }
305
310
  if (handlePasteIntoTaskAndDecisionWithAnalytics(view, event, slice, isPlainText ? PasteTypes.plain : PasteTypes.richText, pluginInjectionApi)(state, dispatch)) {
306
311
  return true;
307
312
  }
@@ -377,11 +382,6 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
377
382
  return true;
378
383
  }
379
384
 
380
- // handle paste of nested tables to ensure nesting limits are respected
381
- if (handleNestedTablePasteWithAnalytics(editorAnalyticsAPI, fg('platform_editor_use_nested_table_pm_nodes'))(view, event, slice)(state, dispatch)) {
382
- return true;
383
- }
384
-
385
385
  // handle the case when copy content from a table cell inside bodied extension
386
386
  if (handleTableContentPasteInBodiedExtension(slice)(state, dispatch)) {
387
387
  return true;
@@ -1,6 +1,5 @@
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 { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
4
3
  import { resetContentMoved, resetContentMovedTransform, updateContentMoved } from './commands';
5
4
  import { createPluginState, getPluginState } from './plugin-factory';
6
5
  import { pluginKey } from './plugin-key';
@@ -107,7 +106,7 @@ export const createPlugin = (dispatch, editorAnalyticsAPI) => {
107
106
  if (!resetState && isInlineNode(nodeName) && isNestedInlineNode(selection)) {
108
107
  resetState = true;
109
108
  }
110
- if (!resetState && isNestedInTable(state) && editorExperiment('table-nested-dnd', false)) {
109
+ if (!resetState && isNestedInTable(state)) {
111
110
  resetState = true;
112
111
  }
113
112
  if (resetState) {
@@ -320,6 +320,11 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
320
320
  // @ts-ignore - [unblock prosemirror bump] assigning to readonly prop
321
321
  slice.openStart = 1;
322
322
  }
323
+
324
+ // handle paste of nested tables to ensure nesting limits are respected
325
+ if (handleNestedTablePasteWithAnalytics(editorAnalyticsAPI, fg('platform_editor_use_nested_table_pm_nodes'))(view, event, slice)(state, dispatch)) {
326
+ return true;
327
+ }
323
328
  if (handlePasteIntoTaskAndDecisionWithAnalytics(view, event, slice, isPlainText ? PasteTypes.plain : PasteTypes.richText, pluginInjectionApi)(state, dispatch)) {
324
329
  return true;
325
330
  }
@@ -393,11 +398,6 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
393
398
  return true;
394
399
  }
395
400
 
396
- // handle paste of nested tables to ensure nesting limits are respected
397
- if (handleNestedTablePasteWithAnalytics(editorAnalyticsAPI, fg('platform_editor_use_nested_table_pm_nodes'))(view, event, slice)(state, dispatch)) {
398
- return true;
399
- }
400
-
401
401
  // handle the case when copy content from a table cell inside bodied extension
402
402
  if (handleTableContentPasteInBodiedExtension(slice)(state, dispatch)) {
403
403
  return true;
@@ -1,6 +1,5 @@
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 { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
4
3
  import { resetContentMoved, resetContentMovedTransform, updateContentMoved } from './commands';
5
4
  import { createPluginState, getPluginState } from './plugin-factory';
6
5
  import { pluginKey } from './plugin-key';
@@ -96,7 +95,7 @@ export var createPlugin = function createPlugin(dispatch, editorAnalyticsAPI) {
96
95
  if (!resetState && isInlineNode(nodeName) && isNestedInlineNode(selection)) {
97
96
  resetState = true;
98
97
  }
99
- if (!resetState && isNestedInTable(state) && editorExperiment('table-nested-dnd', false)) {
98
+ if (!resetState && isNestedInTable(state)) {
100
99
  resetState = true;
101
100
  }
102
101
  if (resetState) {
@@ -33,19 +33,20 @@ export type PastePluginOptions = {
33
33
  sanitizePrivateContent?: boolean;
34
34
  isFullPage?: boolean;
35
35
  };
36
+ export type PastePluginDependencies = [
37
+ OptionalPlugin<FeatureFlagsPlugin>,
38
+ OptionalPlugin<ListPlugin>,
39
+ BetterTypeHistoryPlugin,
40
+ OptionalPlugin<CardPlugin>,
41
+ OptionalPlugin<AnalyticsPlugin>,
42
+ OptionalPlugin<MediaPlugin>,
43
+ OptionalPlugin<ExtensionPlugin>,
44
+ OptionalPlugin<AnnotationPlugin>,
45
+ OptionalPlugin<MentionsPlugin>
46
+ ];
36
47
  export type PastePlugin = NextEditorPlugin<'paste', {
37
48
  pluginConfiguration: PastePluginOptions;
38
- dependencies: [
39
- OptionalPlugin<FeatureFlagsPlugin>,
40
- OptionalPlugin<ListPlugin>,
41
- BetterTypeHistoryPlugin,
42
- OptionalPlugin<CardPlugin>,
43
- OptionalPlugin<AnalyticsPlugin>,
44
- OptionalPlugin<MediaPlugin>,
45
- OptionalPlugin<ExtensionPlugin>,
46
- OptionalPlugin<AnnotationPlugin>,
47
- OptionalPlugin<MentionsPlugin>
48
- ];
49
+ dependencies: PastePluginDependencies;
49
50
  sharedState: {
50
51
  lastContentPasted: LastContentPasted | null;
51
52
  };
@@ -33,19 +33,20 @@ export type PastePluginOptions = {
33
33
  sanitizePrivateContent?: boolean;
34
34
  isFullPage?: boolean;
35
35
  };
36
+ export type PastePluginDependencies = [
37
+ OptionalPlugin<FeatureFlagsPlugin>,
38
+ OptionalPlugin<ListPlugin>,
39
+ BetterTypeHistoryPlugin,
40
+ OptionalPlugin<CardPlugin>,
41
+ OptionalPlugin<AnalyticsPlugin>,
42
+ OptionalPlugin<MediaPlugin>,
43
+ OptionalPlugin<ExtensionPlugin>,
44
+ OptionalPlugin<AnnotationPlugin>,
45
+ OptionalPlugin<MentionsPlugin>
46
+ ];
36
47
  export type PastePlugin = NextEditorPlugin<'paste', {
37
48
  pluginConfiguration: PastePluginOptions;
38
- dependencies: [
39
- OptionalPlugin<FeatureFlagsPlugin>,
40
- OptionalPlugin<ListPlugin>,
41
- BetterTypeHistoryPlugin,
42
- OptionalPlugin<CardPlugin>,
43
- OptionalPlugin<AnalyticsPlugin>,
44
- OptionalPlugin<MediaPlugin>,
45
- OptionalPlugin<ExtensionPlugin>,
46
- OptionalPlugin<AnnotationPlugin>,
47
- OptionalPlugin<MentionsPlugin>
48
- ];
49
+ dependencies: PastePluginDependencies;
49
50
  sharedState: {
50
51
  lastContentPasted: LastContentPasted | null;
51
52
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-paste",
3
- "version": "2.0.13",
3
+ "version": "2.0.15",
4
4
  "description": "Paste plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -31,7 +31,7 @@
31
31
  ".": "./src/index.ts"
32
32
  },
33
33
  "dependencies": {
34
- "@atlaskit/editor-common": "^98.0.0",
34
+ "@atlaskit/editor-common": "^99.1.0",
35
35
  "@atlaskit/editor-markdown-transformer": "^5.13.0",
36
36
  "@atlaskit/editor-plugin-analytics": "^1.10.0",
37
37
  "@atlaskit/editor-plugin-annotation": "^1.26.0",
@@ -39,14 +39,14 @@
39
39
  "@atlaskit/editor-plugin-card": "^4.5.0",
40
40
  "@atlaskit/editor-plugin-feature-flags": "^1.2.0",
41
41
  "@atlaskit/editor-plugin-list": "^3.9.0",
42
- "@atlaskit/editor-plugin-media": "^1.43.0",
43
- "@atlaskit/editor-plugin-mentions": "^2.10.0",
42
+ "@atlaskit/editor-plugin-media": "^1.44.0",
43
+ "@atlaskit/editor-plugin-mentions": "^2.11.0",
44
44
  "@atlaskit/editor-prosemirror": "6.2.1",
45
45
  "@atlaskit/editor-tables": "^2.8.0",
46
46
  "@atlaskit/media-client": "^29.0.0",
47
47
  "@atlaskit/media-common": "^11.7.0",
48
48
  "@atlaskit/platform-feature-flags": "^0.3.0",
49
- "@atlaskit/tmp-editor-statsig": "^2.31.0",
49
+ "@atlaskit/tmp-editor-statsig": "^2.34.0",
50
50
  "@babel/runtime": "^7.0.0",
51
51
  "lodash": "^4.17.21",
52
52
  "uuid": "^3.1.0"