@atlaskit/editor-core 203.16.2 → 203.16.3

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,13 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 203.16.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#112607](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/112607)
8
+ [`aae2efdae0ebe`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/aae2efdae0ebe) -
9
+ Fixed regression where editor analytics stopped firing
10
+
3
11
  ## 203.16.2
4
12
 
5
13
  ### 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,
@@ -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.3";
@@ -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
+ };
@@ -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.3";
@@ -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,
@@ -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.3";
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.3",
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",
@@ -254,10 +254,6 @@
254
254
  "type": "boolean",
255
255
  "referenceOnly": true
256
256
  },
257
- "platform_editor_preload_insert_menu": {
258
- "type": "boolean",
259
- "referenceOnly": true
260
- },
261
257
  "platform_editor_merge_unconfirmed_steps": {
262
258
  "type": "boolean",
263
259
  "referenceOnly": true