@atlaskit/editor-plugin-undo-redo 3.0.1 → 3.1.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
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-undo-redo
|
|
2
2
|
|
|
3
|
+
## 3.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#189314](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/189314)
|
|
8
|
+
[`22c6251496010`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/22c6251496010) -
|
|
9
|
+
Exported missing types that were already being inferred from existing exports
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 3.0.2
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [#183158](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/183158)
|
|
20
|
+
[`d6096ec5c8ad9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d6096ec5c8ad9) -
|
|
21
|
+
Migrate to useSharedPluginStateWithSelector
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
3
24
|
## 3.0.1
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -12,7 +12,6 @@ var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
|
12
12
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
13
13
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
14
14
|
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
15
|
-
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
16
15
|
var _redo = _interopRequireDefault(require("@atlaskit/icon/core/migration/redo"));
|
|
17
16
|
var _undo = _interopRequireDefault(require("@atlaskit/icon/core/migration/undo"));
|
|
18
17
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
@@ -25,15 +24,22 @@ var _utils = require("../../pm-plugins/utils");
|
|
|
25
24
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
26
25
|
|
|
27
26
|
var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
|
|
28
|
-
var
|
|
29
|
-
|
|
27
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['history'], function (states) {
|
|
28
|
+
var _states$historyState, _states$historyState2;
|
|
29
|
+
return {
|
|
30
|
+
canUndo: (_states$historyState = states.historyState) === null || _states$historyState === void 0 ? void 0 : _states$historyState.canUndo,
|
|
31
|
+
canRedo: (_states$historyState2 = states.historyState) === null || _states$historyState2 === void 0 ? void 0 : _states$historyState2.canRedo
|
|
32
|
+
};
|
|
33
|
+
}),
|
|
34
|
+
canRedo = _useSharedPluginState.canRedo,
|
|
35
|
+
canUndo = _useSharedPluginState.canUndo;
|
|
30
36
|
return {
|
|
31
37
|
canUndo: canUndo,
|
|
32
38
|
canRedo: canRedo
|
|
33
39
|
};
|
|
34
40
|
}, function (api) {
|
|
35
|
-
var
|
|
36
|
-
historyState =
|
|
41
|
+
var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(api, ['history']),
|
|
42
|
+
historyState = _useSharedPluginState2.historyState;
|
|
37
43
|
return {
|
|
38
44
|
canUndo: historyState === null || historyState === void 0 ? void 0 : historyState.canUndo,
|
|
39
45
|
canRedo: historyState === null || historyState === void 0 ? void 0 : historyState.canRedo
|
|
@@ -5,20 +5,27 @@
|
|
|
5
5
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
import { injectIntl } from 'react-intl-next';
|
|
8
|
-
import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
|
|
8
|
+
import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
9
9
|
import { getAriaKeyshortcuts, redo, redoAlt, tooltip, ToolTipContent, undo as undoKeymap } from '@atlaskit/editor-common/keymaps';
|
|
10
10
|
import { undoRedoMessages } from '@atlaskit/editor-common/messages';
|
|
11
11
|
import { buttonGroupStyle, buttonGroupStyleBeforeVisualRefresh, separatorStyles } from '@atlaskit/editor-common/styles';
|
|
12
12
|
import { TOOLBAR_BUTTON, ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
13
|
-
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
14
13
|
import RedoIcon from '@atlaskit/icon/core/migration/redo';
|
|
15
14
|
import UndoIcon from '@atlaskit/icon/core/migration/undo';
|
|
16
15
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
16
|
import { redoFromToolbarWithAnalytics, undoFromToolbarWithAnalytics } from '../../pm-plugins/commands';
|
|
18
17
|
import { forceFocus } from '../../pm-plugins/utils';
|
|
19
18
|
const useSharedState = sharedPluginStateHookMigratorFactory(api => {
|
|
20
|
-
const
|
|
21
|
-
|
|
19
|
+
const {
|
|
20
|
+
canRedo,
|
|
21
|
+
canUndo
|
|
22
|
+
} = useSharedPluginStateWithSelector(api, ['history'], states => {
|
|
23
|
+
var _states$historyState, _states$historyState2;
|
|
24
|
+
return {
|
|
25
|
+
canUndo: (_states$historyState = states.historyState) === null || _states$historyState === void 0 ? void 0 : _states$historyState.canUndo,
|
|
26
|
+
canRedo: (_states$historyState2 = states.historyState) === null || _states$historyState2 === void 0 ? void 0 : _states$historyState2.canRedo
|
|
27
|
+
};
|
|
28
|
+
});
|
|
22
29
|
return {
|
|
23
30
|
canUndo,
|
|
24
31
|
canRedo
|
|
@@ -5,27 +5,33 @@
|
|
|
5
5
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
import { injectIntl } from 'react-intl-next';
|
|
8
|
-
import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
|
|
8
|
+
import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
9
9
|
import { getAriaKeyshortcuts, redo, redoAlt, tooltip, ToolTipContent, undo as undoKeymap } from '@atlaskit/editor-common/keymaps';
|
|
10
10
|
import { undoRedoMessages } from '@atlaskit/editor-common/messages';
|
|
11
11
|
import { buttonGroupStyle, buttonGroupStyleBeforeVisualRefresh, separatorStyles } from '@atlaskit/editor-common/styles';
|
|
12
12
|
import { TOOLBAR_BUTTON, ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
13
|
-
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
14
13
|
import RedoIcon from '@atlaskit/icon/core/migration/redo';
|
|
15
14
|
import UndoIcon from '@atlaskit/icon/core/migration/undo';
|
|
16
15
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
16
|
import { redoFromToolbarWithAnalytics, undoFromToolbarWithAnalytics } from '../../pm-plugins/commands';
|
|
18
17
|
import { forceFocus } from '../../pm-plugins/utils';
|
|
19
18
|
var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
|
|
20
|
-
var
|
|
21
|
-
|
|
19
|
+
var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['history'], function (states) {
|
|
20
|
+
var _states$historyState, _states$historyState2;
|
|
21
|
+
return {
|
|
22
|
+
canUndo: (_states$historyState = states.historyState) === null || _states$historyState === void 0 ? void 0 : _states$historyState.canUndo,
|
|
23
|
+
canRedo: (_states$historyState2 = states.historyState) === null || _states$historyState2 === void 0 ? void 0 : _states$historyState2.canRedo
|
|
24
|
+
};
|
|
25
|
+
}),
|
|
26
|
+
canRedo = _useSharedPluginState.canRedo,
|
|
27
|
+
canUndo = _useSharedPluginState.canUndo;
|
|
22
28
|
return {
|
|
23
29
|
canUndo: canUndo,
|
|
24
30
|
canRedo: canRedo
|
|
25
31
|
};
|
|
26
32
|
}, function (api) {
|
|
27
|
-
var
|
|
28
|
-
historyState =
|
|
33
|
+
var _useSharedPluginState2 = useSharedPluginState(api, ['history']),
|
|
34
|
+
historyState = _useSharedPluginState2.historyState;
|
|
29
35
|
return {
|
|
30
36
|
canUndo: historyState === null || historyState === void 0 ? void 0 : historyState.canUndo,
|
|
31
37
|
canRedo: historyState === null || historyState === void 0 ? void 0 : historyState.canRedo
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { undoRedoPlugin } from './undoRedoPlugin';
|
|
2
|
-
export type { UndoRedoPlugin } from './undoRedoPluginType';
|
|
2
|
+
export type { UndoRedoPlugin, UndoRedoAction } from './undoRedoPluginType';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { undoRedoPlugin } from './undoRedoPlugin';
|
|
2
|
-
export type { UndoRedoPlugin } from './undoRedoPluginType';
|
|
2
|
+
export type { UndoRedoPlugin, UndoRedoAction } from './undoRedoPluginType';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-undo-redo",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "Undo redo plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,18 +32,18 @@
|
|
|
32
32
|
".": "./src/index.ts"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@atlaskit/editor-plugin-history": "^3.
|
|
36
|
-
"@atlaskit/editor-plugin-primary-toolbar": "^4.
|
|
37
|
-
"@atlaskit/editor-plugin-type-ahead": "^3.
|
|
35
|
+
"@atlaskit/editor-plugin-history": "^3.1.0",
|
|
36
|
+
"@atlaskit/editor-plugin-primary-toolbar": "^4.1.0",
|
|
37
|
+
"@atlaskit/editor-plugin-type-ahead": "^3.1.0",
|
|
38
38
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
39
|
-
"@atlaskit/icon": "^27.
|
|
39
|
+
"@atlaskit/icon": "^27.5.0",
|
|
40
40
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
41
|
-
"@atlaskit/tmp-editor-statsig": "^9.
|
|
41
|
+
"@atlaskit/tmp-editor-statsig": "^9.9.0",
|
|
42
42
|
"@babel/runtime": "^7.0.0",
|
|
43
43
|
"@emotion/react": "^11.7.1"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"@atlaskit/editor-common": "^107.
|
|
46
|
+
"@atlaskit/editor-common": "^107.9.0",
|
|
47
47
|
"react": "^18.2.0",
|
|
48
48
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
49
49
|
},
|