@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 +8 -0
- package/dist/cjs/create-editor/editorStateNotificationPlugin.js +4 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/create-editor/editorStateNotificationPlugin.js +37 -32
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/create-editor/editorStateNotificationPlugin.js +4 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/package.json +2 -6
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:
|
|
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,
|
|
@@ -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) =>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
22
|
+
view: () => {
|
|
14
23
|
return {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
+
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:
|
|
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
|
+
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.
|
|
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.
|
|
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
|