@atlaskit/editor-plugin-paste 13.3.13 → 13.3.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,20 @@
1
1
  # @atlaskit/editor-plugin-paste
2
2
 
3
+ ## 13.3.15
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 13.3.14
10
+
11
+ ### Patch Changes
12
+
13
+ - [`c897922dd06fc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c897922dd06fc) -
14
+ Resolve root gap cursor paste selection as doc-level so repeated resized panel paste keeps
15
+ breakout width
16
+ - Updated dependencies
17
+
3
18
  ## 13.3.13
4
19
 
5
20
  ### Patch Changes
@@ -548,7 +548,10 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
548
548
  // Check that we are pasting in a location that does not accept
549
549
  // breakout marks, if so we strip the mark and paste. Note that
550
550
  // breakout marks are only valid in the root document.
551
- if (selectionParentType !== state.schema.nodes.doc) {
551
+ if ((0, _platformFeatureFlags.fg)('platform_editor_lovability_resize_patch_2') ? selectionParentType !== state.schema.nodes.doc :
552
+ // When pasting at a root GapCursor, selection depth is 0 and there is no
553
+ // parent node to resolve. Treat it as doc-level so valid breakout marks stay.
554
+ selectionParentType !== state.schema.nodes.doc && selectionDepth !== 0) {
552
555
  var sliceCopy = _model.Slice.fromJSON(state.schema, slice.toJSON() || {});
553
556
  sliceCopy.content.descendants(function (node) {
554
557
  // @ts-ignore - [unblock prosemirror bump] assigning to readonly prop
@@ -10,7 +10,6 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
10
10
  var _adfSchema = require("@atlaskit/adf-schema");
11
11
  var _analytics = require("@atlaskit/editor-common/analytics");
12
12
  var _utils = require("@atlaskit/editor-common/utils");
13
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
14
13
  var _actions = require("../../editor-actions/actions");
15
14
  var _pastePluginType = require("../../pastePluginType");
16
15
  var _pluginFactory = require("../../pm-plugins/plugin-factory");
@@ -124,19 +123,17 @@ var handleSyncBlocksPaste = exports.handleSyncBlocksPaste = function handleSyncB
124
123
  // Bitbucket). Emit a track event so this can be measured directly instead of relying
125
124
  // on the "copied-but-never-landed" proxy. See EDITOR-7749.
126
125
  if (!hasSyncedBlockInSlice && isSyncedBlockInRawHtml) {
127
- if ((0, _platformFeatureFlags.fg)('platform_editor_blocks_patch_2')) {
128
- var _api$analytics;
129
- api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || (_api$analytics = _api$analytics.actions) === null || _api$analytics === void 0 || _api$analytics.fireAnalyticsEvent({
130
- eventType: _analytics.EVENT_TYPE.TRACK,
131
- action: _analytics.ACTION.INSERT_ATTEMPTED,
132
- actionSubject: _analytics.ACTION_SUBJECT.SYNCED_BLOCK,
133
- actionSubjectId: _analytics.ACTION_SUBJECT_ID.UNSUPPORTED_SURFACE,
134
- attributes: {
135
- sourceProduct: getSourceProductFromRawHtml(rawHtml),
136
- pasteSource: pasteSource
137
- }
138
- });
139
- }
126
+ var _api$analytics;
127
+ api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || (_api$analytics = _api$analytics.actions) === null || _api$analytics === void 0 || _api$analytics.fireAnalyticsEvent({
128
+ eventType: _analytics.EVENT_TYPE.TRACK,
129
+ action: _analytics.ACTION.INSERT_ATTEMPTED,
130
+ actionSubject: _analytics.ACTION_SUBJECT.SYNCED_BLOCK,
131
+ actionSubjectId: _analytics.ACTION_SUBJECT_ID.UNSUPPORTED_SURFACE,
132
+ attributes: {
133
+ sourceProduct: getSourceProductFromRawHtml(rawHtml),
134
+ pasteSource: pasteSource
135
+ }
136
+ });
140
137
  if (pasteWarningOptions !== null && pasteWarningOptions !== void 0 && pasteWarningOptions.cannotPasteSyncedBlock) {
141
138
  var _pasteWarningOptions$, _pasteWarningOptions$2, _pasteWarningOptions$3, _pasteWarningOptions$4;
142
139
  showWarningFlag({
@@ -509,7 +509,10 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
509
509
  // Check that we are pasting in a location that does not accept
510
510
  // breakout marks, if so we strip the mark and paste. Note that
511
511
  // breakout marks are only valid in the root document.
512
- if (selectionParentType !== state.schema.nodes.doc) {
512
+ if (fg('platform_editor_lovability_resize_patch_2') ? selectionParentType !== state.schema.nodes.doc :
513
+ // When pasting at a root GapCursor, selection depth is 0 and there is no
514
+ // parent node to resolve. Treat it as doc-level so valid breakout marks stay.
515
+ selectionParentType !== state.schema.nodes.doc && selectionDepth !== 0) {
513
516
  const sliceCopy = Slice.fromJSON(state.schema, slice.toJSON() || {});
514
517
  sliceCopy.content.descendants(node => {
515
518
  // @ts-ignore - [unblock prosemirror bump] assigning to readonly prop
@@ -1,7 +1,6 @@
1
1
  import { uuid } from '@atlaskit/adf-schema';
2
2
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
3
3
  import { mapSlice } from '@atlaskit/editor-common/utils';
4
- import { fg } from '@atlaskit/platform-feature-flags';
5
4
  import { PastePluginActionTypes } from '../../editor-actions/actions';
6
5
  import { FLAG_TYPE } from '../../pastePluginType';
7
6
  import { pluginKey } from '../../pm-plugins/plugin-factory';
@@ -117,19 +116,17 @@ export const handleSyncBlocksPaste = (slice, schema, pasteSource, rawHtml, paste
117
116
  // Bitbucket). Emit a track event so this can be measured directly instead of relying
118
117
  // on the "copied-but-never-landed" proxy. See EDITOR-7749.
119
118
  if (!hasSyncedBlockInSlice && isSyncedBlockInRawHtml) {
120
- if (fg('platform_editor_blocks_patch_2')) {
121
- var _api$analytics, _api$analytics$action;
122
- api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : (_api$analytics$action = _api$analytics.actions) === null || _api$analytics$action === void 0 ? void 0 : _api$analytics$action.fireAnalyticsEvent({
123
- eventType: EVENT_TYPE.TRACK,
124
- action: ACTION.INSERT_ATTEMPTED,
125
- actionSubject: ACTION_SUBJECT.SYNCED_BLOCK,
126
- actionSubjectId: ACTION_SUBJECT_ID.UNSUPPORTED_SURFACE,
127
- attributes: {
128
- sourceProduct: getSourceProductFromRawHtml(rawHtml),
129
- pasteSource
130
- }
131
- });
132
- }
119
+ var _api$analytics, _api$analytics$action;
120
+ api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : (_api$analytics$action = _api$analytics.actions) === null || _api$analytics$action === void 0 ? void 0 : _api$analytics$action.fireAnalyticsEvent({
121
+ eventType: EVENT_TYPE.TRACK,
122
+ action: ACTION.INSERT_ATTEMPTED,
123
+ actionSubject: ACTION_SUBJECT.SYNCED_BLOCK,
124
+ actionSubjectId: ACTION_SUBJECT_ID.UNSUPPORTED_SURFACE,
125
+ attributes: {
126
+ sourceProduct: getSourceProductFromRawHtml(rawHtml),
127
+ pasteSource
128
+ }
129
+ });
133
130
  if (pasteWarningOptions !== null && pasteWarningOptions !== void 0 && pasteWarningOptions.cannotPasteSyncedBlock) {
134
131
  var _pasteWarningOptions$, _pasteWarningOptions$2, _pasteWarningOptions$3, _pasteWarningOptions$4;
135
132
  showWarningFlag({
@@ -540,7 +540,10 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
540
540
  // Check that we are pasting in a location that does not accept
541
541
  // breakout marks, if so we strip the mark and paste. Note that
542
542
  // breakout marks are only valid in the root document.
543
- if (selectionParentType !== state.schema.nodes.doc) {
543
+ if (fg('platform_editor_lovability_resize_patch_2') ? selectionParentType !== state.schema.nodes.doc :
544
+ // When pasting at a root GapCursor, selection depth is 0 and there is no
545
+ // parent node to resolve. Treat it as doc-level so valid breakout marks stay.
546
+ selectionParentType !== state.schema.nodes.doc && selectionDepth !== 0) {
544
547
  var sliceCopy = Slice.fromJSON(state.schema, slice.toJSON() || {});
545
548
  sliceCopy.content.descendants(function (node) {
546
549
  // @ts-ignore - [unblock prosemirror bump] assigning to readonly prop
@@ -5,7 +5,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
5
5
  import { uuid } from '@atlaskit/adf-schema';
6
6
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
7
7
  import { mapSlice } from '@atlaskit/editor-common/utils';
8
- import { fg } from '@atlaskit/platform-feature-flags';
9
8
  import { PastePluginActionTypes } from '../../editor-actions/actions';
10
9
  import { FLAG_TYPE } from '../../pastePluginType';
11
10
  import { pluginKey } from '../../pm-plugins/plugin-factory';
@@ -118,19 +117,17 @@ export var handleSyncBlocksPaste = function handleSyncBlocksPaste(slice, schema,
118
117
  // Bitbucket). Emit a track event so this can be measured directly instead of relying
119
118
  // on the "copied-but-never-landed" proxy. See EDITOR-7749.
120
119
  if (!hasSyncedBlockInSlice && isSyncedBlockInRawHtml) {
121
- if (fg('platform_editor_blocks_patch_2')) {
122
- var _api$analytics;
123
- api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || (_api$analytics = _api$analytics.actions) === null || _api$analytics === void 0 || _api$analytics.fireAnalyticsEvent({
124
- eventType: EVENT_TYPE.TRACK,
125
- action: ACTION.INSERT_ATTEMPTED,
126
- actionSubject: ACTION_SUBJECT.SYNCED_BLOCK,
127
- actionSubjectId: ACTION_SUBJECT_ID.UNSUPPORTED_SURFACE,
128
- attributes: {
129
- sourceProduct: getSourceProductFromRawHtml(rawHtml),
130
- pasteSource: pasteSource
131
- }
132
- });
133
- }
120
+ var _api$analytics;
121
+ api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || (_api$analytics = _api$analytics.actions) === null || _api$analytics === void 0 || _api$analytics.fireAnalyticsEvent({
122
+ eventType: EVENT_TYPE.TRACK,
123
+ action: ACTION.INSERT_ATTEMPTED,
124
+ actionSubject: ACTION_SUBJECT.SYNCED_BLOCK,
125
+ actionSubjectId: ACTION_SUBJECT_ID.UNSUPPORTED_SURFACE,
126
+ attributes: {
127
+ sourceProduct: getSourceProductFromRawHtml(rawHtml),
128
+ pasteSource: pasteSource
129
+ }
130
+ });
134
131
  if (pasteWarningOptions !== null && pasteWarningOptions !== void 0 && pasteWarningOptions.cannotPasteSyncedBlock) {
135
132
  var _pasteWarningOptions$, _pasteWarningOptions$2, _pasteWarningOptions$3, _pasteWarningOptions$4;
136
133
  showWarningFlag({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-paste",
3
- "version": "13.3.13",
3
+ "version": "13.3.15",
4
4
  "description": "Paste plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -34,21 +34,21 @@
34
34
  "@atlaskit/editor-plugin-mentions": "^14.6.0",
35
35
  "@atlaskit/editor-prosemirror": "^8.0.0",
36
36
  "@atlaskit/editor-tables": "^3.0.0",
37
- "@atlaskit/flag": "^18.1.0",
37
+ "@atlaskit/flag": "^18.2.0",
38
38
  "@atlaskit/icon": "^37.0.0",
39
39
  "@atlaskit/insm": "^1.0.0",
40
40
  "@atlaskit/media-client": "^37.2.0",
41
41
  "@atlaskit/media-common": "^14.3.0",
42
42
  "@atlaskit/platform-feature-flags": "^2.0.0",
43
43
  "@atlaskit/prosemirror-history": "^1.0.0",
44
- "@atlaskit/tmp-editor-statsig": "^124.1.0",
45
- "@atlaskit/tokens": "^15.5.0",
44
+ "@atlaskit/tmp-editor-statsig": "^126.0.0",
45
+ "@atlaskit/tokens": "^15.8.0",
46
46
  "@babel/runtime": "^7.0.0",
47
47
  "lodash": "^4.17.21",
48
48
  "uuid": "^3.1.0"
49
49
  },
50
50
  "peerDependencies": {
51
- "@atlaskit/editor-common": "^116.25.0",
51
+ "@atlaskit/editor-common": "^116.30.0",
52
52
  "react": "^18.2.0",
53
53
  "react-dom": "^18.2.0",
54
54
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
@@ -97,10 +97,6 @@
97
97
  }
98
98
  },
99
99
  "platform-feature-flags": {
100
- "platform_editor_blocks_patch_2": {
101
- "type": "boolean",
102
- "referenceOnly": true
103
- },
104
100
  "platform_editor_legacy_content_macro_insert": {
105
101
  "type": "boolean"
106
102
  },
@@ -130,6 +126,9 @@
130
126
  },
131
127
  "platform_editor_flexible_list_kill_switch_1": {
132
128
  "type": "boolean"
129
+ },
130
+ "platform_editor_lovability_resize_patch_2": {
131
+ "type": "boolean"
133
132
  }
134
133
  }
135
134
  }