@atlaskit/editor-core 209.1.5 → 209.1.6
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 +9 -0
- package/dist/cjs/create-editor/ReactEditorView.js +8 -10
- package/dist/cjs/create-editor/editorStateNotificationPlugin.js +0 -14
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/create-editor/ReactEditorView.js +8 -10
- package/dist/es2019/create-editor/editorStateNotificationPlugin.js +1 -15
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/create-editor/ReactEditorView.js +8 -10
- package/dist/esm/create-editor/editorStateNotificationPlugin.js +0 -14
- package/dist/esm/version-wrapper.js +1 -1
- package/package.json +3 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 209.1.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#185630](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/185630)
|
|
8
|
+
[`3535873b417f3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3535873b417f3) -
|
|
9
|
+
Remove FG platform_editor_migrate_state_updates
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 209.1.5
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -368,6 +368,7 @@ function ReactEditorView(props) {
|
|
|
368
368
|
}));
|
|
369
369
|
}, [blur, dispatchAnalyticsEvent, eventDispatcher, dispatch, errorReporter, featureFlags]);
|
|
370
370
|
var onEditorViewUpdated = (0, _react.useCallback)(function (_ref2) {
|
|
371
|
+
var _config$current;
|
|
371
372
|
var originalTransaction = _ref2.originalTransaction,
|
|
372
373
|
transactions = _ref2.transactions,
|
|
373
374
|
oldEditorState = _ref2.oldEditorState,
|
|
@@ -378,17 +379,14 @@ function ReactEditorView(props) {
|
|
|
378
379
|
oldEditorState: oldEditorState
|
|
379
380
|
});
|
|
380
381
|
}
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
oldEditorState: oldEditorState,
|
|
388
|
-
newEditorState: newEditorState
|
|
389
|
-
});
|
|
382
|
+
(_config$current = config.current) === null || _config$current === void 0 || _config$current.onEditorViewStateUpdatedCallbacks.forEach(function (entry) {
|
|
383
|
+
entry.callback({
|
|
384
|
+
originalTransaction: originalTransaction,
|
|
385
|
+
transactions: transactions,
|
|
386
|
+
oldEditorState: oldEditorState,
|
|
387
|
+
newEditorState: newEditorState
|
|
390
388
|
});
|
|
391
|
-
}
|
|
389
|
+
});
|
|
392
390
|
}, []);
|
|
393
391
|
var _dispatchTransaction = (0, _useDispatchTransaction.useDispatchTransaction)({
|
|
394
392
|
onChange: props.editorProps.onChange,
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.createEditorStateNotificationPlugin = void 0;
|
|
7
7
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
8
8
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
9
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
9
|
var key = new _state.PluginKey('editorStateNotificationPlugin');
|
|
11
10
|
var createEditorStateNotificationPlugin = exports.createEditorStateNotificationPlugin = function createEditorStateNotificationPlugin(onEditorStateUpdated, onEditorViewStateUpdatedCallbacks) {
|
|
12
11
|
var transactions = [];
|
|
@@ -28,19 +27,6 @@ var createEditorStateNotificationPlugin = exports.createEditorStateNotificationP
|
|
|
28
27
|
view: function view() {
|
|
29
28
|
return {
|
|
30
29
|
update: function update(view, oldEditorState) {
|
|
31
|
-
var _key$getState;
|
|
32
|
-
var originalTransaction = (_key$getState = key.getState(view.state)) === null || _key$getState === void 0 ? void 0 : _key$getState.latestTransaction;
|
|
33
|
-
if (originalTransaction && (0, _platformFeatureFlags.fg)('platform_editor_migrate_state_updates')) {
|
|
34
|
-
onEditorViewStateUpdatedCallbacks.forEach(function (entry) {
|
|
35
|
-
entry.callback({
|
|
36
|
-
originalTransaction: originalTransaction,
|
|
37
|
-
transactions: transactions,
|
|
38
|
-
oldEditorState: oldEditorState,
|
|
39
|
-
newEditorState: view.state
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
transactions = [];
|
|
43
|
-
}
|
|
44
30
|
onEditorStateUpdated({
|
|
45
31
|
oldEditorState: oldEditorState,
|
|
46
32
|
newEditorState: view.state
|
|
@@ -343,23 +343,21 @@ export function ReactEditorView(props) {
|
|
|
343
343
|
oldEditorState,
|
|
344
344
|
newEditorState
|
|
345
345
|
}) => {
|
|
346
|
+
var _config$current;
|
|
346
347
|
if (!fg('platform_editor_catch_missing_injection_states')) {
|
|
347
348
|
pluginInjectionAPI.current.onEditorViewUpdated({
|
|
348
349
|
newEditorState,
|
|
349
350
|
oldEditorState
|
|
350
351
|
});
|
|
351
352
|
}
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
oldEditorState,
|
|
359
|
-
newEditorState
|
|
360
|
-
});
|
|
353
|
+
(_config$current = config.current) === null || _config$current === void 0 ? void 0 : _config$current.onEditorViewStateUpdatedCallbacks.forEach(entry => {
|
|
354
|
+
entry.callback({
|
|
355
|
+
originalTransaction,
|
|
356
|
+
transactions,
|
|
357
|
+
oldEditorState,
|
|
358
|
+
newEditorState
|
|
361
359
|
});
|
|
362
|
-
}
|
|
360
|
+
});
|
|
363
361
|
}, []);
|
|
364
362
|
const dispatchTransaction = useDispatchTransaction({
|
|
365
363
|
onChange: props.editorProps.onChange,
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
const key = new PluginKey('editorStateNotificationPlugin');
|
|
5
4
|
export const createEditorStateNotificationPlugin = (onEditorStateUpdated, onEditorViewStateUpdatedCallbacks) => {
|
|
6
|
-
|
|
5
|
+
const transactions = [];
|
|
7
6
|
return new SafePlugin({
|
|
8
7
|
key: key,
|
|
9
8
|
state: {
|
|
@@ -22,19 +21,6 @@ export const createEditorStateNotificationPlugin = (onEditorStateUpdated, onEdit
|
|
|
22
21
|
view: () => {
|
|
23
22
|
return {
|
|
24
23
|
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
|
-
});
|
|
35
|
-
});
|
|
36
|
-
transactions = [];
|
|
37
|
-
}
|
|
38
24
|
onEditorStateUpdated({
|
|
39
25
|
oldEditorState,
|
|
40
26
|
newEditorState: view.state
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "209.1.
|
|
2
|
+
export const version = "209.1.5";
|
|
@@ -358,6 +358,7 @@ export function ReactEditorView(props) {
|
|
|
358
358
|
}));
|
|
359
359
|
}, [blur, dispatchAnalyticsEvent, eventDispatcher, dispatch, errorReporter, featureFlags]);
|
|
360
360
|
var onEditorViewUpdated = useCallback(function (_ref2) {
|
|
361
|
+
var _config$current;
|
|
361
362
|
var originalTransaction = _ref2.originalTransaction,
|
|
362
363
|
transactions = _ref2.transactions,
|
|
363
364
|
oldEditorState = _ref2.oldEditorState,
|
|
@@ -368,17 +369,14 @@ export function ReactEditorView(props) {
|
|
|
368
369
|
oldEditorState: oldEditorState
|
|
369
370
|
});
|
|
370
371
|
}
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
oldEditorState: oldEditorState,
|
|
378
|
-
newEditorState: newEditorState
|
|
379
|
-
});
|
|
372
|
+
(_config$current = config.current) === null || _config$current === void 0 || _config$current.onEditorViewStateUpdatedCallbacks.forEach(function (entry) {
|
|
373
|
+
entry.callback({
|
|
374
|
+
originalTransaction: originalTransaction,
|
|
375
|
+
transactions: transactions,
|
|
376
|
+
oldEditorState: oldEditorState,
|
|
377
|
+
newEditorState: newEditorState
|
|
380
378
|
});
|
|
381
|
-
}
|
|
379
|
+
});
|
|
382
380
|
}, []);
|
|
383
381
|
var _dispatchTransaction = useDispatchTransaction({
|
|
384
382
|
onChange: props.editorProps.onChange,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
var key = new PluginKey('editorStateNotificationPlugin');
|
|
5
4
|
export var createEditorStateNotificationPlugin = function createEditorStateNotificationPlugin(onEditorStateUpdated, onEditorViewStateUpdatedCallbacks) {
|
|
6
5
|
var transactions = [];
|
|
@@ -22,19 +21,6 @@ export var createEditorStateNotificationPlugin = function createEditorStateNotif
|
|
|
22
21
|
view: function view() {
|
|
23
22
|
return {
|
|
24
23
|
update: function update(view, oldEditorState) {
|
|
25
|
-
var _key$getState;
|
|
26
|
-
var 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(function (entry) {
|
|
29
|
-
entry.callback({
|
|
30
|
-
originalTransaction: originalTransaction,
|
|
31
|
-
transactions: transactions,
|
|
32
|
-
oldEditorState: oldEditorState,
|
|
33
|
-
newEditorState: view.state
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
transactions = [];
|
|
37
|
-
}
|
|
38
24
|
onEditorStateUpdated({
|
|
39
25
|
oldEditorState: oldEditorState,
|
|
40
26
|
newEditorState: view.state
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "209.1.
|
|
2
|
+
export var version = "209.1.5";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "209.1.
|
|
3
|
+
"version": "209.1.6",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@atlaskit/platform-feature-flags-react": "^0.2.0",
|
|
62
62
|
"@atlaskit/react-ufo": "^4.0.0",
|
|
63
63
|
"@atlaskit/task-decision": "^19.2.0",
|
|
64
|
-
"@atlaskit/tmp-editor-statsig": "^9.
|
|
64
|
+
"@atlaskit/tmp-editor-statsig": "^9.7.0",
|
|
65
65
|
"@atlaskit/tokens": "^5.5.0",
|
|
66
66
|
"@atlaskit/tooltip": "^20.3.0",
|
|
67
67
|
"@atlaskit/width-detector": "^5.0.0",
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"@atlaskit/primitives": "^14.10.0",
|
|
105
105
|
"@atlaskit/renderer": "^120.1.0",
|
|
106
106
|
"@atlaskit/section-message": "^8.2.0",
|
|
107
|
-
"@atlaskit/smart-card": "^40.
|
|
107
|
+
"@atlaskit/smart-card": "^40.1.0",
|
|
108
108
|
"@atlaskit/synchrony-test-helpers": "workspace:^",
|
|
109
109
|
"@atlaskit/toggle": "^15.0.0",
|
|
110
110
|
"@atlaskit/util-data-test": "^18.0.0",
|
|
@@ -229,9 +229,6 @@
|
|
|
229
229
|
"platform_editor_catch_missing_injection_states": {
|
|
230
230
|
"type": "boolean"
|
|
231
231
|
},
|
|
232
|
-
"platform_editor_migrate_state_updates": {
|
|
233
|
-
"type": "boolean"
|
|
234
|
-
},
|
|
235
232
|
"platform_editor_typography_ugc": {
|
|
236
233
|
"type": "boolean",
|
|
237
234
|
"referenceOnly": true
|