@atlaskit/editor-plugin-collab-edit 2.3.0 → 2.4.1
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 +14 -0
- package/dist/cjs/pm-plugins/events/send-transaction.js +7 -2
- package/dist/cjs/pm-plugins/utils.js +2 -2
- package/dist/es2019/pm-plugins/events/send-transaction.js +7 -2
- package/dist/esm/pm-plugins/events/send-transaction.js +7 -2
- package/dist/esm/pm-plugins/utils.js +3 -2
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-collab-edit
|
|
2
2
|
|
|
3
|
+
## 2.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 2.4.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#106350](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/106350)
|
|
14
|
+
[`ab9819f908779`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ab9819f908779) -
|
|
15
|
+
Migrated onEditorViewStateUpdatedCallbacks calls to createEditorStateNotificationPlugin
|
|
16
|
+
|
|
3
17
|
## 2.3.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.sendTransaction = void 0;
|
|
7
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
7
8
|
var _actions = require("../actions");
|
|
8
9
|
var _pluginKey = require("../main/plugin-key");
|
|
9
10
|
var sendTransaction = exports.sendTransaction = function sendTransaction(_ref) {
|
|
@@ -14,7 +15,7 @@ var sendTransaction = exports.sendTransaction = function sendTransaction(_ref) {
|
|
|
14
15
|
useNativePlugin = _ref.useNativePlugin,
|
|
15
16
|
viewMode = _ref.viewMode;
|
|
16
17
|
return function (provider) {
|
|
17
|
-
var docChangedTransaction = transactions.find(function (tr) {
|
|
18
|
+
var docChangedTransaction = (0, _platformFeatureFlags.fg)('platform_editor_migrate_state_updates') ? originalTransaction.docChanged : transactions.find(function (tr) {
|
|
18
19
|
return tr.docChanged;
|
|
19
20
|
});
|
|
20
21
|
var currentPluginState = _pluginKey.pluginKey.getState(newEditorState);
|
|
@@ -27,7 +28,11 @@ var sendTransaction = exports.sendTransaction = function sendTransaction(_ref) {
|
|
|
27
28
|
// This metadata is coming from the scaleTable command in table-resizing plugin
|
|
28
29
|
!originalTransaction.getMeta('scaleTable') && docChangedTransaction;
|
|
29
30
|
if (useNativePlugin || shouldSendStepForSynchronyCollabProvider) {
|
|
30
|
-
|
|
31
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_migrate_state_updates')) {
|
|
32
|
+
provider.send(originalTransaction, oldEditorState, newEditorState);
|
|
33
|
+
} else {
|
|
34
|
+
provider.send(docChangedTransaction, oldEditorState, newEditorState);
|
|
35
|
+
}
|
|
31
36
|
}
|
|
32
37
|
var prevPluginState = _pluginKey.pluginKey.getState(oldEditorState);
|
|
33
38
|
var _ref2 = prevPluginState || {},
|
|
@@ -175,14 +175,14 @@ var getPositionOfTelepointer = exports.getPositionOfTelepointer = function getPo
|
|
|
175
175
|
var isReplaceStep = exports.isReplaceStep = function isReplaceStep(step) {
|
|
176
176
|
return step instanceof _transform.ReplaceStep;
|
|
177
177
|
};
|
|
178
|
-
var
|
|
178
|
+
var _originalTransactionHasMeta = exports.originalTransactionHasMeta = function originalTransactionHasMeta(transaction, metaTag) {
|
|
179
179
|
var hasMetaTag = Boolean(transaction.getMeta(metaTag));
|
|
180
180
|
if (hasMetaTag) {
|
|
181
181
|
return true;
|
|
182
182
|
}
|
|
183
183
|
var appendedTransaction = transaction.getMeta('appendedTransaction');
|
|
184
184
|
if (appendedTransaction instanceof _state.Transaction) {
|
|
185
|
-
return
|
|
185
|
+
return _originalTransactionHasMeta(appendedTransaction, metaTag);
|
|
186
186
|
}
|
|
187
187
|
return false;
|
|
188
188
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
2
|
import { getSendableSelection } from '../actions';
|
|
2
3
|
import { pluginKey } from '../main/plugin-key';
|
|
3
4
|
export const sendTransaction = ({
|
|
@@ -8,7 +9,7 @@ export const sendTransaction = ({
|
|
|
8
9
|
useNativePlugin,
|
|
9
10
|
viewMode
|
|
10
11
|
}) => provider => {
|
|
11
|
-
const docChangedTransaction = transactions.find(tr => tr.docChanged);
|
|
12
|
+
const docChangedTransaction = fg('platform_editor_migrate_state_updates') ? originalTransaction.docChanged : transactions.find(tr => tr.docChanged);
|
|
12
13
|
const currentPluginState = pluginKey.getState(newEditorState);
|
|
13
14
|
if (!(currentPluginState !== null && currentPluginState !== void 0 && currentPluginState.isReady)) {
|
|
14
15
|
return;
|
|
@@ -19,7 +20,11 @@ export const sendTransaction = ({
|
|
|
19
20
|
// This metadata is coming from the scaleTable command in table-resizing plugin
|
|
20
21
|
!originalTransaction.getMeta('scaleTable') && docChangedTransaction;
|
|
21
22
|
if (useNativePlugin || shouldSendStepForSynchronyCollabProvider) {
|
|
22
|
-
|
|
23
|
+
if (fg('platform_editor_migrate_state_updates')) {
|
|
24
|
+
provider.send(originalTransaction, oldEditorState, newEditorState);
|
|
25
|
+
} else {
|
|
26
|
+
provider.send(docChangedTransaction, oldEditorState, newEditorState);
|
|
27
|
+
}
|
|
23
28
|
}
|
|
24
29
|
const prevPluginState = pluginKey.getState(oldEditorState);
|
|
25
30
|
const {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
2
|
import { getSendableSelection } from '../actions';
|
|
2
3
|
import { pluginKey } from '../main/plugin-key';
|
|
3
4
|
export var sendTransaction = function sendTransaction(_ref) {
|
|
@@ -8,7 +9,7 @@ export var sendTransaction = function sendTransaction(_ref) {
|
|
|
8
9
|
useNativePlugin = _ref.useNativePlugin,
|
|
9
10
|
viewMode = _ref.viewMode;
|
|
10
11
|
return function (provider) {
|
|
11
|
-
var docChangedTransaction = transactions.find(function (tr) {
|
|
12
|
+
var docChangedTransaction = fg('platform_editor_migrate_state_updates') ? originalTransaction.docChanged : transactions.find(function (tr) {
|
|
12
13
|
return tr.docChanged;
|
|
13
14
|
});
|
|
14
15
|
var currentPluginState = pluginKey.getState(newEditorState);
|
|
@@ -21,7 +22,11 @@ export var sendTransaction = function sendTransaction(_ref) {
|
|
|
21
22
|
// This metadata is coming from the scaleTable command in table-resizing plugin
|
|
22
23
|
!originalTransaction.getMeta('scaleTable') && docChangedTransaction;
|
|
23
24
|
if (useNativePlugin || shouldSendStepForSynchronyCollabProvider) {
|
|
24
|
-
|
|
25
|
+
if (fg('platform_editor_migrate_state_updates')) {
|
|
26
|
+
provider.send(originalTransaction, oldEditorState, newEditorState);
|
|
27
|
+
} else {
|
|
28
|
+
provider.send(docChangedTransaction, oldEditorState, newEditorState);
|
|
29
|
+
}
|
|
25
30
|
}
|
|
26
31
|
var prevPluginState = pluginKey.getState(oldEditorState);
|
|
27
32
|
var _ref2 = prevPluginState || {},
|
|
@@ -166,14 +166,14 @@ export var getPositionOfTelepointer = function getPositionOfTelepointer(sessionI
|
|
|
166
166
|
export var isReplaceStep = function isReplaceStep(step) {
|
|
167
167
|
return step instanceof ReplaceStep;
|
|
168
168
|
};
|
|
169
|
-
|
|
169
|
+
var _originalTransactionHasMeta = function originalTransactionHasMeta(transaction, metaTag) {
|
|
170
170
|
var hasMetaTag = Boolean(transaction.getMeta(metaTag));
|
|
171
171
|
if (hasMetaTag) {
|
|
172
172
|
return true;
|
|
173
173
|
}
|
|
174
174
|
var appendedTransaction = transaction.getMeta('appendedTransaction');
|
|
175
175
|
if (appendedTransaction instanceof Transaction) {
|
|
176
|
-
return
|
|
176
|
+
return _originalTransactionHasMeta(appendedTransaction, metaTag);
|
|
177
177
|
}
|
|
178
178
|
return false;
|
|
179
179
|
};
|
|
@@ -188,6 +188,7 @@ export var originalTransactionHasMeta = function originalTransactionHasMeta(tran
|
|
|
188
188
|
*
|
|
189
189
|
* Steps analycs dashboard: https://atlassian-discover.cloud.databricks.com/dashboardsv3/01ef4d3c8aa916c8b0cb5332a9f37caf/published?o=4482001201517624
|
|
190
190
|
*/
|
|
191
|
+
export { _originalTransactionHasMeta as originalTransactionHasMeta };
|
|
191
192
|
var blockedAttrsList = ['__contextId', 'localId', '__autoSize', 'attr_colwidth', 'originalHeight', 'originalWidth'];
|
|
192
193
|
|
|
193
194
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-collab-edit",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"description": "Collab Edit plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/adf-schema": "^46.1.0",
|
|
35
35
|
"@atlaskit/custom-steps": "^0.9.0",
|
|
36
|
-
"@atlaskit/editor-common": "^99.
|
|
36
|
+
"@atlaskit/editor-common": "^99.7.0",
|
|
37
37
|
"@atlaskit/editor-json-transformer": "^8.22.0",
|
|
38
38
|
"@atlaskit/editor-plugin-analytics": "1.11.0",
|
|
39
39
|
"@atlaskit/editor-plugin-connectivity": "^1.1.0",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@atlaskit/editor-plugin-feature-flags": "^1.2.0",
|
|
42
42
|
"@atlaskit/editor-prosemirror": "6.2.1",
|
|
43
43
|
"@atlaskit/editor-shared-styles": "^3.2.0",
|
|
44
|
-
"@atlaskit/platform-feature-flags": "^0.
|
|
44
|
+
"@atlaskit/platform-feature-flags": "^1.0.0",
|
|
45
45
|
"@atlaskit/prosemirror-collab": "^0.11.0",
|
|
46
46
|
"@babel/runtime": "^7.0.0",
|
|
47
47
|
"memoize-one": "^6.0.0"
|
|
@@ -111,6 +111,9 @@
|
|
|
111
111
|
},
|
|
112
112
|
"platform_editor_selection_without_left_shift": {
|
|
113
113
|
"type": "boolean"
|
|
114
|
+
},
|
|
115
|
+
"platform_editor_migrate_state_updates": {
|
|
116
|
+
"type": "boolean"
|
|
114
117
|
}
|
|
115
118
|
}
|
|
116
119
|
}
|