@atlaskit/editor-core 203.16.2 → 203.16.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,21 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 203.16.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#112160](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/112160)
8
+ [`00ccb71f91143`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/00ccb71f91143) -
9
+ ED-26483 cleanup platform_editor_media_interaction_improvements
10
+
11
+ ## 203.16.3
12
+
13
+ ### Patch Changes
14
+
15
+ - [#112607](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/112607)
16
+ [`aae2efdae0ebe`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/aae2efdae0ebe) -
17
+ Fixed regression where editor analytics stopped firing
18
+
3
19
  ## 203.16.2
4
20
 
5
21
  ### Patch Changes
@@ -9,6 +9,7 @@ var _state = require("@atlaskit/editor-prosemirror/state");
9
9
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
10
10
  var key = new _state.PluginKey('editorStateNotificationPlugin');
11
11
  var createEditorStateNotificationPlugin = exports.createEditorStateNotificationPlugin = function createEditorStateNotificationPlugin(onEditorStateUpdated, onEditorViewStateUpdatedCallbacks) {
12
+ var transactions = [];
12
13
  return new _safePlugin.SafePlugin({
13
14
  key: key,
14
15
  state: {
@@ -18,6 +19,7 @@ var createEditorStateNotificationPlugin = exports.createEditorStateNotificationP
18
19
  };
19
20
  },
20
21
  apply: function apply(tr) {
22
+ transactions.push(tr);
21
23
  return {
22
24
  latestTransaction: tr
23
25
  };
@@ -32,11 +34,12 @@ var createEditorStateNotificationPlugin = exports.createEditorStateNotificationP
32
34
  onEditorViewStateUpdatedCallbacks.forEach(function (entry) {
33
35
  entry.callback({
34
36
  originalTransaction: originalTransaction,
35
- transactions: [originalTransaction],
37
+ transactions: transactions,
36
38
  oldEditorState: oldEditorState,
37
39
  newEditorState: view.state
38
40
  });
39
41
  });
42
+ transactions = [];
40
43
  }
41
44
  onEditorStateUpdated({
42
45
  oldEditorState: oldEditorState,
@@ -81,7 +81,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
81
81
  * @returns a full featured preset configured according to the provided props - basis for create-plugins-list
82
82
  */
83
83
  function createUniversalPresetInternal(_ref) {
84
- var _featureFlags$lpLinkP, _props$media, _props$media2, _props$media3, _props$media4, _props$media5, _props$mention$insert, _props$mention, _props$mention2, _props$mention3, _initialPluginConfigu, _props$collabEdit$EXP, _props$collabEdit, _props$linking, _props$linking2, _featureFlags$lpLinkP2, _props$linking3, _props$primaryToolbar;
84
+ var _featureFlags$lpLinkP, _props$media, _props$media2, _props$media3, _props$media4, _props$media5, _props$media6, _props$media7, _props$mention$insert, _props$mention, _props$mention2, _props$mention3, _initialPluginConfigu, _props$collabEdit$EXP, _props$collabEdit, _props$linking, _props$linking2, _featureFlags$lpLinkP2, _props$linking3, _props$primaryToolbar;
85
85
  var appearance = _ref.appearance,
86
86
  props = _ref.props,
87
87
  featureFlags = _ref.featureFlags,
@@ -128,15 +128,15 @@ function createUniversalPresetInternal(_ref) {
128
128
  allowMediaSingleEditable: true,
129
129
  allowRemoteDimensionsFetch: true,
130
130
  allowMarkingUploadsAsIncomplete: false,
131
- allowImagePreview: isFullPage,
131
+ allowImagePreview: typeof ((_props$media3 = props.media) === null || _props$media3 === void 0 ? void 0 : _props$media3.allowImagePreview) !== 'undefined' ? (_props$media4 = props.media) === null || _props$media4 === void 0 ? void 0 : _props$media4.allowImagePreview : isFullPage,
132
132
  fullWidthEnabled: appearance === 'full-width',
133
133
  editorAppearance: appearance,
134
134
  uploadErrorHandler: props.uploadErrorHandler,
135
135
  waitForMediaUpload: props.waitForMediaUpload,
136
136
  isCopyPasteEnabled: true,
137
- alignLeftOnInsert: typeof ((_props$media3 = props.media) === null || _props$media3 === void 0 ? void 0 : _props$media3.alignLeftOnInsert) !== 'undefined' ? (_props$media4 = props.media) === null || _props$media4 === void 0 ? void 0 : _props$media4.alignLeftOnInsert : isComment,
137
+ alignLeftOnInsert: typeof ((_props$media5 = props.media) === null || _props$media5 === void 0 ? void 0 : _props$media5.alignLeftOnInsert) !== 'undefined' ? (_props$media6 = props.media) === null || _props$media6 === void 0 ? void 0 : _props$media6.alignLeftOnInsert : isComment,
138
138
  getEditorFeatureFlags: getEditorFeatureFlags
139
- })], Boolean(props.media)).maybeAdd(_mediaInsert.mediaInsertPlugin, Boolean(props.media && (0, _experiments.editorExperiment)('add-media-from-url', true))).maybeAdd(_caption.captionPlugin, Boolean((_props$media5 = props.media) === null || _props$media5 === void 0 ? void 0 : _props$media5.allowCaptions)).maybeAdd([_mentions.mentionsPlugin, _objectSpread({
139
+ })], Boolean(props.media)).maybeAdd(_mediaInsert.mediaInsertPlugin, Boolean(props.media && (0, _experiments.editorExperiment)('add-media-from-url', true))).maybeAdd(_caption.captionPlugin, Boolean((_props$media7 = props.media) === null || _props$media7 === void 0 ? void 0 : _props$media7.allowCaptions)).maybeAdd([_mentions.mentionsPlugin, _objectSpread({
140
140
  sanitizePrivateContent: props.sanitizePrivateContent,
141
141
  insertDisplayName: (_props$mention$insert = (_props$mention = props.mention) === null || _props$mention === void 0 ? void 0 : _props$mention.insertDisplayName) !== null && _props$mention$insert !== void 0 ? _props$mention$insert : props.mentionInsertDisplayName,
142
142
  allowZeroWidthSpaceAfter: true,
@@ -5,4 +5,4 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = exports.name = void 0;
7
7
  var name = exports.name = "@atlaskit/editor-core";
8
- var version = exports.version = "203.16.2";
8
+ var version = exports.version = "203.16.4";
@@ -2,40 +2,45 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
2
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
3
3
  import { fg } from '@atlaskit/platform-feature-flags';
4
4
  const key = new PluginKey('editorStateNotificationPlugin');
5
- export const createEditorStateNotificationPlugin = (onEditorStateUpdated, onEditorViewStateUpdatedCallbacks) => new SafePlugin({
6
- key: key,
7
- state: {
8
- init() {
9
- return {
10
- latestTransaction: undefined
11
- };
5
+ export const createEditorStateNotificationPlugin = (onEditorStateUpdated, onEditorViewStateUpdatedCallbacks) => {
6
+ let transactions = [];
7
+ return new SafePlugin({
8
+ key: key,
9
+ state: {
10
+ init() {
11
+ return {
12
+ latestTransaction: undefined
13
+ };
14
+ },
15
+ apply(tr) {
16
+ transactions.push(tr);
17
+ return {
18
+ latestTransaction: tr
19
+ };
20
+ }
12
21
  },
13
- apply(tr) {
22
+ view: () => {
14
23
  return {
15
- latestTransaction: tr
16
- };
17
- }
18
- },
19
- view: () => {
20
- return {
21
- update: (view, oldEditorState) => {
22
- var _key$getState;
23
- const originalTransaction = (_key$getState = key.getState(view.state)) === null || _key$getState === void 0 ? void 0 : _key$getState.latestTransaction;
24
- if (originalTransaction && fg('platform_editor_migrate_state_updates')) {
25
- onEditorViewStateUpdatedCallbacks.forEach(entry => {
26
- entry.callback({
27
- originalTransaction,
28
- transactions: [originalTransaction],
29
- oldEditorState,
30
- newEditorState: view.state
24
+ update: (view, oldEditorState) => {
25
+ var _key$getState;
26
+ const originalTransaction = (_key$getState = key.getState(view.state)) === null || _key$getState === void 0 ? void 0 : _key$getState.latestTransaction;
27
+ if (originalTransaction && fg('platform_editor_migrate_state_updates')) {
28
+ onEditorViewStateUpdatedCallbacks.forEach(entry => {
29
+ entry.callback({
30
+ originalTransaction,
31
+ transactions: transactions,
32
+ oldEditorState,
33
+ newEditorState: view.state
34
+ });
31
35
  });
36
+ transactions = [];
37
+ }
38
+ onEditorStateUpdated({
39
+ oldEditorState,
40
+ newEditorState: view.state
32
41
  });
33
42
  }
34
- onEditorStateUpdated({
35
- oldEditorState,
36
- newEditorState: view.state
37
- });
38
- }
39
- };
40
- }
41
- });
43
+ };
44
+ }
45
+ });
46
+ };
@@ -77,7 +77,7 @@ export default function createUniversalPresetInternal({
77
77
  prevAppearance,
78
78
  createAnalyticsEvent
79
79
  }) {
80
- var _featureFlags$lpLinkP, _props$media, _props$media2, _props$media3, _props$media4, _props$media5, _props$mention$insert, _props$mention, _props$mention2, _props$mention3, _initialPluginConfigu, _props$collabEdit$EXP, _props$collabEdit, _props$linking, _props$linking2, _featureFlags$lpLinkP2, _props$linking3, _props$primaryToolbar;
80
+ var _featureFlags$lpLinkP, _props$media, _props$media2, _props$media3, _props$media4, _props$media5, _props$media6, _props$media7, _props$mention$insert, _props$mention, _props$mention2, _props$mention3, _initialPluginConfigu, _props$collabEdit$EXP, _props$collabEdit, _props$linking, _props$linking2, _featureFlags$lpLinkP2, _props$linking3, _props$primaryToolbar;
81
81
  const isComment = appearance === 'comment';
82
82
  const isChromeless = appearance === 'chromeless';
83
83
  const isFullPage = fullPageCheck(appearance);
@@ -119,15 +119,15 @@ export default function createUniversalPresetInternal({
119
119
  allowMediaSingleEditable: true,
120
120
  allowRemoteDimensionsFetch: true,
121
121
  allowMarkingUploadsAsIncomplete: false,
122
- allowImagePreview: isFullPage,
122
+ allowImagePreview: typeof ((_props$media3 = props.media) === null || _props$media3 === void 0 ? void 0 : _props$media3.allowImagePreview) !== 'undefined' ? (_props$media4 = props.media) === null || _props$media4 === void 0 ? void 0 : _props$media4.allowImagePreview : isFullPage,
123
123
  fullWidthEnabled: appearance === 'full-width',
124
124
  editorAppearance: appearance,
125
125
  uploadErrorHandler: props.uploadErrorHandler,
126
126
  waitForMediaUpload: props.waitForMediaUpload,
127
127
  isCopyPasteEnabled: true,
128
- alignLeftOnInsert: typeof ((_props$media3 = props.media) === null || _props$media3 === void 0 ? void 0 : _props$media3.alignLeftOnInsert) !== 'undefined' ? (_props$media4 = props.media) === null || _props$media4 === void 0 ? void 0 : _props$media4.alignLeftOnInsert : isComment,
128
+ alignLeftOnInsert: typeof ((_props$media5 = props.media) === null || _props$media5 === void 0 ? void 0 : _props$media5.alignLeftOnInsert) !== 'undefined' ? (_props$media6 = props.media) === null || _props$media6 === void 0 ? void 0 : _props$media6.alignLeftOnInsert : isComment,
129
129
  getEditorFeatureFlags
130
- }], Boolean(props.media)).maybeAdd(mediaInsertPlugin, Boolean(props.media && editorExperiment('add-media-from-url', true))).maybeAdd(captionPlugin, Boolean((_props$media5 = props.media) === null || _props$media5 === void 0 ? void 0 : _props$media5.allowCaptions)).maybeAdd([mentionsPlugin, {
130
+ }], Boolean(props.media)).maybeAdd(mediaInsertPlugin, Boolean(props.media && editorExperiment('add-media-from-url', true))).maybeAdd(captionPlugin, Boolean((_props$media7 = props.media) === null || _props$media7 === void 0 ? void 0 : _props$media7.allowCaptions)).maybeAdd([mentionsPlugin, {
131
131
  sanitizePrivateContent: props.sanitizePrivateContent,
132
132
  insertDisplayName: (_props$mention$insert = (_props$mention = props.mention) === null || _props$mention === void 0 ? void 0 : _props$mention.insertDisplayName) !== null && _props$mention$insert !== void 0 ? _props$mention$insert : props.mentionInsertDisplayName,
133
133
  allowZeroWidthSpaceAfter: true,
@@ -1,2 +1,2 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "203.16.2";
2
+ export const version = "203.16.4";
@@ -3,6 +3,7 @@ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
3
3
  import { fg } from '@atlaskit/platform-feature-flags';
4
4
  var key = new PluginKey('editorStateNotificationPlugin');
5
5
  export var createEditorStateNotificationPlugin = function createEditorStateNotificationPlugin(onEditorStateUpdated, onEditorViewStateUpdatedCallbacks) {
6
+ var transactions = [];
6
7
  return new SafePlugin({
7
8
  key: key,
8
9
  state: {
@@ -12,6 +13,7 @@ export var createEditorStateNotificationPlugin = function createEditorStateNotif
12
13
  };
13
14
  },
14
15
  apply: function apply(tr) {
16
+ transactions.push(tr);
15
17
  return {
16
18
  latestTransaction: tr
17
19
  };
@@ -26,11 +28,12 @@ export var createEditorStateNotificationPlugin = function createEditorStateNotif
26
28
  onEditorViewStateUpdatedCallbacks.forEach(function (entry) {
27
29
  entry.callback({
28
30
  originalTransaction: originalTransaction,
29
- transactions: [originalTransaction],
31
+ transactions: transactions,
30
32
  oldEditorState: oldEditorState,
31
33
  newEditorState: view.state
32
34
  });
33
35
  });
36
+ transactions = [];
34
37
  }
35
38
  onEditorStateUpdated({
36
39
  oldEditorState: oldEditorState,
@@ -74,7 +74,7 @@ import { createDefaultPreset } from './default';
74
74
  * @returns a full featured preset configured according to the provided props - basis for create-plugins-list
75
75
  */
76
76
  export default function createUniversalPresetInternal(_ref) {
77
- var _featureFlags$lpLinkP, _props$media, _props$media2, _props$media3, _props$media4, _props$media5, _props$mention$insert, _props$mention, _props$mention2, _props$mention3, _initialPluginConfigu, _props$collabEdit$EXP, _props$collabEdit, _props$linking, _props$linking2, _featureFlags$lpLinkP2, _props$linking3, _props$primaryToolbar;
77
+ var _featureFlags$lpLinkP, _props$media, _props$media2, _props$media3, _props$media4, _props$media5, _props$media6, _props$media7, _props$mention$insert, _props$mention, _props$mention2, _props$mention3, _initialPluginConfigu, _props$collabEdit$EXP, _props$collabEdit, _props$linking, _props$linking2, _featureFlags$lpLinkP2, _props$linking3, _props$primaryToolbar;
78
78
  var appearance = _ref.appearance,
79
79
  props = _ref.props,
80
80
  featureFlags = _ref.featureFlags,
@@ -121,15 +121,15 @@ export default function createUniversalPresetInternal(_ref) {
121
121
  allowMediaSingleEditable: true,
122
122
  allowRemoteDimensionsFetch: true,
123
123
  allowMarkingUploadsAsIncomplete: false,
124
- allowImagePreview: isFullPage,
124
+ allowImagePreview: typeof ((_props$media3 = props.media) === null || _props$media3 === void 0 ? void 0 : _props$media3.allowImagePreview) !== 'undefined' ? (_props$media4 = props.media) === null || _props$media4 === void 0 ? void 0 : _props$media4.allowImagePreview : isFullPage,
125
125
  fullWidthEnabled: appearance === 'full-width',
126
126
  editorAppearance: appearance,
127
127
  uploadErrorHandler: props.uploadErrorHandler,
128
128
  waitForMediaUpload: props.waitForMediaUpload,
129
129
  isCopyPasteEnabled: true,
130
- alignLeftOnInsert: typeof ((_props$media3 = props.media) === null || _props$media3 === void 0 ? void 0 : _props$media3.alignLeftOnInsert) !== 'undefined' ? (_props$media4 = props.media) === null || _props$media4 === void 0 ? void 0 : _props$media4.alignLeftOnInsert : isComment,
130
+ alignLeftOnInsert: typeof ((_props$media5 = props.media) === null || _props$media5 === void 0 ? void 0 : _props$media5.alignLeftOnInsert) !== 'undefined' ? (_props$media6 = props.media) === null || _props$media6 === void 0 ? void 0 : _props$media6.alignLeftOnInsert : isComment,
131
131
  getEditorFeatureFlags: getEditorFeatureFlags
132
- })], Boolean(props.media)).maybeAdd(mediaInsertPlugin, Boolean(props.media && editorExperiment('add-media-from-url', true))).maybeAdd(captionPlugin, Boolean((_props$media5 = props.media) === null || _props$media5 === void 0 ? void 0 : _props$media5.allowCaptions)).maybeAdd([mentionsPlugin, _objectSpread({
132
+ })], Boolean(props.media)).maybeAdd(mediaInsertPlugin, Boolean(props.media && editorExperiment('add-media-from-url', true))).maybeAdd(captionPlugin, Boolean((_props$media7 = props.media) === null || _props$media7 === void 0 ? void 0 : _props$media7.allowCaptions)).maybeAdd([mentionsPlugin, _objectSpread({
133
133
  sanitizePrivateContent: props.sanitizePrivateContent,
134
134
  insertDisplayName: (_props$mention$insert = (_props$mention = props.mention) === null || _props$mention === void 0 ? void 0 : _props$mention.insertDisplayName) !== null && _props$mention$insert !== void 0 ? _props$mention$insert : props.mentionInsertDisplayName,
135
135
  allowZeroWidthSpaceAfter: true,
@@ -1,2 +1,2 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "203.16.2";
2
+ export var version = "203.16.4";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "203.16.2",
3
+ "version": "203.16.4",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -103,7 +103,7 @@
103
103
  "@atlaskit/visual-regression": "*",
104
104
  "@atlassian/adf-schema-json": "^1.22.0",
105
105
  "@atlassian/feature-flags-test-utils": "*",
106
- "@atlassian/search-provider": "3.0.33",
106
+ "@atlassian/search-provider": "3.0.34",
107
107
  "@emotion/jest": "^11.8.0",
108
108
  "@storybook/addon-knobs": "^6.4.0",
109
109
  "@testing-library/react": "^13.4.0",
@@ -238,10 +238,6 @@
238
238
  "type": "boolean",
239
239
  "referenceOnly": true
240
240
  },
241
- "platform_editor_media_interaction_improvements": {
242
- "type:": "boolean",
243
- "referenceOnly": true
244
- },
245
241
  "platform_editor_element_dnd_nested_fix_patch_5": {
246
242
  "type": "boolean",
247
243
  "referenceOnly": true
@@ -254,10 +250,6 @@
254
250
  "type": "boolean",
255
251
  "referenceOnly": true
256
252
  },
257
- "platform_editor_preload_insert_menu": {
258
- "type": "boolean",
259
- "referenceOnly": true
260
- },
261
253
  "platform_editor_merge_unconfirmed_steps": {
262
254
  "type": "boolean",
263
255
  "referenceOnly": true