@atlaskit/editor-plugin-undo-redo 15.0.12 → 15.0.14
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 +16 -0
- package/dist/cjs/pm-plugins/commands.js +10 -9
- package/dist/cjs/undoRedoPlugin.js +7 -6
- package/dist/es2019/pm-plugins/commands.js +2 -1
- package/dist/es2019/undoRedoPlugin.js +3 -2
- package/dist/esm/pm-plugins/commands.js +2 -1
- package/dist/esm/undoRedoPlugin.js +3 -2
- package/dist/types/pm-plugins/attach-input-meta.d.ts +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-undo-redo
|
|
2
2
|
|
|
3
|
+
## 15.0.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 15.0.13
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`656801b9e097c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/656801b9e097c) -
|
|
14
|
+
VOLTC-331 - Migrate updated package usage in platform/editor: rewrite barrel imports of
|
|
15
|
+
voltCompliant provider packages to deep/subpath imports (consumer-side debarrel). No public API
|
|
16
|
+
changes.
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 15.0.12
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -5,22 +5,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.undoFromToolbarWithAnalytics = exports.undoFromToolbar = exports.undoFromKeyboardWithAnalytics = exports.undoFromKeyboard = exports.redoFromToolbarWithAnalytics = exports.redoFromToolbar = exports.redoFromKeyboardWithAnalytics = exports.redoFromKeyboard = void 0;
|
|
7
7
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
8
|
-
var
|
|
8
|
+
var _redo = require("@atlaskit/prosemirror-history/redo");
|
|
9
|
+
var _undo = require("@atlaskit/prosemirror-history/undo");
|
|
9
10
|
var _attachInputMeta = require("./attach-input-meta");
|
|
10
11
|
var _enums = require("./enums");
|
|
11
|
-
var undoFromKeyboard = exports.undoFromKeyboard = (0, _attachInputMeta.attachInputMeta)(_enums.InputSource.KEYBOARD)(
|
|
12
|
-
var redoFromKeyboard = exports.redoFromKeyboard = (0, _attachInputMeta.attachInputMeta)(_enums.InputSource.KEYBOARD)(
|
|
13
|
-
var undoFromToolbar = exports.undoFromToolbar = (0, _attachInputMeta.attachInputMeta)(_enums.InputSource.TOOLBAR)(
|
|
14
|
-
var redoFromToolbar = exports.redoFromToolbar = (0, _attachInputMeta.attachInputMeta)(_enums.InputSource.TOOLBAR)(
|
|
12
|
+
var undoFromKeyboard = exports.undoFromKeyboard = (0, _attachInputMeta.attachInputMeta)(_enums.InputSource.KEYBOARD)(_undo.undo);
|
|
13
|
+
var redoFromKeyboard = exports.redoFromKeyboard = (0, _attachInputMeta.attachInputMeta)(_enums.InputSource.KEYBOARD)(_redo.redo);
|
|
14
|
+
var undoFromToolbar = exports.undoFromToolbar = (0, _attachInputMeta.attachInputMeta)(_enums.InputSource.TOOLBAR)(_undo.undo);
|
|
15
|
+
var redoFromToolbar = exports.redoFromToolbar = (0, _attachInputMeta.attachInputMeta)(_enums.InputSource.TOOLBAR)(_redo.redo);
|
|
15
16
|
var undoFromKeyboardWithAnalytics = exports.undoFromKeyboardWithAnalytics = function undoFromKeyboardWithAnalytics(editorAnalyticsAPI) {
|
|
16
|
-
return (0, _attachInputMeta.attachInputMetaWithAnalytics)(editorAnalyticsAPI)(_enums.InputSource.KEYBOARD, _analytics.ACTION.UNDO_PERFORMED)(
|
|
17
|
+
return (0, _attachInputMeta.attachInputMetaWithAnalytics)(editorAnalyticsAPI)(_enums.InputSource.KEYBOARD, _analytics.ACTION.UNDO_PERFORMED)(_undo.undo);
|
|
17
18
|
};
|
|
18
19
|
var redoFromKeyboardWithAnalytics = exports.redoFromKeyboardWithAnalytics = function redoFromKeyboardWithAnalytics(editorAnalyticsAPI) {
|
|
19
|
-
return (0, _attachInputMeta.attachInputMetaWithAnalytics)(editorAnalyticsAPI)(_enums.InputSource.KEYBOARD, _analytics.ACTION.REDO_PERFORMED)(
|
|
20
|
+
return (0, _attachInputMeta.attachInputMetaWithAnalytics)(editorAnalyticsAPI)(_enums.InputSource.KEYBOARD, _analytics.ACTION.REDO_PERFORMED)(_redo.redo);
|
|
20
21
|
};
|
|
21
22
|
var undoFromToolbarWithAnalytics = exports.undoFromToolbarWithAnalytics = function undoFromToolbarWithAnalytics(editorAnalyticsAPI) {
|
|
22
|
-
return (0, _attachInputMeta.attachInputMetaWithAnalytics)(editorAnalyticsAPI)(_enums.InputSource.TOOLBAR, _analytics.ACTION.UNDO_PERFORMED)(
|
|
23
|
+
return (0, _attachInputMeta.attachInputMetaWithAnalytics)(editorAnalyticsAPI)(_enums.InputSource.TOOLBAR, _analytics.ACTION.UNDO_PERFORMED)(_undo.undo);
|
|
23
24
|
};
|
|
24
25
|
var redoFromToolbarWithAnalytics = exports.redoFromToolbarWithAnalytics = function redoFromToolbarWithAnalytics(editorAnalyticsAPI) {
|
|
25
|
-
return (0, _attachInputMeta.attachInputMetaWithAnalytics)(editorAnalyticsAPI)(_enums.InputSource.TOOLBAR, _analytics.ACTION.REDO_PERFORMED)(
|
|
26
|
+
return (0, _attachInputMeta.attachInputMetaWithAnalytics)(editorAnalyticsAPI)(_enums.InputSource.TOOLBAR, _analytics.ACTION.REDO_PERFORMED)(_redo.redo);
|
|
26
27
|
};
|
|
@@ -8,8 +8,9 @@ exports.undoRedoPlugin = void 0;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
10
10
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
11
|
-
var
|
|
12
|
-
var
|
|
11
|
+
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
12
|
+
var _redo = require("@atlaskit/prosemirror-history/redo");
|
|
13
|
+
var _undo = require("@atlaskit/prosemirror-history/undo");
|
|
13
14
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
14
15
|
var _attachInputMeta = require("./pm-plugins/attach-input-meta");
|
|
15
16
|
var _enums = require("./pm-plugins/enums");
|
|
@@ -44,7 +45,7 @@ var undoRedoPlugin = exports.undoRedoPlugin = function undoRedoPlugin(_ref) {
|
|
|
44
45
|
api: api
|
|
45
46
|
});
|
|
46
47
|
};
|
|
47
|
-
if ((0,
|
|
48
|
+
if ((0, _fg.fg)('platform_editor_ai_add_undoredo_jira')) {
|
|
48
49
|
if (showToolbarButton) {
|
|
49
50
|
if (isToolbarAIFCEnabled) {
|
|
50
51
|
var _api$toolbar;
|
|
@@ -74,16 +75,16 @@ var undoRedoPlugin = exports.undoRedoPlugin = function undoRedoPlugin(_ref) {
|
|
|
74
75
|
if (!editorViewRef.current) {
|
|
75
76
|
return false;
|
|
76
77
|
}
|
|
77
|
-
return (0, _utils.forceFocus)(editorViewRef.current, api)((0, _attachInputMeta.attachInputMetaWithAnalytics)(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions)(inputSource || _enums.InputSource.EXTERNAL, _analytics.ACTION.UNDO_PERFORMED)(
|
|
78
|
+
return (0, _utils.forceFocus)(editorViewRef.current, api)((0, _attachInputMeta.attachInputMetaWithAnalytics)(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions)(inputSource || _enums.InputSource.EXTERNAL, _analytics.ACTION.UNDO_PERFORMED)(_undo.undo));
|
|
78
79
|
};
|
|
79
80
|
var handleRedo = function handleRedo(inputSource) {
|
|
80
81
|
var _api$analytics2;
|
|
81
82
|
if (!editorViewRef.current) {
|
|
82
83
|
return false;
|
|
83
84
|
}
|
|
84
|
-
return (0, _utils.forceFocus)(editorViewRef.current, api)((0, _attachInputMeta.attachInputMetaWithAnalytics)(api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions)(inputSource || _enums.InputSource.EXTERNAL, _analytics.ACTION.REDO_PERFORMED)(
|
|
85
|
+
return (0, _utils.forceFocus)(editorViewRef.current, api)((0, _attachInputMeta.attachInputMetaWithAnalytics)(api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions)(inputSource || _enums.InputSource.EXTERNAL, _analytics.ACTION.REDO_PERFORMED)(_redo.redo));
|
|
85
86
|
};
|
|
86
|
-
var showPrimaryToolbarComponent = (0,
|
|
87
|
+
var showPrimaryToolbarComponent = (0, _fg.fg)('platform_editor_ai_add_undoredo_jira') ? !(api !== null && api !== void 0 && api.primaryToolbar) && !isToolbarAIFCEnabled && showToolbarButton : !(api !== null && api !== void 0 && api.primaryToolbar) && !isToolbarAIFCEnabled;
|
|
87
88
|
return {
|
|
88
89
|
name: 'undoRedoPlugin',
|
|
89
90
|
actions: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ACTION } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import { redo
|
|
2
|
+
import { redo } from '@atlaskit/prosemirror-history/redo';
|
|
3
|
+
import { undo } from '@atlaskit/prosemirror-history/undo';
|
|
3
4
|
import { attachInputMeta, attachInputMetaWithAnalytics } from './attach-input-meta';
|
|
4
5
|
import { InputSource } from './enums';
|
|
5
6
|
export const undoFromKeyboard = attachInputMeta(InputSource.KEYBOARD)(undo);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ACTION } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
|
-
import { redo
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
5
|
+
import { redo } from '@atlaskit/prosemirror-history/redo';
|
|
6
|
+
import { undo } from '@atlaskit/prosemirror-history/undo';
|
|
6
7
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
7
8
|
import { attachInputMetaWithAnalytics } from './pm-plugins/attach-input-meta';
|
|
8
9
|
import { InputSource } from './pm-plugins/enums';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ACTION } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import { redo
|
|
2
|
+
import { redo } from '@atlaskit/prosemirror-history/redo';
|
|
3
|
+
import { undo } from '@atlaskit/prosemirror-history/undo';
|
|
3
4
|
import { attachInputMeta, attachInputMetaWithAnalytics } from './attach-input-meta';
|
|
4
5
|
import { InputSource } from './enums';
|
|
5
6
|
export var undoFromKeyboard = attachInputMeta(InputSource.KEYBOARD)(undo);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ACTION } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
|
-
import { redo
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
5
|
+
import { redo } from '@atlaskit/prosemirror-history/redo';
|
|
6
|
+
import { undo } from '@atlaskit/prosemirror-history/undo';
|
|
6
7
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
7
8
|
import { attachInputMetaWithAnalytics } from './pm-plugins/attach-input-meta';
|
|
8
9
|
import { InputSource } from './pm-plugins/enums';
|
|
@@ -21,8 +21,8 @@ type NodeWithDifferingAttributes = {
|
|
|
21
21
|
* @returns Object containing change analysis results with hasChanged boolean and affectedNodes array
|
|
22
22
|
*/
|
|
23
23
|
export declare function getChanges({ before, after }: NodeHistory): {
|
|
24
|
-
hasChanged: boolean;
|
|
25
24
|
affectedNodes: NodeWithDifferingAttributes[] | undefined;
|
|
25
|
+
hasChanged: boolean;
|
|
26
26
|
};
|
|
27
27
|
export declare const attachInputMetaWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputSource: InputSource, action: ACTION.UNDO_PERFORMED | ACTION.REDO_PERFORMED) => (command: Command) => Command;
|
|
28
28
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-undo-redo",
|
|
3
|
-
"version": "15.0.
|
|
3
|
+
"version": "15.0.14",
|
|
4
4
|
"description": "Undo redo plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@atlaskit/icon": "^37.5.0",
|
|
32
32
|
"@atlaskit/platform-feature-flags": "^2.1.0",
|
|
33
33
|
"@atlaskit/prosemirror-history": "^1.2.0",
|
|
34
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
34
|
+
"@atlaskit/tmp-editor-statsig": "^160.0.0",
|
|
35
35
|
"@babel/runtime": "^7.0.0",
|
|
36
36
|
"@emotion/react": "^11.7.1"
|
|
37
37
|
},
|