@atlaskit/editor-plugin-undo-redo 1.7.1 → 1.8.0
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 +12 -0
- package/dist/cjs/undoRedoPlugin.js +13 -6
- package/dist/es2019/undoRedoPlugin.js +13 -6
- package/dist/esm/undoRedoPlugin.js +13 -6
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-undo-redo
|
|
2
2
|
|
|
3
|
+
## 1.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#116013](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/116013)
|
|
8
|
+
[`18e022766bfd3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/18e022766bfd3) -
|
|
9
|
+
[ux] ED-26464 Hiding primary toolbar and docking contextual toolbar items to top
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 1.7.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.undoRedoPlugin = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
9
10
|
var _keymaps = require("./pm-plugins/keymaps");
|
|
10
11
|
var _main = require("./pm-plugins/main");
|
|
11
12
|
var _ToolbarUndoRedo = _interopRequireDefault(require("./ui/ToolbarUndoRedo"));
|
|
@@ -14,7 +15,6 @@ var _ToolbarUndoRedo = _interopRequireDefault(require("./ui/ToolbarUndoRedo"));
|
|
|
14
15
|
// eslint-disable-next-line import/no-named-as-default
|
|
15
16
|
|
|
16
17
|
var undoRedoPlugin = exports.undoRedoPlugin = function undoRedoPlugin(_ref) {
|
|
17
|
-
var _api$primaryToolbar;
|
|
18
18
|
var api = _ref.api;
|
|
19
19
|
var primaryToolbarComponent = function primaryToolbarComponent(_ref2) {
|
|
20
20
|
var editorView = _ref2.editorView,
|
|
@@ -27,10 +27,15 @@ var undoRedoPlugin = exports.undoRedoPlugin = function undoRedoPlugin(_ref) {
|
|
|
27
27
|
api: api
|
|
28
28
|
});
|
|
29
29
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
if ((0, _experiments.editorExperiment)('platform_editor_controls', 'control', {
|
|
31
|
+
exposure: true
|
|
32
|
+
})) {
|
|
33
|
+
var _api$primaryToolbar;
|
|
34
|
+
api === null || api === void 0 || (_api$primaryToolbar = api.primaryToolbar) === null || _api$primaryToolbar === void 0 || _api$primaryToolbar.actions.registerComponent({
|
|
35
|
+
name: 'undoRedoPlugin',
|
|
36
|
+
component: primaryToolbarComponent
|
|
37
|
+
});
|
|
38
|
+
}
|
|
34
39
|
return {
|
|
35
40
|
name: 'undoRedoPlugin',
|
|
36
41
|
pmPlugins: function pmPlugins() {
|
|
@@ -46,6 +51,8 @@ var undoRedoPlugin = exports.undoRedoPlugin = function undoRedoPlugin(_ref) {
|
|
|
46
51
|
}
|
|
47
52
|
}];
|
|
48
53
|
},
|
|
49
|
-
primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar)
|
|
54
|
+
primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) && (0, _experiments.editorExperiment)('platform_editor_controls', 'control', {
|
|
55
|
+
exposure: true
|
|
56
|
+
}) ? primaryToolbarComponent : undefined
|
|
50
57
|
};
|
|
51
58
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
2
3
|
import { keymapPlugin } from './pm-plugins/keymaps';
|
|
3
4
|
import { createPlugin } from './pm-plugins/main';
|
|
4
5
|
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
@@ -8,7 +9,6 @@ import ToolbarUndoRedo from './ui/ToolbarUndoRedo';
|
|
|
8
9
|
export const undoRedoPlugin = ({
|
|
9
10
|
api
|
|
10
11
|
}) => {
|
|
11
|
-
var _api$primaryToolbar;
|
|
12
12
|
const primaryToolbarComponent = ({
|
|
13
13
|
editorView,
|
|
14
14
|
disabled,
|
|
@@ -21,10 +21,15 @@ export const undoRedoPlugin = ({
|
|
|
21
21
|
api: api
|
|
22
22
|
});
|
|
23
23
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
if (editorExperiment('platform_editor_controls', 'control', {
|
|
25
|
+
exposure: true
|
|
26
|
+
})) {
|
|
27
|
+
var _api$primaryToolbar;
|
|
28
|
+
api === null || api === void 0 ? void 0 : (_api$primaryToolbar = api.primaryToolbar) === null || _api$primaryToolbar === void 0 ? void 0 : _api$primaryToolbar.actions.registerComponent({
|
|
29
|
+
name: 'undoRedoPlugin',
|
|
30
|
+
component: primaryToolbarComponent
|
|
31
|
+
});
|
|
32
|
+
}
|
|
28
33
|
return {
|
|
29
34
|
name: 'undoRedoPlugin',
|
|
30
35
|
pmPlugins() {
|
|
@@ -36,6 +41,8 @@ export const undoRedoPlugin = ({
|
|
|
36
41
|
plugin: options => createPlugin(options)
|
|
37
42
|
}];
|
|
38
43
|
},
|
|
39
|
-
primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar)
|
|
44
|
+
primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) && editorExperiment('platform_editor_controls', 'control', {
|
|
45
|
+
exposure: true
|
|
46
|
+
}) ? primaryToolbarComponent : undefined
|
|
40
47
|
};
|
|
41
48
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
2
3
|
import { keymapPlugin } from './pm-plugins/keymaps';
|
|
3
4
|
import { createPlugin } from './pm-plugins/main';
|
|
4
5
|
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
@@ -6,7 +7,6 @@ import { createPlugin } from './pm-plugins/main';
|
|
|
6
7
|
// eslint-disable-next-line import/no-named-as-default
|
|
7
8
|
import ToolbarUndoRedo from './ui/ToolbarUndoRedo';
|
|
8
9
|
export var undoRedoPlugin = function undoRedoPlugin(_ref) {
|
|
9
|
-
var _api$primaryToolbar;
|
|
10
10
|
var api = _ref.api;
|
|
11
11
|
var primaryToolbarComponent = function primaryToolbarComponent(_ref2) {
|
|
12
12
|
var editorView = _ref2.editorView,
|
|
@@ -19,10 +19,15 @@ export var undoRedoPlugin = function undoRedoPlugin(_ref) {
|
|
|
19
19
|
api: api
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
if (editorExperiment('platform_editor_controls', 'control', {
|
|
23
|
+
exposure: true
|
|
24
|
+
})) {
|
|
25
|
+
var _api$primaryToolbar;
|
|
26
|
+
api === null || api === void 0 || (_api$primaryToolbar = api.primaryToolbar) === null || _api$primaryToolbar === void 0 || _api$primaryToolbar.actions.registerComponent({
|
|
27
|
+
name: 'undoRedoPlugin',
|
|
28
|
+
component: primaryToolbarComponent
|
|
29
|
+
});
|
|
30
|
+
}
|
|
26
31
|
return {
|
|
27
32
|
name: 'undoRedoPlugin',
|
|
28
33
|
pmPlugins: function pmPlugins() {
|
|
@@ -38,6 +43,8 @@ export var undoRedoPlugin = function undoRedoPlugin(_ref) {
|
|
|
38
43
|
}
|
|
39
44
|
}];
|
|
40
45
|
},
|
|
41
|
-
primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar)
|
|
46
|
+
primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) && editorExperiment('platform_editor_controls', 'control', {
|
|
47
|
+
exposure: true
|
|
48
|
+
}) ? primaryToolbarComponent : undefined
|
|
42
49
|
};
|
|
43
50
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-undo-redo",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "Undo redo plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
".": "./src/index.ts"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@atlaskit/editor-common": "^99.
|
|
34
|
+
"@atlaskit/editor-common": "^99.18.0",
|
|
35
35
|
"@atlaskit/editor-plugin-history": "^1.5.0",
|
|
36
|
-
"@atlaskit/editor-plugin-primary-toolbar": "^2.
|
|
36
|
+
"@atlaskit/editor-plugin-primary-toolbar": "^2.3.0",
|
|
37
37
|
"@atlaskit/editor-plugin-type-ahead": "^1.13.0",
|
|
38
38
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
39
|
-
"@atlaskit/icon": "^23.
|
|
39
|
+
"@atlaskit/icon": "^23.10.0",
|
|
40
40
|
"@atlaskit/platform-feature-flags": "1.1.0",
|
|
41
41
|
"@babel/runtime": "^7.0.0",
|
|
42
42
|
"@emotion/react": "^11.7.1"
|